[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF=yD-+y4Qd4nqTsOKq3cX==HvofeH_9FsgmiPXMcU3i9Hhn1w@mail.gmail.com>
Date: Wed, 24 Jul 2024 10:51:39 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Praveen Kaligineedi <pkaligineedi@...gle.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, willemb@...gle.com, shailend@...gle.com,
hramamurthy@...gle.com, csully@...gle.com, jfraker@...gle.com,
stable@...r.kernel.org, Bailey Forrest <bcf@...gle.com>,
Jeroen de Borst <jeroendb@...gle.com>
Subject: Re: [PATCH net v2] gve: Fix an edge case for TSO skb validity check
On Wed, Jul 24, 2024 at 10:35 AM Praveen Kaligineedi
<pkaligineedi@...gle.com> wrote:
>
> From: Bailey Forrest <bcf@...gle.com>
>
> The NIC requires each TSO segment to not span more than 10
> descriptors. NIC further requires each descriptor to not exceed
> 16KB - 1 (GVE_TX_MAX_BUF_SIZE_DQO).
>
> The descriptors for an skb are generated by
> gve_tx_add_skb_no_copy_dqo() for DQO RDA queue format.
> gve_tx_add_skb_no_copy_dqo() loops through each skb frag and
> generates a descriptor for the entire frag if the frag size is
> not greater than GVE_TX_MAX_BUF_SIZE_DQO. If the frag size is
> greater than GVE_TX_MAX_BUF_SIZE_DQO, it is split into descriptor(s)
> of size GVE_TX_MAX_BUF_SIZE_DQO and a descriptor is generated for
> the remainder (frag size % GVE_TX_MAX_BUF_SIZE_DQO).
>
> gve_can_send_tso() checks if the descriptors thus generated for an
> skb would meet the requirement that each TSO-segment not span more
> than 10 descriptors. However, the current code misses an edge case
> when a TSO segment spans multiple descriptors within a large frag.
> This change fixes the edge case.
>
> gve_can_send_tso() relies on the assumption that max gso size (9728)
> is less than GVE_TX_MAX_BUF_SIZE_DQO and therefore within an skb
> fragment a TSO segment can never span more than 2 descriptors.
>
> Fixes: a57e5de476be ("gve: DQO: Add TX path")
> Signed-off-by: Praveen Kaligineedi <pkaligineedi@...gle.com>
> Signed-off-by: Bailey Forrest <bcf@...gle.com>
> Reviewed-by: Jeroen de Borst <jeroendb@...gle.com>
> Cc: stable@...r.kernel.org
Reviewed-by: Willem de Bruijn <willemb@...gle.com>
Thanks for the extra description. The way gve_tx_add_skb_no_copy_dqo
lays out descriptors, and the descriptor and segment max lengths are key.
Now I follow the calculation.
Powered by blists - more mailing lists