RE: [PATCH v2] net/iavf: add diagnostic support in TX path
> -Original Message- > From: Zhang, Qi Z > Sent: 2023年12月22日 19:38 > To: Ye, MingjinX ; dev@dpdk.org > Cc: Yang, Qiming ; Ye, MingjinX > ; Wu, Jingjing ; Xing, Beilei > > Subject: RE: [PATCH v2] net/iavf: add diagnostic support in TX path > > > > > -Original Message- > > From: Mingjin Ye > > Sent: Friday, December 22, 2023 6:45 PM > > To: dev@dpdk.org > > Cc: Yang, Qiming ; Ye, MingjinX > > ; Wu, Jingjing ; Xing, > > Beilei > > Subject: [PATCH v2] net/iavf: add diagnostic support in TX path > > > > The only way to enable diagnostics for TX paths is to modify the > > application source code. Making it difficult to diagnose faults. > > > > In this patch, the devarg option "mbuf_check" is introduced and the > > parameters are configured to enable the corresponding diagnostics. > > > > supported cases: mbuf, size, segment, offload, strict. > > 1. mbuf: check for corrupted mbuf. > > 2. size: check min/max packet length according to hw spec. > > 3. segment: check number of mbuf segments not exceed hw limitation. > > 4. offload: check any unsupported offload flag. > > 5. strict: check protocol headers. > > > > parameter format: mbuf_check=[mbuf,,] > > eg: dpdk-testpmd -a :81:01.0,mbuf_check=[mbuf,size] -- -i > > > > Signed-off-by: Mingjin Ye > > --- > > v2: Remove call chain. > > ... > > > > > +static struct iavf_pkt_burst iavf_rxtx_pkt_burst[RTE_MAX_ETHPORTS]; > > Global array is not necessary, I assume we can get adapter with rxq->vsi- > >adapter. Multi-process support to solve the problems caused by ASLR. > > > + > > static inline void > > iavf_rxd_to_pkt_fields_by_comms_ovs(__rte_unused struct > iavf_rx_queue > > *rxq, > > struct rte_mbuf *mb, > > @@ -3394,34 +3396,34 @@ check_mbuf_len(struct offload_info *info, > > struct rte_mbuf *m) { > > if (m->ol_flags & RTE_MBUF_F_TX_TUNNEL_MASK) { > > if (info->outer_l2_len != m->outer_l2_len) { > > - PMD_TX_LOG(ERR, "outer_l2_len error in mbuf. > > Original " > > - "length: %hu, calculated length: %u", m- > > >outer_l2_len, > > + PMD_DRV_LOG(ERR, "outer_l2_len error in mbuf. > > Original " > > + "length: %d, calculated length: %u", m- > > >outer_l2_len, > > info->outer_l2_len); > > return -1; > > } > > if (info->outer_l3_len != m->outer_l3_len) { > > - PMD_TX_LOG(ERR, "outer_l3_len error in mbuf. > > Original " > > - "length: %hu,calculated length: %u", m- > > >outer_l3_len, > > + PMD_DRV_LOG(ERR, "outer_l3_len error in mbuf. > > Original " > > + "length: %d,calculated length: %u", m->outer_l3_len, > > info->outer_l3_len); > > return -1; > > } > > } > > > > if (info->l2_len != m->l2_len) { > > - PMD_TX_LOG(ERR, "l2_len error in mbuf. Original " > > - "length: %hu, calculated length: %u", m->l2_len, > > + PMD_DRV_LOG(ERR, "l2_len error in mbuf. Original " > > + "length: %d, calculated length: %u", m->l2_len, > > info->l2_len); > > return -1; > > Can you explain why need to change all the log type here? PMD_TX_LOG requires the RTE_ETHDEV_DEBUG_TX macro to be configured and recompiled to output the log. Modifying PMD_DRV_LOG allows for quick debugging of operations without modifying or compiling code. > basically the > diagnose check is for Tx only , we don't need to touch existing Rx > implementation. it could be a separate patch if you think something need to > be refactor. Restore RX Change. >
[PATCH v4 0/3] net/iavf: support Tx LLDP on scalar and AVX512
This patch set adds an IAVF testpmd command "set tx lldp on|off" which will register an mbuf dynfield IAVF_TX_LLDP_DYNFIELD, currently only supported turning on. IAVF will fill the SWTCH_UPLINK bit in the Tx context descriptor based on the mbuf dynfield to send the LLDP packet. For avx512, need to close the Tx port first, then "set tx lldp on", and reopen the port to select correct Tx path. --- v4: fix compile error v3: non-lldp packet do not use the context descriptor v2: split into patch set, refine commit log Zhichao Zeng (3): net/iavf: support Tx LLDP on scalar net/iavf: support Tx LLDP on AVX512 net/iavf: add Tx LLDP command doc/guides/rel_notes/release_24_03.rst | 3 + drivers/net/iavf/iavf_rxtx.c| 24 ++- drivers/net/iavf/iavf_rxtx.h| 6 ++ drivers/net/iavf/iavf_rxtx_vec_avx512.c | 19 ++ drivers/net/iavf/iavf_rxtx_vec_common.h | 5 ++ drivers/net/iavf/iavf_testpmd.c | 84 + drivers/net/iavf/meson.build| 3 + drivers/net/iavf/rte_pmd_iavf.h | 3 + drivers/net/iavf/version.map| 3 + 9 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 drivers/net/iavf/iavf_testpmd.c -- 2.34.1
[PATCH v4 1/3] net/iavf: support Tx LLDP on scalar
This patch adds an mbuf dynfield IAVF_TX_LLDP_DYNFIELD to determine whether or not to fill the SWTCH_UPLINK bit in the Tx context descriptor to send LLDP packet. Signed-off-by: Zhichao Zeng --- drivers/net/iavf/iavf_rxtx.c| 19 +-- drivers/net/iavf/iavf_rxtx.h| 3 +++ drivers/net/iavf/rte_pmd_iavf.h | 3 +++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index f19aa14646..736db21ea4 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -85,6 +85,9 @@ uint64_t rte_pmd_ifd_dynflag_proto_xtr_tcp_mask; uint64_t rte_pmd_ifd_dynflag_proto_xtr_ip_offset_mask; uint64_t rte_pmd_ifd_dynflag_proto_xtr_ipsec_crypto_said_mask; +/* Offset of mbuf dynamic field for transmitting LLDP packet */ +int rte_pmd_iavf_tx_lldp_dynfield_offset = -1; + uint8_t iavf_proto_xtr_type_to_rxdid(uint8_t flex_type) { @@ -2418,8 +2421,9 @@ iavf_xmit_cleanup(struct iavf_tx_queue *txq) /* Check if the context descriptor is needed for TX offloading */ static inline uint16_t -iavf_calc_context_desc(uint64_t flags, uint8_t vlan_flag) +iavf_calc_context_desc(struct rte_mbuf *mb, uint8_t vlan_flag) { + uint64_t flags = mb->ol_flags; if (flags & (RTE_MBUF_F_TX_TCP_SEG | RTE_MBUF_F_TX_UDP_SEG | RTE_MBUF_F_TX_TUNNEL_MASK | RTE_MBUF_F_TX_OUTER_IP_CKSUM | RTE_MBUF_F_TX_OUTER_UDP_CKSUM)) @@ -2427,6 +2431,12 @@ iavf_calc_context_desc(uint64_t flags, uint8_t vlan_flag) if (flags & RTE_MBUF_F_TX_VLAN && vlan_flag & IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2) return 1; + + if (rte_pmd_iavf_tx_lldp_dynfield_offset == + rte_mbuf_dynfield_lookup(IAVF_TX_LLDP_DYNFIELD, NULL)) + if (*RTE_MBUF_DYNFIELD(mb, + rte_pmd_iavf_tx_lldp_dynfield_offset, uint8_t *) > 0) + return 1; return 0; } @@ -2446,6 +2456,11 @@ iavf_fill_ctx_desc_cmd_field(volatile uint64_t *field, struct rte_mbuf *m, << IAVF_TXD_CTX_QW1_CMD_SHIFT; } + if (*RTE_MBUF_DYNFIELD(m, + rte_pmd_iavf_tx_lldp_dynfield_offset, uint8_t *) > 0) + cmd |= IAVF_TX_CTX_DESC_SWTCH_UPLINK + << IAVF_TXD_CTX_QW1_CMD_SHIFT; + *field |= cmd; } @@ -2826,7 +2841,7 @@ iavf_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) nb_desc_data = mb->nb_segs; nb_desc_ctx = - iavf_calc_context_desc(mb->ol_flags, txq->vlan_flag); + iavf_calc_context_desc(mb, txq->vlan_flag); nb_desc_ipsec = !!(mb->ol_flags & RTE_MBUF_F_TX_SEC_OFFLOAD); /** diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h index f432f9d956..960618205c 100644 --- a/drivers/net/iavf/iavf_rxtx.h +++ b/drivers/net/iavf/iavf_rxtx.h @@ -107,8 +107,11 @@ #define IAVF_MAX_DATA_PER_TXD \ (IAVF_TXD_QW1_TX_BUF_SZ_MASK >> IAVF_TXD_QW1_TX_BUF_SZ_SHIFT) +#define IAVF_TX_LLDP_DYNFIELD "intel_pmd_dynfield_tx_lldp" + extern uint64_t iavf_timestamp_dynflag; extern int iavf_timestamp_dynfield_offset; +extern int rte_pmd_iavf_tx_lldp_dynfield_offset; /** * Rx Flex Descriptors diff --git a/drivers/net/iavf/rte_pmd_iavf.h b/drivers/net/iavf/rte_pmd_iavf.h index 56d453fc4c..07d961eaff 100644 --- a/drivers/net/iavf/rte_pmd_iavf.h +++ b/drivers/net/iavf/rte_pmd_iavf.h @@ -95,6 +95,9 @@ extern uint64_t rte_pmd_ifd_dynflag_proto_xtr_tcp_mask; extern uint64_t rte_pmd_ifd_dynflag_proto_xtr_ip_offset_mask; extern uint64_t rte_pmd_ifd_dynflag_proto_xtr_ipsec_crypto_said_mask; +/* Offset of mbuf dynamic field for transmitting LLDP packet */ +extern int rte_pmd_iavf_tx_lldp_dynfield_offset; + /** * The mbuf dynamic field pointer for flexible descriptor's extraction metadata. */ -- 2.34.1
[PATCH v4 2/3] net/iavf: support Tx LLDP on AVX512
This patch adds an avx512 ctx Tx path that supports context descriptor, filling in the SWTCH_UPLINK bit based on mbuf dynfield IAVF_TX_LLDP_DYNFIELD to support sending LLDP packet. Signed-off-by: Zhichao Zeng --- drivers/net/iavf/iavf_rxtx.c| 5 + drivers/net/iavf/iavf_rxtx.h| 3 +++ drivers/net/iavf/iavf_rxtx_vec_avx512.c | 19 +++ drivers/net/iavf/iavf_rxtx_vec_common.h | 5 + 4 files changed, 32 insertions(+) diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c index 736db21ea4..8e147ad6b1 100644 --- a/drivers/net/iavf/iavf_rxtx.c +++ b/drivers/net/iavf/iavf_rxtx.c @@ -4054,6 +4054,11 @@ iavf_set_tx_function(struct rte_eth_dev *dev) dev->tx_pkt_prepare = iavf_prep_pkts; PMD_DRV_LOG(DEBUG, "Using AVX512 OFFLOAD Vector Tx (port %d).", dev->data->port_id); + } else if (check_ret == IAVF_VECTOR_CTX_PATH) { + dev->tx_pkt_burst = iavf_xmit_pkts_vec_avx512_ctx; + dev->tx_pkt_prepare = iavf_prep_pkts; + PMD_DRV_LOG(DEBUG, "Using AVX512 CONTEXT Vector Tx (port %d).", + dev->data->port_id); } else { dev->tx_pkt_burst = iavf_xmit_pkts_vec_avx512_ctx_offload; dev->tx_pkt_prepare = iavf_prep_pkts; diff --git a/drivers/net/iavf/iavf_rxtx.h b/drivers/net/iavf/iavf_rxtx.h index 960618205c..4e25aa9000 100644 --- a/drivers/net/iavf/iavf_rxtx.h +++ b/drivers/net/iavf/iavf_rxtx.h @@ -66,6 +66,7 @@ #define IAVF_VECTOR_PATH 0 #define IAVF_VECTOR_OFFLOAD_PATH 1 #define IAVF_VECTOR_CTX_OFFLOAD_PATH 2 +#define IAVF_VECTOR_CTX_PATH 3 #define DEFAULT_TX_RS_THRESH 32 #define DEFAULT_TX_FREE_THRESH 32 @@ -755,6 +756,8 @@ uint16_t iavf_xmit_pkts_vec_avx512_offload(void *tx_queue, uint16_t nb_pkts); uint16_t iavf_xmit_pkts_vec_avx512_ctx_offload(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts); +uint16_t iavf_xmit_pkts_vec_avx512_ctx(void *tx_queue, struct rte_mbuf **tx_pkts, + uint16_t nb_pkts); int iavf_txq_vec_setup_avx512(struct iavf_tx_queue *txq); uint8_t iavf_proto_xtr_type_to_rxdid(uint8_t xtr_type); diff --git a/drivers/net/iavf/iavf_rxtx_vec_avx512.c b/drivers/net/iavf/iavf_rxtx_vec_avx512.c index 7a7df6d258..045cb7fd11 100644 --- a/drivers/net/iavf/iavf_rxtx_vec_avx512.c +++ b/drivers/net/iavf/iavf_rxtx_vec_avx512.c @@ -2206,6 +2206,10 @@ ctx_vtx1(volatile struct iavf_tx_desc *txdp, struct rte_mbuf *pkt, low_ctx_qw |= (uint64_t)pkt->vlan_tci << IAVF_TXD_CTX_QW0_L2TAG2_PARAM; } } + if (*RTE_MBUF_DYNFIELD(pkt, + rte_pmd_iavf_tx_lldp_dynfield_offset, uint8_t *) > 0) + high_ctx_qw |= IAVF_TX_CTX_DESC_SWTCH_UPLINK + << IAVF_TXD_CTX_QW1_CMD_SHIFT; uint64_t high_data_qw = (IAVF_TX_DESC_DTYPE_DATA | ((uint64_t)flags << IAVF_TXD_QW1_CMD_SHIFT) | ((uint64_t)pkt->data_len << IAVF_TXD_QW1_TX_BUF_SZ_SHIFT)); @@ -2258,6 +2262,10 @@ ctx_vtx(volatile struct iavf_tx_desc *txdp, (uint64_t)pkt[1]->vlan_tci << IAVF_TXD_QW1_L2TAG1_SHIFT; } } + if (*RTE_MBUF_DYNFIELD(pkt[1], + rte_pmd_iavf_tx_lldp_dynfield_offset, uint8_t *) > 0) + hi_ctx_qw1 |= IAVF_TX_CTX_DESC_SWTCH_UPLINK + << IAVF_TXD_CTX_QW1_CMD_SHIFT; if (pkt[0]->ol_flags & RTE_MBUF_F_TX_VLAN) { if (vlan_flag & IAVF_TX_FLAGS_VLAN_TAG_LOC_L2TAG2) { @@ -2270,6 +2278,10 @@ ctx_vtx(volatile struct iavf_tx_desc *txdp, (uint64_t)pkt[0]->vlan_tci << IAVF_TXD_QW1_L2TAG1_SHIFT; } } + if (*RTE_MBUF_DYNFIELD(pkt[0], + rte_pmd_iavf_tx_lldp_dynfield_offset, uint8_t *) > 0) + hi_ctx_qw0 |= IAVF_TX_CTX_DESC_SWTCH_UPLINK + << IAVF_TXD_CTX_QW1_CMD_SHIFT; if (offload) { iavf_txd_enable_offload(pkt[1], &hi_data_qw1); @@ -2520,3 +2532,10 @@ iavf_xmit_pkts_vec_avx512_ctx_offload(void *tx_queue, struct rte_mbuf **tx_pkts, { return iavf_xmit_pkts_vec_avx512_ctx_cmn(tx_queue, tx_pkts, nb_pkts, true); } + +uint16_t +iavf_xmit_pkts_vec_avx512_ctx(void *tx_queue, struct rte_mbuf **tx_pkts, + uint16_t nb_pkts) +{ + return iavf_xmit_pkts_vec_avx512_ctx_cmn(tx_queue, tx_pkts, nb_pkts, false); +} diff --git a/drive
[PATCH v4 3/3] net/iavf: add Tx LLDP command
This patch adds an IAVF testpmd command "set tx lldp on|off" which will register an mbuf dynfield IAVF_TX_LLDP_DYNFIELD to indicate the need to send LLDP packet. Currently, it only supports turning on. For avx512, need to close the Tx port first, then "set tx lldp on", and reopen the port to select correct Tx path. Signed-off-by: Zhichao Zeng --- doc/guides/rel_notes/release_24_03.rst | 3 + drivers/net/iavf/iavf_testpmd.c| 84 ++ drivers/net/iavf/meson.build | 3 + drivers/net/iavf/version.map | 3 + 4 files changed, 93 insertions(+) create mode 100644 drivers/net/iavf/iavf_testpmd.c diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst index 6f8ad27808..f94e18c33a 100644 --- a/doc/guides/rel_notes/release_24_03.rst +++ b/doc/guides/rel_notes/release_24_03.rst @@ -55,6 +55,9 @@ New Features Also, make sure to start the actual text at the margin. === +* **Updated Intel iavf driver.** + + * Added support for Tx LLDP packet on scalar and avx512. Removed Items - diff --git a/drivers/net/iavf/iavf_testpmd.c b/drivers/net/iavf/iavf_testpmd.c new file mode 100644 index 00..9d4fbb43ed --- /dev/null +++ b/drivers/net/iavf/iavf_testpmd.c @@ -0,0 +1,84 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2010-2016 Intel Corporation. + */ + +#include + +#include + +#include +#include + +#include "iavf.h" +#include "testpmd.h" +#include "iavf_rxtx.h" + +struct cmd_enable_tx_lldp_result { + cmdline_fixed_string_t set; + cmdline_fixed_string_t tx; + cmdline_fixed_string_t lldp; + cmdline_fixed_string_t what; +}; + +static cmdline_parse_token_string_t cmd_enable_tx_lldp_set = + TOKEN_STRING_INITIALIZER(struct cmd_enable_tx_lldp_result, + set, "set"); +static cmdline_parse_token_string_t cmd_enable_tx_lldp_tx = + TOKEN_STRING_INITIALIZER(struct cmd_enable_tx_lldp_result, + tx, "tx"); +static cmdline_parse_token_string_t cmd_enable_tx_lldp_lldp = + TOKEN_STRING_INITIALIZER(struct cmd_enable_tx_lldp_result, + lldp, "lldp"); +static cmdline_parse_token_string_t cmd_enable_tx_lldp_what = + TOKEN_STRING_INITIALIZER(struct cmd_enable_tx_lldp_result, + what, "on#off"); + +static void +cmd_enable_tx_lldp_parsed(void *parsed_result, + __rte_unused struct cmdline *cl, __rte_unused void *data) +{ + struct cmd_enable_tx_lldp_result *res = parsed_result; + const struct rte_mbuf_dynfield iavf_tx_lldp_dynfield = { + .name = IAVF_TX_LLDP_DYNFIELD, + .size = sizeof(uint8_t), + .align = __alignof__(uint8_t), + .flags = 0 + }; + int ret = 0; + + if (strncmp(res->what, "on", 2) == 0) { + rte_pmd_iavf_tx_lldp_dynfield_offset = + rte_mbuf_dynfield_register(&iavf_tx_lldp_dynfield); + printf("rte_pmd_iavf_tx_lldp_dynfield_offset: %d", + rte_pmd_iavf_tx_lldp_dynfield_offset); + if (ret < 0) + fprintf(stderr, + "rte mbuf dynfield register failed, offset: %d", + rte_pmd_iavf_tx_lldp_dynfield_offset); + } +} + +static cmdline_parse_inst_t cmd_enable_tx_lldp = { + .f = cmd_enable_tx_lldp_parsed, + .data = NULL, + .help_str = "set iavf tx lldp on|off", + .tokens = { + (void *)&cmd_enable_tx_lldp_set, + (void *)&cmd_enable_tx_lldp_tx, + (void *)&cmd_enable_tx_lldp_lldp, + (void *)&cmd_enable_tx_lldp_what, + NULL, + }, +}; + +static struct testpmd_driver_commands iavf_cmds = { + .commands = { + { + &cmd_enable_tx_lldp, + "set tx lldp (on|off)\n" + "Set iavf Tx lldp packet(currently only supported on)\n\n", + }, + { NULL, NULL }, + }, +}; +TESTPMD_ADD_DRIVER_COMMANDS(iavf_cmds) diff --git a/drivers/net/iavf/meson.build b/drivers/net/iavf/meson.build index a6ce2725c3..83aebd5596 100644 --- a/drivers/net/iavf/meson.build +++ b/drivers/net/iavf/meson.build @@ -8,6 +8,9 @@ endif cflags += ['-Wno-strict-aliasing'] includes += include_directories('../../common/iavf') + +testpmd_sources = files('iavf_testpmd.c') + deps += ['common_iavf', 'security', 'cryptodev'] sources = files( diff --git a/drivers/net/iavf/version.map b/drivers/net/iavf/version.map index 135a4ccd3d..51e94f32fe 100644 --- a/drivers/net/iavf/version.map +++ b/drivers/net/iavf/version.map @@ -16,4 +16,7 @@ EXPERIMENTAL { # added in 21.11 rte_pmd_ifd_dynflag_proto_xtr_ipsec_crypto_said_mask; + + # added in 24.03 + rte_pmd_iavf_tx_lldp_dynfield_offset; }; -- 2.34.1
RE: [PATCH 4/4] eal: add new args to choose VFIO mode
> -Original Message- > From: Stephen Hemminger > Sent: Saturday, December 23, 2023 1:18 AM > To: Xing, Beilei > Cc: Burakov, Anatoly ; dev@dpdk.org; > tho...@monjalon.net; ferruh.yi...@amd.com; Richardson, Bruce > ; chen...@nvidia.com; Cao, Yahui > > Subject: Re: [PATCH 4/4] eal: add new args to choose VFIO mode > > On Fri, 22 Dec 2023 19:44:53 + > beilei.x...@intel.com wrote: > > > From: Beilei Xing > > > > Since now Linux has both of VFIO Container/GROUP & VFIO IOMMUFD/CDEV > > support, user can determine how to probe the PCI device by the new > > args "--vfio-mode". > > > > Use "--vfio-mode=container" to choose VFIO Container/GROUP, and use > > "--vfio-mode=iommufd" to choose VFIO IOMMUFD/CDEV. > > > > Signed-off-by: Beilei Xing > > Signed-off-by: Yahui Cao > > Can't this be automatic, users don't need more EAL options. Thanks for your review. Since Linux supports both VFIO Container/GROUP and VFIO OMMUFD/CDEV currently, I think user can choose which mode they want. The new IOMMU features (e.g. PASID/SSID) may be only available through VFIO IOMMUFD/CDEV interface, VFIO Container/GROUP may be deprecated in future, and then DPDK will use iommufd mode automatically. .
RE: [PATCH 2/4] vfio: add VFIO IOMMUFD support
> -Original Message- > From: Stephen Hemminger > Sent: Saturday, December 23, 2023 1:17 AM > To: Xing, Beilei > Cc: Burakov, Anatoly ; dev@dpdk.org; > tho...@monjalon.net; ferruh.yi...@amd.com; Richardson, Bruce > ; chen...@nvidia.com; Cao, Yahui > > Subject: Re: [PATCH 2/4] vfio: add VFIO IOMMUFD support > > On Fri, 22 Dec 2023 19:44:51 + > 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 > > #include > > > > +#include > > + > > /* > > * 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.