Commit e38b1706 authored by Somnath Kotur's avatar Somnath Kotur Committed by David S. Miller

be2net: Mark checksum fail for IP fragmented packets

HW does not compute L4 checksum for IP Fragmented packets.
Signed-off-by: default avatarKalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: default avatarSomnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 73ce00d4
......@@ -262,6 +262,7 @@ struct be_rx_compl_info {
u8 ipv6;
u8 vtm;
u8 pkt_type;
u8 ip_frag;
};
struct be_rx_obj {
......
......@@ -356,7 +356,7 @@ struct amap_eth_rx_compl_v0 {
u8 ip_version; /* dword 1 */
u8 macdst[6]; /* dword 1 */
u8 vtp; /* dword 1 */
u8 rsvd0; /* dword 1 */
u8 ip_frag; /* dword 1 */
u8 fragndx[10]; /* dword 1 */
u8 ct[2]; /* dword 1 */
u8 sw; /* dword 1 */
......
......@@ -1599,6 +1599,8 @@ static void be_parse_rx_compl_v0(struct be_eth_rx_compl *compl,
compl);
}
rxcp->port = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, port, compl);
rxcp->ip_frag = AMAP_GET_BITS(struct amap_eth_rx_compl_v0,
ip_frag, compl);
}
static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo)
......@@ -1620,6 +1622,9 @@ static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo)
else
be_parse_rx_compl_v0(compl, rxcp);
if (rxcp->ip_frag)
rxcp->l4_csum = 0;
if (rxcp->vlanf) {
/* vlanf could be wrongly set in some cards.
* ignore if vtm is not set */
......@@ -2168,7 +2173,7 @@ static irqreturn_t be_msix(int irq, void *dev)
static inline bool do_gro(struct be_rx_compl_info *rxcp)
{
return (rxcp->tcpf && !rxcp->err) ? true : false;
return (rxcp->tcpf && !rxcp->err && rxcp->l4_csum) ? true : false;
}
static int be_process_rx(struct be_rx_obj *rxo, struct napi_struct *napi,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment