netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] qede: Correctly map aggregation replacement pages
@ 2016-11-02 14:36 Yuval Mintz
  2016-11-03 19:34 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Yuval Mintz @ 2016-11-02 14:36 UTC (permalink / raw)
  To: davem, netdev; +Cc: Yuval Mintz

Driver allocates replacement buffers before-hand to make
sure whenever an aggregation begins there would be a replacement
for the Rx buffers, as we can't release the buffer until
aggregation is terminated and driver logic assumes the Rx rings
are always full.

For every other Rx page that's being allocated [I.e., regular]
the page is being completely mapped while for the replacement
buffers only the first portion of the page is being mapped.
This means that:
  a. Once replacement buffer replenishes the regular Rx ring,
assuming there's more than a single packet on page we'd post unmapped
memory toward HW [assuming mapping is actually done in granularity
smaller than page].
  b. Unmaps are being done for the entire page, which is incorrect.

Fixes: 55482edc25f06 ("qede: Add slowpath/fastpath support and enable hardware GRO")
Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
---
Dave,

Please consider applying this to `net'.

Thanks,
Yuval
---
 drivers/net/ethernet/qlogic/qede/qede_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index 1391776..73f2a67 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -2918,7 +2918,7 @@ static int qede_alloc_sge_mem(struct qede_dev *edev, struct qede_rx_queue *rxq)
 		}
 
 		mapping = dma_map_page(&edev->pdev->dev, replace_buf->data, 0,
-				       rxq->rx_buf_size, DMA_FROM_DEVICE);
+				       PAGE_SIZE, DMA_FROM_DEVICE);
 		if (unlikely(dma_mapping_error(&edev->pdev->dev, mapping))) {
 			DP_NOTICE(edev,
 				  "Failed to map TPA replacement buffer\n");
-- 
1.8.3.1

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

* Re: [PATCH net] qede: Correctly map aggregation replacement pages
  2016-11-02 14:36 [PATCH net] qede: Correctly map aggregation replacement pages Yuval Mintz
@ 2016-11-03 19:34 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-11-03 19:34 UTC (permalink / raw)
  To: Yuval.Mintz; +Cc: netdev

From: Yuval Mintz <Yuval.Mintz@cavium.com>
Date: Wed, 2 Nov 2016 16:36:46 +0200

> Driver allocates replacement buffers before-hand to make
> sure whenever an aggregation begins there would be a replacement
> for the Rx buffers, as we can't release the buffer until
> aggregation is terminated and driver logic assumes the Rx rings
> are always full.
> 
> For every other Rx page that's being allocated [I.e., regular]
> the page is being completely mapped while for the replacement
> buffers only the first portion of the page is being mapped.
> This means that:
>   a. Once replacement buffer replenishes the regular Rx ring,
> assuming there's more than a single packet on page we'd post unmapped
> memory toward HW [assuming mapping is actually done in granularity
> smaller than page].
>   b. Unmaps are being done for the entire page, which is incorrect.
> 
> Fixes: 55482edc25f06 ("qede: Add slowpath/fastpath support and enable hardware GRO")
> Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>

Applied.

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

end of thread, other threads:[~2016-11-03 19:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-02 14:36 [PATCH net] qede: Correctly map aggregation replacement pages Yuval Mintz
2016-11-03 19:34 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).