summaryrefslogtreecommitdiffstats
path: root/src/plugins/dpdk/device/init.c
diff options
context:
space:
mode:
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",