aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Hemminger <stephen@networkplumber.org>2018-10-22 11:17:57 -0700
committerDamjan Marion <dmarion@me.com>2018-10-23 13:08:16 +0000
commit0a554c773bc287721d1100db4725c373b7640c67 (patch)
tree371ff443a31b254e70332fdbfab81f7b7cd71637 /src
parent1dfdb289a105dafb11d161abaf7e9c946cbf228e (diff)
dpdk: support 18.11 changes to CRC flags
In DPDK 18.11 the device flags for keeping/stripping CRC flags has changed. The old strip flag is gone, and replaced by a CRC keep flag. Change-Id: Iaa162854862a2a0855b418ee8029383fc116d3a2 Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'src')
-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;