[dpdk-dev] [PATCH v1 1/2] vfio: make API return values consistent
Stephen Hemminger
stephen at networkplumber.org
Thu Oct 28 18:38:24 CEST 2021
On Thu, 28 Oct 2021 16:40:28 +0100
"Burakov, Anatoly" <anatoly.burakov at intel.com> wrote:
> On 28-Oct-21 3:53 PM, Thomas Monjalon wrote:
> > 28/10/2021 13:32, Ferruh Yigit:
> >> On 10/28/2021 12:11 PM, Xia, Chenbo wrote:
> >>>> -----Original Message-----
> >>>> From: Burakov, Anatoly <anatoly.burakov at intel.com>
> >>>> Sent: Thursday, October 28, 2021 6:30 PM
> >>>> To: Xia, Chenbo <chenbo.xia at intel.com>; dev at dpdk.org
> >>>> Subject: Re: [dpdk-dev] [PATCH v1 1/2] vfio: make API return values consistent
> >>>>
> >>>> Hi Chenbo,
> >>>>
> >>>>> And do we need backport? As 'return -1' does not align with the API doxygen.
> >>>>>
> >>>>> Thanks,
> >>>>> Chenbo
> >>>>>
> >>>> Maybe it's the FreeBSD implementation that needs to be adjusted then,
> >>>> because none of those functions are valid on FreeBSD, and the
> >>>> documentation for VFIO functions explicitly mentions that on FreeBSD,
> >>>> they should return an error. I went with adjusting Linux implementation
> >>>> to minimize the amount of changes we have to make (and only change code
> >>>> path that no one uses in the first place), but maybe that was a wrong
> >>>> decision.
> >>>>
> >>>> I'm not sure if changing the API return value to match what was
> >>>> documented counts as an API change, so maybe backport to stable is not
> >>>> advised here.
> >>>
> >>> It's not a API change. My point is whether VFIO is present, users just use
> >>> the API to check if vfio support is there. In a kernel version that does not
> >>> support VFIO, he uses 'if(rte_vfio_is_enabled(XXX))' to check as the doxygen
> >>> says its return value should be 1 as true or 0 as false. He will get true (-1)
> >>> but VFIO is not there. That's why I think it's a bug and should be backported.
> >>>
> >>> But I think we can first discuss if we should drop the dummy implementation
> >>> as DPDK requires Linux kernel version >= 4.4 now so VFIO is always present.
> >>> I think it depends on by saying 'DPDK requires kernel version >= 4.4'. It's
> >>> a real _requirement_ or only a recommendation?
> >>>
> >>> Ferruh, David & Thomas, What do you think?
> >>>
> >>
> >> My understanding is, it is a requirement. DPDK does not guarantee support for
> >> kernels < 4.4.
> >
> > Do we have a kernel version check at runtime?
> > I think we should add a warning if running too old kernel.
> >
>
> Perhaps we should (there's a `uname()` call, should be fairly
> straightforward to implement), but obviously this would be outside the
> scope for this patchset.
>
Checking kernel version at runtime with uname() is a bad idea because
enterprise distro vendors support things without updating the kernel version.
It is always better to try for the feature and handle errors that could be
reported by older kernels.
Also DPDK System Requirements says kernel >= 4.4 on Linux.
More information about the dev
mailing list