aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorSomnath Kotur <somnath.kotur@emulex.com>2013-05-29 18:55:56 -0400
committerDavid S. Miller <davem@davemloft.net>2013-05-30 19:58:06 -0400
commite38b170695d4108eeb6cd84db36f567fc6de4120 (patch)
tree75c4a48d3ca0295620749ed72e8f549d7088d13c /drivers/net
parent73ce00d4d6369c1a91c95f9b41e6ce498fbbd56f (diff)
be2net: Mark checksum fail for IP fragmented packets
HW does not compute L4 checksum for IP Fragmented packets. Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/emulex/benet/be.h1
-rw-r--r--drivers/net/ethernet/emulex/benet/be_hw.h2
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c7
3 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h
index f544b297c9ab..0a510684e468 100644
--- a/drivers/net/ethernet/emulex/benet/be.h
+++ b/drivers/net/ethernet/emulex/benet/be.h
@@ -262,6 +262,7 @@ struct be_rx_compl_info {
262 u8 ipv6; 262 u8 ipv6;
263 u8 vtm; 263 u8 vtm;
264 u8 pkt_type; 264 u8 pkt_type;
265 u8 ip_frag;
265}; 266};
266 267
267struct be_rx_obj { 268struct be_rx_obj {
diff --git a/drivers/net/ethernet/emulex/benet/be_hw.h b/drivers/net/ethernet/emulex/benet/be_hw.h
index 3c1099b47f2a..8780183c6d1c 100644
--- a/drivers/net/ethernet/emulex/benet/be_hw.h
+++ b/drivers/net/ethernet/emulex/benet/be_hw.h
@@ -356,7 +356,7 @@ struct amap_eth_rx_compl_v0 {
356 u8 ip_version; /* dword 1 */ 356 u8 ip_version; /* dword 1 */
357 u8 macdst[6]; /* dword 1 */ 357 u8 macdst[6]; /* dword 1 */
358 u8 vtp; /* dword 1 */ 358 u8 vtp; /* dword 1 */
359 u8 rsvd0; /* dword 1 */ 359 u8 ip_frag; /* dword 1 */
360 u8 fragndx[10]; /* dword 1 */ 360 u8 fragndx[10]; /* dword 1 */
361 u8 ct[2]; /* dword 1 */ 361 u8 ct[2]; /* dword 1 */
362 u8 sw; /* dword 1 */ 362 u8 sw; /* dword 1 */
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index ca2967b0f18b..32a6927ca977 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -1599,6 +1599,8 @@ static void be_parse_rx_compl_v0(struct be_eth_rx_compl *compl,
1599 compl); 1599 compl);
1600 } 1600 }
1601 rxcp->port = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, port, compl); 1601 rxcp->port = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, port, compl);
1602 rxcp->ip_frag = AMAP_GET_BITS(struct amap_eth_rx_compl_v0,
1603 ip_frag, compl);
1602} 1604}
1603 1605
1604static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo) 1606static 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)
1620 else 1622 else
1621 be_parse_rx_compl_v0(compl, rxcp); 1623 be_parse_rx_compl_v0(compl, rxcp);
1622 1624
1625 if (rxcp->ip_frag)
1626 rxcp->l4_csum = 0;
1627
1623 if (rxcp->vlanf) { 1628 if (rxcp->vlanf) {
1624 /* vlanf could be wrongly set in some cards. 1629 /* vlanf could be wrongly set in some cards.
1625 * ignore if vtm is not set */ 1630 * ignore if vtm is not set */
@@ -2168,7 +2173,7 @@ static irqreturn_t be_msix(int irq, void *dev)
2168 2173
2169static inline bool do_gro(struct be_rx_compl_info *rxcp) 2174static inline bool do_gro(struct be_rx_compl_info *rxcp)
2170{ 2175{
2171 return (rxcp->tcpf && !rxcp->err) ? true : false; 2176 return (rxcp->tcpf && !rxcp->err && rxcp->l4_csum) ? true : false;
2172} 2177}
2173 2178
2174static int be_process_rx(struct be_rx_obj *rxo, struct napi_struct *napi, 2179static int be_process_rx(struct be_rx_obj *rxo, struct napi_struct *napi,