eth: bnxt: link NAPI instances to queues and IRQs
Make bnxt compatible with the newly added netlink queue GET APIs. Signed-off-by: Amritha Nambiar <amritha.nambiar@intel.com> Reviewed-by: Michael Chan <michael.chan@broadcom.com> Link: https://lore.kernel.org/r/170147336340.5260.6773000274196548907.stgit@anambiarhost.jf.intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
db4704f4e4
commit
e3b57ffdb3
@ -4008,6 +4008,9 @@ static int bnxt_init_one_rx_ring(struct bnxt *bp, int ring_nr)
|
||||
ring = &rxr->rx_ring_struct;
|
||||
bnxt_init_rxbd_pages(ring, type);
|
||||
|
||||
netif_queue_set_napi(bp->dev, ring_nr, NETDEV_QUEUE_TYPE_RX,
|
||||
&rxr->bnapi->napi);
|
||||
|
||||
if (BNXT_RX_PAGE_MODE(bp) && bp->xdp_prog) {
|
||||
bpf_prog_add(bp->xdp_prog, 1);
|
||||
rxr->xdp_prog = bp->xdp_prog;
|
||||
@ -4084,6 +4087,11 @@ static int bnxt_init_tx_rings(struct bnxt *bp)
|
||||
struct bnxt_ring_struct *ring = &txr->tx_ring_struct;
|
||||
|
||||
ring->fw_ring_id = INVALID_HW_RING_ID;
|
||||
|
||||
if (i >= bp->tx_nr_rings_xdp)
|
||||
netif_queue_set_napi(bp->dev, i - bp->tx_nr_rings_xdp,
|
||||
NETDEV_QUEUE_TYPE_TX,
|
||||
&txr->bnapi->napi);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@ -9930,6 +9938,7 @@ static int bnxt_request_irq(struct bnxt *bp)
|
||||
if (rc)
|
||||
break;
|
||||
|
||||
netif_napi_set_irq(&bp->bnapi[i]->napi, irq->vector);
|
||||
irq->requested = 1;
|
||||
|
||||
if (zalloc_cpumask_var(&irq->cpu_mask, GFP_KERNEL)) {
|
||||
@ -9957,6 +9966,11 @@ static void bnxt_del_napi(struct bnxt *bp)
|
||||
if (!bp->bnapi)
|
||||
return;
|
||||
|
||||
for (i = 0; i < bp->rx_nr_rings; i++)
|
||||
netif_queue_set_napi(bp->dev, i, NETDEV_QUEUE_TYPE_RX, NULL);
|
||||
for (i = 0; i < bp->tx_nr_rings - bp->tx_nr_rings_xdp; i++)
|
||||
netif_queue_set_napi(bp->dev, i, NETDEV_QUEUE_TYPE_TX, NULL);
|
||||
|
||||
for (i = 0; i < bp->cp_nr_rings; i++) {
|
||||
struct bnxt_napi *bnapi = bp->bnapi[i];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user