eal/linux: fix build when VFIO is disabled

The header linux/version.h isn't included when CONFIG_RTE_EAL_VFIO
is explicitly disabled. LINUX_VERSION_CODE and KERNEL_VERSION are
therefore undefined, causing the build failure:

  lib/librte_eal/linux/eal/eal.c: In function ‘rte_eal_init’:
  lib/librte_eal/linux/eal/eal.c:1076:32: error: "LINUX_VERSION_CODE" is
    not defined, evaluates to 0 [-Werror=undef]

Fixes: a0dede62a5 ("eal/linux: remove KNI restriction on IOVA")
Cc: stable@dpdk.org

Signed-off-by: Ali Alnubani <alialnu@mellanox.com>
This commit is contained in:
Ali Alnubani 2019-12-11 18:25:59 +00:00 committed by Thomas Monjalon
parent 5a352a3a98
commit e8a17faa5e

View File

@ -25,6 +25,7 @@
#if defined(RTE_ARCH_X86)
#include <sys/io.h>
#endif
#include <linux/version.h>
#include <rte_compat.h>
#include <rte_common.h>