aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/init.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2022-02-13 20:08:30 +0100
committerFlorin Coras <florin.coras@gmail.com>2022-04-05 16:02:30 +0000
commit57eb4b6269dd22b042deb2a7a535cf31387a0161 (patch)
tree7501b8dd4e92f3df3bbe6918bb199672011f10b8 /src/plugins/dpdk/device/init.c
parent35cf8aa93bfb8414ae58bfcb1d668b2c374ff583 (diff)
dpdk: fix max frame size
Type: fix Change-Id: I70f9ec2eb6c9c1494a4ecd56e06898f6162a0e0e Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device/init.c')
-rw-r--r--src/plugins/dpdk/device/init.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c
index 9d68775d86a..3b5b90704df 100644
--- a/src/plugins/dpdk/device/init.c
+++ b/src/plugins/dpdk/device/init.c
@@ -399,7 +399,8 @@ dpdk_lib_init (dpdk_main_t * dm)
#if RTE_VERSION >= RTE_VERSION_NUM(21, 11, 0, 0)
q = di.max_rx_pktlen - di.max_mtu;
- if (q < xd->driver_frame_overhead && q > 0)
+ /* attempt to protect from bogus value provided by pmd */
+ if (q < (2 * xd->driver_frame_overhead) && q > 0)
xd->driver_frame_overhead = q;
dpdk_log_debug ("[%u] min_mtu: %u, max_mtu: %u, min_rx_bufsize: %u, "
"max_rx_pktlen: %u, max_lro_pkt_size: %u",