[PATCH v2 1/2] net/virtio: fix legacy device IO port map in secondary process

David Marchand david.marchand at redhat.com
Mon Jul 3 10:57:42 CEST 2023


On Mon, Jul 3, 2023 at 10:54 AM Li, Miao <miao.li at 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.
> >
> 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 for 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.


-- 
David Marchand



More information about the stable mailing list