Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218408
b: refs/heads/master
c: c6ce2f4
h: refs/heads/master
v: v3
  • Loading branch information
Somnath Kotur authored and David S. Miller committed Oct 25, 2010
1 parent f17199e commit ab4df43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 63a76944b674bb758232e4213da0da95ae055012
refs/heads/master: c6ce2f4b270cb1d4d6b6f4f692a12ca2fea13f3f
20 changes: 8 additions & 12 deletions trunk/drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,20 +849,16 @@ static void be_rx_stats_update(struct be_rx_obj *rxo,
stats->rx_mcast_pkts++;
}

static inline bool do_pkt_csum(struct be_eth_rx_compl *rxcp, bool cso)
static inline bool csum_passed(struct be_eth_rx_compl *rxcp)
{
u8 l4_cksm, ip_version, ipcksm, tcpf = 0, udpf = 0, ipv6_chk;
u8 l4_cksm, ipv6, ipcksm;

l4_cksm = AMAP_GET_BITS(struct amap_eth_rx_compl, l4_cksm, rxcp);
ipcksm = AMAP_GET_BITS(struct amap_eth_rx_compl, ipcksm, rxcp);
ip_version = AMAP_GET_BITS(struct amap_eth_rx_compl, ip_version, rxcp);
if (ip_version) {
tcpf = AMAP_GET_BITS(struct amap_eth_rx_compl, tcpf, rxcp);
udpf = AMAP_GET_BITS(struct amap_eth_rx_compl, udpf, rxcp);
}
ipv6_chk = (ip_version && (tcpf || udpf));
ipv6 = AMAP_GET_BITS(struct amap_eth_rx_compl, ip_version, rxcp);

return ((l4_cksm && ipv6_chk && ipcksm) && cso) ? false : true;
/* Ignore ipcksm for ipv6 pkts */
return l4_cksm && (ipcksm || ipv6);
}

static struct be_rx_page_info *
Expand Down Expand Up @@ -1017,10 +1013,10 @@ static void be_rx_compl_process(struct be_adapter *adapter,

skb_fill_rx_data(adapter, rxo, skb, rxcp, num_rcvd);

if (do_pkt_csum(rxcp, adapter->rx_csum))
skb_checksum_none_assert(skb);
else
if (likely(adapter->rx_csum && csum_passed(rxcp)))
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
skb_checksum_none_assert(skb);

skb->truesize = skb->len + sizeof(struct sk_buff);
skb->protocol = eth_type_trans(skb, adapter->netdev);
Expand Down

0 comments on commit ab4df43

Please sign in to comment.