linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFT net-next 0/2] stmmac: recycle SKB
@ 2021-08-05 17:10 Matteo Croce
  2021-08-05 17:11 ` [RFT net-next 1/2] stmmac: use build_skb() Matteo Croce
  2021-08-05 17:11 ` [RFT net-next 2/2] stmmac: skb recycling Matteo Croce
  0 siblings, 2 replies; 3+ messages in thread
From: Matteo Croce @ 2021-08-05 17:10 UTC (permalink / raw)
  To: netdev
  Cc: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	Maxime Coquelin, linux-stm32, linux-arm-kernel, linux-kernel

From: Matteo Croce <mcroce@microsoft.com>

I have two patches to enable SKB recycling in stmmac. Unfortunately the
only stmmac hardware I have behave very bad, so I can't do decent
performance tests.
Can I get some feedback for this series?


Matteo Croce (2):
  stmmac: use build_skb()
  stmmac: skb recycling

 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

-- 
2.31.1


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

* [RFT net-next 1/2] stmmac: use build_skb()
  2021-08-05 17:10 [RFT net-next 0/2] stmmac: recycle SKB Matteo Croce
@ 2021-08-05 17:11 ` Matteo Croce
  2021-08-05 17:11 ` [RFT net-next 2/2] stmmac: skb recycling Matteo Croce
  1 sibling, 0 replies; 3+ messages in thread
From: Matteo Croce @ 2021-08-05 17:11 UTC (permalink / raw)
  To: netdev
  Cc: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	Maxime Coquelin, linux-stm32, linux-arm-kernel, linux-kernel

From: Matteo Croce <mcroce@microsoft.com>

Signed-off-by: Matteo Croce <mcroce@microsoft.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index a2aa75cb184e..30a0d915cd4b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5208,7 +5208,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 			/* XDP program may expand or reduce tail */
 			buf1_len = xdp.data_end - xdp.data;
 
-			skb = napi_alloc_skb(&ch->rx_napi, buf1_len);
+			skb = build_skb(xdp.data_hard_start, PAGE_SIZE);
 			if (!skb) {
 				priv->dev->stats.rx_dropped++;
 				count++;
@@ -5216,11 +5216,10 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 			}
 
 			/* XDP program may adjust header */
-			skb_copy_to_linear_data(skb, xdp.data, buf1_len);
+			skb_reserve(skb, buf->page_offset);
 			skb_put(skb, buf1_len);
 
-			/* Data payload copied into SKB, page ready for recycle */
-			page_pool_recycle_direct(rx_q->page_pool, buf->page);
+			page_pool_release_page(rx_q->page_pool, buf->page);
 			buf->page = NULL;
 		} else if (buf1_len) {
 			dma_sync_single_for_cpu(priv->device, buf->addr,
-- 
2.31.1


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

* [RFT net-next 2/2] stmmac: skb recycling
  2021-08-05 17:10 [RFT net-next 0/2] stmmac: recycle SKB Matteo Croce
  2021-08-05 17:11 ` [RFT net-next 1/2] stmmac: use build_skb() Matteo Croce
@ 2021-08-05 17:11 ` Matteo Croce
  1 sibling, 0 replies; 3+ messages in thread
From: Matteo Croce @ 2021-08-05 17:11 UTC (permalink / raw)
  To: netdev
  Cc: Giuseppe Cavallaro, Alexandre Torgue, Jose Abreu,
	Maxime Coquelin, linux-stm32, linux-arm-kernel, linux-kernel

From: Matteo Croce <mcroce@microsoft.com>

Signed-off-by: Matteo Croce <mcroce@microsoft.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 30a0d915cd4b..2c48f1b5e9e9 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -5219,7 +5219,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 			skb_reserve(skb, buf->page_offset);
 			skb_put(skb, buf1_len);
 
-			page_pool_release_page(rx_q->page_pool, buf->page);
+			skb_mark_for_recycle(skb, buf->page, rx_q->page_pool);
 			buf->page = NULL;
 		} else if (buf1_len) {
 			dma_sync_single_for_cpu(priv->device, buf->addr,
@@ -5229,7 +5229,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 					priv->dma_buf_sz);
 
 			/* Data payload appended into SKB */
-			page_pool_release_page(rx_q->page_pool, buf->page);
+			page_pool_store_mem_info(buf->page, rx_q->page_pool);
 			buf->page = NULL;
 		}
 
@@ -5241,7 +5241,7 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
 					priv->dma_buf_sz);
 
 			/* Data payload appended into SKB */
-			page_pool_release_page(rx_q->page_pool, buf->sec_page);
+			page_pool_store_mem_info(buf->sec_page, rx_q->page_pool);
 			buf->sec_page = NULL;
 		}
 
-- 
2.31.1


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

end of thread, other threads:[~2021-08-05 17:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-05 17:10 [RFT net-next 0/2] stmmac: recycle SKB Matteo Croce
2021-08-05 17:11 ` [RFT net-next 1/2] stmmac: use build_skb() Matteo Croce
2021-08-05 17:11 ` [RFT net-next 2/2] stmmac: skb recycling Matteo Croce

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).