netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Edward Cree <ecree@solarflare.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>
Subject: [PATCH v3 net-next 1/9] net: core: trivial netif_receive_skb_list() entry point
Date: Fri, 29 Jun 2018 20:29:23 +0100	[thread overview]
Message-ID: <880ab313-8208-1b1d-88bf-efc41d17a120@solarflare.com> (raw)
In-Reply-To: <bec738bd-c3fa-ba54-9473-84c8366c5699@solarflare.com>

Just calls netif_receive_skb() in a loop.

Signed-off-by: Edward Cree <ecree@solarflare.com>
---
 include/linux/netdevice.h |  1 +
 net/core/dev.c            | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c6b377a15869..e104b2e4a735 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -3365,6 +3365,7 @@ int netif_rx(struct sk_buff *skb);
 int netif_rx_ni(struct sk_buff *skb);
 int netif_receive_skb(struct sk_buff *skb);
 int netif_receive_skb_core(struct sk_buff *skb);
+void netif_receive_skb_list(struct list_head *head);
 gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb);
 void napi_gro_flush(struct napi_struct *napi, bool flush_old);
 struct sk_buff *napi_get_frags(struct napi_struct *napi);
diff --git a/net/core/dev.c b/net/core/dev.c
index dffed642e686..110c8dfebc01 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4792,6 +4792,25 @@ int netif_receive_skb(struct sk_buff *skb)
 }
 EXPORT_SYMBOL(netif_receive_skb);
 
+/**
+ *	netif_receive_skb_list - process many receive buffers from network
+ *	@head: list of skbs to process.
+ *
+ *	For now, just calls netif_receive_skb() in a loop, ignoring the
+ *	return value.
+ *
+ *	This function may only be called from softirq context and interrupts
+ *	should be enabled.
+ */
+void netif_receive_skb_list(struct list_head *head)
+{
+	struct sk_buff *skb, *next;
+
+	list_for_each_entry_safe(skb, next, head, list)
+		netif_receive_skb(skb);
+}
+EXPORT_SYMBOL(netif_receive_skb_list);
+
 DEFINE_PER_CPU(struct work_struct, flush_works);
 
 /* Network device is going away, flush any packets still pending */

  reply	other threads:[~2018-06-29 19:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-29 19:27 [PATCH v3 net-next 0/9] Handle multiple received packets at each stage Edward Cree
2018-06-29 19:29 ` Edward Cree [this message]
2018-06-29 19:29 ` [PATCH v3 net-next 2/9] sfc: batch up RX delivery Edward Cree
2018-06-29 19:30 ` [PATCH v3 net-next 3/9] net: core: unwrap skb list receive slightly further Edward Cree
2018-06-29 19:30 ` [PATCH v3 net-next 4/9] net: core: Another step of skb receive list processing Edward Cree
2018-06-29 19:30 ` [PATCH v3 net-next 5/9] net: core: another layer of lists, around PF_MEMALLOC skb handling Edward Cree
2018-06-29 19:31 ` [PATCH v3 net-next 6/9] net: core: propagate SKB lists through packet_type lookup Edward Cree
2018-06-29 19:31 ` [PATCH v3 net-next 7/9] net: ipv4: listified version of ip_rcv Edward Cree
2018-06-29 22:08   ` kbuild test robot
2018-07-02 14:59     ` Edward Cree
2018-06-29 22:44   ` kbuild test robot
2018-06-29 19:31 ` [PATCH v3 net-next 8/9] net: ipv4: listify ip_rcv_finish Edward Cree
2018-06-29 19:32 ` [PATCH v3 net-next 9/9] net: don't bother calling list RX functions on empty lists Edward Cree

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=880ab313-8208-1b1d-88bf-efc41d17a120@solarflare.com \
    --to=ecree@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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).