Commit 822eaf7c authored by Yan Markman's avatar Yan Markman Committed by David S. Miller

net: mvpp2: fix TSO headers allocation and management

TSO headers are managed with txq index and therefore should be aligned
with the txq size, not with the aggregated txq size.

Fixes: 186cd4d4 ("net: mvpp2: software tso support")
Reported-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
Signed-off-by: default avatarYan Markman <ymarkman@marvell.com>
Signed-off-by: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 07f37efd
...@@ -5609,7 +5609,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port, ...@@ -5609,7 +5609,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
txq_pcpu->tso_headers = txq_pcpu->tso_headers =
dma_alloc_coherent(port->dev->dev.parent, dma_alloc_coherent(port->dev->dev.parent,
MVPP2_AGGR_TXQ_SIZE * TSO_HEADER_SIZE, txq_pcpu->size * TSO_HEADER_SIZE,
&txq_pcpu->tso_headers_dma, &txq_pcpu->tso_headers_dma,
GFP_KERNEL); GFP_KERNEL);
if (!txq_pcpu->tso_headers) if (!txq_pcpu->tso_headers)
...@@ -5623,7 +5623,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port, ...@@ -5623,7 +5623,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
kfree(txq_pcpu->buffs); kfree(txq_pcpu->buffs);
dma_free_coherent(port->dev->dev.parent, dma_free_coherent(port->dev->dev.parent,
MVPP2_AGGR_TXQ_SIZE * MVPP2_DESC_ALIGNED_SIZE, txq_pcpu->size * TSO_HEADER_SIZE,
txq_pcpu->tso_headers, txq_pcpu->tso_headers,
txq_pcpu->tso_headers_dma); txq_pcpu->tso_headers_dma);
} }
...@@ -5647,7 +5647,7 @@ static void mvpp2_txq_deinit(struct mvpp2_port *port, ...@@ -5647,7 +5647,7 @@ static void mvpp2_txq_deinit(struct mvpp2_port *port,
kfree(txq_pcpu->buffs); kfree(txq_pcpu->buffs);
dma_free_coherent(port->dev->dev.parent, dma_free_coherent(port->dev->dev.parent,
MVPP2_AGGR_TXQ_SIZE * MVPP2_DESC_ALIGNED_SIZE, txq_pcpu->size * TSO_HEADER_SIZE,
txq_pcpu->tso_headers, txq_pcpu->tso_headers,
txq_pcpu->tso_headers_dma); txq_pcpu->tso_headers_dma);
} }
......
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