Commit 85affd7e authored by Antoine Ténart's avatar Antoine Ténart Committed by David S. Miller

net: mvpp2: unify the txq size define use

The txq size is defined by MVPP2_AGGR_TXQ_SIZE, which is sometime not
used directly but through variables. As it is a fixed value use the
define everywhere in the driver.
Signed-off-by: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f9cbe9a5
...@@ -5284,15 +5284,14 @@ static unsigned int mvpp2_tx_done(struct mvpp2_port *port, u32 cause, ...@@ -5284,15 +5284,14 @@ static unsigned int mvpp2_tx_done(struct mvpp2_port *port, u32 cause,
/* Allocate and initialize descriptors for aggr TXQ */ /* Allocate and initialize descriptors for aggr TXQ */
static int mvpp2_aggr_txq_init(struct platform_device *pdev, static int mvpp2_aggr_txq_init(struct platform_device *pdev,
struct mvpp2_tx_queue *aggr_txq, struct mvpp2_tx_queue *aggr_txq, int cpu,
int desc_num, int cpu,
struct mvpp2 *priv) struct mvpp2 *priv)
{ {
u32 txq_dma; u32 txq_dma;
/* Allocate memory for TX descriptors */ /* Allocate memory for TX descriptors */
aggr_txq->descs = dma_alloc_coherent(&pdev->dev, aggr_txq->descs = dma_alloc_coherent(&pdev->dev,
desc_num * MVPP2_DESC_ALIGNED_SIZE, MVPP2_AGGR_TXQ_SIZE * MVPP2_DESC_ALIGNED_SIZE,
&aggr_txq->descs_dma, GFP_KERNEL); &aggr_txq->descs_dma, GFP_KERNEL);
if (!aggr_txq->descs) if (!aggr_txq->descs)
return -ENOMEM; return -ENOMEM;
...@@ -5313,7 +5312,8 @@ static int mvpp2_aggr_txq_init(struct platform_device *pdev, ...@@ -5313,7 +5312,8 @@ static int mvpp2_aggr_txq_init(struct platform_device *pdev,
MVPP22_AGGR_TXQ_DESC_ADDR_OFFS; MVPP22_AGGR_TXQ_DESC_ADDR_OFFS;
mvpp2_write(priv, MVPP2_AGGR_TXQ_DESC_ADDR_REG(cpu), txq_dma); mvpp2_write(priv, MVPP2_AGGR_TXQ_DESC_ADDR_REG(cpu), txq_dma);
mvpp2_write(priv, MVPP2_AGGR_TXQ_DESC_SIZE_REG(cpu), desc_num); mvpp2_write(priv, MVPP2_AGGR_TXQ_DESC_SIZE_REG(cpu),
MVPP2_AGGR_TXQ_SIZE);
return 0; return 0;
} }
...@@ -7445,8 +7445,7 @@ static int mvpp2_init(struct platform_device *pdev, struct mvpp2 *priv) ...@@ -7445,8 +7445,7 @@ static int mvpp2_init(struct platform_device *pdev, struct mvpp2 *priv)
for_each_present_cpu(i) { for_each_present_cpu(i) {
priv->aggr_txqs[i].id = i; priv->aggr_txqs[i].id = i;
priv->aggr_txqs[i].size = MVPP2_AGGR_TXQ_SIZE; priv->aggr_txqs[i].size = MVPP2_AGGR_TXQ_SIZE;
err = mvpp2_aggr_txq_init(pdev, &priv->aggr_txqs[i], err = mvpp2_aggr_txq_init(pdev, &priv->aggr_txqs[i], i, priv);
MVPP2_AGGR_TXQ_SIZE, i, priv);
if (err < 0) if (err < 0)
return err; return err;
} }
......
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