Merge Mainline

This commit is contained in:
CN_SZTL
2020-08-23 02:15:59 +08:00
9 changed files with 71 additions and 69 deletions

View File

@@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1412,6 +1412,7 @@ enum netdev_priv_flags {
@@ -1415,6 +1415,7 @@ enum netdev_priv_flags {
IFF_PHONY_HEADROOM = 1<<26,
IFF_MACSEC = 1<<27,
IFF_L3MDEV_RX_HANDLER = 1<<28,
@@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
};
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
@@ -1442,6 +1443,7 @@ enum netdev_priv_flags {
@@ -1445,6 +1446,7 @@ enum netdev_priv_flags {
#define IFF_RXFH_CONFIGURED IFF_RXFH_CONFIGURED
#define IFF_MACSEC IFF_MACSEC
#define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER
@@ -31,7 +31,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/**
* struct net_device - The DEVICE structure.
@@ -1728,6 +1730,11 @@ struct net_device {
@@ -1731,6 +1733,11 @@ struct net_device {
const struct xfrmdev_ops *xfrmdev_ops;
#endif
@@ -43,7 +43,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
const struct header_ops *header_ops;
unsigned int flags;
@@ -1802,6 +1809,10 @@ struct net_device {
@@ -1805,6 +1812,10 @@ struct net_device {
struct mpls_dev __rcu *mpls_ptr;
#endif
@@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
help
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3008,10 +3008,20 @@ static int xmit_one(struct sk_buff *skb,
@@ -3009,10 +3009,20 @@ static int xmit_one(struct sk_buff *skb,
#endif
dev_queue_xmit_nit(skb, dev);

View File

@@ -44,7 +44,7 @@
+ bool "Enables kernel network stack path for Shortcut Forwarding Engine
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3006,7 +3006,16 @@ static int xmit_one(struct sk_buff *skb,
@@ -3007,7 +3007,16 @@ static int xmit_one(struct sk_buff *skb,
#else
if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all))
#endif
@@ -61,7 +61,7 @@
#ifdef CONFIG_ETHERNET_PACKET_MANGLE
if (!dev->eth_mangle_tx ||
@@ -4321,6 +4330,11 @@ void netdev_rx_handler_unregister(struct
@@ -4322,6 +4331,11 @@ void netdev_rx_handler_unregister(struct
}
EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister);
@@ -73,7 +73,7 @@
/*
* Limit the use of PFMEMALLOC reserves to those protocols that implement
* the special handling of PFMEMALLOC skbs.
@@ -4368,6 +4382,9 @@ static int __netif_receive_skb_core(stru
@@ -4369,6 +4383,9 @@ static int __netif_receive_skb_core(stru
bool deliver_exact = false;
int ret = NET_RX_DROP;
__be16 type;
@@ -83,7 +83,7 @@
net_timestamp_check(!netdev_tstamp_prequeue, skb);
@@ -4394,6 +4411,16 @@ another_round:
@@ -4395,6 +4412,16 @@ another_round:
goto out;
}

View File

@@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1514,6 +1514,7 @@ enum netdev_priv_flags {
@@ -1517,6 +1517,7 @@ enum netdev_priv_flags {
IFF_FAILOVER_SLAVE = 1<<28,
IFF_L3MDEV_RX_HANDLER = 1<<29,
IFF_LIVE_RENAME_OK = 1<<30,
@@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
};
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
@@ -1546,6 +1547,7 @@ enum netdev_priv_flags {
@@ -1549,6 +1550,7 @@ enum netdev_priv_flags {
#define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE
#define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER
#define IFF_LIVE_RENAME_OK IFF_LIVE_RENAME_OK
@@ -31,7 +31,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/**
* struct net_device - The DEVICE structure.
@@ -1846,6 +1848,11 @@ struct net_device {
@@ -1849,6 +1851,11 @@ struct net_device {
const struct tlsdev_ops *tlsdev_ops;
#endif
@@ -43,7 +43,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
const struct header_ops *header_ops;
unsigned int flags;
@@ -1928,6 +1935,10 @@ struct net_device {
@@ -1931,6 +1938,10 @@ struct net_device {
struct mpls_dev __rcu *mpls_ptr;
#endif
@@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
help
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3259,10 +3259,20 @@ static int xmit_one(struct sk_buff *skb,
@@ -3260,10 +3260,20 @@ static int xmit_one(struct sk_buff *skb,
#endif
dev_queue_xmit_nit(skb, dev);

View File

@@ -44,7 +44,7 @@
+ bool "Enables kernel network stack path for Shortcut Forwarding Engine
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3257,7 +3257,16 @@ static int xmit_one(struct sk_buff *skb,
@@ -3258,7 +3258,16 @@ static int xmit_one(struct sk_buff *skb,
#else
if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all))
#endif
@@ -61,7 +61,7 @@
#ifdef CONFIG_ETHERNET_PACKET_MANGLE
if (!dev->eth_mangle_tx ||
@@ -4753,6 +4762,11 @@ void netdev_rx_handler_unregister(struct
@@ -4754,6 +4763,11 @@ void netdev_rx_handler_unregister(struct
}
EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister);
@@ -73,7 +73,7 @@
/*
* Limit the use of PFMEMALLOC reserves to those protocols that implement
* the special handling of PFMEMALLOC skbs.
@@ -4802,6 +4816,9 @@ static int __netif_receive_skb_core(stru
@@ -4803,6 +4817,9 @@ static int __netif_receive_skb_core(stru
bool deliver_exact = false;
int ret = NET_RX_DROP;
__be16 type;
@@ -83,7 +83,7 @@
net_timestamp_check(!netdev_tstamp_prequeue, skb);
@@ -4842,6 +4859,16 @@ another_round:
@@ -4843,6 +4860,16 @@ another_round:
goto out;
}

View File

@@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1546,6 +1546,7 @@ enum netdev_priv_flags {
@@ -1549,6 +1549,7 @@ enum netdev_priv_flags {
IFF_FAILOVER_SLAVE = 1<<28,
IFF_L3MDEV_RX_HANDLER = 1<<29,
IFF_LIVE_RENAME_OK = 1<<30,
@@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
};
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
@@ -1578,6 +1579,7 @@ enum netdev_priv_flags {
@@ -1581,6 +1582,7 @@ enum netdev_priv_flags {
#define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE
#define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER
#define IFF_LIVE_RENAME_OK IFF_LIVE_RENAME_OK
@@ -31,7 +31,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/**
* struct net_device - The DEVICE structure.
@@ -1879,6 +1881,11 @@ struct net_device {
@@ -1882,6 +1884,11 @@ struct net_device {
const struct tlsdev_ops *tlsdev_ops;
#endif
@@ -43,7 +43,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
const struct header_ops *header_ops;
unsigned int flags;
@@ -1961,6 +1968,10 @@ struct net_device {
@@ -1964,6 +1971,10 @@ struct net_device {
struct mpls_dev __rcu *mpls_ptr;
#endif
@@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
help
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3201,10 +3201,20 @@ static int xmit_one(struct sk_buff *skb,
@@ -3202,10 +3202,20 @@ static int xmit_one(struct sk_buff *skb,
if (dev_nit_active(dev))
dev_queue_xmit_nit(skb, dev);

View File

@@ -69,7 +69,7 @@
struct net_bridge_port *p;
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3198,9 +3198,17 @@ static int xmit_one(struct sk_buff *skb,
@@ -3199,9 +3199,17 @@ static int xmit_one(struct sk_buff *skb,
if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all))
#endif
@@ -88,7 +88,7 @@
#ifdef CONFIG_ETHERNET_PACKET_MANGLE
if (!dev->eth_mangle_tx ||
(skb = dev->eth_mangle_tx(dev, skb)) != NULL)
@@ -4694,6 +4702,11 @@ void netdev_rx_handler_unregister(struct
@@ -4695,6 +4703,11 @@ void netdev_rx_handler_unregister(struct
}
EXPORT_SYMBOL_GPL(netdev_rx_handler_unregister);
@@ -100,7 +100,7 @@
/*
* Limit the use of PFMEMALLOC reserves to those protocols that implement
* the special handling of PFMEMALLOC skbs.
@@ -4744,6 +4757,10 @@ static int __netif_receive_skb_core(stru
@@ -4745,6 +4758,10 @@ static int __netif_receive_skb_core(stru
int ret = NET_RX_DROP;
__be16 type;
@@ -111,7 +111,7 @@
net_timestamp_check(!netdev_tstamp_prequeue, skb);
trace_netif_receive_skb(skb);
@@ -4783,6 +4800,16 @@ another_round:
@@ -4784,6 +4801,16 @@ another_round:
goto out;
}

View File

@@ -50,7 +50,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
};
enum gro_result {
@@ -2093,6 +2096,26 @@ void netif_napi_add(struct net_device *d
@@ -2098,6 +2101,26 @@ void netif_napi_add(struct net_device *d
int (*poll)(struct napi_struct *, int), int weight);
/**
@@ -79,7 +79,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
* @napi: NAPI context
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -160,6 +160,7 @@ static DEFINE_SPINLOCK(offload_lock);
@@ -163,6 +163,7 @@ static DEFINE_SPINLOCK(offload_lock);
struct list_head ptype_base[PTYPE_HASH_SIZE] __read_mostly;
struct list_head ptype_all __read_mostly; /* Taps */
static struct list_head offload_base __read_mostly;
@@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static int netif_rx_internal(struct sk_buff *skb);
static int call_netdevice_notifiers_info(unsigned long val,
@@ -5237,6 +5238,11 @@ void __napi_schedule(struct napi_struct
@@ -5247,6 +5248,11 @@ void __napi_schedule(struct napi_struct
{
unsigned long flags;
@@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
local_irq_save(flags);
____napi_schedule(this_cpu_ptr(&softnet_data), n);
local_irq_restore(flags);
@@ -5284,6 +5290,11 @@ EXPORT_SYMBOL(napi_schedule_prep);
@@ -5294,6 +5300,11 @@ EXPORT_SYMBOL(napi_schedule_prep);
*/
void __napi_schedule_irqoff(struct napi_struct *n)
{
@@ -111,7 +111,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
____napi_schedule(this_cpu_ptr(&softnet_data), n);
}
EXPORT_SYMBOL(__napi_schedule_irqoff);
@@ -5521,6 +5532,82 @@ static enum hrtimer_restart napi_watchdo
@@ -5531,6 +5542,82 @@ static enum hrtimer_restart napi_watchdo
return HRTIMER_NORESTART;
}
@@ -194,7 +194,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
void netif_napi_add(struct net_device *dev, struct napi_struct *napi,
int (*poll)(struct napi_struct *, int), int weight)
{
@@ -5540,6 +5627,7 @@ void netif_napi_add(struct net_device *d
@@ -5550,6 +5637,7 @@ void netif_napi_add(struct net_device *d
#ifdef CONFIG_NETPOLL
napi->poll_owner = -1;
#endif
@@ -202,7 +202,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
set_bit(NAPI_STATE_SCHED, &napi->state);
napi_hash_add(napi);
}
@@ -5565,6 +5653,7 @@ EXPORT_SYMBOL(napi_disable);
@@ -5575,6 +5663,7 @@ EXPORT_SYMBOL(napi_disable);
void netif_napi_del(struct napi_struct *napi)
{
might_sleep();
@@ -210,7 +210,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (napi_hash_del(napi))
synchronize_net();
list_del_init(&napi->dev_list);
@@ -5578,48 +5667,18 @@ EXPORT_SYMBOL(netif_napi_del);
@@ -5588,49 +5677,19 @@ EXPORT_SYMBOL(netif_napi_del);
static int napi_poll(struct napi_struct *n, struct list_head *repoll)
{
@@ -224,7 +224,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
have = netpoll_poll_lock(n);
- weight = n->weight;
-
+ work = __napi_poll(n, &do_repoll);
- /* This NAPI_STATE_SCHED test is for avoiding a race
- * with netpoll's poll_napi(). Only the entity which
- * obtains the lock and sees NAPI_STATE_SCHED set will
@@ -240,8 +241,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
- WARN_ON_ONCE(work > weight);
-
- if (likely(work < weight))
- goto out_unlock;
+ work = __napi_poll(n, &do_repoll);
+ if (!do_repoll)
goto out_unlock;
- /* Drivers must not modify the NAPI state if they
- * consume the entire weight. In such cases this code
@@ -250,8 +251,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
- */
- if (unlikely(napi_disable_pending(n))) {
- napi_complete(n);
+ if (!do_repoll)
goto out_unlock;
- goto out_unlock;
- }
-
- if (n->gro_list) {
@@ -260,10 +260,11 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
- */
- napi_gro_flush(n, HZ >= 1000);
- }
-
/* Some drivers may have called napi_schedule
* prior to exhausting their budget.
@@ -8855,6 +8914,10 @@ static int __init net_dev_init(void)
*/
@@ -8865,6 +8924,10 @@ static int __init net_dev_init(void)
sd->backlog.weight = weight_p;
}

View File

@@ -50,7 +50,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
};
enum gro_result {
@@ -2230,6 +2233,26 @@ void netif_napi_add(struct net_device *d
@@ -2235,6 +2238,26 @@ void netif_napi_add(struct net_device *d
int (*poll)(struct napi_struct *, int), int weight);
/**
@@ -79,7 +79,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
* @napi: NAPI context
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -160,6 +160,7 @@ static DEFINE_SPINLOCK(offload_lock);
@@ -163,6 +163,7 @@ static DEFINE_SPINLOCK(offload_lock);
struct list_head ptype_base[PTYPE_HASH_SIZE] __read_mostly;
struct list_head ptype_all __read_mostly; /* Taps */
static struct list_head offload_base __read_mostly;
@@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static int netif_rx_internal(struct sk_buff *skb);
static int call_netdevice_notifiers_info(unsigned long val,
@@ -5891,6 +5892,11 @@ void __napi_schedule(struct napi_struct
@@ -5901,6 +5902,11 @@ void __napi_schedule(struct napi_struct
{
unsigned long flags;
@@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
local_irq_save(flags);
____napi_schedule(this_cpu_ptr(&softnet_data), n);
local_irq_restore(flags);
@@ -5938,6 +5944,11 @@ EXPORT_SYMBOL(napi_schedule_prep);
@@ -5948,6 +5954,11 @@ EXPORT_SYMBOL(napi_schedule_prep);
*/
void __napi_schedule_irqoff(struct napi_struct *n)
{
@@ -111,7 +111,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
____napi_schedule(this_cpu_ptr(&softnet_data), n);
}
EXPORT_SYMBOL(__napi_schedule_irqoff);
@@ -6186,6 +6197,82 @@ static void init_gro_hash(struct napi_st
@@ -6196,6 +6207,82 @@ static void init_gro_hash(struct napi_st
napi->gro_bitmask = 0;
}
@@ -194,7 +194,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
void netif_napi_add(struct net_device *dev, struct napi_struct *napi,
int (*poll)(struct napi_struct *, int), int weight)
{
@@ -6204,6 +6291,7 @@ void netif_napi_add(struct net_device *d
@@ -6214,6 +6301,7 @@ void netif_napi_add(struct net_device *d
#ifdef CONFIG_NETPOLL
napi->poll_owner = -1;
#endif
@@ -202,7 +202,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
set_bit(NAPI_STATE_SCHED, &napi->state);
napi_hash_add(napi);
}
@@ -6242,6 +6330,7 @@ static void flush_gro_hash(struct napi_s
@@ -6252,6 +6340,7 @@ static void flush_gro_hash(struct napi_s
void netif_napi_del(struct napi_struct *napi)
{
might_sleep();
@@ -210,7 +210,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (napi_hash_del(napi))
synchronize_net();
list_del_init(&napi->dev_list);
@@ -6254,48 +6343,18 @@ EXPORT_SYMBOL(netif_napi_del);
@@ -6264,49 +6353,19 @@ EXPORT_SYMBOL(netif_napi_del);
static int napi_poll(struct napi_struct *n, struct list_head *repoll)
{
@@ -224,7 +224,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
have = netpoll_poll_lock(n);
- weight = n->weight;
-
+ work = __napi_poll(n, &do_repoll);
- /* This NAPI_STATE_SCHED test is for avoiding a race
- * with netpoll's poll_napi(). Only the entity which
- * obtains the lock and sees NAPI_STATE_SCHED set will
@@ -240,8 +241,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
- WARN_ON_ONCE(work > weight);
-
- if (likely(work < weight))
- goto out_unlock;
+ work = __napi_poll(n, &do_repoll);
+ if (!do_repoll)
goto out_unlock;
- /* Drivers must not modify the NAPI state if they
- * consume the entire weight. In such cases this code
@@ -250,8 +251,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
- */
- if (unlikely(napi_disable_pending(n))) {
- napi_complete(n);
+ if (!do_repoll)
goto out_unlock;
- goto out_unlock;
- }
-
- if (n->gro_bitmask) {
@@ -260,10 +260,11 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
- */
- napi_gro_flush(n, HZ >= 1000);
- }
-
/* Some drivers may have called napi_schedule
* prior to exhausting their budget.
@@ -9895,6 +9954,10 @@ static int __init net_dev_init(void)
*/
@@ -9905,6 +9964,10 @@ static int __init net_dev_init(void)
sd->backlog.weight = weight_p;
}

View File

@@ -50,7 +50,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
};
enum gro_result {
@@ -2249,6 +2252,26 @@ void netif_napi_add(struct net_device *d
@@ -2254,6 +2257,26 @@ void netif_napi_add(struct net_device *d
int (*poll)(struct napi_struct *, int), int weight);
/**
@@ -79,7 +79,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
* @napi: NAPI context
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -156,6 +156,7 @@ static DEFINE_SPINLOCK(offload_lock);
@@ -159,6 +159,7 @@ static DEFINE_SPINLOCK(offload_lock);
struct list_head ptype_base[PTYPE_HASH_SIZE] __read_mostly;
struct list_head ptype_all __read_mostly; /* Taps */
static struct list_head offload_base __read_mostly;
@@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
static int netif_rx_internal(struct sk_buff *skb);
static int call_netdevice_notifiers_info(unsigned long val,
@@ -5910,6 +5911,11 @@ void __napi_schedule(struct napi_struct
@@ -5922,6 +5923,11 @@ void __napi_schedule(struct napi_struct
{
unsigned long flags;
@@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
local_irq_save(flags);
____napi_schedule(this_cpu_ptr(&softnet_data), n);
local_irq_restore(flags);
@@ -5957,6 +5963,11 @@ EXPORT_SYMBOL(napi_schedule_prep);
@@ -5969,6 +5975,11 @@ EXPORT_SYMBOL(napi_schedule_prep);
*/
void __napi_schedule_irqoff(struct napi_struct *n)
{
@@ -111,7 +111,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
____napi_schedule(this_cpu_ptr(&softnet_data), n);
}
EXPORT_SYMBOL(__napi_schedule_irqoff);
@@ -6218,6 +6229,84 @@ static void init_gro_hash(struct napi_st
@@ -6230,6 +6241,84 @@ static void init_gro_hash(struct napi_st
napi->gro_bitmask = 0;
}
@@ -196,7 +196,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
void netif_napi_add(struct net_device *dev, struct napi_struct *napi,
int (*poll)(struct napi_struct *, int), int weight)
{
@@ -6238,6 +6327,7 @@ void netif_napi_add(struct net_device *d
@@ -6250,6 +6339,7 @@ void netif_napi_add(struct net_device *d
#ifdef CONFIG_NETPOLL
napi->poll_owner = -1;
#endif
@@ -204,7 +204,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
set_bit(NAPI_STATE_SCHED, &napi->state);
napi_hash_add(napi);
}
@@ -6276,6 +6366,7 @@ static void flush_gro_hash(struct napi_s
@@ -6288,6 +6378,7 @@ static void flush_gro_hash(struct napi_s
void netif_napi_del(struct napi_struct *napi)
{
might_sleep();
@@ -212,7 +212,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (napi_hash_del(napi))
synchronize_net();
list_del_init(&napi->dev_list);
@@ -6288,50 +6379,18 @@ EXPORT_SYMBOL(netif_napi_del);
@@ -6300,50 +6391,18 @@ EXPORT_SYMBOL(netif_napi_del);
static int napi_poll(struct napi_struct *n, struct list_head *repoll)
{
@@ -226,7 +226,8 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
have = netpoll_poll_lock(n);
- weight = n->weight;
-
+ work = __napi_poll(n, &do_repoll);
- /* This NAPI_STATE_SCHED test is for avoiding a race
- * with netpoll's poll_napi(). Only the entity which
- * obtains the lock and sees NAPI_STATE_SCHED set will
@@ -243,8 +244,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
-
- if (likely(work < weight))
- goto out_unlock;
+ work = __napi_poll(n, &do_repoll);
-
- /* Drivers must not modify the NAPI state if they
- * consume the entire weight. In such cases this code
- * still "owns" the NAPI instance and therefore can
@@ -267,7 +267,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/* Some drivers may have called napi_schedule
* prior to exhausting their budget.
@@ -10264,6 +10323,10 @@ static int __init net_dev_init(void)
@@ -10276,6 +10335,10 @@ static int __init net_dev_init(void)
sd->backlog.weight = weight_p;
}