aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/dpdk')
-rw-r--r--src/plugins/dpdk/device/init.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index 697458c04b6..6553fca77ec 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -207,12 +207,12 @@ static int
dpdk_port_crc_strip_enabled (dpdk_device_t * xd)
{
#if RTE_VERSION < RTE_VERSION_NUM(18, 8, 0, 0)
- if (xd->port_conf.rxmode.hw_strip_crc)
+ return ! !(xd->port_conf.rxmode.hw_strip_crc);
+#elif RTE_VERSION < RTE_VERSION_NUM(18, 11, 0, 0)
+ return ! !(xd->port_conf.rxmode.offloads & DEV_RX_OFFLOAD_CRC_STRIP);
#else
- if (xd->port_conf.rxmode.offloads & DEV_RX_OFFLOAD_CRC_STRIP)
+ return !(xd->port_conf.rxmode.offloads & DEV_RX_OFFLOAD_KEEP_CRC);
#endif
- return 1;
- return 0;
}
static clib_error_t *
@@ -488,7 +488,7 @@ dpdk_lib_init (dpdk_main_t * dm)
xd->port_type = VNET_DPDK_PORT_TYPE_ETH_VF;
#if RTE_VERSION < RTE_VERSION_NUM(18, 8, 0, 0)
xd->port_conf.rxmode.hw_strip_crc = 1;
-#else
+#elif RTE_VERSION < RTE_VERSION_NUM(18, 11, 0, 0)
xd->port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
#endif
break;
@@ -497,7 +497,7 @@ dpdk_lib_init (dpdk_main_t * dm)
xd->port_type = VNET_DPDK_PORT_TYPE_ETH_VF;
#if RTE_VERSION < RTE_VERSION_NUM(18, 8, 0, 0)
xd->port_conf.rxmode.hw_strip_crc = 1;
-#else
+#elif RTE_VERSION < RTE_VERSION_NUM(18, 11, 0, 0)
xd->port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
#endif
break;
@@ -528,7 +528,7 @@ dpdk_lib_init (dpdk_main_t * dm)
xd->port_type = VNET_DPDK_PORT_TYPE_ETH_SWITCH;
#if RTE_VERSION < RTE_VERSION_NUM(18, 8, 0, 0)
xd->port_conf.rxmode.hw_strip_crc = 1;
-#else
+#elif RTE_VERSION < RTE_VERSION_NUM(18, 11, 0, 0)
xd->port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
#endif
break;