[PATCH v3] bus/pci: fix legacy device IO port map in secondary process

Ma, WenwuX wenwux.ma at intel.com
Tue Aug 29 10:00:06 CEST 2023



> -----Original Message-----
> From: Gupta, Nipun <nipun.gupta at amd.com>
> Sent: 2023年8月28日 14:07
> To: Ma, WenwuX <wenwux.ma at intel.com>; dev at dpdk.org
> Cc: david.marchand at redhat.com; maxime.coquelin at redhat.com; Xia,
> Chenbo <chenbo.xia at intel.com>; Li, Miao <miao.li at intel.com>; Ling, WeiX
> <weix.ling at intel.com>; stable at 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: stable at dpdk.org
> >
> > Signed-off-by: Wenwu Ma <wenwux.ma at 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


More information about the stable mailing list