Lines Matching refs:bnapi
323 if (!rxr->bnapi->in_reset) { in bnxt_sched_reset_rxr()
324 rxr->bnapi->in_reset = true; in bnxt_sched_reset_rxr()
337 struct bnxt_napi *bnapi = txr->bnapi; in bnxt_sched_reset_txr() local
339 if (bnapi->tx_fault) in bnxt_sched_reset_txr()
343 txr->txq_index, bnapi->tx_pkts, in bnxt_sched_reset_txr()
346 bnapi->tx_fault = 1; in bnxt_sched_reset_txr()
690 static void bnxt_tx_int(struct bnxt *bp, struct bnxt_napi *bnapi, int budget) in bnxt_tx_int() argument
692 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in bnxt_tx_int()
696 int nr_pkts = bnapi->tx_pkts; in bnxt_tx_int()
751 bnapi->tx_pkts = 0; in bnxt_tx_int()
923 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_reuse_rx_agg_bufs() local
924 struct bnxt *bp = bnapi->bp; in bnxt_reuse_rx_agg_bufs()
925 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_reuse_rx_agg_bufs()
1035 skb = napi_alloc_skb(&rxr->bnapi->napi, payload); in bnxt_rx_page_skb()
1091 struct bnxt_napi *bnapi = cpr->bnapi; in __bnxt_rx_agg_pages() local
1093 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in __bnxt_rx_agg_pages()
1212 static inline struct sk_buff *bnxt_copy_skb(struct bnxt_napi *bnapi, u8 *data, in bnxt_copy_skb() argument
1216 struct bnxt *bp = bnapi->bp; in bnxt_copy_skb()
1220 skb = napi_alloc_skb(&bnapi->napi, len); in bnxt_copy_skb()
1596 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_tpa_end() local
1597 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_tpa_end()
1607 if (unlikely(bnapi->in_reset)) { in bnxt_tpa_end()
1659 skb = bnxt_copy_skb(bnapi, data_ptr, len, mapping); in bnxt_tpa_end()
1749 static void bnxt_deliver_skb(struct bnxt *bp, struct bnxt_napi *bnapi, in bnxt_deliver_skb() argument
1759 skb_record_rx_queue(skb, bnapi->index); in bnxt_deliver_skb()
1760 napi_gro_receive(&bnapi->napi, skb); in bnxt_deliver_skb()
1788 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_rx_pkt() local
1789 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_rx_pkt()
1848 bnxt_deliver_skb(bp, bnapi, skb); in bnxt_rx_pkt()
1896 bnapi->cp_ring.sw_stats.rx.rx_buf_errors++; in bnxt_rx_pkt()
1934 skb = bnxt_copy_skb(bnapi, data_ptr, len, dma_addr); in bnxt_rx_pkt()
2022 bnapi->cp_ring.sw_stats.rx.rx_l4_csum_errors++; in bnxt_rx_pkt()
2042 bnxt_deliver_skb(bp, bnapi, skb); in bnxt_rx_pkt()
2138 u16 grp_idx = bp->rx_ring[i].bnapi->index; in bnxt_agg_ring_id_to_grp_idx()
2345 rxr = bp->bnapi[grp_idx]->rx_ring; in bnxt_async_event_process()
2447 struct bnxt_napi *bnapi = dev_instance; in bnxt_msix() local
2448 struct bnxt *bp = bnapi->bp; in bnxt_msix()
2449 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_msix()
2454 napi_schedule(&bnapi->napi); in bnxt_msix()
2471 struct bnxt_napi *bnapi = dev_instance; in bnxt_inta() local
2472 struct bnxt *bp = bnapi->bp; in bnxt_inta()
2473 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_inta()
2493 napi_schedule(&bnapi->napi); in bnxt_inta()
2500 struct bnxt_napi *bnapi = cpr->bnapi; in __bnxt_poll_work() local
2570 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in __bnxt_poll_work()
2580 bnapi->tx_pkts += tx_pkts; in __bnxt_poll_work()
2581 bnapi->events |= event; in __bnxt_poll_work()
2585 static void __bnxt_poll_work_done(struct bnxt *bp, struct bnxt_napi *bnapi, in __bnxt_poll_work_done() argument
2588 if (bnapi->tx_pkts && !bnapi->tx_fault) in __bnxt_poll_work_done()
2589 bnapi->tx_int(bp, bnapi, budget); in __bnxt_poll_work_done()
2591 if ((bnapi->events & BNXT_RX_EVENT) && !(bnapi->in_reset)) { in __bnxt_poll_work_done()
2592 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in __bnxt_poll_work_done()
2596 if (bnapi->events & BNXT_AGG_EVENT) { in __bnxt_poll_work_done()
2597 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in __bnxt_poll_work_done()
2601 bnapi->events = 0; in __bnxt_poll_work_done()
2607 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_poll_work() local
2618 __bnxt_poll_work_done(bp, bnapi, budget); in bnxt_poll_work()
2624 struct bnxt_napi *bnapi = container_of(napi, struct bnxt_napi, napi); in bnxt_poll_nitroa0() local
2625 struct bnxt *bp = bnapi->bp; in bnxt_poll_nitroa0()
2626 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_poll_nitroa0()
2627 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_poll_nitroa0()
2700 struct bnxt_napi *bnapi = container_of(napi, struct bnxt_napi, napi); in bnxt_poll() local
2701 struct bnxt *bp = bnapi->bp; in bnxt_poll()
2702 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_poll()
2736 static int __bnxt_poll_cqs(struct bnxt *bp, struct bnxt_napi *bnapi, int budget) in __bnxt_poll_cqs() argument
2738 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in __bnxt_poll_cqs()
2753 static void __bnxt_poll_cqs_done(struct bnxt *bp, struct bnxt_napi *bnapi, in __bnxt_poll_cqs_done() argument
2756 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in __bnxt_poll_cqs_done()
2770 __bnxt_poll_work_done(bp, bnapi, budget); in __bnxt_poll_cqs_done()
2775 struct bnxt_napi *bnapi = container_of(napi, struct bnxt_napi, napi); in bnxt_poll_p5() local
2776 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_poll_p5()
2779 struct bnxt *bp = bnapi->bp; in bnxt_poll_p5()
2790 work_done = __bnxt_poll_cqs(bp, bnapi, budget); in bnxt_poll_p5()
2800 __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ_ARMALL, in bnxt_poll_p5()
2831 __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ, budget); in bnxt_poll_p5()
3212 pp.napi = &rxr->bnapi->napi; in bnxt_alloc_rx_page_pool()
3343 ring->grp_idx = txr->bnapi->index; in bnxt_alloc_tx_rings()
3401 if (!bp->bnapi) in bnxt_free_all_cp_arrays()
3404 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_free_all_cp_arrays() local
3406 if (!bnapi) in bnxt_free_all_cp_arrays()
3408 bnxt_free_cp_arrays(&bnapi->cp_ring); in bnxt_free_all_cp_arrays()
3417 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_alloc_all_cp_arrays() local
3420 if (!bnapi) in bnxt_alloc_all_cp_arrays()
3422 rc = bnxt_alloc_cp_arrays(&bnapi->cp_ring, n); in bnxt_alloc_all_cp_arrays()
3433 if (!bp->bnapi) in bnxt_free_cp_rings()
3437 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_free_cp_rings() local
3442 if (!bnapi) in bnxt_free_cp_rings()
3445 cpr = &bnapi->cp_ring; in bnxt_free_cp_rings()
3506 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_alloc_cp_rings() local
3510 if (!bnapi) in bnxt_alloc_cp_rings()
3513 cpr = &bnapi->cp_ring; in bnxt_alloc_cp_rings()
3514 cpr->bnapi = bnapi; in bnxt_alloc_cp_rings()
3536 cpr2->bnapi = bnapi; in bnxt_alloc_cp_rings()
3546 cpr2->bnapi = bnapi; in bnxt_alloc_cp_rings()
3557 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_init_ring_struct() local
3564 if (!bnapi) in bnxt_init_ring_struct()
3567 cpr = &bnapi->cp_ring; in bnxt_init_ring_struct()
3576 rxr = bnapi->rx_ring; in bnxt_init_ring_struct()
3599 txr = bnapi->tx_ring; in bnxt_init_ring_struct()
3725 struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring; in bnxt_init_cp_rings()
4251 struct bnxt_napi *bnapi = bp->bnapi[0]; in bnxt_init_stats() local
4260 cpr = &bnapi->cp_ring; in bnxt_init_stats()
4334 if (!bp->bnapi) in bnxt_free_ring_stats()
4338 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_free_ring_stats() local
4339 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_free_ring_stats()
4353 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_alloc_stats() local
4354 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_alloc_stats()
4412 if (!bp->bnapi) in bnxt_clear_ring_indices()
4416 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_clear_ring_indices() local
4421 if (!bnapi) in bnxt_clear_ring_indices()
4424 cpr = &bnapi->cp_ring; in bnxt_clear_ring_indices()
4427 txr = bnapi->tx_ring; in bnxt_clear_ring_indices()
4433 rxr = bnapi->rx_ring; in bnxt_clear_ring_indices()
4514 kfree(bp->bnapi); in bnxt_free_mem()
4515 bp->bnapi = NULL; in bnxt_free_mem()
4524 void *bnapi; in bnxt_alloc_mem() local
4533 bnapi = kzalloc(arr_size + size * bp->cp_nr_rings, GFP_KERNEL); in bnxt_alloc_mem()
4534 if (!bnapi) in bnxt_alloc_mem()
4537 bp->bnapi = bnapi; in bnxt_alloc_mem()
4538 bnapi += arr_size; in bnxt_alloc_mem()
4539 for (i = 0; i < bp->cp_nr_rings; i++, bnapi += size) { in bnxt_alloc_mem()
4540 bp->bnapi[i] = bnapi; in bnxt_alloc_mem()
4541 bp->bnapi[i]->index = i; in bnxt_alloc_mem()
4542 bp->bnapi[i]->bp = bp; in bnxt_alloc_mem()
4545 &bp->bnapi[i]->cp_ring; in bnxt_alloc_mem()
4567 rxr->bnapi = bp->bnapi[i]; in bnxt_alloc_mem()
4568 bp->bnapi[i]->rx_ring = &bp->rx_ring[i]; in bnxt_alloc_mem()
4594 txr->bnapi = bp->bnapi[j]; in bnxt_alloc_mem()
4595 bp->bnapi[j]->tx_ring = txr; in bnxt_alloc_mem()
4599 bp->bnapi[j]->tx_int = bnxt_tx_int; in bnxt_alloc_mem()
4601 bp->bnapi[j]->flags |= BNXT_NAPI_FLAG_XDP; in bnxt_alloc_mem()
4602 bp->bnapi[j]->tx_int = bnxt_tx_int_xdp; in bnxt_alloc_mem()
4654 if (!bp->bnapi) in bnxt_disable_int()
4658 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_disable_int() local
4659 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_disable_int()
4669 struct bnxt_napi *bnapi = bp->bnapi[n]; in bnxt_cp_num_to_irq_num() local
4672 cpr = &bnapi->cp_ring; in bnxt_cp_num_to_irq_num()
4699 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_enable_int() local
4700 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_enable_int()
5155 struct bnxt_napi *bnapi = rxr->bnapi; in bnxt_cp_ring_for_rx() local
5158 cpr = bnapi->cp_ring.cp_ring_arr[BNXT_RX_HDL]; in bnxt_cp_ring_for_rx()
5168 struct bnxt_napi *bnapi = txr->bnapi; in bnxt_cp_ring_for_tx() local
5171 cpr = bnapi->cp_ring.cp_ring_arr[BNXT_TX_HDL]; in bnxt_cp_ring_for_tx()
5511 grp_idx = bp->rx_ring[ring].bnapi->index; in bnxt_hwrm_vnic_cfg()
5573 grp_idx = bp->rx_ring[i].bnapi->index; in bnxt_hwrm_vnic_alloc()
5660 unsigned int grp_idx = bp->rx_ring[i].bnapi->index; in bnxt_hwrm_ring_grp_alloc()
5902 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_ring_alloc() local
5903 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_ring_alloc()
5934 struct bnxt_napi *bnapi = txr->bnapi; in bnxt_hwrm_ring_alloc() local
5938 cpr = &bnapi->cp_ring; in bnxt_hwrm_ring_alloc()
5942 map_idx = bnapi->index; in bnxt_hwrm_ring_alloc()
5962 struct bnxt_napi *bnapi = rxr->bnapi; in bnxt_hwrm_ring_alloc() local
5963 u32 map_idx = bnapi->index; in bnxt_hwrm_ring_alloc()
5974 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_ring_alloc()
6052 if (!bp->bnapi) in bnxt_hwrm_ring_free()
6073 u32 grp_idx = rxr->bnapi->index; in bnxt_hwrm_ring_free()
6095 u32 grp_idx = rxr->bnapi->index; in bnxt_hwrm_ring_free()
6120 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_ring_free() local
6121 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_ring_free()
6747 static int __bnxt_hwrm_set_coal_nq(struct bnxt *bp, struct bnxt_napi *bnapi, in __bnxt_hwrm_set_coal_nq() argument
6751 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in __bnxt_hwrm_set_coal_nq()
6775 int bnxt_hwrm_set_ring_coal(struct bnxt *bp, struct bnxt_napi *bnapi) in bnxt_hwrm_set_ring_coal() argument
6778 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_set_ring_coal()
6790 if (!bnapi->rx_ring) in bnxt_hwrm_set_ring_coal()
6799 req_rx->ring_id = cpu_to_le16(bnxt_cp_ring_for_rx(bp, bnapi->rx_ring)); in bnxt_hwrm_set_ring_coal()
6826 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_set_coal() local
6831 if (!bnapi->rx_ring) { in bnxt_hwrm_set_coal()
6832 ring_id = bnxt_cp_ring_for_tx(bp, bnapi->tx_ring); in bnxt_hwrm_set_coal()
6835 ring_id = bnxt_cp_ring_for_rx(bp, bnapi->rx_ring); in bnxt_hwrm_set_coal()
6846 if (bnapi->rx_ring && bnapi->tx_ring) { in bnxt_hwrm_set_coal()
6848 ring_id = bnxt_cp_ring_for_tx(bp, bnapi->tx_ring); in bnxt_hwrm_set_coal()
6854 if (bnapi->rx_ring) in bnxt_hwrm_set_coal()
6858 __bnxt_hwrm_set_coal_nq(bp, bnapi, hw_coal); in bnxt_hwrm_set_coal()
6871 if (!bp->bnapi) in bnxt_hwrm_stat_ctx_free()
6888 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_stat_ctx_free() local
6889 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_stat_ctx_free()
6925 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_stat_ctx_alloc() local
6926 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_stat_ctx_alloc()
8356 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_accumulate_all_stats() local
8360 cpr = &bnapi->cp_ring; in bnxt_accumulate_all_stats()
9283 if (!bp->irq_tbl || !bp->bnapi) in bnxt_free_irq()
9296 free_irq(irq->vector, bp->bnapi[i]); in bnxt_free_irq()
9328 if (rmap && bp->bnapi[i]->rx_ring) { in bnxt_request_irq()
9337 bp->bnapi[i]); in bnxt_request_irq()
9365 if (!bp->bnapi) in bnxt_del_napi()
9369 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_del_napi() local
9371 __netif_napi_del(&bnapi->napi); in bnxt_del_napi()
9383 struct bnxt_napi *bnapi; in bnxt_init_napi() local
9393 bnapi = bp->bnapi[i]; in bnxt_init_napi()
9394 netif_napi_add(bp->dev, &bnapi->napi, poll_fn); in bnxt_init_napi()
9397 bnapi = bp->bnapi[cp_nr_rings]; in bnxt_init_napi()
9398 netif_napi_add(bp->dev, &bnapi->napi, in bnxt_init_napi()
9402 bnapi = bp->bnapi[0]; in bnxt_init_napi()
9403 netif_napi_add(bp->dev, &bnapi->napi, bnxt_poll); in bnxt_init_napi()
9411 if (!bp->bnapi || in bnxt_disable_napi()
9416 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_disable_napi() local
9419 cpr = &bnapi->cp_ring; in bnxt_disable_napi()
9420 if (bnapi->tx_fault) in bnxt_disable_napi()
9422 if (bnapi->in_reset) in bnxt_disable_napi()
9424 napi_disable(&bnapi->napi); in bnxt_disable_napi()
9425 if (bnapi->rx_ring) in bnxt_disable_napi()
9436 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_enable_napi() local
9439 bnapi->tx_fault = 0; in bnxt_enable_napi()
9441 cpr = &bnapi->cp_ring; in bnxt_enable_napi()
9442 bnapi->in_reset = false; in bnxt_enable_napi()
9444 bnapi->tx_pkts = 0; in bnxt_enable_napi()
9446 if (bnapi->rx_ring) { in bnxt_enable_napi()
9450 napi_enable(&bnapi->napi); in bnxt_enable_napi()
10713 if (bp->bnapi && irq_re_init) { in __bnxt_close_nic()
10874 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_get_ring_stats() local
10875 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_get_ring_stats()
10992 bnxt_get_one_ring_err_stats(bp, stats, &bp->bnapi[i]->cp_ring); in bnxt_get_ring_err_stats()
11552 static void bnxt_dump_tx_sw_state(struct bnxt_napi *bnapi) in bnxt_dump_tx_sw_state() argument
11554 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in bnxt_dump_tx_sw_state()
11555 int i = bnapi->index; in bnxt_dump_tx_sw_state()
11560 netdev_info(bnapi->bp->dev, "[%d]: tx{fw_ring: %d prod: %x cons: %x}\n", in bnxt_dump_tx_sw_state()
11565 static void bnxt_dump_rx_sw_state(struct bnxt_napi *bnapi) in bnxt_dump_rx_sw_state() argument
11567 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_dump_rx_sw_state()
11568 int i = bnapi->index; in bnxt_dump_rx_sw_state()
11573 …netdev_info(bnapi->bp->dev, "[%d]: rx{fw_ring: %d prod: %x} rx_agg{fw_ring: %d agg_prod: %x sw_agg… in bnxt_dump_rx_sw_state()
11579 static void bnxt_dump_cp_sw_state(struct bnxt_napi *bnapi) in bnxt_dump_cp_sw_state() argument
11581 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_dump_cp_sw_state()
11582 int i = bnapi->index; in bnxt_dump_cp_sw_state()
11584 netdev_info(bnapi->bp->dev, "[%d]: cp{fw_ring: %d raw_cons: %x}\n", in bnxt_dump_cp_sw_state()
11591 struct bnxt_napi *bnapi; in bnxt_dbg_dump_states() local
11594 bnapi = bp->bnapi[i]; in bnxt_dbg_dump_states()
11596 bnxt_dump_tx_sw_state(bnapi); in bnxt_dbg_dump_states()
11597 bnxt_dump_rx_sw_state(bnapi); in bnxt_dbg_dump_states()
11598 bnxt_dump_cp_sw_state(bnapi); in bnxt_dbg_dump_states()
11607 struct bnxt_napi *bnapi = rxr->bnapi; in bnxt_hwrm_rx_ring_reset() local
11616 cpr = &bnapi->cp_ring; in bnxt_hwrm_rx_ring_reset()
11620 req->ring_id = cpu_to_le16(bp->grp_info[bnapi->index].fw_grp_id); in bnxt_hwrm_rx_ring_reset()
11777 if (!rxr->bnapi->in_reset) in bnxt_rx_ring_reset()
11795 rxr->bnapi->in_reset = false; in bnxt_rx_ring_reset()
11797 cpr = &rxr->bnapi->cp_ring; in bnxt_rx_ring_reset()
11983 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_chk_missed_irq() local
11988 if (!bnapi) in bnxt_chk_missed_irq()
11991 cpr = &bnapi->cp_ring; in bnxt_chk_missed_irq()