diff options
author | Padmanabh Ratnakar <[email protected]> | 2011-03-07 03:08:16 +0000 |
---|---|---|
committer | David S. Miller <[email protected]> | 2011-03-07 15:26:56 -0800 |
commit | 19fad86f3b34f52eebc511f6cdb99e82f53aee94 (patch) | |
tree | b440b46e31be59e29e8e04e15a11ca9d49c8fbd2 | |
parent | e80d9da651b19a79a1500d6bb808fcbcb39a869d (diff) |
be2net: Checksum field valid only for TCP/UDP
L4 checksum field is valid only for TCP/UDP packets in Lancer
Signed-off-by: Padmanabh Ratnakar <[email protected]>
Signed-off-by: Sathya Perla <[email protected]>
Signed-off-by: Subramanian Seetharaman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
-rw-r--r-- | drivers/net/benet/be_main.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index bf344347b5a6..ac7ae21bd0d1 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c @@ -865,14 +865,17 @@ static void be_rx_stats_update(struct be_rx_obj *rxo, static inline bool csum_passed(struct be_eth_rx_compl *rxcp) { - u8 l4_cksm, ipv6, ipcksm; + u8 l4_cksm, ipv6, ipcksm, tcpf, udpf; l4_cksm = AMAP_GET_BITS(struct amap_eth_rx_compl, l4_cksm, rxcp); ipcksm = AMAP_GET_BITS(struct amap_eth_rx_compl, ipcksm, rxcp); ipv6 = AMAP_GET_BITS(struct amap_eth_rx_compl, ip_version, rxcp); + tcpf = AMAP_GET_BITS(struct amap_eth_rx_compl, tcpf, rxcp); + udpf = AMAP_GET_BITS(struct amap_eth_rx_compl, udpf, rxcp); - /* Ignore ipcksm for ipv6 pkts */ - return l4_cksm && (ipcksm || ipv6); + /* L4 checksum is not reliable for non TCP/UDP packets. + * Also ignore ipcksm for ipv6 pkts */ + return (tcpf || udpf) && l4_cksm && (ipcksm || ipv6); } static struct be_rx_page_info * |