> -----Original Message-----
> From: Stephen Hemminger <step...@networkplumber.org>
> Sent: Saturday, December 23, 2023 1:17 AM
> To: Xing, Beilei <beilei.x...@intel.com>
> Cc: Burakov, Anatoly <anatoly.bura...@intel.com>; dev@dpdk.org;
> tho...@monjalon.net; ferruh.yi...@amd.com; Richardson, Bruce
> <bruce.richard...@intel.com>; chen...@nvidia.com; Cao, Yahui
> <yahui....@intel.com>
> Subject: Re: [PATCH 2/4] vfio: add VFIO IOMMUFD support
>
> On Fri, 22 Dec 2023 19:44:51 +0000
> beilei.x...@intel.com wrote:
>
> > diff --git a/lib/eal/include/rte_vfio.h b/lib/eal/include/rte_vfio.h
> > index 22832afd0f..7a9b26b0f7 100644
> > --- a/lib/eal/include/rte_vfio.h
> > +++ b/lib/eal/include/rte_vfio.h
> > @@ -17,6 +17,8 @@ extern "C" {
> > #include <stdbool.h>
> > #include <stdint.h>
> >
> > +#include <rte_compat.h>
> > +
> > /*
> > * determine if VFIO is present on the system
> > */
> > @@ -28,6 +30,9 @@ extern "C" {
> > #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) #define
> > HAVE_VFIO_DEV_REQ_INTERFACE #endif /* kernel version >= 4.0.0 */
> > +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) #define
> > +VFIO_IOMMUFD_PRESENT #endif /* kernel version >= 6.6.0 */
> > #endif /* RTE_EAL_VFIO */
>
> Depending on kernel version macro is a mistake because many enterprise
> distro's backport features and do not change kernel version.
Make sense. We defined VFIO_IOMMUFD_PRESENT with reference to
VFIO_PRESENT. Do you have suggestion for this point? Thanks a lot.
> Also, it means the build and target machine have to be same kernel version.