Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1535514

Re: [PATCH V2 net-next] net: hns: Fix to conditionally convey RX checksum flag to stack

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH V2 net-next] net: hns: Fix to conditionally convey RX checksum flag to stack
Date 2016-12-03 21:10 +0100
Message-ID <sKoNb-5PC-13@gated-at.bofh.it> (permalink)
References <sIQue-v5-5@gated-at.bofh.it> <sJiJQ-1JG-13@gated-at.bofh.it> <sJylz-3Eb-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Salil Mehta <salil.mehta@huawei.com>
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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V2 net-next] net: hns: Fix to conditionally convey RX checksum flag to stack Salil Mehta <salil.mehta@huawei.com> - 2016-11-29 14:20 +0100
  Re: [PATCH V2 net-next] net: hns: Fix to conditionally convey RX  checksum flag to stack David Miller <davem@davemloft.net> - 2016-11-30 20:30 +0100
    RE: [PATCH V2 net-next] net: hns: Fix to conditionally convey RX  checksum flag to stack Salil Mehta <salil.mehta@huawei.com> - 2016-12-01 13:10 +0100
      Re: [PATCH V2 net-next] net: hns: Fix to conditionally convey RX  checksum flag to stack David Miller <davem@davemloft.net> - 2016-12-03 21:10 +0100
        RE: [PATCH V2 net-next] net: hns: Fix to conditionally convey RX  checksum flag to stack Salil Mehta <salil.mehta@huawei.com> - 2016-12-05 16:50 +0100
    RE: [PATCH V2 net-next] net: hns: Fix to conditionally convey RX  checksum flag to stack Salil Mehta <salil.mehta@huawei.com> - 2016-12-01 18:00 +0100
      Re: [PATCH V2 net-next] net: hns: Fix to conditionally convey RX  checksum flag to stack David Miller <davem@davemloft.net> - 2016-12-03 21:30 +0100
        RE: [PATCH V2 net-next] net: hns: Fix to conditionally convey RX  checksum flag to stack Salil Mehta <salil.mehta@huawei.com> - 2016-12-05 16:50 +0100

csiph-web