[PATCH] net/gve: Update max_rx_pktlen to be based on MTU
Stephen Hemminger
stephen at networkplumber.org
Tue Oct 17 00:58:51 CEST 2023
On Mon, 16 Oct 2023 13:59:48 -0700
Joshua Washington <joshwash at google.com> wrote:
> conjunction with the MTU fix, causes problems with testpmd, as setting the
> packet length with the --max-pkt-len flag causes the MTU to be set
> higher than possible due to underflow.
>
> As an example, setting --max-pkt-len=1460 (the default MTU on Google
> Cloud VMs) causes testpmd to set the following:
> mtu = 1460 - eth_overhead,
>
> where eth_overhead = dev->max_rx_pktlen - dev->max_mtu = 65535 - 1460.
>
> Thus, mtu = 1460 - 65535 + 1460 = 2921 due to underflow.
>
> Signed-off-by: Joshua Washington <joshwash at google.com>
>
> Fixes: 030025b74202 ("net/gve: fix max MTU limit")
> Cc: joshwash at google.com
Never mind, previous comment.
You are correctly doing the inverse of this common code pattern.
In testpmd:
static uint32_t
eth_dev_get_overhead_len(uint32_t max_rx_pktlen, uint16_t max_mtu)
{
uint32_t overhead_len;
if (max_mtu != UINT16_MAX && max_rx_pktlen > max_mtu)
overhead_len = max_rx_pktlen - max_mtu;
else
overhead_len = RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN;
return overhead_len;
}
More information about the dev
mailing list