[dpdk-dev] [PATCH v12 2/2] eal: support for VFIO-PCI VF token

Wang, Haiyue haiyue.wang at intel.com
Wed May 6 13:44:25 CEST 2020


> -----Original Message-----
> From: Burakov, Anatoly <anatoly.burakov at intel.com>
> Sent: Wednesday, May 6, 2020 19:40
> To: Wang, Haiyue <haiyue.wang at intel.com>; dev at dpdk.org; thomas at monjalon.net; jerinj at marvell.com;
> david.marchand at redhat.com
> Subject: Re: [PATCH v12 2/2] eal: support for VFIO-PCI VF token
> 
> On 06-May-20 12:35 PM, Wang, Haiyue wrote:
> > Hi Anatoly,
> >
> >> -----Original Message-----
> >> From: Burakov, Anatoly <anatoly.burakov at intel.com>
> >> Sent: Wednesday, May 6, 2020 18:27
> >> To: Wang, Haiyue <haiyue.wang at intel.com>; dev at dpdk.org; thomas at monjalon.net; jerinj at marvell.com;
> >> david.marchand at redhat.com
> >> Subject: Re: [PATCH v12 2/2] eal: support for VFIO-PCI VF token
> >>
> >> On 05-May-20 11:34 AM, Haiyue Wang wrote:
> >>> The kernel module vfio-pci introduces the VF token to enable SR-IOV
> >>> support since 5.7.
> >>>
> >>> The VF token can be set by a vfio-pci based PF driver and must be known
> >>> by the vfio-pci based VF driver in order to gain access to the device.
> >>>
> >>> Signed-off-by: Haiyue Wang <haiyue.wang at intel.com>
> >>> ---
> >>
> >> <snip>
> >>
> >>> diff --git a/lib/librte_eal/freebsd/eal.c b/lib/librte_eal/freebsd/eal.c
> >>> index 540b7d38c..00b02855e 100644
> >>> --- a/lib/librte_eal/freebsd/eal.c
> >>> +++ b/lib/librte_eal/freebsd/eal.c
> >>> @@ -1002,6 +1002,11 @@ rte_eal_vfio_intr_mode(void)
> >>>    	return RTE_INTR_MODE_NONE;
> >>>    }
> >>>
> >>> +void rte_eal_vfio_vf_token(rte_uuid_t vf_token)
> >>> +{
> >>> +	memset(vf_token, 0, sizeof(rte_uuid_t));
> >>> +}
> >>
> >> What's the purpose of memset(0) here? Presumably, if the API is not
> >> supposed to be supported, the function should have no effect?
> >>
> >
> > Yes, originally I meant to no parse the input, then return zero UUID.
> > I changed it to the same as Linux:
> > 	rte_uuid_copy(vf_token, internal_config.vfio_vf_token);
> > Since it is inited to zero.
> 
> Yes but on Linux it has effect because Linux supports it. On FreeBSD
> there's no VFIO, so the function should IMO have no effect. However, i
> don't have a strong opinion on this, so i'm fine either way.
> 

Uh, seems empty function should be good one. I will change it. ;-)

> --
> Thanks,
> Anatoly


More information about the dev mailing list