From: Rosen Penev <rosenp@gmail.com>
To: netdev@vger.kernel.org
Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, linux-kernel@vger.kernel.org,
olek2@wp.pl, shannon.nelson@amd.com
Subject: [PATCHv2 net-next 01/10] net: lantiq_etop: use netif_receive_skb_list
Date: Tue, 1 Oct 2024 11:45:58 -0700 [thread overview]
Message-ID: <20241001184607.193461-2-rosenp@gmail.com> (raw)
In-Reply-To: <20241001184607.193461-1-rosenp@gmail.com>
Improves cache efficiency by batching rx skb processing. Small
performance improvement on RX.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Shannon Nelson <shannon.nelson@amd.com>
---
drivers/net/ethernet/lantiq_etop.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
index 3c289bfe0a09..94b37c12f3f7 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -122,8 +122,7 @@ ltq_etop_alloc_skb(struct ltq_etop_chan *ch)
return 0;
}
-static void
-ltq_etop_hw_receive(struct ltq_etop_chan *ch)
+static void ltq_etop_hw_receive(struct ltq_etop_chan *ch, struct list_head *lh)
{
struct ltq_etop_priv *priv = netdev_priv(ch->netdev);
struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc];
@@ -143,7 +142,7 @@ ltq_etop_hw_receive(struct ltq_etop_chan *ch)
skb_put(skb, len);
skb->protocol = eth_type_trans(skb, ch->netdev);
- netif_receive_skb(skb);
+ list_add_tail(&skb->list, lh);
}
static int
@@ -151,6 +150,7 @@ ltq_etop_poll_rx(struct napi_struct *napi, int budget)
{
struct ltq_etop_chan *ch = container_of(napi,
struct ltq_etop_chan, napi);
+ LIST_HEAD(rx_list);
int work_done = 0;
while (work_done < budget) {
@@ -158,9 +158,12 @@ ltq_etop_poll_rx(struct napi_struct *napi, int budget)
if ((desc->ctl & (LTQ_DMA_OWN | LTQ_DMA_C)) != LTQ_DMA_C)
break;
- ltq_etop_hw_receive(ch);
+ ltq_etop_hw_receive(ch, &rx_list);
work_done++;
}
+
+ netif_receive_skb_list(&rx_list);
+
if (work_done < budget) {
napi_complete_done(&ch->napi, work_done);
ltq_dma_ack_irq(&ch->dma);
--
2.46.2
next prev parent reply other threads:[~2024-10-01 18:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-01 18:45 [PATCHv2 net-next 00/10] net: lantiq_etop: some cleanups Rosen Penev
2024-10-01 18:45 ` Rosen Penev [this message]
2024-10-01 22:40 ` [PATCHv2 net-next 01/10] net: lantiq_etop: use netif_receive_skb_list Andrew Lunn
2024-10-01 23:39 ` Rosen Penev
2024-10-01 18:45 ` [PATCHv2 net-next 02/10] net: lantiq_etop: use devm_alloc_etherdev_mqs Rosen Penev
2024-10-01 18:46 ` [PATCHv2 net-next 03/10] net: lantiq_etop: use devm for register_netdev Rosen Penev
2024-10-01 22:48 ` Andrew Lunn
2024-10-01 18:46 ` [PATCHv2 net-next 04/10] net: lantiq_etop: use devm for mdiobus Rosen Penev
2024-10-01 22:51 ` Andrew Lunn
2024-10-01 18:46 ` [PATCHv2 net-next 05/10] net: lantiq_etop: move phy_disconnect to stop Rosen Penev
2024-10-01 22:56 ` Andrew Lunn
2024-10-03 21:09 ` Aleksander Jan Bajkowski
2024-10-01 18:46 ` [PATCHv2 net-next 06/10] net: lantiq_etop: use devm_err_probe Rosen Penev
2024-10-01 18:46 ` [PATCHv2 net-next 07/10] net: lantiq_etop: remove struct resource Rosen Penev
2024-10-01 18:46 ` [PATCHv2 net-next 08/10] net: lantiq_etop: use module_platform_driver_probe Rosen Penev
2024-10-03 17:55 ` kernel test robot
2024-10-03 23:26 ` kernel test robot
2024-10-01 18:46 ` [PATCHv2 net-next 09/10] net: lantiq_etop: no queue stop in remove Rosen Penev
2024-10-01 18:46 ` [PATCHv2 net-next 10/10] net: lantiq_etop: return by register_netdev Rosen Penev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241001184607.193461-2-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olek2@wp.pl \
--cc=pabeni@redhat.com \
--cc=shannon.nelson@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).