Commit 5c4b934f authored by David S. Miller's avatar David S. Miller

Merge branch 'bcmgenet-next'

Petri Gynther says:

====================
net: bcmgenet: preparation for multiple Rx queues

Three small patches in preparation for supporting multiple Rx queues:
1. set hw_params->rx_queues = 0
2. adjust the call to alloc_etherdev_mqs()
3. add GENET_Q16_RX_BD_CNT and hw_params->rx_bds_per_q
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 76f53bfd 3feafa02
...@@ -54,6 +54,8 @@ ...@@ -54,6 +54,8 @@
/* Default highest priority queue for multi queue support */ /* Default highest priority queue for multi queue support */
#define GENET_Q0_PRIORITY 0 #define GENET_Q0_PRIORITY 0
#define GENET_Q16_RX_BD_CNT \
(TOTAL_DESC - priv->hw_params->rx_queues * priv->hw_params->rx_bds_per_q)
#define GENET_Q16_TX_BD_CNT \ #define GENET_Q16_TX_BD_CNT \
(TOTAL_DESC - priv->hw_params->tx_queues * priv->hw_params->tx_bds_per_q) (TOTAL_DESC - priv->hw_params->tx_queues * priv->hw_params->tx_bds_per_q)
...@@ -2488,6 +2490,7 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = { ...@@ -2488,6 +2490,7 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
.tx_queues = 0, .tx_queues = 0,
.tx_bds_per_q = 0, .tx_bds_per_q = 0,
.rx_queues = 0, .rx_queues = 0,
.rx_bds_per_q = 0,
.bp_in_en_shift = 16, .bp_in_en_shift = 16,
.bp_in_mask = 0xffff, .bp_in_mask = 0xffff,
.hfb_filter_cnt = 16, .hfb_filter_cnt = 16,
...@@ -2500,7 +2503,8 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = { ...@@ -2500,7 +2503,8 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
[GENET_V2] = { [GENET_V2] = {
.tx_queues = 4, .tx_queues = 4,
.tx_bds_per_q = 32, .tx_bds_per_q = 32,
.rx_queues = 4, .rx_queues = 0,
.rx_bds_per_q = 0,
.bp_in_en_shift = 16, .bp_in_en_shift = 16,
.bp_in_mask = 0xffff, .bp_in_mask = 0xffff,
.hfb_filter_cnt = 16, .hfb_filter_cnt = 16,
...@@ -2516,7 +2520,8 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = { ...@@ -2516,7 +2520,8 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
[GENET_V3] = { [GENET_V3] = {
.tx_queues = 4, .tx_queues = 4,
.tx_bds_per_q = 32, .tx_bds_per_q = 32,
.rx_queues = 4, .rx_queues = 0,
.rx_bds_per_q = 0,
.bp_in_en_shift = 17, .bp_in_en_shift = 17,
.bp_in_mask = 0x1ffff, .bp_in_mask = 0x1ffff,
.hfb_filter_cnt = 48, .hfb_filter_cnt = 48,
...@@ -2532,7 +2537,8 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = { ...@@ -2532,7 +2537,8 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
[GENET_V4] = { [GENET_V4] = {
.tx_queues = 4, .tx_queues = 4,
.tx_bds_per_q = 32, .tx_bds_per_q = 32,
.rx_queues = 4, .rx_queues = 0,
.rx_bds_per_q = 0,
.bp_in_en_shift = 17, .bp_in_en_shift = 17,
.bp_in_mask = 0x1ffff, .bp_in_mask = 0x1ffff,
.hfb_filter_cnt = 48, .hfb_filter_cnt = 48,
...@@ -2632,7 +2638,7 @@ static void bcmgenet_set_hw_params(struct bcmgenet_priv *priv) ...@@ -2632,7 +2638,7 @@ static void bcmgenet_set_hw_params(struct bcmgenet_priv *priv)
#endif #endif
pr_debug("Configuration for version: %d\n" pr_debug("Configuration for version: %d\n"
"TXq: %1d, TXqBDs: %1d, RXq: %1d\n" "TXq: %1d, TXqBDs: %1d, RXq: %1d, RXqBDs: %1d\n"
"BP << en: %2d, BP msk: 0x%05x\n" "BP << en: %2d, BP msk: 0x%05x\n"
"HFB count: %2d, QTAQ msk: 0x%05x\n" "HFB count: %2d, QTAQ msk: 0x%05x\n"
"TBUF: 0x%04x, HFB: 0x%04x, HFBreg: 0x%04x\n" "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,7 +2646,7 @@ static void bcmgenet_set_hw_params(struct bcmgenet_priv *priv)
"Words/BD: %d\n", "Words/BD: %d\n",
priv->version, priv->version,
params->tx_queues, params->tx_bds_per_q, params->tx_queues, params->tx_bds_per_q,
params->rx_queues, params->rx_queues, params->rx_bds_per_q,
params->bp_in_en_shift, params->bp_in_mask, params->bp_in_en_shift, params->bp_in_mask,
params->hfb_filter_cnt, params->qtag_mask, params->hfb_filter_cnt, params->qtag_mask,
params->tbuf_offset, params->hfb_offset, params->tbuf_offset, params->hfb_offset,
...@@ -2668,8 +2674,9 @@ static int bcmgenet_probe(struct platform_device *pdev) ...@@ -2668,8 +2674,9 @@ static int bcmgenet_probe(struct platform_device *pdev)
struct resource *r; struct resource *r;
int err = -EIO; int err = -EIO;
/* Up to GENET_MAX_MQ_CNT + 1 TX queues and a single RX queue */ /* Up to GENET_MAX_MQ_CNT + 1 TX queues and RX queues */
dev = alloc_etherdev_mqs(sizeof(*priv), GENET_MAX_MQ_CNT + 1, 1); dev = alloc_etherdev_mqs(sizeof(*priv), GENET_MAX_MQ_CNT + 1,
GENET_MAX_MQ_CNT + 1);
if (!dev) { if (!dev) {
dev_err(&pdev->dev, "can't allocate net device\n"); dev_err(&pdev->dev, "can't allocate net device\n");
return -ENOMEM; return -ENOMEM;
......
...@@ -505,6 +505,7 @@ struct bcmgenet_hw_params { ...@@ -505,6 +505,7 @@ struct bcmgenet_hw_params {
u8 tx_queues; u8 tx_queues;
u8 tx_bds_per_q; u8 tx_bds_per_q;
u8 rx_queues; u8 rx_queues;
u8 rx_bds_per_q;
u8 bp_in_en_shift; u8 bp_in_en_shift;
u32 bp_in_mask; u32 bp_in_mask;
u8 hfb_filter_cnt; u8 hfb_filter_cnt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment