From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net [IPv6:2001:a60:0:28:0:1:25:1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 417r5y1MYhzF09q for ; Sun, 17 Jun 2018 20:28:05 +1000 (AEST) From: Andreas Schwab To: Eric Dumazet Cc: Mathieu Malaterre , "David S. Miller" , Eric Dumazet , LKML , Christophe LEROY , Meelis Roos , netdev@vger.kernel.org, linuxppc-dev Subject: Re: [PATCH] Revert "net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends" References: <20180615185645.8921-1-malat@debian.org> <9d88677a-f2be-2089-79df-15df4e9a5dd6@gmail.com> Date: Sun, 17 Jun 2018 12:27:58 +0200 In-Reply-To: <9d88677a-f2be-2089-79df-15df4e9a5dd6@gmail.com> (Eric Dumazet's message of "Sat, 16 Jun 2018 05:45:42 -0700") Message-ID: MIME-Version: 1.0 Content-Type: text/plain List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Jun 16 2018, Eric Dumazet 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."