aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/pending-5.4
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2021-03-12 14:45:19 +0100
committerFelix Fietkau <nbd@nbd.name>2021-03-14 20:41:58 +0100
commit1eb1d5e0bb1c54ea4ecba3cbb30fe66c91560706 (patch)
tree7555063ab43cbe1b5875678299419b6e1c748bb9 /target/linux/generic/pending-5.4
parente17e212b51ac8b39778191f9be29d9c2f86989db (diff)
downloadupstream-1eb1d5e0bb1c54ea4ecba3cbb30fe66c91560706.tar.gz
upstream-1eb1d5e0bb1c54ea4ecba3cbb30fe66c91560706.tar.bz2
upstream-1eb1d5e0bb1c54ea4ecba3cbb30fe66c91560706.zip
kernel: add compatibility with upstream threaded NAPI patch
Enable threading if dev->threaded is set. This will be used to bring mt76 back in sync with upstream Signed-off-by: Felix Fietkau <nbd@nbd.name> (cherry-picked from commit 3d1ea0d77f9d)
Diffstat (limited to 'target/linux/generic/pending-5.4')
-rw-r--r--target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch25
1 files changed, 19 insertions, 6 deletions
diff --git a/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch b/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch
index 6d24007b6a..a90bb2c285 100644
--- a/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch
+++ b/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch
@@ -50,7 +50,15 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
};
enum gro_result {
-@@ -2249,6 +2252,26 @@ void netif_napi_add(struct net_device *d
+@@ -2092,6 +2095,7 @@ struct net_device {
+ struct lock_class_key addr_list_lock_key;
+ bool proto_down;
+ unsigned wol_enabled:1;
++ unsigned threaded:1;
+ };
+ #define to_net_dev(d) container_of(d, struct net_device, dev)
+
+@@ -2249,6 +2253,26 @@ void netif_napi_add(struct net_device *d
int (*poll)(struct napi_struct *, int), int weight);
/**
@@ -111,7 +119,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
____napi_schedule(this_cpu_ptr(&softnet_data), n);
}
EXPORT_SYMBOL(__napi_schedule_irqoff);
-@@ -6219,6 +6230,84 @@ static void init_gro_hash(struct napi_st
+@@ -6219,9 +6230,89 @@ static void init_gro_hash(struct napi_st
napi->gro_bitmask = 0;
}
@@ -196,7 +204,12 @@ 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
++ if (dev->threaded)
++ set_bit(NAPI_STATE_THREADED, &napi->state);
+ INIT_LIST_HEAD(&napi->poll_list);
+ hrtimer_init(&napi->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED);
+ napi->timer.function = napi_watchdog;
+@@ -6238,6 +6329,7 @@ void netif_napi_add(struct net_device *d
#ifdef CONFIG_NETPOLL
napi->poll_owner = -1;
#endif
@@ -204,7 +217,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
set_bit(NAPI_STATE_SCHED, &napi->state);
set_bit(NAPI_STATE_NPSVC, &napi->state);
list_add_rcu(&napi->dev_list, &dev->napi_list);
-@@ -6278,6 +6368,7 @@ static void flush_gro_hash(struct napi_s
+@@ -6278,6 +6370,7 @@ static void flush_gro_hash(struct napi_s
void netif_napi_del(struct napi_struct *napi)
{
might_sleep();
@@ -212,7 +225,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (napi_hash_del(napi))
synchronize_net();
list_del_init(&napi->dev_list);
-@@ -6290,50 +6381,18 @@ EXPORT_SYMBOL(netif_napi_del);
+@@ -6290,50 +6383,18 @@ EXPORT_SYMBOL(netif_napi_del);
static int napi_poll(struct napi_struct *n, struct list_head *repoll)
{
@@ -267,7 +280,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
/* Some drivers may have called napi_schedule
* prior to exhausting their budget.
-@@ -10271,6 +10330,10 @@ static int __init net_dev_init(void)
+@@ -10271,6 +10332,10 @@ static int __init net_dev_init(void)
sd->backlog.weight = weight_p;
}