|
@@ -4784,6 +4784,14 @@ int netif_receive_skb_core(struct sk_buff *skb)
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(netif_receive_skb_core);
|
|
EXPORT_SYMBOL(netif_receive_skb_core);
|
|
|
|
|
|
|
|
+static void __netif_receive_skb_list_core(struct list_head *head, bool pfmemalloc)
|
|
|
|
+{
|
|
|
|
+ struct sk_buff *skb, *next;
|
|
|
|
+
|
|
|
|
+ list_for_each_entry_safe(skb, next, head, list)
|
|
|
|
+ __netif_receive_skb_core(skb, pfmemalloc);
|
|
|
|
+}
|
|
|
|
+
|
|
static int __netif_receive_skb(struct sk_buff *skb)
|
|
static int __netif_receive_skb(struct sk_buff *skb)
|
|
{
|
|
{
|
|
int ret;
|
|
int ret;
|
|
@@ -4809,6 +4817,34 @@ static int __netif_receive_skb(struct sk_buff *skb)
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static void __netif_receive_skb_list(struct list_head *head)
|
|
|
|
+{
|
|
|
|
+ unsigned long noreclaim_flag = 0;
|
|
|
|
+ struct sk_buff *skb, *next;
|
|
|
|
+ bool pfmemalloc = false; /* Is current sublist PF_MEMALLOC? */
|
|
|
|
+
|
|
|
|
+ list_for_each_entry_safe(skb, next, head, list) {
|
|
|
|
+ if ((sk_memalloc_socks() && skb_pfmemalloc(skb)) != pfmemalloc) {
|
|
|
|
+ struct list_head sublist;
|
|
|
|
+
|
|
|
|
+ /* Handle the previous sublist */
|
|
|
|
+ list_cut_before(&sublist, head, &skb->list);
|
|
|
|
+ __netif_receive_skb_list_core(&sublist, pfmemalloc);
|
|
|
|
+ pfmemalloc = !pfmemalloc;
|
|
|
|
+ /* See comments in __netif_receive_skb */
|
|
|
|
+ if (pfmemalloc)
|
|
|
|
+ noreclaim_flag = memalloc_noreclaim_save();
|
|
|
|
+ else
|
|
|
|
+ memalloc_noreclaim_restore(noreclaim_flag);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /* Handle the remaining sublist */
|
|
|
|
+ __netif_receive_skb_list_core(head, pfmemalloc);
|
|
|
|
+ /* Restore pflags */
|
|
|
|
+ if (pfmemalloc)
|
|
|
|
+ memalloc_noreclaim_restore(noreclaim_flag);
|
|
|
|
+}
|
|
|
|
+
|
|
static int generic_xdp_install(struct net_device *dev, struct netdev_bpf *xdp)
|
|
static int generic_xdp_install(struct net_device *dev, struct netdev_bpf *xdp)
|
|
{
|
|
{
|
|
struct bpf_prog *old = rtnl_dereference(dev->xdp_prog);
|
|
struct bpf_prog *old = rtnl_dereference(dev->xdp_prog);
|
|
@@ -4843,14 +4879,6 @@ static int generic_xdp_install(struct net_device *dev, struct netdev_bpf *xdp)
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
-static 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);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
static int netif_receive_skb_internal(struct sk_buff *skb)
|
|
static int netif_receive_skb_internal(struct sk_buff *skb)
|
|
{
|
|
{
|
|
int ret;
|
|
int ret;
|