[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89i+FSNSF5JgXZcq5h-h2o5QhzOmRDc3q6XT7dcxMG-S20w@mail.gmail.com>
Date: Fri, 5 Jan 2024 15:36:28 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Vladimir Oltean <olteanv@...il.com>
Cc: Linus Walleij <linus.walleij@...aro.org>, Hans Ulli Kroll <ulli.kroll@...glemail.com>,
"David S. Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Household Cang <canghousehold@....com>, Romain Gantois <romain.gantois@...tlin.com>,
netdev@...r.kernel.org
Subject: Re: [PATCH net v5 1/2] net: ethernet: cortina: Drop software checksum
and TSO
On Fri, Jan 5, 2024 at 12:32 PM Vladimir Oltean <olteanv@...il.com> wrote:
>
> On Tue, Jan 02, 2024 at 09:34:25PM +0100, Linus Walleij wrote:
> > @@ -1143,39 +1142,13 @@ static int gmac_map_tx_bufs(struct net_device *netdev, struct sk_buff *skb,
> > struct gmac_txdesc *txd;
> > skb_frag_t *skb_frag;
> > dma_addr_t mapping;
> > - unsigned short mtu;
> > void *buffer;
> > - int ret;
> > -
> > - mtu = ETH_HLEN;
> > - mtu += netdev->mtu;
> > - if (skb->protocol == htons(ETH_P_8021Q))
> > - mtu += VLAN_HLEN;
> >
> > + /* TODO: implement proper TSO using MTU in word3 */
> > word1 = skb->len;
> > - word3 = SOF_BIT;
> > -
> > - if (word1 > mtu) {
> > - word1 |= TSS_MTU_ENABLE_BIT;
> > - word3 |= mtu;
> > - }
> > + word3 = SOF_BIT | skb->len;
> >
> > - if (skb->len >= ETH_FRAME_LEN) {
> > - /* Hardware offloaded checksumming isn't working on frames
> > - * bigger than 1514 bytes. A hypothesis about this is that the
> > - * checksum buffer is only 1518 bytes, so when the frames get
> > - * bigger they get truncated, or the last few bytes get
> > - * overwritten by the FCS.
> > - *
> > - * Just use software checksumming and bypass on bigger frames.
> > - */
> > - if (skb->ip_summed == CHECKSUM_PARTIAL) {
> > - ret = skb_checksum_help(skb);
> > - if (ret)
> > - return ret;
> > - }
> > - word1 |= TSS_BYPASS_BIT;
> > - } else if (skb->ip_summed == CHECKSUM_PARTIAL) {
>
> So are you taking back the statement that "Hardware offloaded
> checksumming isn't working on frames bigger than 1514 bytes"?
>
> Have you increased the interface MTU beyond 1500, and tested with plain
> TCP (no DSA) on top of it? Who will provide the TCP checksum for them now?
>
> I don't understand why you remove the skb_checksum_help() call.
> It doesn't play nice with skb_is_gso() packets, agreed, but you removed
> the TSO netdev feature.
This TSO feature never possibly worked.
This was probably hidden because TCP retransmits non TSO packets eventually.
A TSO enabled driver must use/propagate skb_shinfo(skb)->gso_size
value to the TSO engine on the NIC.
Otherwise, this is absolutely broken.
Please look at my original suggestion. I think the plan is to try to
add back TSO in next release, with proper testing (ie not rely on TCP
resilience)
https://lore.kernel.org/netdev/CANn89iJLfxng1sYL5Zk0mknXpyYQPCp83m3KgD2KJ2_hKCpEUg@mail.gmail.com/
Powered by blists - more mailing lists