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()
949 skb = napi_alloc_skb(&rxr->bnapi->napi, payload); in bnxt_rx_page_skb()
1003 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_rx_pages() local
1005 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_rx_pages()
1088 static inline struct sk_buff *bnxt_copy_skb(struct bnxt_napi *bnapi, u8 *data, in bnxt_copy_skb() argument
1092 struct bnxt *bp = bnapi->bp; in bnxt_copy_skb()
1096 skb = napi_alloc_skb(&bnapi->napi, len); in bnxt_copy_skb()
1169 if (!rxr->bnapi->in_reset) { in bnxt_sched_reset()
1170 rxr->bnapi->in_reset = true; in bnxt_sched_reset()
1507 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_tpa_end() local
1508 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_tpa_end()
1518 if (unlikely(bnapi->in_reset)) { in bnxt_tpa_end()
1570 skb = bnxt_copy_skb(bnapi, data_ptr, len, mapping); in bnxt_tpa_end()
1651 static void bnxt_deliver_skb(struct bnxt *bp, struct bnxt_napi *bnapi, in bnxt_deliver_skb() argument
1659 skb_record_rx_queue(skb, bnapi->index); in bnxt_deliver_skb()
1660 napi_gro_receive(&bnapi->napi, skb); in bnxt_deliver_skb()
1673 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_rx_pkt() local
1674 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_rx_pkt()
1726 bnxt_deliver_skb(bp, bnapi, skb); in bnxt_rx_pkt()
1785 skb = bnxt_copy_skb(bnapi, data_ptr, len, dma_addr); in bnxt_rx_pkt()
1849 bnapi->cp_ring.rx_l4_csum_errors++; in bnxt_rx_pkt()
1853 bnxt_deliver_skb(bp, bnapi, skb); in bnxt_rx_pkt()
2093 struct bnxt_napi *bnapi = dev_instance; in bnxt_msix() local
2094 struct bnxt *bp = bnapi->bp; in bnxt_msix()
2095 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_msix()
2100 napi_schedule(&bnapi->napi); in bnxt_msix()
2117 struct bnxt_napi *bnapi = dev_instance; in bnxt_inta() local
2118 struct bnxt *bp = bnapi->bp; in bnxt_inta()
2119 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_inta()
2139 napi_schedule(&bnapi->napi); in bnxt_inta()
2146 struct bnxt_napi *bnapi = cpr->bnapi; in __bnxt_poll_work() local
2216 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in __bnxt_poll_work()
2226 bnapi->tx_pkts += tx_pkts; in __bnxt_poll_work()
2227 bnapi->events |= event; in __bnxt_poll_work()
2231 static void __bnxt_poll_work_done(struct bnxt *bp, struct bnxt_napi *bnapi) in __bnxt_poll_work_done() argument
2233 if (bnapi->tx_pkts) { in __bnxt_poll_work_done()
2234 bnapi->tx_int(bp, bnapi, bnapi->tx_pkts); in __bnxt_poll_work_done()
2235 bnapi->tx_pkts = 0; in __bnxt_poll_work_done()
2238 if (bnapi->events & BNXT_RX_EVENT) { in __bnxt_poll_work_done()
2239 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in __bnxt_poll_work_done()
2241 if (bnapi->events & BNXT_AGG_EVENT) in __bnxt_poll_work_done()
2245 bnapi->events = 0; in __bnxt_poll_work_done()
2251 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_poll_work() local
2262 __bnxt_poll_work_done(bp, bnapi); in bnxt_poll_work()
2268 struct bnxt_napi *bnapi = container_of(napi, struct bnxt_napi, napi); in bnxt_poll_nitroa0() local
2269 struct bnxt *bp = bnapi->bp; in bnxt_poll_nitroa0()
2270 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_poll_nitroa0()
2271 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_poll_nitroa0()
2335 struct bnxt_napi *bnapi = container_of(napi, struct bnxt_napi, napi); in bnxt_poll() local
2336 struct bnxt *bp = bnapi->bp; in bnxt_poll()
2337 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_poll()
2367 static int __bnxt_poll_cqs(struct bnxt *bp, struct bnxt_napi *bnapi, int budget) in __bnxt_poll_cqs() argument
2369 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in __bnxt_poll_cqs()
2384 static void __bnxt_poll_cqs_done(struct bnxt *bp, struct bnxt_napi *bnapi, in __bnxt_poll_cqs_done() argument
2387 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in __bnxt_poll_cqs_done()
2401 __bnxt_poll_work_done(bp, bnapi); in __bnxt_poll_cqs_done()
2406 struct bnxt_napi *bnapi = container_of(napi, struct bnxt_napi, napi); in bnxt_poll_p5() local
2407 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_poll_p5()
2409 struct bnxt *bp = bnapi->bp; in bnxt_poll_p5()
2416 work_done = __bnxt_poll_cqs(bp, bnapi, budget); in bnxt_poll_p5()
2418 __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ, false); in bnxt_poll_p5()
2421 __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ_ARMALL, true); in bnxt_poll_p5()
2431 __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ_ARMALL, in bnxt_poll_p5()
2460 __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ, true); in bnxt_poll_p5()
2927 ring->grp_idx = txr->bnapi->index; in bnxt_alloc_tx_rings()
2960 if (!bp->bnapi) in bnxt_free_cp_rings()
2964 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_free_cp_rings() local
2969 if (!bnapi) in bnxt_free_cp_rings()
2972 cpr = &bnapi->cp_ring; in bnxt_free_cp_rings()
3025 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_alloc_cp_rings() local
3029 if (!bnapi) in bnxt_alloc_cp_rings()
3032 cpr = &bnapi->cp_ring; in bnxt_alloc_cp_rings()
3033 cpr->bnapi = bnapi; in bnxt_alloc_cp_rings()
3055 cpr2->bnapi = bnapi; in bnxt_alloc_cp_rings()
3065 cpr2->bnapi = bnapi; in bnxt_alloc_cp_rings()
3076 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_init_ring_struct() local
3083 if (!bnapi) in bnxt_init_ring_struct()
3086 cpr = &bnapi->cp_ring; in bnxt_init_ring_struct()
3095 rxr = bnapi->rx_ring; in bnxt_init_ring_struct()
3118 txr = bnapi->tx_ring; in bnxt_init_ring_struct()
3245 struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring; in bnxt_init_cp_rings()
3739 if (!bp->bnapi) in bnxt_free_ring_stats()
3745 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_free_ring_stats() local
3746 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_free_ring_stats()
3764 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_alloc_stats() local
3765 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_alloc_stats()
3845 if (!bp->bnapi) in bnxt_clear_ring_indices()
3849 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_clear_ring_indices() local
3854 if (!bnapi) in bnxt_clear_ring_indices()
3857 cpr = &bnapi->cp_ring; in bnxt_clear_ring_indices()
3860 txr = bnapi->tx_ring; in bnxt_clear_ring_indices()
3866 rxr = bnapi->rx_ring; in bnxt_clear_ring_indices()
3945 kfree(bp->bnapi); in bnxt_free_mem()
3946 bp->bnapi = NULL; in bnxt_free_mem()
3955 void *bnapi; in bnxt_alloc_mem() local
3964 bnapi = kzalloc(arr_size + size * bp->cp_nr_rings, GFP_KERNEL); in bnxt_alloc_mem()
3965 if (!bnapi) in bnxt_alloc_mem()
3968 bp->bnapi = bnapi; in bnxt_alloc_mem()
3969 bnapi += arr_size; in bnxt_alloc_mem()
3970 for (i = 0; i < bp->cp_nr_rings; i++, bnapi += size) { in bnxt_alloc_mem()
3971 bp->bnapi[i] = bnapi; in bnxt_alloc_mem()
3972 bp->bnapi[i]->index = i; in bnxt_alloc_mem()
3973 bp->bnapi[i]->bp = bp; in bnxt_alloc_mem()
3976 &bp->bnapi[i]->cp_ring; in bnxt_alloc_mem()
3998 rxr->bnapi = bp->bnapi[i]; in bnxt_alloc_mem()
3999 bp->bnapi[i]->rx_ring = &bp->rx_ring[i]; in bnxt_alloc_mem()
4025 txr->bnapi = bp->bnapi[j]; in bnxt_alloc_mem()
4026 bp->bnapi[j]->tx_ring = txr; in bnxt_alloc_mem()
4030 bp->bnapi[j]->tx_int = bnxt_tx_int; in bnxt_alloc_mem()
4032 bp->bnapi[j]->flags |= BNXT_NAPI_FLAG_XDP; in bnxt_alloc_mem()
4033 bp->bnapi[j]->tx_int = bnxt_tx_int_xdp; in bnxt_alloc_mem()
4080 if (!bp->bnapi) in bnxt_disable_int()
4084 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_disable_int() local
4085 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_disable_int()
4095 struct bnxt_napi *bnapi = bp->bnapi[n]; in bnxt_cp_num_to_irq_num() local
4098 cpr = &bnapi->cp_ring; in bnxt_cp_num_to_irq_num()
4122 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_enable_int() local
4123 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_enable_int()
4799 struct bnxt_napi *bnapi = rxr->bnapi; in bnxt_cp_ring_for_rx() local
4802 cpr = bnapi->cp_ring.cp_ring_arr[BNXT_RX_HDL]; in bnxt_cp_ring_for_rx()
4812 struct bnxt_napi *bnapi = txr->bnapi; in bnxt_cp_ring_for_tx() local
4815 cpr = bnapi->cp_ring.cp_ring_arr[BNXT_TX_HDL]; in bnxt_cp_ring_for_tx()
5031 grp_idx = bp->rx_ring[ring].bnapi->index; in bnxt_hwrm_vnic_cfg()
5091 grp_idx = bp->rx_ring[i].bnapi->index; in bnxt_hwrm_vnic_alloc()
5161 unsigned int grp_idx = bp->rx_ring[i].bnapi->index; in bnxt_hwrm_ring_grp_alloc()
5399 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_ring_alloc() local
5400 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_ring_alloc()
5431 struct bnxt_napi *bnapi = txr->bnapi; in bnxt_hwrm_ring_alloc() local
5435 cpr = &bnapi->cp_ring; in bnxt_hwrm_ring_alloc()
5439 map_idx = bnapi->index; in bnxt_hwrm_ring_alloc()
5459 struct bnxt_napi *bnapi = rxr->bnapi; in bnxt_hwrm_ring_alloc() local
5460 u32 map_idx = bnapi->index; in bnxt_hwrm_ring_alloc()
5471 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_ring_alloc()
5545 if (!bp->bnapi) in bnxt_hwrm_ring_free()
5566 u32 grp_idx = rxr->bnapi->index; in bnxt_hwrm_ring_free()
5588 u32 grp_idx = rxr->bnapi->index; in bnxt_hwrm_ring_free()
5613 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_ring_free() local
5614 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_ring_free()
6188 static int __bnxt_hwrm_set_coal_nq(struct bnxt *bp, struct bnxt_napi *bnapi, in __bnxt_hwrm_set_coal_nq() argument
6192 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in __bnxt_hwrm_set_coal_nq()
6213 int bnxt_hwrm_set_ring_coal(struct bnxt *bp, struct bnxt_napi *bnapi) in bnxt_hwrm_set_ring_coal() argument
6216 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_set_ring_coal()
6227 if (!bnapi->rx_ring) in bnxt_hwrm_set_ring_coal()
6235 req_rx.ring_id = cpu_to_le16(bnxt_cp_ring_for_rx(bp, bnapi->rx_ring)); in bnxt_hwrm_set_ring_coal()
6257 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_set_coal() local
6262 if (!bnapi->rx_ring) { in bnxt_hwrm_set_coal()
6263 ring_id = bnxt_cp_ring_for_tx(bp, bnapi->tx_ring); in bnxt_hwrm_set_coal()
6266 ring_id = bnxt_cp_ring_for_rx(bp, bnapi->rx_ring); in bnxt_hwrm_set_coal()
6278 if (bnapi->rx_ring && bnapi->tx_ring) { in bnxt_hwrm_set_coal()
6280 ring_id = bnxt_cp_ring_for_tx(bp, bnapi->tx_ring); in bnxt_hwrm_set_coal()
6287 if (bnapi->rx_ring) in bnxt_hwrm_set_coal()
6291 __bnxt_hwrm_set_coal_nq(bp, bnapi, hw_coal); in bnxt_hwrm_set_coal()
6302 if (!bp->bnapi) in bnxt_hwrm_stat_ctx_free()
6312 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_stat_ctx_free() local
6313 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_stat_ctx_free()
6344 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_stat_ctx_alloc() local
6345 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_stat_ctx_alloc()
8168 if (!bp->irq_tbl || !bp->bnapi) in bnxt_free_irq()
8181 free_irq(irq->vector, bp->bnapi[i]); in bnxt_free_irq()
8213 if (rmap && bp->bnapi[i]->rx_ring) { in bnxt_request_irq()
8222 bp->bnapi[i]); in bnxt_request_irq()
8250 if (!bp->bnapi) in bnxt_del_napi()
8254 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_del_napi() local
8256 napi_hash_del(&bnapi->napi); in bnxt_del_napi()
8257 netif_napi_del(&bnapi->napi); in bnxt_del_napi()
8269 struct bnxt_napi *bnapi; in bnxt_init_napi() local
8279 bnapi = bp->bnapi[i]; in bnxt_init_napi()
8280 netif_napi_add(bp->dev, &bnapi->napi, poll_fn, 64); in bnxt_init_napi()
8283 bnapi = bp->bnapi[cp_nr_rings]; in bnxt_init_napi()
8284 netif_napi_add(bp->dev, &bnapi->napi, in bnxt_init_napi()
8288 bnapi = bp->bnapi[0]; in bnxt_init_napi()
8289 netif_napi_add(bp->dev, &bnapi->napi, bnxt_poll, 64); in bnxt_init_napi()
8297 if (!bp->bnapi) in bnxt_disable_napi()
8301 struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring; in bnxt_disable_napi()
8303 if (bp->bnapi[i]->rx_ring) in bnxt_disable_napi()
8306 napi_disable(&bp->bnapi[i]->napi); in bnxt_disable_napi()
8315 struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring; in bnxt_enable_napi()
8316 bp->bnapi[i]->in_reset = false; in bnxt_enable_napi()
8318 if (bp->bnapi[i]->rx_ring) { in bnxt_enable_napi()
8322 napi_enable(&bp->bnapi[i]->napi); in bnxt_enable_napi()
9280 if (bp->bnapi) in __bnxt_close_nic()
9426 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_get_ring_stats() local
9427 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_get_ring_stats()
9872 static void bnxt_dump_tx_sw_state(struct bnxt_napi *bnapi) in bnxt_dump_tx_sw_state() argument
9874 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in bnxt_dump_tx_sw_state()
9875 int i = bnapi->index; in bnxt_dump_tx_sw_state()
9880 netdev_info(bnapi->bp->dev, "[%d]: tx{fw_ring: %d prod: %x cons: %x}\n", in bnxt_dump_tx_sw_state()
9885 static void bnxt_dump_rx_sw_state(struct bnxt_napi *bnapi) in bnxt_dump_rx_sw_state() argument
9887 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_dump_rx_sw_state()
9888 int i = bnapi->index; in bnxt_dump_rx_sw_state()
9893 …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()
9899 static void bnxt_dump_cp_sw_state(struct bnxt_napi *bnapi) in bnxt_dump_cp_sw_state() argument
9901 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_dump_cp_sw_state()
9902 int i = bnapi->index; in bnxt_dump_cp_sw_state()
9904 netdev_info(bnapi->bp->dev, "[%d]: cp{fw_ring: %d raw_cons: %x}\n", in bnxt_dump_cp_sw_state()
9911 struct bnxt_napi *bnapi; in bnxt_dbg_dump_states() local
9914 bnapi = bp->bnapi[i]; in bnxt_dbg_dump_states()
9916 bnxt_dump_tx_sw_state(bnapi); in bnxt_dbg_dump_states()
9917 bnxt_dump_rx_sw_state(bnapi); in bnxt_dbg_dump_states()
9918 bnxt_dump_cp_sw_state(bnapi); in bnxt_dbg_dump_states()
10189 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_chk_missed_irq() local
10194 if (!bnapi) in bnxt_chk_missed_irq()
10197 cpr = &bnapi->cp_ring; in bnxt_chk_missed_irq()