On 1/6/2021 3:36 AM, Yang, SteveX wrote:

<...>

If max rx packet length is smaller then MTU + Ether overhead, that
will drop all MTU size packets.

Update the MTU size according to the max rx packet and Ether overhead.


Can you please elaborate the explanation a little more, it is hard to understand the problem with above description.

Problem is:
"
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.
"

Addition to above, the code reviews suggest slight difference, like dropping the ethdev check completely for non-jumbo packets, please reflect them to the commit log if changes are implemented.

Fixes: 59d0ecdbf0e1 ("ethdev: MTU accessors")

Signed-off-by: Steve Yang <stevex.y...@intel.com>
---

Reply via email to