Lines Matching refs:bnapi
651 static void bnxt_tx_int(struct bnxt *bp, struct bnxt_napi *bnapi, int nr_pkts) in bnxt_tx_int() argument
653 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in bnxt_tx_int()
906 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_reuse_rx_agg_bufs() local
907 struct bnxt *bp = bnapi->bp; in bnxt_reuse_rx_agg_bufs()
908 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_reuse_rx_agg_bufs()
987 skb = napi_alloc_skb(&rxr->bnapi->napi, payload); in bnxt_rx_page_skb()
1041 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_rx_pages() local
1043 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_rx_pages()
1126 static inline struct sk_buff *bnxt_copy_skb(struct bnxt_napi *bnapi, u8 *data, in bnxt_copy_skb() argument
1130 struct bnxt *bp = bnapi->bp; in bnxt_copy_skb()
1134 skb = napi_alloc_skb(&bnapi->napi, len); in bnxt_copy_skb()
1202 if (!rxr->bnapi->in_reset) { in bnxt_sched_reset()
1203 rxr->bnapi->in_reset = true; in bnxt_sched_reset()
1542 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_tpa_end() local
1543 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_tpa_end()
1553 if (unlikely(bnapi->in_reset)) { in bnxt_tpa_end()
1605 skb = bnxt_copy_skb(bnapi, data_ptr, len, mapping); in bnxt_tpa_end()
1695 static void bnxt_deliver_skb(struct bnxt *bp, struct bnxt_napi *bnapi, in bnxt_deliver_skb() argument
1703 skb_record_rx_queue(skb, bnapi->index); in bnxt_deliver_skb()
1704 napi_gro_receive(&bnapi->napi, skb); in bnxt_deliver_skb()
1717 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_rx_pkt() local
1718 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_rx_pkt()
1774 bnxt_deliver_skb(bp, bnapi, skb); in bnxt_rx_pkt()
1822 bnapi->cp_ring.sw_stats.rx.rx_buf_errors++; in bnxt_rx_pkt()
1843 skb = bnxt_copy_skb(bnapi, data_ptr, len, dma_addr); in bnxt_rx_pkt()
1916 bnapi->cp_ring.sw_stats.rx.rx_l4_csum_errors++; in bnxt_rx_pkt()
1938 bnxt_deliver_skb(bp, bnapi, skb); in bnxt_rx_pkt()
2034 u16 grp_idx = bp->rx_ring[i].bnapi->index; in bnxt_agg_ring_id_to_grp_idx()
2219 rxr = bp->bnapi[grp_idx]->rx_ring; in bnxt_async_event_process()
2302 struct bnxt_napi *bnapi = dev_instance; in bnxt_msix() local
2303 struct bnxt *bp = bnapi->bp; in bnxt_msix()
2304 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_msix()
2309 napi_schedule(&bnapi->napi); in bnxt_msix()
2326 struct bnxt_napi *bnapi = dev_instance; in bnxt_inta() local
2327 struct bnxt *bp = bnapi->bp; in bnxt_inta()
2328 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_inta()
2348 napi_schedule(&bnapi->napi); in bnxt_inta()
2355 struct bnxt_napi *bnapi = cpr->bnapi; in __bnxt_poll_work() local
2425 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in __bnxt_poll_work()
2435 bnapi->tx_pkts += tx_pkts; in __bnxt_poll_work()
2436 bnapi->events |= event; in __bnxt_poll_work()
2440 static void __bnxt_poll_work_done(struct bnxt *bp, struct bnxt_napi *bnapi) in __bnxt_poll_work_done() argument
2442 if (bnapi->tx_pkts) { in __bnxt_poll_work_done()
2443 bnapi->tx_int(bp, bnapi, bnapi->tx_pkts); in __bnxt_poll_work_done()
2444 bnapi->tx_pkts = 0; in __bnxt_poll_work_done()
2447 if ((bnapi->events & BNXT_RX_EVENT) && !(bnapi->in_reset)) { in __bnxt_poll_work_done()
2448 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in __bnxt_poll_work_done()
2450 if (bnapi->events & BNXT_AGG_EVENT) in __bnxt_poll_work_done()
2454 bnapi->events = 0; in __bnxt_poll_work_done()
2460 struct bnxt_napi *bnapi = cpr->bnapi; in bnxt_poll_work() local
2471 __bnxt_poll_work_done(bp, bnapi); in bnxt_poll_work()
2477 struct bnxt_napi *bnapi = container_of(napi, struct bnxt_napi, napi); in bnxt_poll_nitroa0() local
2478 struct bnxt *bp = bnapi->bp; in bnxt_poll_nitroa0()
2479 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_poll_nitroa0()
2480 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_poll_nitroa0()
2548 struct bnxt_napi *bnapi = container_of(napi, struct bnxt_napi, napi); in bnxt_poll() local
2549 struct bnxt *bp = bnapi->bp; in bnxt_poll()
2550 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_poll()
2584 static int __bnxt_poll_cqs(struct bnxt *bp, struct bnxt_napi *bnapi, int budget) in __bnxt_poll_cqs() argument
2586 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in __bnxt_poll_cqs()
2601 static void __bnxt_poll_cqs_done(struct bnxt *bp, struct bnxt_napi *bnapi, in __bnxt_poll_cqs_done() argument
2604 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in __bnxt_poll_cqs_done()
2618 __bnxt_poll_work_done(bp, bnapi); in __bnxt_poll_cqs_done()
2623 struct bnxt_napi *bnapi = container_of(napi, struct bnxt_napi, napi); in bnxt_poll_p5() local
2624 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_poll_p5()
2626 struct bnxt *bp = bnapi->bp; in bnxt_poll_p5()
2637 work_done = __bnxt_poll_cqs(bp, bnapi, budget); in bnxt_poll_p5()
2647 __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ_ARMALL); in bnxt_poll_p5()
2673 __bnxt_poll_cqs_done(bp, bnapi, DBR_TYPE_CQ); in bnxt_poll_p5()
3178 ring->grp_idx = txr->bnapi->index; in bnxt_alloc_tx_rings()
3235 if (!bp->bnapi) in bnxt_free_all_cp_arrays()
3238 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_free_all_cp_arrays() local
3240 if (!bnapi) in bnxt_free_all_cp_arrays()
3242 bnxt_free_cp_arrays(&bnapi->cp_ring); in bnxt_free_all_cp_arrays()
3251 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_alloc_all_cp_arrays() local
3254 if (!bnapi) in bnxt_alloc_all_cp_arrays()
3256 rc = bnxt_alloc_cp_arrays(&bnapi->cp_ring, n); in bnxt_alloc_all_cp_arrays()
3267 if (!bp->bnapi) in bnxt_free_cp_rings()
3271 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_free_cp_rings() local
3276 if (!bnapi) in bnxt_free_cp_rings()
3279 cpr = &bnapi->cp_ring; in bnxt_free_cp_rings()
3340 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_alloc_cp_rings() local
3344 if (!bnapi) in bnxt_alloc_cp_rings()
3347 cpr = &bnapi->cp_ring; in bnxt_alloc_cp_rings()
3348 cpr->bnapi = bnapi; in bnxt_alloc_cp_rings()
3370 cpr2->bnapi = bnapi; in bnxt_alloc_cp_rings()
3380 cpr2->bnapi = bnapi; in bnxt_alloc_cp_rings()
3391 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_init_ring_struct() local
3398 if (!bnapi) in bnxt_init_ring_struct()
3401 cpr = &bnapi->cp_ring; in bnxt_init_ring_struct()
3410 rxr = bnapi->rx_ring; in bnxt_init_ring_struct()
3433 txr = bnapi->tx_ring; in bnxt_init_ring_struct()
3559 struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring; in bnxt_init_cp_rings()
4067 struct bnxt_napi *bnapi = bp->bnapi[0]; in bnxt_init_stats() local
4076 cpr = &bnapi->cp_ring; in bnxt_init_stats()
4150 if (!bp->bnapi) in bnxt_free_ring_stats()
4154 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_free_ring_stats() local
4155 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_free_ring_stats()
4169 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_alloc_stats() local
4170 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_alloc_stats()
4228 if (!bp->bnapi) in bnxt_clear_ring_indices()
4232 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_clear_ring_indices() local
4237 if (!bnapi) in bnxt_clear_ring_indices()
4240 cpr = &bnapi->cp_ring; in bnxt_clear_ring_indices()
4243 txr = bnapi->tx_ring; in bnxt_clear_ring_indices()
4249 rxr = bnapi->rx_ring; in bnxt_clear_ring_indices()
4332 kfree(bp->bnapi); in bnxt_free_mem()
4333 bp->bnapi = NULL; in bnxt_free_mem()
4342 void *bnapi; in bnxt_alloc_mem() local
4351 bnapi = kzalloc(arr_size + size * bp->cp_nr_rings, GFP_KERNEL); in bnxt_alloc_mem()
4352 if (!bnapi) in bnxt_alloc_mem()
4355 bp->bnapi = bnapi; in bnxt_alloc_mem()
4356 bnapi += arr_size; in bnxt_alloc_mem()
4357 for (i = 0; i < bp->cp_nr_rings; i++, bnapi += size) { in bnxt_alloc_mem()
4358 bp->bnapi[i] = bnapi; in bnxt_alloc_mem()
4359 bp->bnapi[i]->index = i; in bnxt_alloc_mem()
4360 bp->bnapi[i]->bp = bp; in bnxt_alloc_mem()
4363 &bp->bnapi[i]->cp_ring; in bnxt_alloc_mem()
4385 rxr->bnapi = bp->bnapi[i]; in bnxt_alloc_mem()
4386 bp->bnapi[i]->rx_ring = &bp->rx_ring[i]; in bnxt_alloc_mem()
4412 txr->bnapi = bp->bnapi[j]; in bnxt_alloc_mem()
4413 bp->bnapi[j]->tx_ring = txr; in bnxt_alloc_mem()
4417 bp->bnapi[j]->tx_int = bnxt_tx_int; in bnxt_alloc_mem()
4419 bp->bnapi[j]->flags |= BNXT_NAPI_FLAG_XDP; in bnxt_alloc_mem()
4420 bp->bnapi[j]->tx_int = bnxt_tx_int_xdp; in bnxt_alloc_mem()
4472 if (!bp->bnapi) in bnxt_disable_int()
4476 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_disable_int() local
4477 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_disable_int()
4487 struct bnxt_napi *bnapi = bp->bnapi[n]; in bnxt_cp_num_to_irq_num() local
4490 cpr = &bnapi->cp_ring; in bnxt_cp_num_to_irq_num()
4517 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_enable_int() local
4518 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_enable_int()
4968 struct bnxt_napi *bnapi = rxr->bnapi; in bnxt_cp_ring_for_rx() local
4971 cpr = bnapi->cp_ring.cp_ring_arr[BNXT_RX_HDL]; in bnxt_cp_ring_for_rx()
4981 struct bnxt_napi *bnapi = txr->bnapi; in bnxt_cp_ring_for_tx() local
4984 cpr = bnapi->cp_ring.cp_ring_arr[BNXT_TX_HDL]; in bnxt_cp_ring_for_tx()
5294 grp_idx = bp->rx_ring[ring].bnapi->index; in bnxt_hwrm_vnic_cfg()
5356 grp_idx = bp->rx_ring[i].bnapi->index; in bnxt_hwrm_vnic_alloc()
5441 unsigned int grp_idx = bp->rx_ring[i].bnapi->index; in bnxt_hwrm_ring_grp_alloc()
5683 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_ring_alloc() local
5684 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_ring_alloc()
5715 struct bnxt_napi *bnapi = txr->bnapi; in bnxt_hwrm_ring_alloc() local
5719 cpr = &bnapi->cp_ring; in bnxt_hwrm_ring_alloc()
5723 map_idx = bnapi->index; in bnxt_hwrm_ring_alloc()
5743 struct bnxt_napi *bnapi = rxr->bnapi; in bnxt_hwrm_ring_alloc() local
5744 u32 map_idx = bnapi->index; in bnxt_hwrm_ring_alloc()
5755 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_ring_alloc()
5833 if (!bp->bnapi) in bnxt_hwrm_ring_free()
5854 u32 grp_idx = rxr->bnapi->index; in bnxt_hwrm_ring_free()
5876 u32 grp_idx = rxr->bnapi->index; in bnxt_hwrm_ring_free()
5901 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_ring_free() local
5902 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_ring_free()
6530 static int __bnxt_hwrm_set_coal_nq(struct bnxt *bp, struct bnxt_napi *bnapi, in __bnxt_hwrm_set_coal_nq() argument
6534 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in __bnxt_hwrm_set_coal_nq()
6558 int bnxt_hwrm_set_ring_coal(struct bnxt *bp, struct bnxt_napi *bnapi) in bnxt_hwrm_set_ring_coal() argument
6561 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_set_ring_coal()
6573 if (!bnapi->rx_ring) in bnxt_hwrm_set_ring_coal()
6582 req_rx->ring_id = cpu_to_le16(bnxt_cp_ring_for_rx(bp, bnapi->rx_ring)); in bnxt_hwrm_set_ring_coal()
6609 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_set_coal() local
6614 if (!bnapi->rx_ring) { in bnxt_hwrm_set_coal()
6615 ring_id = bnxt_cp_ring_for_tx(bp, bnapi->tx_ring); in bnxt_hwrm_set_coal()
6618 ring_id = bnxt_cp_ring_for_rx(bp, bnapi->rx_ring); in bnxt_hwrm_set_coal()
6629 if (bnapi->rx_ring && bnapi->tx_ring) { in bnxt_hwrm_set_coal()
6631 ring_id = bnxt_cp_ring_for_tx(bp, bnapi->tx_ring); in bnxt_hwrm_set_coal()
6637 if (bnapi->rx_ring) in bnxt_hwrm_set_coal()
6641 __bnxt_hwrm_set_coal_nq(bp, bnapi, hw_coal); in bnxt_hwrm_set_coal()
6654 if (!bp->bnapi) in bnxt_hwrm_stat_ctx_free()
6671 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_stat_ctx_free() local
6672 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_stat_ctx_free()
6708 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_hwrm_stat_ctx_alloc() local
6709 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_hwrm_stat_ctx_alloc()
8124 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_accumulate_all_stats() local
8128 cpr = &bnapi->cp_ring; in bnxt_accumulate_all_stats()
9035 if (!bp->irq_tbl || !bp->bnapi) in bnxt_free_irq()
9048 free_irq(irq->vector, bp->bnapi[i]); in bnxt_free_irq()
9080 if (rmap && bp->bnapi[i]->rx_ring) { in bnxt_request_irq()
9089 bp->bnapi[i]); in bnxt_request_irq()
9117 if (!bp->bnapi) in bnxt_del_napi()
9121 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_del_napi() local
9123 __netif_napi_del(&bnapi->napi); in bnxt_del_napi()
9135 struct bnxt_napi *bnapi; in bnxt_init_napi() local
9145 bnapi = bp->bnapi[i]; in bnxt_init_napi()
9146 netif_napi_add(bp->dev, &bnapi->napi, poll_fn, 64); in bnxt_init_napi()
9149 bnapi = bp->bnapi[cp_nr_rings]; in bnxt_init_napi()
9150 netif_napi_add(bp->dev, &bnapi->napi, in bnxt_init_napi()
9154 bnapi = bp->bnapi[0]; in bnxt_init_napi()
9155 netif_napi_add(bp->dev, &bnapi->napi, bnxt_poll, 64); in bnxt_init_napi()
9163 if (!bp->bnapi || in bnxt_disable_napi()
9168 struct bnxt_cp_ring_info *cpr = &bp->bnapi[i]->cp_ring; in bnxt_disable_napi()
9170 napi_disable(&bp->bnapi[i]->napi); in bnxt_disable_napi()
9171 if (bp->bnapi[i]->rx_ring) in bnxt_disable_napi()
9182 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_enable_napi() local
9185 cpr = &bnapi->cp_ring; in bnxt_enable_napi()
9186 if (bnapi->in_reset) in bnxt_enable_napi()
9188 bnapi->in_reset = false; in bnxt_enable_napi()
9190 if (bnapi->rx_ring) { in bnxt_enable_napi()
9194 napi_enable(&bnapi->napi); in bnxt_enable_napi()
10418 if (bp->bnapi && irq_re_init) in __bnxt_close_nic()
10576 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_get_ring_stats() local
10577 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_get_ring_stats()
11197 static void bnxt_dump_tx_sw_state(struct bnxt_napi *bnapi) in bnxt_dump_tx_sw_state() argument
11199 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in bnxt_dump_tx_sw_state()
11200 int i = bnapi->index; in bnxt_dump_tx_sw_state()
11205 netdev_info(bnapi->bp->dev, "[%d]: tx{fw_ring: %d prod: %x cons: %x}\n", in bnxt_dump_tx_sw_state()
11210 static void bnxt_dump_rx_sw_state(struct bnxt_napi *bnapi) in bnxt_dump_rx_sw_state() argument
11212 struct bnxt_rx_ring_info *rxr = bnapi->rx_ring; in bnxt_dump_rx_sw_state()
11213 int i = bnapi->index; in bnxt_dump_rx_sw_state()
11218 …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()
11224 static void bnxt_dump_cp_sw_state(struct bnxt_napi *bnapi) in bnxt_dump_cp_sw_state() argument
11226 struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; in bnxt_dump_cp_sw_state()
11227 int i = bnapi->index; in bnxt_dump_cp_sw_state()
11229 netdev_info(bnapi->bp->dev, "[%d]: cp{fw_ring: %d raw_cons: %x}\n", in bnxt_dump_cp_sw_state()
11236 struct bnxt_napi *bnapi; in bnxt_dbg_dump_states() local
11239 bnapi = bp->bnapi[i]; in bnxt_dbg_dump_states()
11241 bnxt_dump_tx_sw_state(bnapi); in bnxt_dbg_dump_states()
11242 bnxt_dump_rx_sw_state(bnapi); in bnxt_dbg_dump_states()
11243 bnxt_dump_cp_sw_state(bnapi); in bnxt_dbg_dump_states()
11252 struct bnxt_napi *bnapi = rxr->bnapi; in bnxt_hwrm_rx_ring_reset() local
11261 cpr = &bnapi->cp_ring; in bnxt_hwrm_rx_ring_reset()
11265 req->ring_id = cpu_to_le16(bp->grp_info[bnapi->index].fw_grp_id); in bnxt_hwrm_rx_ring_reset()
11428 if (!rxr->bnapi->in_reset) in bnxt_rx_ring_reset()
11446 rxr->bnapi->in_reset = false; in bnxt_rx_ring_reset()
11448 cpr = &rxr->bnapi->cp_ring; in bnxt_rx_ring_reset()
11634 struct bnxt_napi *bnapi = bp->bnapi[i]; in bnxt_chk_missed_irq() local
11639 if (!bnapi) in bnxt_chk_missed_irq()
11642 cpr = &bnapi->cp_ring; in bnxt_chk_missed_irq()