aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetri Gynther <pgynther@google.com>2015-03-05 20:40:14 -0500
committerDavid S. Miller <davem@davemloft.net>2015-03-06 15:13:41 -0500
commit3feafa02156681a5a2a843680c7daeb93d22e280 (patch)
tree04bd4faf0fb83e818b38a7989380c5032a9e8277
parent3feafeed16f92b96b7b67a3e30882c62c859f4bb (diff)
net: bcmgenet: add GENET_Q16_RX_BD_CNT and hw_params->rx_bds_per_q
In preparation for supporting multiple Rx queues, add GENET_Q16_RX_BD_CNT and hw_params->rx_bds_per_q. Signed-off-by: Petri Gynther <pgynther@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/genet/bcmgenet.c10
-rw-r--r--drivers/net/ethernet/broadcom/genet/bcmgenet.h1
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 57271f7b2456..d90785caab59 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -54,6 +54,8 @@
54/* Default highest priority queue for multi queue support */ 54/* Default highest priority queue for multi queue support */
55#define GENET_Q0_PRIORITY 0 55#define GENET_Q0_PRIORITY 0
56 56
57#define GENET_Q16_RX_BD_CNT \
58 (TOTAL_DESC - priv->hw_params->rx_queues * priv->hw_params->rx_bds_per_q)
57#define GENET_Q16_TX_BD_CNT \ 59#define GENET_Q16_TX_BD_CNT \
58 (TOTAL_DESC - priv->hw_params->tx_queues * priv->hw_params->tx_bds_per_q) 60 (TOTAL_DESC - priv->hw_params->tx_queues * priv->hw_params->tx_bds_per_q)
59 61
@@ -2488,6 +2490,7 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
2488 .tx_queues = 0, 2490 .tx_queues = 0,
2489 .tx_bds_per_q = 0, 2491 .tx_bds_per_q = 0,
2490 .rx_queues = 0, 2492 .rx_queues = 0,
2493 .rx_bds_per_q = 0,
2491 .bp_in_en_shift = 16, 2494 .bp_in_en_shift = 16,
2492 .bp_in_mask = 0xffff, 2495 .bp_in_mask = 0xffff,
2493 .hfb_filter_cnt = 16, 2496 .hfb_filter_cnt = 16,
@@ -2501,6 +2504,7 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
2501 .tx_queues = 4, 2504 .tx_queues = 4,
2502 .tx_bds_per_q = 32, 2505 .tx_bds_per_q = 32,
2503 .rx_queues = 0, 2506 .rx_queues = 0,
2507 .rx_bds_per_q = 0,
2504 .bp_in_en_shift = 16, 2508 .bp_in_en_shift = 16,
2505 .bp_in_mask = 0xffff, 2509 .bp_in_mask = 0xffff,
2506 .hfb_filter_cnt = 16, 2510 .hfb_filter_cnt = 16,
@@ -2517,6 +2521,7 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
2517 .tx_queues = 4, 2521 .tx_queues = 4,
2518 .tx_bds_per_q = 32, 2522 .tx_bds_per_q = 32,
2519 .rx_queues = 0, 2523 .rx_queues = 0,
2524 .rx_bds_per_q = 0,
2520 .bp_in_en_shift = 17, 2525 .bp_in_en_shift = 17,
2521 .bp_in_mask = 0x1ffff, 2526 .bp_in_mask = 0x1ffff,
2522 .hfb_filter_cnt = 48, 2527 .hfb_filter_cnt = 48,
@@ -2533,6 +2538,7 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
2533 .tx_queues = 4, 2538 .tx_queues = 4,
2534 .tx_bds_per_q = 32, 2539 .tx_bds_per_q = 32,
2535 .rx_queues = 0, 2540 .rx_queues = 0,
2541 .rx_bds_per_q = 0,
2536 .bp_in_en_shift = 17, 2542 .bp_in_en_shift = 17,
2537 .bp_in_mask = 0x1ffff, 2543 .bp_in_mask = 0x1ffff,
2538 .hfb_filter_cnt = 48, 2544 .hfb_filter_cnt = 48,
@@ -2632,7 +2638,7 @@ static void bcmgenet_set_hw_params(struct bcmgenet_priv *priv)
2632#endif 2638#endif
2633 2639
2634 pr_debug("Configuration for version: %d\n" 2640 pr_debug("Configuration for version: %d\n"
2635 "TXq: %1d, TXqBDs: %1d, RXq: %1d\n" 2641 "TXq: %1d, TXqBDs: %1d, RXq: %1d, RXqBDs: %1d\n"
2636 "BP << en: %2d, BP msk: 0x%05x\n" 2642 "BP << en: %2d, BP msk: 0x%05x\n"
2637 "HFB count: %2d, QTAQ msk: 0x%05x\n" 2643 "HFB count: %2d, QTAQ msk: 0x%05x\n"
2638 "TBUF: 0x%04x, HFB: 0x%04x, HFBreg: 0x%04x\n" 2644 "TBUF: 0x%04x, HFB: 0x%04x, HFBreg: 0x%04x\n"
@@ -2640,7 +2646,7 @@ static void bcmgenet_set_hw_params(struct bcmgenet_priv *priv)
2640 "Words/BD: %d\n", 2646 "Words/BD: %d\n",
2641 priv->version, 2647 priv->version,
2642 params->tx_queues, params->tx_bds_per_q, 2648 params->tx_queues, params->tx_bds_per_q,
2643 params->rx_queues, 2649 params->rx_queues, params->rx_bds_per_q,
2644 params->bp_in_en_shift, params->bp_in_mask, 2650 params->bp_in_en_shift, params->bp_in_mask,
2645 params->hfb_filter_cnt, params->qtag_mask, 2651 params->hfb_filter_cnt, params->qtag_mask,
2646 params->tbuf_offset, params->hfb_offset, 2652 params->tbuf_offset, params->hfb_offset,
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
index 548b7e934727..5684e8529ecc 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
@@ -505,6 +505,7 @@ struct bcmgenet_hw_params {
505 u8 tx_queues; 505 u8 tx_queues;
506 u8 tx_bds_per_q; 506 u8 tx_bds_per_q;
507 u8 rx_queues; 507 u8 rx_queues;
508 u8 rx_bds_per_q;
508 u8 bp_in_en_shift; 509 u8 bp_in_en_shift;
509 u32 bp_in_mask; 510 u32 bp_in_mask;
510 u8 hfb_filter_cnt; 511 u8 hfb_filter_cnt;