Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752028AbcLEPoG convert rfc822-to-8bit (ORCPT ); Mon, 5 Dec 2016 10:44:06 -0500 Received: from lhrrgout.huawei.com ([194.213.3.17]:4786 "EHLO lhrrgout.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751464AbcLEPoD (ORCPT ); Mon, 5 Dec 2016 10:44:03 -0500 From: Salil Mehta To: David Miller CC: "Zhuangyuzeng (Yisen)" , "mehta.salil.lnk@gmail.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Linuxarm Subject: RE: [PATCH V2 net-next] net: hns: Fix to conditionally convey RX checksum flag to stack Thread-Topic: [PATCH V2 net-next] net: hns: Fix to conditionally convey RX checksum flag to stack Thread-Index: AQHSSkHpMFDOpU42u0SRd9dvOPMXEKDx6oyAgADkfKCAA96lgIAC2joQ Date: Mon, 5 Dec 2016 15:43:48 +0000 Message-ID: References: <20161129130945.919372-1-salil.mehta@huawei.com> <20161130.142539.1927956259851457047.davem@davemloft.net> <20161203.150905.739546865468666597.davem@davemloft.net> In-Reply-To: <20161203.150905.739546865468666597.davem@davemloft.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.203.181.153] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.58458B3E.0240,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: b00e21e4b65a00742e5b77451b53b23f Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1352 Lines: 45 > -----Original Message----- > From: David Miller [mailto:davem@davemloft.net] > Sent: Saturday, December 03, 2016 8:09 PM > To: Salil Mehta > Cc: Zhuangyuzeng (Yisen); mehta.salil.lnk@gmail.com; > netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Linuxarm > Subject: Re: [PATCH V2 net-next] net: hns: Fix to conditionally convey > RX checksum flag to stack > > From: Salil Mehta > Date: Thu, 1 Dec 2016 12:09:22 +0000 > > > But maybe now since we don't have any method to de-multiplex the kind > of > > checksum error (cannot depend upon register) we can have below code > > re-arrangement: > > > > hns_nic_rx_checksum() { > > /* check supported L3 protocol */ > > if (l3 != IPV4 && l3 != IPV6) > > return; > > /* check if L3 protocols error */ > > if (l3e) > > return; > > > > /* check if the packets are fragmented */ > > If (l3frags) > > Return; > > > > /* check supported L4 protocol */ > > if (l4 != UDP && l4 != TCP && l4 != SCTP) > > return; > > /* check if any L4 protocol error */ > > if (l3e) > > return; > > > > /* packet with valid checksum - covey to stack */ > > skb->ip_summed = CHECKSUM_UNNECESSARY > > } > > This looks a lot cleaner and easier to understand. Sure, floated Patch V3. Please have a look. Thanks! Best regards Salil