DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: David Marchand <david.marchand@redhat.com>,
	"Li, Miao" <miao.li@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"stable@dpdk.org" <stable@dpdk.org>,
	Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: RE: [PATCH v2 1/2] net/virtio: fix legacy device IO port map in secondary process
Date: Thu, 6 Jul 2023 08:58:47 +0000	[thread overview]
Message-ID: <SN6PR11MB350400AD0849F8BD9DCC30959C2CA@SN6PR11MB3504.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CAJFAV8wiDoZMY8Msfa9=YVpc+9qqVrw-9x3+pm76ArGu=_okOA@mail.gmail.com>

> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Monday, July 3, 2023 3:48 PM
> To: Li, Miao <miao.li@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org; Maxime Coquelin
> <maxime.coquelin@redhat.com>; Xia, Chenbo <chenbo.xia@intel.com>
> Subject: Re: [PATCH v2 1/2] net/virtio: fix legacy device IO port map in
> secondary process
> 
> On Thu, Jun 29, 2023 at 4:27 AM Miao Li <miao.li@intel.com> 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
> > is 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() function.

Thinking about this again: pci_vfio_ioport_map is defined to map specific ioport so
it does not make sense to do any device setup in such function. Any reason why
we can't call rte_pci_map_device in secondary/legacy? This function rte_pci_map_device
is defined to set-up device and set up BAR mapping if needed. Secondary process for any
driver needs set-up device and BAR mapping again (right?). For legacy device it can skip
the BAR mapping part, which rte_pci_map_device is already doing.

Any comments?

Thanks,
Chenbo

> 
> 
> >> Fixes: 512e27eeb743 ("net/virtio: move PCI specific dev init to PCI
> ethdev init")
> 
> This commit only moved code, and at this point, there was no need for
> a call to rte_pci_map_device in the secondary process case.
> It seems unlikely this is a faulty change.
> 
> The recent addition on the vfio side seems a better culprit, but I am
> fine with being proven wrong :-).
> 
> 
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Miao Li <miao.li@intel.com>
> 
> 
> --
> David Marchand


      parent reply	other threads:[~2023-07-06  8:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28  6:36 [PATCH " Miao Li
2023-06-28  6:36 ` [PATCH 2/2] bus/pci: add IO port region check before region map Miao Li
2023-06-29  2:26 ` [PATCH v2 1/2] net/virtio: fix legacy device IO port map in secondary process Miao Li
2023-06-29  2:26   ` [PATCH v2 2/2] bus/pci: add IO port region check before region map Miao Li
2023-07-03  1:19   ` [PATCH v2 1/2] net/virtio: fix legacy device IO port map in secondary process Ling, WeiX
2023-07-03  7:47   ` David Marchand
2023-07-03  8:54     ` Li, Miao
2023-07-03  8:57       ` David Marchand
2023-07-03  9:31         ` Xia, Chenbo
2023-07-07 17:03           ` Gupta, Nipun
2023-07-06  8:58     ` Xia, Chenbo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SN6PR11MB350400AD0849F8BD9DCC30959C2CA@SN6PR11MB3504.namprd11.prod.outlook.com \
    --to=chenbo.xia@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=miao.li@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).