Skip to content

Commit 9f3e7f1

Browse files
brettcreeleykuba-moo
authored andcommitted
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: bc61077 ("eth: fbnic: Allocate a netdevice and napi vectors with queues") Signed-off-by: Brett Creeley <[email protected]> Reviewed-by: Joe Damato <[email protected]> Reviewed-by: Vadim Fedorenko <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 2c84b0a commit 9f3e7f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/ethernet/meta/fbnic/fbnic_txrx.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,14 +1012,14 @@ static int fbnic_alloc_napi_vector(struct fbnic_dev *fbd, struct fbnic_net *fbn,
10121012
nv->fbd = fbd;
10131013
nv->v_idx = v_idx;
10141014

1015-
/* Record IRQ to NAPI struct */
1016-
netif_napi_set_irq(&nv->napi,
1017-
pci_irq_vector(to_pci_dev(fbd->dev), nv->v_idx));
1018-
10191015
/* Tie napi to netdev */
10201016
list_add(&nv->napis, &fbn->napis);
10211017
netif_napi_add(fbn->netdev, &nv->napi, fbnic_poll);
10221018

1019+
/* Record IRQ to NAPI struct */
1020+
netif_napi_set_irq(&nv->napi,
1021+
pci_irq_vector(to_pci_dev(fbd->dev), nv->v_idx));
1022+
10231023
/* Tie nv back to PCIe dev */
10241024
nv->dev = fbd->dev;
10251025

0 commit comments

Comments
 (0)