summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2022-01-19 18:26:43 +0100
committerDamjan Marion <dmarion@me.com>2022-01-20 12:08:32 +0000
commit0e4e5a8222089d6e8f70ad74afcfd4e2854a00da (patch)
treeb23cf1a9e1e6f17bec8e8811f41a843d052e26eb /src/plugins/dpdk/device
parent0b65621d41619e242b136e78fecfb325c90ae0bc (diff)
dpdk: fix compilation for DPDK < 21.11
Type: fix Change-Id: Ic5b74fb7a8e479e8cdccbb6a564ff3fdd299455c Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device')
-rw-r--r--src/plugins/dpdk/device/common.c4
-rw-r--r--src/plugins/dpdk/device/init.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/dpdk/device/common.c b/src/plugins/dpdk/device/common.c
index 0f54a616773..df80a85872d 100644
--- a/src/plugins/dpdk/device/common.c
+++ b/src/plugins/dpdk/device/common.c
@@ -169,8 +169,8 @@ dpdk_device_setup (dpdk_device_t * xd)
}
else
{
- mtu = 1500;
- xd->max_supported_frame_size = mtu + xd->driver_frame_overhead;
+ xd->max_supported_frame_size =
+ clib_min (1500 + xd->driver_frame_overhead, buf_sz);
}
#else
if (xd->conf.disable_multi_seg)
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index 6c34981b2a2..09f1e18c9a5 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -390,6 +390,9 @@ dpdk_lib_init (dpdk_main_t * dm)
xd->conf.rss_hf);
}
+#ifndef RTE_VLAN_HLEN
+#define RTE_VLAN_HLEN 4
+#endif
xd->driver_frame_overhead =
RTE_ETHER_HDR_LEN + 2 * RTE_VLAN_HLEN + RTE_ETHER_CRC_LEN;
#if RTE_VERSION >= RTE_VERSION_NUM(21, 11, 0, 0)