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>
This commit is contained in:
committed by
David S. Miller
parent
e80d9da651
commit
19fad86f3b
@@ -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)
|
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);
|
l4_cksm = AMAP_GET_BITS(struct amap_eth_rx_compl, l4_cksm, rxcp);
|
||||||
ipcksm = AMAP_GET_BITS(struct amap_eth_rx_compl, ipcksm, rxcp);
|
ipcksm = AMAP_GET_BITS(struct amap_eth_rx_compl, ipcksm, rxcp);
|
||||||
ipv6 = AMAP_GET_BITS(struct amap_eth_rx_compl, ip_version, 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 */
|
/* L4 checksum is not reliable for non TCP/UDP packets.
|
||||||
return l4_cksm && (ipcksm || ipv6);
|
* Also ignore ipcksm for ipv6 pkts */
|
||||||
|
return (tcpf || udpf) && l4_cksm && (ipcksm || ipv6);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct be_rx_page_info *
|
static struct be_rx_page_info *
|
||||||
|
Reference in New Issue
Block a user