aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_main.c
diff options
context:
space:
mode:
authorPadmanabh Ratnakar <padmanabh.ratnakar@emulex.com>2011-03-06 22:08:16 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-07 18:26:56 -0500
commit19fad86f3b34f52eebc511f6cdb99e82f53aee94 (patch)
treeb440b46e31be59e29e8e04e15a11ca9d49c8fbd2 /drivers/net/benet/be_main.c
parente80d9da651b19a79a1500d6bb808fcbcb39a869d (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 <padmanabh.ratnakar@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: Subramanian Seetharaman <subbu.seetharaman@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_main.c')
-rw-r--r--drivers/net/benet/be_main.c9
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,
865 865
866static inline bool csum_passed(struct be_eth_rx_compl *rxcp) 866static inline bool csum_passed(struct be_eth_rx_compl *rxcp)
867{ 867{
868 u8 l4_cksm, ipv6, ipcksm; 868 u8 l4_cksm, ipv6, ipcksm, tcpf, udpf;
869 869
870 l4_cksm = AMAP_GET_BITS(struct amap_eth_rx_compl, l4_cksm, rxcp); 870 l4_cksm = AMAP_GET_BITS(struct amap_eth_rx_compl, l4_cksm, rxcp);
871 ipcksm = AMAP_GET_BITS(struct amap_eth_rx_compl, ipcksm, rxcp); 871 ipcksm = AMAP_GET_BITS(struct amap_eth_rx_compl, ipcksm, rxcp);
872 ipv6 = AMAP_GET_BITS(struct amap_eth_rx_compl, ip_version, rxcp); 872 ipv6 = AMAP_GET_BITS(struct amap_eth_rx_compl, ip_version, rxcp);
873 tcpf = AMAP_GET_BITS(struct amap_eth_rx_compl, tcpf, rxcp);
874 udpf = AMAP_GET_BITS(struct amap_eth_rx_compl, udpf, rxcp);
873 875
874 /* Ignore ipcksm for ipv6 pkts */ 876 /* L4 checksum is not reliable for non TCP/UDP packets.
875 return l4_cksm && (ipcksm || ipv6); 877 * Also ignore ipcksm for ipv6 pkts */
878 return (tcpf || udpf) && l4_cksm && (ipcksm || ipv6);
876} 879}
877 880
878static struct be_rx_page_info * 881static struct be_rx_page_info *