Netdev List
 help / color / mirror / Atom feed
* [PATCH net 1/3] net: mvpp2: fix TSO headers allocation and management
@ 2017-10-23 13:24 Antoine Tenart
  2017-10-23 13:24 ` [PATCH net 2/3] net: mvpp2: do not unmap TSO headers buffers Antoine Tenart
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Antoine Tenart @ 2017-10-23 13:24 UTC (permalink / raw)
  To: davem
  Cc: Yan Markman, andrew, gregory.clement, thomas.petazzoni,
	miquel.raynal, nadavh, linux-kernel, mw, stefanc, netdev,
	Antoine Tenart

From: Yan Markman <ymarkman@marvell.com>

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

Fixes: 186cd4d4e414 ("net: mvpp2: software tso support")
Reported-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Yan Markman <ymarkman@marvell.com>
Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
---
 drivers/net/ethernet/marvell/mvpp2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 1a540c88c974..2898ac70b826 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -5609,7 +5609,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
 
 		txq_pcpu->tso_headers =
 			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,
 					   GFP_KERNEL);
 		if (!txq_pcpu->tso_headers)
@@ -5623,7 +5623,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port,
 		kfree(txq_pcpu->buffs);
 
 		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_dma);
 	}
@@ -5647,7 +5647,7 @@ static void mvpp2_txq_deinit(struct mvpp2_port *port,
 		kfree(txq_pcpu->buffs);
 
 		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_dma);
 	}
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-10-24  9:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-23 13:24 [PATCH net 1/3] net: mvpp2: fix TSO headers allocation and management Antoine Tenart
2017-10-23 13:24 ` [PATCH net 2/3] net: mvpp2: do not unmap TSO headers buffers Antoine Tenart
2017-10-24  9:34   ` David Miller
2017-10-23 13:24 ` [PATCH net 3/3] net: mvpp2: do not call txq_done from the Tx path when Tx irqs are used Antoine Tenart
2017-10-24  9:34   ` David Miller
2017-10-24  9:34 ` [PATCH net 1/3] net: mvpp2: fix TSO headers allocation and management David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox