Re: [net-next PATCH v1 7/9] net: Add NAPI IRQ support
From: Nambiar, Amritha <hidden>
Date: 2023-07-31 23:22:52
On 7/28/2023 9:05 PM, Stephen Hemminger wrote:
On Fri, 28 Jul 2023 17:47:28 -0700 Amritha Nambiar [off-list ref] wrote:quoted
Add support to associate the interrupt vector number for a NAPI instance. Signed-off-by: Amritha Nambiar <redacted> --- drivers/net/ethernet/intel/ice/ice_lib.c | 3 +++ include/linux/netdevice.h | 6 ++++++ net/core/dev.c | 1 + net/core/netdev-genl.c | 4 ++++ 4 files changed, 14 insertions(+)diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 171177db8fb4..1ebd293ca7de 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c@@ -2975,6 +2975,9 @@ int ice_q_vector_add_napi_queues(struct ice_q_vector *q_vector) return ret; } + /* Also set the interrupt number for the NAPI */ + napi_set_irq(&q_vector->napi, q_vector->irq.virq); + return ret; }Doing this for only one device seems like a potential problem.
For devices that does not call napi_set_irq(), irq will be initialized to -1 as part of netif_napi_add_weight().
Also, there are some weird devices where there may not be a 1:1:1 mapping between IRQ, NAPI, and netdev.
IIUC, there's a 1:1 mapping between IRQ and NAPI, and need not be mapped :1 with netdev.