Skip to content

Commit f6ad8c1

Browse files
ecree-solarflaredavem330
authored andcommitted
net: core: trivial netif_receive_skb_list() entry point
Just calls netif_receive_skb() in a loop. Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2bdea15 commit f6ad8c1

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

include/linux/netdevice.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3477,6 +3477,7 @@ int netif_rx(struct sk_buff *skb);
34773477
int netif_rx_ni(struct sk_buff *skb);
34783478
int netif_receive_skb(struct sk_buff *skb);
34793479
int netif_receive_skb_core(struct sk_buff *skb);
3480+
void netif_receive_skb_list(struct list_head *head);
34803481
gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb);
34813482
void napi_gro_flush(struct napi_struct *napi, bool flush_old);
34823483
struct sk_buff *napi_get_frags(struct napi_struct *napi);

net/core/dev.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4906,6 +4906,25 @@ int netif_receive_skb(struct sk_buff *skb)
49064906
}
49074907
EXPORT_SYMBOL(netif_receive_skb);
49084908

4909+
/**
4910+
* netif_receive_skb_list - process many receive buffers from network
4911+
* @head: list of skbs to process.
4912+
*
4913+
* For now, just calls netif_receive_skb() in a loop, ignoring the
4914+
* return value.
4915+
*
4916+
* This function may only be called from softirq context and interrupts
4917+
* should be enabled.
4918+
*/
4919+
void netif_receive_skb_list(struct list_head *head)
4920+
{
4921+
struct sk_buff *skb, *next;
4922+
4923+
list_for_each_entry_safe(skb, next, head, list)
4924+
netif_receive_skb(skb);
4925+
}
4926+
EXPORT_SYMBOL(netif_receive_skb_list);
4927+
49094928
DEFINE_PER_CPU(struct work_struct, flush_works);
49104929

49114930
/* Network device is going away, flush any packets still pending */

0 commit comments

Comments
 (0)