From 4a79c32fee81aba5ae3a7efda9db7819a66ac838 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 14 Mar 2021 23:53:35 +0100 Subject: kernel: replace threaded NAPI implementation in 5.10 with upstream backport This uses a kthread per NAPI instance instead of the workqueue approach Signed-off-by: Felix Fietkau --- ...ysfs-attribute-for-enabling-threaded-NAPI.patch | 74 ---------------------- 1 file changed, 74 deletions(-) delete mode 100644 target/linux/generic/pending-5.10/691-net-add-sysfs-attribute-for-enabling-threaded-NAPI.patch (limited to 'target/linux/generic/pending-5.10/691-net-add-sysfs-attribute-for-enabling-threaded-NAPI.patch') diff --git a/target/linux/generic/pending-5.10/691-net-add-sysfs-attribute-for-enabling-threaded-NAPI.patch b/target/linux/generic/pending-5.10/691-net-add-sysfs-attribute-for-enabling-threaded-NAPI.patch deleted file mode 100644 index 279ae2c25a..0000000000 --- a/target/linux/generic/pending-5.10/691-net-add-sysfs-attribute-for-enabling-threaded-NAPI.patch +++ /dev/null @@ -1,74 +0,0 @@ -From: Felix Fietkau -Date: Fri, 21 Aug 2020 15:07:54 +0200 -Subject: [PATCH] net: add sysfs attribute for enabling threaded NAPI - -This can be used to enable threaded NAPI on drivers that did not explicitly -request it. - -Suggested-by: Eric Dumazet -Signed-off-by: Felix Fietkau ---- - ---- a/net/core/net-sysfs.c -+++ b/net/core/net-sysfs.c -@@ -472,6 +472,52 @@ static ssize_t proto_down_store(struct d - } - NETDEVICE_SHOW_RW(proto_down, fmt_dec); - -+static int change_napi_threaded(struct net_device *dev, unsigned long val) -+{ -+ struct napi_struct *napi; -+ -+ if (list_empty(&dev->napi_list)) -+ return -EOPNOTSUPP; -+ -+ list_for_each_entry(napi, &dev->napi_list, dev_list) { -+ if (val) -+ set_bit(NAPI_STATE_THREADED, &napi->state); -+ else -+ clear_bit(NAPI_STATE_THREADED, &napi->state); -+ } -+ -+ return 0; -+} -+ -+static ssize_t napi_threaded_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t len) -+{ -+ return netdev_store(dev, attr, buf, len, change_napi_threaded); -+} -+ -+static ssize_t napi_threaded_show(struct device *dev, -+ struct device_attribute *attr, -+ char *buf) -+{ -+ struct net_device *netdev = to_net_dev(dev); -+ struct napi_struct *napi; -+ bool enabled = false; -+ -+ if (!rtnl_trylock()) -+ return restart_syscall(); -+ -+ list_for_each_entry(napi, &netdev->napi_list, dev_list) { -+ if (test_bit(NAPI_STATE_THREADED, &napi->state)) -+ enabled = true; -+ } -+ -+ rtnl_unlock(); -+ -+ return sprintf(buf, fmt_dec, enabled); -+} -+static DEVICE_ATTR_RW(napi_threaded); -+ - static ssize_t phys_port_id_show(struct device *dev, - struct device_attribute *attr, char *buf) - { -@@ -564,6 +610,7 @@ static struct attribute *net_class_attrs - &dev_attr_tx_queue_len.attr, - &dev_attr_gro_flush_timeout.attr, - &dev_attr_napi_defer_hard_irqs.attr, -+ &dev_attr_napi_threaded.attr, - &dev_attr_phys_port_id.attr, - &dev_attr_phys_port_name.attr, - &dev_attr_phys_switch_id.attr, -- cgit v1.2.3