net: bcmgenet: rename bcmgenet_hw_params->bds_cnt and GENET_DEFAULT_BD_CNT
bcmgenet_hw_params->bds_cnt and GENET_DEFAULT_BD_CNT are used only in Tx init. Rename them accordingly: - bcmgenet_hw_params->bds_cnt => bcmgenet_hw_params->tx_bds_per_q - GENET_DEFAULT_BD_CNT => GENET_Q16_TX_BD_CNT Signed-off-by: Petri Gynther <pgynther@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
014012a491
commit
51a966a718
|
@ -54,8 +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_DEFAULT_BD_CNT \
|
#define GENET_Q16_TX_BD_CNT \
|
||||||
(TOTAL_DESC - priv->hw_params->tx_queues * priv->hw_params->bds_cnt)
|
(TOTAL_DESC - priv->hw_params->tx_queues * priv->hw_params->tx_bds_per_q)
|
||||||
|
|
||||||
#define RX_BUF_LENGTH 2048
|
#define RX_BUF_LENGTH 2048
|
||||||
#define SKB_ALIGNMENT 32
|
#define SKB_ALIGNMENT 32
|
||||||
|
@ -1782,7 +1782,7 @@ static int bcmgenet_init_rx_ring(struct bcmgenet_priv *priv,
|
||||||
* with queue 0 being the highest priority queue.
|
* with queue 0 being the highest priority queue.
|
||||||
*
|
*
|
||||||
* Queue 16 is the default Tx queue with
|
* Queue 16 is the default Tx queue with
|
||||||
* GENET_DEFAULT_BD_CNT = 256 - 4 * 32 = 128 descriptors.
|
* GENET_Q16_TX_BD_CNT = 256 - 4 * 32 = 128 descriptors.
|
||||||
*
|
*
|
||||||
* The transmit control block pool is then partitioned as follows:
|
* The transmit control block pool is then partitioned as follows:
|
||||||
* - Tx queue 0 uses tx_cbs[0..31]
|
* - Tx queue 0 uses tx_cbs[0..31]
|
||||||
|
@ -1811,9 +1811,9 @@ static void bcmgenet_init_tx_queues(struct net_device *dev)
|
||||||
|
|
||||||
/* Initialize Tx priority queues */
|
/* Initialize Tx priority queues */
|
||||||
for (i = 0; i < priv->hw_params->tx_queues; i++) {
|
for (i = 0; i < priv->hw_params->tx_queues; i++) {
|
||||||
bcmgenet_init_tx_ring(priv, i, priv->hw_params->bds_cnt,
|
bcmgenet_init_tx_ring(priv, i, priv->hw_params->tx_bds_per_q,
|
||||||
i * priv->hw_params->bds_cnt,
|
i * priv->hw_params->tx_bds_per_q,
|
||||||
(i + 1) * priv->hw_params->bds_cnt);
|
(i + 1) * priv->hw_params->tx_bds_per_q);
|
||||||
ring_cfg |= (1 << i);
|
ring_cfg |= (1 << i);
|
||||||
dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT));
|
dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT));
|
||||||
dma_priority[DMA_PRIO_REG_INDEX(i)] |=
|
dma_priority[DMA_PRIO_REG_INDEX(i)] |=
|
||||||
|
@ -1821,9 +1821,9 @@ static void bcmgenet_init_tx_queues(struct net_device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize Tx default queue 16 */
|
/* Initialize Tx default queue 16 */
|
||||||
bcmgenet_init_tx_ring(priv, DESC_INDEX, GENET_DEFAULT_BD_CNT,
|
bcmgenet_init_tx_ring(priv, DESC_INDEX, GENET_Q16_TX_BD_CNT,
|
||||||
priv->hw_params->tx_queues *
|
priv->hw_params->tx_queues *
|
||||||
priv->hw_params->bds_cnt,
|
priv->hw_params->tx_bds_per_q,
|
||||||
TOTAL_DESC);
|
TOTAL_DESC);
|
||||||
ring_cfg |= (1 << DESC_INDEX);
|
ring_cfg |= (1 << DESC_INDEX);
|
||||||
dma_ctrl |= (1 << (DESC_INDEX + DMA_RING_BUF_EN_SHIFT));
|
dma_ctrl |= (1 << (DESC_INDEX + DMA_RING_BUF_EN_SHIFT));
|
||||||
|
@ -2427,8 +2427,8 @@ static const struct net_device_ops bcmgenet_netdev_ops = {
|
||||||
static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
|
static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
|
||||||
[GENET_V1] = {
|
[GENET_V1] = {
|
||||||
.tx_queues = 0,
|
.tx_queues = 0,
|
||||||
|
.tx_bds_per_q = 0,
|
||||||
.rx_queues = 0,
|
.rx_queues = 0,
|
||||||
.bds_cnt = 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,
|
||||||
|
@ -2440,8 +2440,8 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
|
||||||
},
|
},
|
||||||
[GENET_V2] = {
|
[GENET_V2] = {
|
||||||
.tx_queues = 4,
|
.tx_queues = 4,
|
||||||
|
.tx_bds_per_q = 32,
|
||||||
.rx_queues = 4,
|
.rx_queues = 4,
|
||||||
.bds_cnt = 32,
|
|
||||||
.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,
|
||||||
|
@ -2456,8 +2456,8 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
|
||||||
},
|
},
|
||||||
[GENET_V3] = {
|
[GENET_V3] = {
|
||||||
.tx_queues = 4,
|
.tx_queues = 4,
|
||||||
|
.tx_bds_per_q = 32,
|
||||||
.rx_queues = 4,
|
.rx_queues = 4,
|
||||||
.bds_cnt = 32,
|
|
||||||
.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,
|
||||||
|
@ -2472,8 +2472,8 @@ static struct bcmgenet_hw_params bcmgenet_hw_params[] = {
|
||||||
},
|
},
|
||||||
[GENET_V4] = {
|
[GENET_V4] = {
|
||||||
.tx_queues = 4,
|
.tx_queues = 4,
|
||||||
|
.tx_bds_per_q = 32,
|
||||||
.rx_queues = 4,
|
.rx_queues = 4,
|
||||||
.bds_cnt = 32,
|
|
||||||
.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,
|
||||||
|
@ -2573,14 +2573,15 @@ 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, RXq: %1d, BDs: %1d\n"
|
"TXq: %1d, TXqBDs: %1d, RXq: %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"
|
||||||
"RDMA: 0x%05x, TDMA: 0x%05x\n"
|
"RDMA: 0x%05x, TDMA: 0x%05x\n"
|
||||||
"Words/BD: %d\n",
|
"Words/BD: %d\n",
|
||||||
priv->version,
|
priv->version,
|
||||||
params->tx_queues, params->rx_queues, params->bds_cnt,
|
params->tx_queues, params->tx_bds_per_q,
|
||||||
|
params->rx_queues,
|
||||||
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,
|
||||||
|
|
|
@ -503,8 +503,8 @@ enum bcmgenet_version {
|
||||||
*/
|
*/
|
||||||
struct bcmgenet_hw_params {
|
struct bcmgenet_hw_params {
|
||||||
u8 tx_queues;
|
u8 tx_queues;
|
||||||
|
u8 tx_bds_per_q;
|
||||||
u8 rx_queues;
|
u8 rx_queues;
|
||||||
u8 bds_cnt;
|
|
||||||
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;
|
||||||
|
|
Loading…
Reference in New Issue