summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
diff options
context:
space:
mode:
authorDmitry Kravkov <dmitry@broadcom.com>2012-02-20 09:59:11 +0000
committerDavid S. Miller <davem@davemloft.net>2012-02-20 19:34:08 -0500
commitfe603b4d680a2bba9d8c6d4267450fcf295f30d1 (patch)
tree9a95941a880b25f703eac83f444f2f92ea0a9cd0 /drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
parente65de0716f4fb72b09fb37f603b71f4eabe18322 (diff)
downloadlwn-fe603b4d680a2bba9d8c6d4267450fcf295f30d1.tar.gz
lwn-fe603b4d680a2bba9d8c6d4267450fcf295f30d1.zip
bnx2x: add gro_check
The patch provides workaround for BUG in FW 7.2.16, which in GRO mode may miscalculate buffer and place on SGE one frag less than it could. It may happen only for some MTUs, we mark these MTUs with gro_check flag during device initialization or MTU change. Next FW should include fix for the issue and the patch could be reverted. Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 0a45251edb8f..f82dfff58243 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -330,6 +330,16 @@ static void bnx2x_tpa_start(struct bnx2x_fastpath *fp, u16 queue,
u16 gro_size = le16_to_cpu(cqe->pkt_len_or_gro_seg_len);
tpa_info->full_page =
SGE_PAGE_SIZE * PAGES_PER_SGE / gro_size * gro_size;
+ /*
+ * FW 7.2.16 BUG workaround:
+ * if SGE size is (exactly) multiple gro_size
+ * fw will place one less frag on SGE.
+ * the calculation is done only for potentially
+ * dangerous MTUs.
+ */
+ if (unlikely(bp->gro_check))
+ if (!(SGE_PAGE_SIZE * PAGES_PER_SGE % gro_size))
+ tpa_info->full_page -= gro_size;
tpa_info->gro_size = gro_size;
}
@@ -3486,6 +3496,8 @@ int bnx2x_change_mtu(struct net_device *dev, int new_mtu)
*/
dev->mtu = new_mtu;
+ bp->gro_check = bnx2x_need_gro_check(new_mtu);
+
return bnx2x_reload_if_running(dev);
}