Commit 9f3e7f11 authored by Brett Creeley's avatar Brett Creeley Committed by Jakub Kicinski

fbnic: Set napi irq value after calling netif_napi_add

The driver calls netif_napi_set_irq() and then calls netif_napi_add(),
which calls netif_napi_add_weight(). At the end of
netif_napi_add_weight() is a call to netif_napi_set_irq(napi, -1), which
clears the previously set napi->irq value. Fix this by calling
netif_napi_set_irq() after calling netif_napi_add().

This was found when reviewing another patch and I have no way to test
this, but the fix seemed relatively straight forward.

Fixes: bc610777 ("eth: fbnic: Allocate a netdevice and napi vectors with queues")
Signed-off-by: default avatarBrett Creeley <brett.creeley@amd.com>
Reviewed-by: default avatarJoe Damato <jdamato@fastly.com>
Reviewed-by: default avatarVadim Fedorenko <vadim.fedorenko@linux.dev>
Link: https://patch.msgid.link/20240912174922.10550-1-brett.creeley@amd.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 2c84b0aa
...@@ -1012,14 +1012,14 @@ static int fbnic_alloc_napi_vector(struct fbnic_dev *fbd, struct fbnic_net *fbn, ...@@ -1012,14 +1012,14 @@ static int fbnic_alloc_napi_vector(struct fbnic_dev *fbd, struct fbnic_net *fbn,
nv->fbd = fbd; nv->fbd = fbd;
nv->v_idx = v_idx; nv->v_idx = v_idx;
/* Record IRQ to NAPI struct */
netif_napi_set_irq(&nv->napi,
pci_irq_vector(to_pci_dev(fbd->dev), nv->v_idx));
/* Tie napi to netdev */ /* Tie napi to netdev */
list_add(&nv->napis, &fbn->napis); list_add(&nv->napis, &fbn->napis);
netif_napi_add(fbn->netdev, &nv->napi, fbnic_poll); netif_napi_add(fbn->netdev, &nv->napi, fbnic_poll);
/* Record IRQ to NAPI struct */
netif_napi_set_irq(&nv->napi,
pci_irq_vector(to_pci_dev(fbd->dev), nv->v_idx));
/* Tie nv back to PCIe dev */ /* Tie nv back to PCIe dev */
nv->dev = fbd->dev; nv->dev = fbd->dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment