lkml.org 
[lkml]   [2016]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V2 net-next] net: hns: Fix to conditionally convey RX checksum flag to stack
From
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.

\
 
 \ /
  Last update: 2016-12-03 21:09    [W:0.291 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site