aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
diff options
context:
space:
mode:
authorDmitry Kravkov <dmitry@broadcom.com>2012-06-25 18:32:50 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-17 04:31:47 -0400
commit7df2dc6bd4b4b13fd9bd239603cc825e3d1aa316 (patch)
tree6b1cc8bf50e0aded9bd8b244217ced6c346cc873 /drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
parent16626b0cc3d5afe250850f96759b241f8a403b52 (diff)
bnx2x: organize BDs calculation for stop/resume
Put the numbers used for stop/resume queue in a single place and fix the condition for sanity check. Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Cc: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x.h')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
index 52f33b8c41e5..dbe97918a7fd 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h
@@ -614,6 +614,22 @@ struct bnx2x_fastpath {
614#define TX_BD(x) ((x) & MAX_TX_BD) 614#define TX_BD(x) ((x) & MAX_TX_BD)
615#define TX_BD_POFF(x) ((x) & MAX_TX_DESC_CNT) 615#define TX_BD_POFF(x) ((x) & MAX_TX_DESC_CNT)
616 616
617/* number of NEXT_PAGE descriptors may be required during placement */
618#define NEXT_CNT_PER_TX_PKT(bds) \
619 (((bds) + MAX_TX_DESC_CNT - 1) / \
620 MAX_TX_DESC_CNT * NEXT_PAGE_TX_DESC_CNT)
621/* max BDs per tx packet w/o next_pages:
622 * START_BD - describes packed
623 * START_BD(splitted) - includes unpaged data segment for GSO
624 * PARSING_BD - for TSO and CSUM data
625 * Frag BDs - decribes pages for frags
626 */
627#define BDS_PER_TX_PKT 3
628#define MAX_BDS_PER_TX_PKT (MAX_SKB_FRAGS + BDS_PER_TX_PKT)
629/* max BDs per tx packet including next pages */
630#define MAX_DESC_PER_TX_PKT (MAX_BDS_PER_TX_PKT + \
631 NEXT_CNT_PER_TX_PKT(MAX_BDS_PER_TX_PKT))
632
617/* The RX BD ring is special, each bd is 8 bytes but the last one is 16 */ 633/* The RX BD ring is special, each bd is 8 bytes but the last one is 16 */
618#define NUM_RX_RINGS 8 634#define NUM_RX_RINGS 8
619#define RX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_bd)) 635#define RX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_bd))