diff options
author | Dmitry Kravkov <dmitry@broadcom.com> | 2012-02-20 09:59:11 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-20 19:34:08 -0500 |
commit | fe603b4d680a2bba9d8c6d4267450fcf295f30d1 (patch) | |
tree | 9a95941a880b25f703eac83f444f2f92ea0a9cd0 /drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | |
parent | e65de0716f4fb72b09fb37f603b71f4eabe18322 (diff) |
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.h')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h index d2093ee9b85e..33aa7de24016 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h @@ -1504,6 +1504,13 @@ static inline bool bnx2x_mtu_allows_gro(int mtu) */ return mtu <= SGE_PAGE_SIZE && (U_ETH_SGL_SIZE * fpp) <= MAX_SKB_FRAGS; } + +static inline bool bnx2x_need_gro_check(int mtu) +{ + return (SGE_PAGES / (mtu - ETH_MAX_TPA_HEADER_SIZE - 1)) != + (SGE_PAGES / (mtu - ETH_MIN_TPA_HEADER_SIZE + 1)); +} + /** * bnx2x_bz_fp - zero content of the fastpath structure. * |