[PATCH 2/4] vfio: add VFIO IOMMUFD support

Stephen Hemminger stephen at networkplumber.org
Fri Dec 22 18:17:02 CET 2023


On Fri, 22 Dec 2023 19:44:51 +0000
beilei.xing at 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.
Also, it means the build and target machine have to be same kernel version.


More information about the dev mailing list