> -----Original Message----- > From: Gupta, Nipun <nipun.gu...@amd.com> > Sent: 2023年8月28日 14:07 > To: Ma, WenwuX <wenwux...@intel.com>; dev@dpdk.org > Cc: david.march...@redhat.com; maxime.coque...@redhat.com; Xia, > Chenbo <chenbo....@intel.com>; Li, Miao <miao...@intel.com>; Ling, WeiX > <weix.l...@intel.com>; sta...@dpdk.org > Subject: Re: [PATCH v3] bus/pci: fix legacy device IO port map in secondary > process > > Hi Wenwu > > On 8/22/2023 7:48 AM, Wenwu Ma wrote: > > When doing IO port mapping for legacy device in secondary process, the > > region information is missing, so, we need to refill it. > > Please use 72 columns in the commit log > Ok > > > > Fixes: 4b741542ecde ("bus/pci: avoid depending on private kernel > > value") > > Cc: sta...@dpdk.org > > > > Signed-off-by: Wenwu Ma <wenwux...@intel.com> > > --- > > v3: > > - adjusting variable settings > > v2: > > - add release of device in pci_vfio_ioport_unmap > > > > --- > > drivers/bus/pci/linux/pci_vfio.c | 43 > ++++++++++++++++++++++++++++++-- > > 1 file changed, 41 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/bus/pci/linux/pci_vfio.c > > b/drivers/bus/pci/linux/pci_vfio.c > > index e634de8322..5ef26c98d1 100644 > > --- a/drivers/bus/pci/linux/pci_vfio.c > > +++ b/drivers/bus/pci/linux/pci_vfio.c > > @@ -1314,6 +1314,27 @@ pci_vfio_ioport_map(struct rte_pci_device *dev, > int bar, > > return -1; > > } > > > > + if (rte_eal_process_type() == RTE_PROC_SECONDARY) { > > One thing I am not fully convinced is that why VFIO setup is not required for > primary process here? > In primary process, if virtio is not modern mode, it will call rte_pci_map_device and pci_vfio_ioport_map, VFIO setup will be called in rte_pci_map_device, so it cannot be called in pci_vfio_ioport_map again.
pci_vfio_ioport_map will not be called if the virtio is modern mode. > Thanks, > Nipun