diff options
author | Tianyu Li <tianyu.li@arm.com> | 2022-06-10 09:30:47 +0000 |
---|---|---|
committer | Matthew Smith <mgsmith@netgate.com> | 2022-07-18 21:22:53 +0000 |
commit | 574d99439d34cea6bf01619fca32493249f4dc3a (patch) | |
tree | 42fc0be1c1745428841026e65bee3e3031d3e1d4 | |
parent | 651cc01b642f0fb373ce15533bf820196b1b5d8f (diff) |
dpdk: fix mlx5 dpdk init with no-multi-seg
Build vpp with MLX DPDK PMD,
make DPDK_MLX4_PMD=y DPDK_MLX5_PMD=y DPDK_MLX5_COMMON_PMD=y build-release
With no-multi-seg in startup.conf,
Mellanox NIC init failed with following message,
rte_eth_rx_queue_setup[port:2, errno:-12]: Unknown error -12
mlx5_net: port 2 Rx queue 0: Scatter offload is not configured and
no enough mbuf space(2176) to contain the maximum RX packet length(2065)
with head-room(128)
In Mellanox NIC PMD driver, 'di.max_rx_pktlen' is returned as 65536,
and 'di.max_mtu' is returned as 65535, which makes
the driver_frame_overhead logic not suitable for Mellanox NICs.
So skip the logic code if MAX_MTU is returned as 65535.
Type: fix
Fixes: 1cd0e5dd533f ("vnet: distinguish between max_frame_size and MTU")
Signed-off-by: Tianyu Li <tianyu.li@arm.com>
Change-Id: I027b76b8d07fb453015b8eebb36d160b4bc8df9c
-rw-r--r-- | src/plugins/dpdk/device/init.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/dpdk/device/init.c b/src/plugins/dpdk/device/init.c index 0cc8e12357b..4863c8c12b6 100644 --- a/src/plugins/dpdk/device/init.c +++ b/src/plugins/dpdk/device/init.c @@ -402,7 +402,8 @@ dpdk_lib_init (dpdk_main_t * dm) q = di.max_rx_pktlen - di.max_mtu; /* attempt to protect from bogus value provided by pmd */ - if (q < (2 * xd->driver_frame_overhead) && q > 0) + if (q < (2 * xd->driver_frame_overhead) && q > 0 && + di.max_mtu != UINT16_MAX) 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", |