bf0f90d92d
Ethdev is using default Ethernet overhead to decide if provided 'max_rx_pkt_len' value is bigger than max (non jumbo) MTU value, and limits it to MAX if it is. Since the application/driver used Ethernet overhead is different than the ethdev one, check result is wrong. If the driver is using Ethernet overhead bigger than the default one, the provided 'max_rx_pkt_len' is trimmed down, and in the driver when correct Ethernet overhead is used to convert back, the resulting MTU is less than the intended one, causing some packets to be dropped. Like, app -> max_rx_pkt_len = 1500/*mtu*/ + 22/*overhead*/ = 1522 ethdev -> 1522 > 1518/*MAX*/; max_rx_pkt_len = 1518 driver -> MTU = 1518 - 22 = 1496 Packets with size 1497-1500 are dropped although intention is to be able to send/receive them. The fix is to make ethdev use the correct Ethernet overhead for port, instead of default one. Fixes: 59d0ecdbf0e1 ("ethdev: MTU accessors") Cc: stable@dpdk.org Signed-off-by: Steve Yang <stevex.yang@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>