aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2x.h
diff options
context:
space:
mode:
authorEilon Greenstein <eilong@broadcom.com>2009-08-13 01:53:28 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-13 01:53:28 -0400
commitca00392cb8f5227c67ff52c656d91a764d022ab9 (patch)
tree007d82074e49d25d1ee6bfb484392032d463be91 /drivers/net/bnx2x.h
parent6200f09036ee6f12822a9133dba7ed011b179c69 (diff)
bnx2x: Using the new FW
The new FW improves the packets per second rate. It required a lot of change in the FW which implies many changes in the driver to support it. It is now also possible for the driver to use a separate MSI-X vector for Rx and Tx - this also add some to the complicity of this change. All things said - after this patch, practically all performance matrixes show improvement. Though Vladislav Zolotarov is not signed on this patch, he did most of the job and deserves credit for that. Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x.h')
-rw-r--r--drivers/net/bnx2x.h45
1 files changed, 28 insertions, 17 deletions
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h
index 8bd80fca9788..16ccba8dda1b 100644
--- a/drivers/net/bnx2x.h
+++ b/drivers/net/bnx2x.h
@@ -142,6 +142,9 @@ struct sw_rx_bd {
142struct sw_tx_bd { 142struct sw_tx_bd {
143 struct sk_buff *skb; 143 struct sk_buff *skb;
144 u16 first_bd; 144 u16 first_bd;
145 u8 flags;
146/* Set on the first BD descriptor when there is a split BD */
147#define BNX2X_TSO_SPLIT_BD (1<<0)
145}; 148};
146 149
147struct sw_rx_page { 150struct sw_rx_page {
@@ -149,6 +152,11 @@ struct sw_rx_page {
149 DECLARE_PCI_UNMAP_ADDR(mapping) 152 DECLARE_PCI_UNMAP_ADDR(mapping)
150}; 153};
151 154
155union db_prod {
156 struct doorbell_set_prod data;
157 u32 raw;
158};
159
152 160
153/* MC hsi */ 161/* MC hsi */
154#define BCM_PAGE_SHIFT 12 162#define BCM_PAGE_SHIFT 12
@@ -234,15 +242,14 @@ struct bnx2x_fastpath {
234 242
235 struct napi_struct napi; 243 struct napi_struct napi;
236 244
245 u8 is_rx_queue;
246
237 struct host_status_block *status_blk; 247 struct host_status_block *status_blk;
238 dma_addr_t status_blk_mapping; 248 dma_addr_t status_blk_mapping;
239 249
240 struct eth_tx_db_data *hw_tx_prods;
241 dma_addr_t tx_prods_mapping;
242
243 struct sw_tx_bd *tx_buf_ring; 250 struct sw_tx_bd *tx_buf_ring;
244 251
245 struct eth_tx_bd *tx_desc_ring; 252 union eth_tx_bd_types *tx_desc_ring;
246 dma_addr_t tx_desc_mapping; 253 dma_addr_t tx_desc_mapping;
247 254
248 struct sw_rx_bd *rx_buf_ring; /* BDs mappings ring */ 255 struct sw_rx_bd *rx_buf_ring; /* BDs mappings ring */
@@ -272,6 +279,8 @@ struct bnx2x_fastpath {
272 u8 cl_id; /* eth client id */ 279 u8 cl_id; /* eth client id */
273 u8 sb_id; /* status block number in HW */ 280 u8 sb_id; /* status block number in HW */
274 281
282 union db_prod tx_db;
283
275 u16 tx_pkt_prod; 284 u16 tx_pkt_prod;
276 u16 tx_pkt_cons; 285 u16 tx_pkt_cons;
277 u16 tx_bd_prod; 286 u16 tx_bd_prod;
@@ -309,21 +318,24 @@ struct bnx2x_fastpath {
309 struct xstorm_per_client_stats old_xclient; 318 struct xstorm_per_client_stats old_xclient;
310 struct bnx2x_eth_q_stats eth_q_stats; 319 struct bnx2x_eth_q_stats eth_q_stats;
311 320
312 char name[IFNAMSIZ]; 321 /* The size is calculated using the following:
322 sizeof name field from netdev structure +
323 4 ('-Xx-' string) +
324 4 (for the digits and to make it DWORD aligned) */
325#define FP_NAME_SIZE (sizeof(((struct net_device *)0)->name) + 8)
326 char name[FP_NAME_SIZE];
313 struct bnx2x *bp; /* parent */ 327 struct bnx2x *bp; /* parent */
314}; 328};
315 329
316#define bnx2x_fp(bp, nr, var) (bp->fp[nr].var) 330#define bnx2x_fp(bp, nr, var) (bp->fp[nr].var)
317 331
318#define BNX2X_HAS_WORK(fp) (bnx2x_has_rx_work(fp) || bnx2x_has_tx_work(fp))
319
320 332
321/* MC hsi */ 333/* MC hsi */
322#define MAX_FETCH_BD 13 /* HW max BDs per packet */ 334#define MAX_FETCH_BD 13 /* HW max BDs per packet */
323#define RX_COPY_THRESH 92 335#define RX_COPY_THRESH 92
324 336
325#define NUM_TX_RINGS 16 337#define NUM_TX_RINGS 16
326#define TX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct eth_tx_bd)) 338#define TX_DESC_CNT (BCM_PAGE_SIZE / sizeof(union eth_tx_bd_types))
327#define MAX_TX_DESC_CNT (TX_DESC_CNT - 1) 339#define MAX_TX_DESC_CNT (TX_DESC_CNT - 1)
328#define NUM_TX_BD (TX_DESC_CNT * NUM_TX_RINGS) 340#define NUM_TX_BD (TX_DESC_CNT * NUM_TX_RINGS)
329#define MAX_TX_BD (NUM_TX_BD - 1) 341#define MAX_TX_BD (NUM_TX_BD - 1)
@@ -395,7 +407,7 @@ struct bnx2x_fastpath {
395#define DPM_TRIGER_TYPE 0x40 407#define DPM_TRIGER_TYPE 0x40
396#define DOORBELL(bp, cid, val) \ 408#define DOORBELL(bp, cid, val) \
397 do { \ 409 do { \
398 writel((u32)val, (bp)->doorbells + (BCM_PAGE_SIZE * cid) + \ 410 writel((u32)(val), bp->doorbells + (BCM_PAGE_SIZE * (cid)) + \
399 DPM_TRIGER_TYPE); \ 411 DPM_TRIGER_TYPE); \
400 } while (0) 412 } while (0)
401 413
@@ -902,8 +914,6 @@ struct bnx2x {
902 u16 rx_quick_cons_trip; 914 u16 rx_quick_cons_trip;
903 u16 rx_ticks_int; 915 u16 rx_ticks_int;
904 u16 rx_ticks; 916 u16 rx_ticks;
905/* Maximal coalescing timeout in us */
906#define BNX2X_MAX_COALESCE_TOUT (0xf0*12)
907 917
908 u32 lin_cnt; 918 u32 lin_cnt;
909 919
@@ -985,19 +995,20 @@ struct bnx2x {
985}; 995};
986 996
987 997
988#define BNX2X_MAX_QUEUES(bp) (IS_E1HMF(bp) ? (MAX_CONTEXT / E1HVN_MAX) : \ 998#define BNX2X_MAX_QUEUES(bp) (IS_E1HMF(bp) ? (MAX_CONTEXT/(2 * E1HVN_MAX)) \
989 MAX_CONTEXT) 999 : (MAX_CONTEXT/2))
990#define BNX2X_NUM_QUEUES(bp) max(bp->num_rx_queues, bp->num_tx_queues) 1000#define BNX2X_NUM_QUEUES(bp) (bp->num_rx_queues + bp->num_tx_queues)
991#define is_multi(bp) (BNX2X_NUM_QUEUES(bp) > 1) 1001#define is_multi(bp) (BNX2X_NUM_QUEUES(bp) > 2)
992 1002
993#define for_each_rx_queue(bp, var) \ 1003#define for_each_rx_queue(bp, var) \
994 for (var = 0; var < bp->num_rx_queues; var++) 1004 for (var = 0; var < bp->num_rx_queues; var++)
995#define for_each_tx_queue(bp, var) \ 1005#define for_each_tx_queue(bp, var) \
996 for (var = 0; var < bp->num_tx_queues; var++) 1006 for (var = bp->num_rx_queues; \
1007 var < BNX2X_NUM_QUEUES(bp); var++)
997#define for_each_queue(bp, var) \ 1008#define for_each_queue(bp, var) \
998 for (var = 0; var < BNX2X_NUM_QUEUES(bp); var++) 1009 for (var = 0; var < BNX2X_NUM_QUEUES(bp); var++)
999#define for_each_nondefault_queue(bp, var) \ 1010#define for_each_nondefault_queue(bp, var) \
1000 for (var = 1; var < BNX2X_NUM_QUEUES(bp); var++) 1011 for (var = 1; var < bp->num_rx_queues; var++)
1001 1012
1002 1013
1003void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32); 1014void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32);