From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0101142DC2; Mon, 3 Jul 2023 10:57:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DA3FC40ED5; Mon, 3 Jul 2023 10:57:57 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 67D9340156 for ; Mon, 3 Jul 2023 10:57:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688374675; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fZiMsgsmA8uDPf8efYdNClvBXpVOaPRgGvL3wB/v/WI=; b=S/SEfKKq1DdQotpFOqNf0urgvg5jvRF9KeqqhhZ6xCZqdnSzqyJiaT1540Yx/NR3KQxMws ncFeckOwqMjI5ZQW6pyVjIZs5lEg6FcJccWFngT1mo2somaRL711ZmUFo2lchnKpEwVZ9V g81ilvZYpCwVf6DUXil5+SDjvw3qX4Q= Received: from mail-oi1-f199.google.com (mail-oi1-f199.google.com [209.85.167.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-538-oG6ga9peN3uJFIHoZNySPw-1; Mon, 03 Jul 2023 04:57:54 -0400 X-MC-Unique: oG6ga9peN3uJFIHoZNySPw-1 Received: by mail-oi1-f199.google.com with SMTP id 5614622812f47-3a1e58db5caso4389401b6e.0 for ; Mon, 03 Jul 2023 01:57:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688374674; x=1690966674; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fZiMsgsmA8uDPf8efYdNClvBXpVOaPRgGvL3wB/v/WI=; b=feJ2wnd2rvwC8ejDcvyZ2C5qh1104/oJGBEAh0OnnIgnwT5PsKuIga+eAwspzqVLda BSSncfG0lywtUmEUAlVE3/sAh5zey+w0YPJxFi7p9g5VqZIlMotzIiTdQy2+x7x6I3Sb b85KfNj+wRFyv4psj1sCKKZjA4NTDzWJr9Boyi5ntAmw1HJrTnSetdyzD4/OlClXtATZ sW+GHqA41G1MPN5Ew7/ZqRXBGI/oWNdfci666gh21K6XxxwIPdUzYhaBHDnqhTaSU3jp 4UOCxD/AXfzRKxKbb3eB0FqcHlAU0eLRF8PQqnw3IelvPjAWP5l4WyfkoY2rlF8LAb5y sIgA== X-Gm-Message-State: ABy/qLbdW/ygx37B4Y5iDlY17GWOqTS7ZcIGo+3YVQX2JTNfKDr71kGg 9Rr+GWgVPRNEeSAvrnwh2+0ZRNq3AN1pCnJLmGJ5KtOxM/eeLP9b7oNsmXxCzJQK1WxV9pIMNZA 5sosyK6VMelHEBiT+fw0= X-Received: by 2002:a05:6808:130d:b0:3a3:94f4:adca with SMTP id y13-20020a056808130d00b003a394f4adcamr5711470oiv.2.1688374674124; Mon, 03 Jul 2023 01:57:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlHfFPOWqkwhpp6TlBUGgyyYukxSczxCjVOwXH1FIgilJb0/yV9dgyGNEESMLchVwtkVjxB3NX5bX6EBKBRo3bw= X-Received: by 2002:a05:6808:130d:b0:3a3:94f4:adca with SMTP id y13-20020a056808130d00b003a394f4adcamr5711461oiv.2.1688374673965; Mon, 03 Jul 2023 01:57:53 -0700 (PDT) MIME-Version: 1.0 References: <20230628063651.178604-1-miao.li@intel.com> <20230629022653.263046-1-miao.li@intel.com> In-Reply-To: From: David Marchand Date: Mon, 3 Jul 2023 10:57:42 +0200 Message-ID: Subject: Re: [PATCH v2 1/2] net/virtio: fix legacy device IO port map in secondary process To: "Li, Miao" Cc: "dev@dpdk.org" , "stable@dpdk.org" , Maxime Coquelin , "Xia, Chenbo" X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Mon, Jul 3, 2023 at 10:54=E2=80=AFAM Li, Miao wrote: > > > When doing IO port map for legacy device in secondary process, > > > vfio_cfg setup for legacy device like vfio_group_fd and vfio_dev_fd i= s > > > missing. So, in secondary process, rte_pci_map_device is added for > > > legacy device to setup vfio_cfg and fill in region info like in > > > primary process. > > > > I think, in legacy mode, there is no PCI mappable memory. > > So there should be no need for this call to rte_pci_map_device. > > > > What is missing is a vfio setup, is this correct? > > I'd rather see this issue be fixed in the pci_vfio_ioport_map() functio= n. > > > If adding vfio setup in the pci_vfio_ioport_map() function, vfio will be = setup twice in primary process because rte_pci_map_device will be called fo= r legacy device in primary process. > I add IO port region check to skip region map in the next patch. Well, something must be done so that it is not mapped twice, I did not look into the details. This current patch looks wrong to me and I understand this is not a virtio only issue. --=20 David Marchand