dpdk: fix compilation for DPDK < 21.11 80/34980/2
authorBenoît Ganne <bganne@cisco.com>
Wed, 19 Jan 2022 17:26:43 +0000 (18:26 +0100)
committerDamjan Marion <dmarion@me.com>
Thu, 20 Jan 2022 12:08:32 +0000 (12:08 +0000)
Type: fix

Change-Id: Ic5b74fb7a8e479e8cdccbb6a564ff3fdd299455c
Signed-off-by: Benoît Ganne <bganne@cisco.com>
src/plugins/dpdk/device/common.c
src/plugins/dpdk/device/init.c

index 0f54a61..df80a85 100644 (file)
@@ -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)
index 6c34981..09f1e18 100644 (file)
@@ -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)