[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240617165142.GX8447@kernel.org>
Date: Mon, 17 Jun 2024 17:51:42 +0100
From: Simon Horman <horms@...nel.org>
To: Furong Xu <0x1207@...il.com>
Cc: "Russell King (Oracle)" <linux@...linux.org.uk>,
Eric Dumazet <edumazet@...gle.com>,
Vadim Fedorenko <vadim.fedorenko@...ux.dev>,
"David S. Miller" <davem@...emloft.net>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Joao Pinto <jpinto@...opsys.com>,
Corinna Vinschen <vinschen@...hat.com>, netdev@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
xfr@...look.com, rock.xu@....com
Subject: Re: [PATCH net-next v4] net: stmmac: Enable TSO on VLANs
On Sat, Jun 15, 2024 at 05:56:11PM +0800, Furong Xu wrote:
> The TSO engine works well when the frames are not VLAN Tagged.
> But it will produce broken segments when frames are VLAN Tagged.
>
> The first segment is all good, while the second segment to the
> last segment are broken, they lack of required VLAN tag.
>
> An example here:
> ========
> // 1st segment of a VLAN Tagged TSO frame, nothing wrong.
> MacSrc > MacDst, ethertype 802.1Q (0x8100), length 1518: vlan 100, p 1, ethertype IPv4 (0x0800), HostA:42643 > HostB:5201: Flags [.], seq 1:1449
>
> // 2nd to last segments of a VLAN Tagged TSO frame, VLAN tag is missing.
> MacSrc > MacDst, ethertype IPv4 (0x0800), length 1514: HostA:42643 > HostB:5201: Flags [.], seq 1449:2897
> MacSrc > MacDst, ethertype IPv4 (0x0800), length 1514: HostA:42643 > HostB:5201: Flags [.], seq 2897:4345
> MacSrc > MacDst, ethertype IPv4 (0x0800), length 1514: HostA:42643 > HostB:5201: Flags [.], seq 4345:5793
> MacSrc > MacDst, ethertype IPv4 (0x0800), length 1514: HostA:42643 > HostB:5201: Flags [P.], seq 5793:7241
>
> // normal VLAN Tagged non-TSO frame, nothing wrong.
> MacSrc > MacDst, ethertype 802.1Q (0x8100), length 1022: vlan 100, p 1, ethertype IPv4 (0x0800), HostA:42643 > HostB:5201: Flags [P.], seq 7241:8193
> MacSrc > MacDst, ethertype 802.1Q (0x8100), length 70: vlan 100, p 1, ethertype IPv4 (0x0800), HostA:42643 > HostB:5201: Flags [F.], seq 8193
> ========
>
> When transmitting VLAN Tagged TSO frames, never insert VLAN tag by HW,
> always insert VLAN tag to SKB payload, then TSO works well on VLANs for
> all MAC cores.
>
> Tested on DWMAC CORE 5.10a, DWMAC CORE 5.20a and DWXGMAC CORE 3.20a
>
> Signed-off-by: Furong Xu <0x1207@...il.com>
> ---
> Changes in v4:
> - Re-arrange variables to keep reverse x-mas tree order.
>
> Changes in v3:
> - Drop packet and increase stats counter when vlan tag insert fails.
>
> Changes in v2:
> - Use __vlan_hwaccel_push_inside() to insert vlan tag to the payload.
Thanks this both seems correct to me and
I believe it addresses the review of earlier revisions.
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists