From: Amritha Nambiar <amritha.nambiar@intel.com> hulk inclusion category: feature bugzilla: https://atomgit.com/openeuler/kernel/issues/10109 ---------------------------------------- Add support to associate the interrupt vector number for a NAPI instance. Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com> Reviewed-by: Sridhar Samudrala <sridhar.samudrala@intel.com> Link: https://lore.kernel.org/r/170147334728.5260.13221803396905901904.stgit@anamb... Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Cai Xinchen <caixinchen1@huawei.com> --- include/linux/netdevice.h | 7 ++++++- net/core/dev.c | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 43cb840f0f2b..03372828a685 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -394,7 +394,7 @@ struct napi_struct { struct list_head dev_list; struct hlist_node napi_hash_node; - KABI_RESERVE(1) + KABI_USE(1, int irq) KABI_RESERVE(2) KABI_RESERVE(3) KABI_RESERVE(4) @@ -2686,6 +2686,11 @@ void netif_queue_set_napi(struct net_device *dev, unsigned int queue_index, enum netdev_queue_type type, struct napi_struct *napi); +static inline void netif_napi_set_irq(struct napi_struct *napi, int irq) +{ + napi->irq = irq; +} + /* Default NAPI poll() weight * Device drivers are strongly advised to not use bigger value */ diff --git a/net/core/dev.c b/net/core/dev.c index a8b10001905c..9dd9761928d9 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -6763,6 +6763,7 @@ void netif_napi_add_weight(struct net_device *dev, struct napi_struct *napi, */ if (dev->threaded && napi_kthread_create(napi)) dev->threaded = 0; + netif_napi_set_irq(napi, -1); } EXPORT_SYMBOL(netif_napi_add_weight); -- 2.18.0.huawei.25