Lines Matching refs:bnapi

619 static void bnxt_tx_int(struct bnxt *bp, struct bnxt_napi *bnapi, int nr_pkts)  in bnxt_tx_int()  argument
621 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in bnxt_tx_int()
869 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_reuse_rx_agg_bufs() local
870 struct bnxt *bp = bnapi->bp; in bnxt_reuse_rx_agg_bufs()
871 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_reuse_rx_agg_bufs()
950 skb = napi_alloc_skb(&rxr->bnapi->napi, payload); in bnxt_rx_page_skb()
1004 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_rx_pages() local
1006 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_rx_pages()
1089 static inline struct sk_buff *bnxt_copy_skb(struct bnxt_napi *bnapi, u8 *data, in bnxt_copy_skb() argument
1093 struct bnxt *bp = bnapi->bp; in bnxt_copy_skb()
1097 skb = napi_alloc_skb(&bnapi->napi, len); in bnxt_copy_skb()
1165 if (!rxr->bnapi->in_reset) { in bnxt_sched_reset()
1166 rxr->bnapi->in_reset = true; in bnxt_sched_reset()
1506 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_tpa_end() local
1507 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_tpa_end()
1517 if (unlikely(bnapi->in_reset)) { in bnxt_tpa_end()
1569 skb = bnxt_copy_skb(bnapi, data_ptr, len, mapping); in bnxt_tpa_end()
1650 static void bnxt_deliver_skb(struct bnxt *bp, struct bnxt_napi *bnapi, in bnxt_deliver_skb() argument
1658 skb_record_rx_queue(skb, bnapi->index); in bnxt_deliver_skb()
1659 napi_gro_receive(&bnapi->napi, skb); in bnxt_deliver_skb()
1672 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_rx_pkt() local
1673 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_rx_pkt()
1725 bnxt_deliver_skb(bp, bnapi, skb); in bnxt_rx_pkt()
1771 bnapi->cp_ring.sw_stats.rx.rx_buf_errors++; in bnxt_rx_pkt()
1791 skb = bnxt_copy_skb(bnapi, data_ptr, len, dma_addr); in bnxt_rx_pkt()
1855 bnapi->cp_ring.sw_stats.rx.rx_l4_csum_errors++; in bnxt_rx_pkt()
1859 bnxt_deliver_skb(bp, bnapi, skb); in bnxt_rx_pkt()
1947 u16 grp_idx = bp->rx_ring[i].bnapi->index; in bnxt_agg_ring_id_to_grp_idx()
2093 rxr = bp->bnapi[grp_idx]->rx_ring; in bnxt_async_event_process()
2150 struct bnxt_napi *bnapi = dev_instance; in bnxt_msix() local
2151 struct bnxt *bp = bnapi->bp; in bnxt_msix()
2152 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_msix()
2157 napi_schedule(&bnapi->napi); in bnxt_msix()
2174 struct bnxt_napi *bnapi = dev_instance; in bnxt_inta() local
2175 struct bnxt *bp = bnapi->bp; in bnxt_inta()
2176 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_inta()
2196 napi_schedule(&bnapi->napi); in bnxt_inta()
2203 struct bnxt_napi *bnapi = cpr->bnapi; in __bnxt_poll_work() local
2273 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in __bnxt_poll_work()
2283 bnapi->tx_pkts += tx_pkts; in __bnxt_poll_work()
2284 bnapi->events |= event; in __bnxt_poll_work()
2288 static void __bnxt_poll_work_done(struct bnxt *bp, struct bnxt_napi *bnapi) in __bnxt_poll_work_done() argument
2290 if (bnapi->tx_pkts) { in __bnxt_poll_work_done()
2291 bnapi->tx_int(bp, bnapi, bnapi->tx_pkts); in __bnxt_poll_work_done()
2292 bnapi->tx_pkts = 0; in __bnxt_poll_work_done()
2295 if ((bnapi->events & BNXT_RX_EVENT) && !(bnapi->in_reset)) { in __bnxt_poll_work_done()
2296 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in __bnxt_poll_work_done()
2298 if (bnapi->events & BNXT_AGG_EVENT) in __bnxt_poll_work_done()
2302 bnapi->events = 0; in __bnxt_poll_work_done()
2308 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_poll_work() local
2319 __bnxt_poll_work_done(bp, bnapi); in bnxt_poll_work()
2325 struct bnxt_napi *bnapi = container_of(napi, struct bnxt_napi, napi); in bnxt_poll_nitroa0() local
2326 struct bnxt *bp = bnapi->bp; in bnxt_poll_nitroa0()
2327 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_poll_nitroa0()
2328 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_poll_nitroa0()
2392 struct bnxt_napi *bnapi = container_of(napi, struct bnxt_napi, napi); in bnxt_poll() local
2393 struct bnxt *bp = bnapi->bp; in bnxt_poll()
2394 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_poll()
2424 static int __bnxt_poll_cqs(struct bnxt *bp, struct bnxt_napi *bnapi, int budget) in __bnxt_poll_cqs() argument
2426 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in __bnxt_poll_cqs()
2441 static void __bnxt_poll_cqs_done(struct bnxt *bp, struct bnxt_napi *bnapi, in __bnxt_poll_cqs_done() argument
2444 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in __bnxt_poll_cqs_done()
2458 __bnxt_poll_work_done(bp, bnapi); in __bnxt_poll_cqs_done()
2463 struct bnxt_napi *bnapi = container_of(napi, struct bnxt_napi, napi); in bnxt_poll_p5() local
2464 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_poll_p5()
2466 struct bnxt *bp = bnapi->bp; in bnxt_poll_p5()
2473 work_done = __bnxt_poll_cqs(bp, bnapi, budget); in bnxt_poll_p5()
2483 __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ_ARMALL); in bnxt_poll_p5()
2509 __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ); in bnxt_poll_p5()
2980 ring->grp_idx = txr->bnapi->index; in bnxt_alloc_tx_rings()
3013 if (!bp->bnapi) in bnxt_free_cp_rings()
3017 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_free_cp_rings() local
3022 if (!bnapi) in bnxt_free_cp_rings()
3025 cpr = &bnapi->cp_ring; in bnxt_free_cp_rings()
3078 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_alloc_cp_rings() local
3082 if (!bnapi) in bnxt_alloc_cp_rings()
3085 cpr = &bnapi->cp_ring; in bnxt_alloc_cp_rings()
3086 cpr->bnapi = bnapi; in bnxt_alloc_cp_rings()
3108 cpr2->bnapi = bnapi; in bnxt_alloc_cp_rings()
3118 cpr2->bnapi = bnapi; in bnxt_alloc_cp_rings()
3129 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_init_ring_struct() local
3136 if (!bnapi) in bnxt_init_ring_struct()
3139 cpr = &bnapi->cp_ring; in bnxt_init_ring_struct()
3148 rxr = bnapi->rx_ring; in bnxt_init_ring_struct()
3171 txr = bnapi->tx_ring; in bnxt_init_ring_struct()
3297 struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring; in bnxt_init_cp_rings()
3849 struct bnxt_napi *bnapi = bp->bnapi[0]; in bnxt_init_stats() local
3858 cpr = &bnapi->cp_ring; in bnxt_init_stats()
3932 if (!bp->bnapi) in bnxt_free_ring_stats()
3936 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_free_ring_stats() local
3937 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_free_ring_stats()
3951 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_alloc_stats() local
3952 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_alloc_stats()
4010 if (!bp->bnapi) in bnxt_clear_ring_indices()
4014 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_clear_ring_indices() local
4019 if (!bnapi) in bnxt_clear_ring_indices()
4022 cpr = &bnapi->cp_ring; in bnxt_clear_ring_indices()
4025 txr = bnapi->tx_ring; in bnxt_clear_ring_indices()
4031 rxr = bnapi->rx_ring; in bnxt_clear_ring_indices()
4113 kfree(bp->bnapi); in bnxt_free_mem()
4114 bp->bnapi = NULL; in bnxt_free_mem()
4123 void *bnapi; in bnxt_alloc_mem() local
4132 bnapi = kzalloc(arr_size + size * bp->cp_nr_rings, GFP_KERNEL); in bnxt_alloc_mem()
4133 if (!bnapi) in bnxt_alloc_mem()
4136 bp->bnapi = bnapi; in bnxt_alloc_mem()
4137 bnapi += arr_size; in bnxt_alloc_mem()
4138 for (i = 0; i < bp->cp_nr_rings; i++, bnapi += size) { in bnxt_alloc_mem()
4139 bp->bnapi[i] = bnapi; in bnxt_alloc_mem()
4140 bp->bnapi[i]->index = i; in bnxt_alloc_mem()
4141 bp->bnapi[i]->bp = bp; in bnxt_alloc_mem()
4144 &bp->bnapi[i]->cp_ring; in bnxt_alloc_mem()
4166 rxr->bnapi = bp->bnapi[i]; in bnxt_alloc_mem()
4167 bp->bnapi[i]->rx_ring = &bp->rx_ring[i]; in bnxt_alloc_mem()
4193 txr->bnapi = bp->bnapi[j]; in bnxt_alloc_mem()
4194 bp->bnapi[j]->tx_ring = txr; in bnxt_alloc_mem()
4198 bp->bnapi[j]->tx_int = bnxt_tx_int; in bnxt_alloc_mem()
4200 bp->bnapi[j]->flags |= BNXT_NAPI_FLAG_XDP; in bnxt_alloc_mem()
4201 bp->bnapi[j]->tx_int = bnxt_tx_int_xdp; in bnxt_alloc_mem()
4249 if (!bp->bnapi) in bnxt_disable_int()
4253 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_disable_int() local
4254 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_disable_int()
4264 struct bnxt_napi *bnapi = bp->bnapi[n]; in bnxt_cp_num_to_irq_num() local
4267 cpr = &bnapi->cp_ring; in bnxt_cp_num_to_irq_num()
4291 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_enable_int() local
4292 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_enable_int()
4978 struct bnxt_napi *bnapi = rxr->bnapi; in bnxt_cp_ring_for_rx() local
4981 cpr = bnapi->cp_ring.cp_ring_arr[BNXT_RX_HDL]; in bnxt_cp_ring_for_rx()
4991 struct bnxt_napi *bnapi = txr->bnapi; in bnxt_cp_ring_for_tx() local
4994 cpr = bnapi->cp_ring.cp_ring_arr[BNXT_TX_HDL]; in bnxt_cp_ring_for_tx()
5285 grp_idx = bp->rx_ring[ring].bnapi->index; in bnxt_hwrm_vnic_cfg()
5341 grp_idx = bp->rx_ring[i].bnapi->index; in bnxt_hwrm_vnic_alloc()
5422 unsigned int grp_idx = bp->rx_ring[i].bnapi->index; in bnxt_hwrm_ring_grp_alloc()
5657 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_ring_alloc() local
5658 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_ring_alloc()
5689 struct bnxt_napi *bnapi = txr->bnapi; in bnxt_hwrm_ring_alloc() local
5693 cpr = &bnapi->cp_ring; in bnxt_hwrm_ring_alloc()
5697 map_idx = bnapi->index; in bnxt_hwrm_ring_alloc()
5717 struct bnxt_napi *bnapi = rxr->bnapi; in bnxt_hwrm_ring_alloc() local
5718 u32 map_idx = bnapi->index; in bnxt_hwrm_ring_alloc()
5729 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_ring_alloc()
5803 if (!bp->bnapi) in bnxt_hwrm_ring_free()
5824 u32 grp_idx = rxr->bnapi->index; in bnxt_hwrm_ring_free()
5846 u32 grp_idx = rxr->bnapi->index; in bnxt_hwrm_ring_free()
5871 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_ring_free() local
5872 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_ring_free()
6481 static int __bnxt_hwrm_set_coal_nq(struct bnxt *bp, struct bnxt_napi *bnapi, in __bnxt_hwrm_set_coal_nq() argument
6485 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in __bnxt_hwrm_set_coal_nq()
6506 int bnxt_hwrm_set_ring_coal(struct bnxt *bp, struct bnxt_napi *bnapi) in bnxt_hwrm_set_ring_coal() argument
6509 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_set_ring_coal()
6520 if (!bnapi->rx_ring) in bnxt_hwrm_set_ring_coal()
6528 req_rx.ring_id = cpu_to_le16(bnxt_cp_ring_for_rx(bp, bnapi->rx_ring)); in bnxt_hwrm_set_ring_coal()
6550 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_set_coal() local
6555 if (!bnapi->rx_ring) { in bnxt_hwrm_set_coal()
6556 ring_id = bnxt_cp_ring_for_tx(bp, bnapi->tx_ring); in bnxt_hwrm_set_coal()
6559 ring_id = bnxt_cp_ring_for_rx(bp, bnapi->rx_ring); in bnxt_hwrm_set_coal()
6571 if (bnapi->rx_ring && bnapi->tx_ring) { in bnxt_hwrm_set_coal()
6573 ring_id = bnxt_cp_ring_for_tx(bp, bnapi->tx_ring); in bnxt_hwrm_set_coal()
6580 if (bnapi->rx_ring) in bnxt_hwrm_set_coal()
6584 __bnxt_hwrm_set_coal_nq(bp, bnapi, hw_coal); in bnxt_hwrm_set_coal()
6596 if (!bp->bnapi) in bnxt_hwrm_stat_ctx_free()
6607 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_stat_ctx_free() local
6608 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_stat_ctx_free()
6642 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_stat_ctx_alloc() local
6643 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_stat_ctx_alloc()
7806 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_accumulate_all_stats() local
7810 cpr = &bnapi->cp_ring; in bnxt_accumulate_all_stats()
8683 if (!bp->irq_tbl || !bp->bnapi) in bnxt_free_irq()
8696 free_irq(irq->vector, bp->bnapi[i]); in bnxt_free_irq()
8728 if (rmap && bp->bnapi[i]->rx_ring) { in bnxt_request_irq()
8737 bp->bnapi[i]); in bnxt_request_irq()
8765 if (!bp->bnapi) in bnxt_del_napi()
8769 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_del_napi() local
8771 __netif_napi_del(&bnapi->napi); in bnxt_del_napi()
8783 struct bnxt_napi *bnapi; in bnxt_init_napi() local
8793 bnapi = bp->bnapi[i]; in bnxt_init_napi()
8794 netif_napi_add(bp->dev, &bnapi->napi, poll_fn, 64); in bnxt_init_napi()
8797 bnapi = bp->bnapi[cp_nr_rings]; in bnxt_init_napi()
8798 netif_napi_add(bp->dev, &bnapi->napi, in bnxt_init_napi()
8802 bnapi = bp->bnapi[0]; in bnxt_init_napi()
8803 netif_napi_add(bp->dev, &bnapi->napi, bnxt_poll, 64); in bnxt_init_napi()
8811 if (!bp->bnapi) in bnxt_disable_napi()
8815 struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring; in bnxt_disable_napi()
8817 if (bp->bnapi[i]->rx_ring) in bnxt_disable_napi()
8820 napi_disable(&bp->bnapi[i]->napi); in bnxt_disable_napi()
8829 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_enable_napi() local
8832 cpr = &bnapi->cp_ring; in bnxt_enable_napi()
8833 if (bnapi->in_reset) in bnxt_enable_napi()
8835 bnapi->in_reset = false; in bnxt_enable_napi()
8837 if (bnapi->rx_ring) { in bnxt_enable_napi()
8841 napi_enable(&bnapi->napi); in bnxt_enable_napi()
9908 if (bp->bnapi && irq_re_init) in __bnxt_close_nic()
10053 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_get_ring_stats() local
10054 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_get_ring_stats()
10533 static void bnxt_dump_tx_sw_state(struct bnxt_napi *bnapi) in bnxt_dump_tx_sw_state() argument
10535 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in bnxt_dump_tx_sw_state()
10536 int i = bnapi->index; in bnxt_dump_tx_sw_state()
10541 netdev_info(bnapi->bp->dev, "[%d]: tx{fw_ring: %d prod: %x cons: %x}\n", in bnxt_dump_tx_sw_state()
10546 static void bnxt_dump_rx_sw_state(struct bnxt_napi *bnapi) in bnxt_dump_rx_sw_state() argument
10548 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_dump_rx_sw_state()
10549 int i = bnapi->index; in bnxt_dump_rx_sw_state()
10554 …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()
10560 static void bnxt_dump_cp_sw_state(struct bnxt_napi *bnapi) in bnxt_dump_cp_sw_state() argument
10562 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_dump_cp_sw_state()
10563 int i = bnapi->index; in bnxt_dump_cp_sw_state()
10565 netdev_info(bnapi->bp->dev, "[%d]: cp{fw_ring: %d raw_cons: %x}\n", in bnxt_dump_cp_sw_state()
10572 struct bnxt_napi *bnapi; in bnxt_dbg_dump_states() local
10575 bnapi = bp->bnapi[i]; in bnxt_dbg_dump_states()
10577 bnxt_dump_tx_sw_state(bnapi); in bnxt_dbg_dump_states()
10578 bnxt_dump_rx_sw_state(bnapi); in bnxt_dbg_dump_states()
10579 bnxt_dump_cp_sw_state(bnapi); in bnxt_dbg_dump_states()
10588 struct bnxt_napi *bnapi = rxr->bnapi; in bnxt_hwrm_rx_ring_reset() local
10592 cpr = &bnapi->cp_ring; in bnxt_hwrm_rx_ring_reset()
10596 req.ring_id = cpu_to_le16(bp->grp_info[bnapi->index].fw_grp_id); in bnxt_hwrm_rx_ring_reset()
10754 if (!rxr->bnapi->in_reset) in bnxt_rx_ring_reset()
10772 rxr->bnapi->in_reset = false; in bnxt_rx_ring_reset()
10774 cpr = &rxr->bnapi->cp_ring; in bnxt_rx_ring_reset()
10933 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_chk_missed_irq() local
10938 if (!bnapi) in bnxt_chk_missed_irq()
10941 cpr = &bnapi->cp_ring; in bnxt_chk_missed_irq()