aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/benet')
-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 *