linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Mathieu Malaterre <malat@debian.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Christophe LEROY <christophe.leroy@c-s.fr>,
	Meelis Roos <mroos@linux.ee>,
	netdev@vger.kernel.org,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH] Revert "net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends"
Date: Sun, 17 Jun 2018 12:27:58 +0200	[thread overview]
Message-ID: <m2tvq1672p.fsf@linux-m68k.org> (raw)
In-Reply-To: <9d88677a-f2be-2089-79df-15df4e9a5dd6@gmail.com> (Eric Dumazet's message of "Sat, 16 Jun 2018 05:45:42 -0700")

On Jun 16 2018, Eric Dumazet <eric.dumazet@gmail.com> wrote:

> I would try something like :
>
> Basically do not bother using CHECKSUM_COMPLETE for small frames that might have been padded.
>
> Since we need to bring one cache line in eth_type_trans() and further header processing,
> computing the checksum in software will be almost free anyway.
>
> diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c
> index 7a16d40a72d13cf1d522e8a3a396c826fe76f9b9..071039f211a8a33153e888bd4014314ba5e686a4 100644
> --- a/drivers/net/ethernet/sun/sungem.c
> +++ b/drivers/net/ethernet/sun/sungem.c
> @@ -855,9 +855,11 @@ static int gem_rx(struct gem *gp, int work_to_do)
>                         skb = copy_skb;
>                 }
>  
> -               csum = (__force __sum16)htons((status & RXDCTRL_TCPCSUM) ^ 0xffff);
> -               skb->csum = csum_unfold(csum);
> -               skb->ip_summed = CHECKSUM_COMPLETE;
> +               if (len > ETH_ZLEN) {
> +                       csum = (__force __sum16)htons((status & RXDCTRL_TCPCSUM) ^ 0xffff);
> +                       skb->csum = csum_unfold(csum);
> +                       skb->ip_summed = CHECKSUM_COMPLETE;
> +               }
>                 skb->protocol = eth_type_trans(skb, gp->dev);
>  
>                 napi_gro_receive(&gp->napi, skb);

That doesn't change anything.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

  reply	other threads:[~2018-06-17 10:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180615185645.8921-1-malat@debian.org>
     [not found] ` <fbb95c11-240c-1a11-0a62-0483908c577e@gmail.com>
2018-06-16  7:14   ` [PATCH] Revert "net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends" Mathieu Malaterre
2018-06-16 12:45     ` Eric Dumazet
2018-06-17 10:27       ` Andreas Schwab [this message]
2018-06-17 22:54         ` Eric Dumazet
2018-06-18 17:54           ` Andreas Schwab
2018-06-18 18:18             ` Eric Dumazet
2018-06-18 18:45               ` Mathieu Malaterre
2018-06-18 23:29                 ` Eric Dumazet
2018-06-18 23:36                   ` Eric Dumazet
2018-06-19 19:10                     ` Andreas Schwab
2018-06-19 20:10                       ` Eric Dumazet
2018-06-19 22:10                         ` Eric Dumazet
2018-06-19 22:32                           ` Andreas Schwab
2018-06-19 22:40                             ` Eric Dumazet
2018-06-18 18:29             ` Mathieu Malaterre
2018-06-17 10:09     ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2tvq1672p.fsf@linux-m68k.org \
    --to=schwab@linux-m68k.org \
    --cc=christophe.leroy@c-s.fr \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=malat@debian.org \
    --cc=mroos@linux.ee \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).