Lines Matching refs:bnapi

357 	struct bnx2_napi *bnapi = &bp->bnx2_napi[0];  in bnx2_setup_cnic_irq_info()  local
362 bnapi->cnic_present = 0; in bnx2_setup_cnic_irq_info()
367 bnapi->cnic_tag = bnapi->last_status_idx; in bnx2_setup_cnic_irq_info()
368 bnapi->cnic_present = 1; in bnx2_setup_cnic_irq_info()
375 ((unsigned long) bnapi->status_blk.msi + in bnx2_setup_cnic_irq_info()
410 struct bnx2_napi *bnapi = &bp->bnx2_napi[0]; in bnx2_unregister_cnic() local
415 bnapi->cnic_present = 0; in bnx2_unregister_cnic()
468 struct bnx2_napi *bnapi = &bp->bnx2_napi[0]; in bnx2_cnic_start() local
470 bnapi->cnic_tag = bnapi->last_status_idx; in bnx2_cnic_start()
602 struct bnx2_napi *bnapi; in bnx2_disable_int() local
605 bnapi = &bp->bnx2_napi[i]; in bnx2_disable_int()
606 BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num | in bnx2_disable_int()
616 struct bnx2_napi *bnapi; in bnx2_enable_int() local
619 bnapi = &bp->bnx2_napi[i]; in bnx2_enable_int()
621 BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num | in bnx2_enable_int()
624 bnapi->last_status_idx); in bnx2_enable_int()
626 BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num | in bnx2_enable_int()
628 bnapi->last_status_idx); in bnx2_enable_int()
702 struct bnx2_napi *bnapi = &bp->bnx2_napi[i]; in bnx2_free_tx_mem() local
703 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_free_tx_mem()
722 struct bnx2_napi *bnapi = &bp->bnx2_napi[i]; in bnx2_free_rx_mem() local
723 struct bnx2_rx_ring_info *rxr = &bnapi->rx_ring; in bnx2_free_rx_mem()
754 struct bnx2_napi *bnapi = &bp->bnx2_napi[i]; in bnx2_alloc_tx_mem() local
755 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_alloc_tx_mem()
776 struct bnx2_napi *bnapi = &bp->bnx2_napi[i]; in bnx2_alloc_rx_mem() local
777 struct bnx2_rx_ring_info *rxr = &bnapi->rx_ring; in bnx2_alloc_rx_mem()
863 struct bnx2_napi *bnapi = &bp->bnx2_napi[0]; in bnx2_free_mem() local
877 if (bnapi->status_blk.msi) in bnx2_free_mem()
878 bnapi->status_blk.msi = NULL; in bnx2_free_mem()
885 struct bnx2_napi *bnapi; in bnx2_alloc_mem() local
887 bnapi = &bp->bnx2_napi[0]; in bnx2_alloc_mem()
888 bnapi->status_blk.msi = bp->status_blk; in bnx2_alloc_mem()
889 bnapi->hw_tx_cons_ptr = in bnx2_alloc_mem()
890 &bnapi->status_blk.msi->status_tx_quick_consumer_index0; in bnx2_alloc_mem()
891 bnapi->hw_rx_cons_ptr = in bnx2_alloc_mem()
892 &bnapi->status_blk.msi->status_rx_quick_consumer_index0; in bnx2_alloc_mem()
897 bnapi = &bp->bnx2_napi[i]; in bnx2_alloc_mem()
900 bnapi->status_blk.msix = sblk; in bnx2_alloc_mem()
901 bnapi->hw_tx_cons_ptr = in bnx2_alloc_mem()
903 bnapi->hw_rx_cons_ptr = in bnx2_alloc_mem()
905 bnapi->int_num = i << 24; in bnx2_alloc_mem()
2802 bnx2_phy_event_is_set(struct bnx2 *bp, struct bnx2_napi *bnapi, u32 event) in bnx2_phy_event_is_set() argument
2804 struct status_block *sblk = bnapi->status_blk.msi; in bnx2_phy_event_is_set()
2822 bnx2_phy_int(struct bnx2 *bp, struct bnx2_napi *bnapi) in bnx2_phy_int() argument
2826 if (bnx2_phy_event_is_set(bp, bnapi, STATUS_ATTN_BITS_LINK_STATE)) in bnx2_phy_int()
2828 if (bnx2_phy_event_is_set(bp, bnapi, STATUS_ATTN_BITS_TIMER_ABORT)) in bnx2_phy_int()
2836 bnx2_get_hw_tx_cons(struct bnx2_napi *bnapi) in bnx2_get_hw_tx_cons() argument
2840 cons = READ_ONCE(*bnapi->hw_tx_cons_ptr); in bnx2_get_hw_tx_cons()
2848 bnx2_tx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) in bnx2_tx_int() argument
2850 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_tx_int()
2856 index = (bnapi - bp->bnx2_napi); in bnx2_tx_int()
2859 hw_cons = bnx2_get_hw_tx_cons(bnapi); in bnx2_tx_int()
2916 hw_cons = bnx2_get_hw_tx_cons(bnapi); in bnx2_tx_int()
3136 bnx2_get_hw_rx_cons(struct bnx2_napi *bnapi) in bnx2_get_hw_rx_cons() argument
3140 cons = READ_ONCE(*bnapi->hw_rx_cons_ptr); in bnx2_get_hw_rx_cons()
3148 bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) in bnx2_rx_int() argument
3150 struct bnx2_rx_ring_info *rxr = &bnapi->rx_ring; in bnx2_rx_int()
3158 hw_cons = bnx2_get_hw_rx_cons(bnapi); in bnx2_rx_int()
3281 skb_record_rx_queue(skb, bnapi - &bp->bnx2_napi[0]); in bnx2_rx_int()
3282 napi_gro_receive(&bnapi->napi, skb); in bnx2_rx_int()
3294 hw_cons = bnx2_get_hw_rx_cons(bnapi); in bnx2_rx_int()
3318 struct bnx2_napi *bnapi = dev_instance; in bnx2_msi() local
3319 struct bnx2 *bp = bnapi->bp; in bnx2_msi()
3321 prefetch(bnapi->status_blk.msi); in bnx2_msi()
3330 napi_schedule(&bnapi->napi); in bnx2_msi()
3338 struct bnx2_napi *bnapi = dev_instance; in bnx2_msi_1shot() local
3339 struct bnx2 *bp = bnapi->bp; in bnx2_msi_1shot()
3341 prefetch(bnapi->status_blk.msi); in bnx2_msi_1shot()
3347 napi_schedule(&bnapi->napi); in bnx2_msi_1shot()
3355 struct bnx2_napi *bnapi = dev_instance; in bnx2_interrupt() local
3356 struct bnx2 *bp = bnapi->bp; in bnx2_interrupt()
3357 struct status_block *sblk = bnapi->status_blk.msi; in bnx2_interrupt()
3365 if ((sblk->status_idx == bnapi->last_status_idx) && in bnx2_interrupt()
3383 if (napi_schedule_prep(&bnapi->napi)) { in bnx2_interrupt()
3384 bnapi->last_status_idx = sblk->status_idx; in bnx2_interrupt()
3385 __napi_schedule(&bnapi->napi); in bnx2_interrupt()
3392 bnx2_has_fast_work(struct bnx2_napi *bnapi) in bnx2_has_fast_work() argument
3394 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_has_fast_work()
3395 struct bnx2_rx_ring_info *rxr = &bnapi->rx_ring; in bnx2_has_fast_work()
3397 if ((bnx2_get_hw_rx_cons(bnapi) != rxr->rx_cons) || in bnx2_has_fast_work()
3398 (bnx2_get_hw_tx_cons(bnapi) != txr->hw_tx_cons)) in bnx2_has_fast_work()
3407 bnx2_has_work(struct bnx2_napi *bnapi) in bnx2_has_work() argument
3409 struct status_block *sblk = bnapi->status_blk.msi; in bnx2_has_work()
3411 if (bnx2_has_fast_work(bnapi)) in bnx2_has_work()
3415 if (bnapi->cnic_present && (bnapi->cnic_tag != sblk->status_idx)) in bnx2_has_work()
3429 struct bnx2_napi *bnapi = &bp->bnx2_napi[0]; in bnx2_chk_missed_msi() local
3432 if (bnx2_has_work(bnapi)) { in bnx2_chk_missed_msi()
3437 if (bnapi->last_status_idx == bp->idle_chk_status_idx) { in bnx2_chk_missed_msi()
3441 bnx2_msi(bp->irq_tbl[0].vector, bnapi); in bnx2_chk_missed_msi()
3445 bp->idle_chk_status_idx = bnapi->last_status_idx; in bnx2_chk_missed_msi()
3449 static void bnx2_poll_cnic(struct bnx2 *bp, struct bnx2_napi *bnapi) in bnx2_poll_cnic() argument
3453 if (!bnapi->cnic_present) in bnx2_poll_cnic()
3459 bnapi->cnic_tag = c_ops->cnic_handler(bp->cnic_data, in bnx2_poll_cnic()
3460 bnapi->status_blk.msi); in bnx2_poll_cnic()
3465 static void bnx2_poll_link(struct bnx2 *bp, struct bnx2_napi *bnapi) in bnx2_poll_link() argument
3467 struct status_block *sblk = bnapi->status_blk.msi; in bnx2_poll_link()
3474 bnx2_phy_int(bp, bnapi); in bnx2_poll_link()
3485 static int bnx2_poll_work(struct bnx2 *bp, struct bnx2_napi *bnapi, in bnx2_poll_work() argument
3488 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_poll_work()
3489 struct bnx2_rx_ring_info *rxr = &bnapi->rx_ring; in bnx2_poll_work()
3491 if (bnx2_get_hw_tx_cons(bnapi) != txr->hw_tx_cons) in bnx2_poll_work()
3492 bnx2_tx_int(bp, bnapi, 0); in bnx2_poll_work()
3494 if (bnx2_get_hw_rx_cons(bnapi) != rxr->rx_cons) in bnx2_poll_work()
3495 work_done += bnx2_rx_int(bp, bnapi, budget - work_done); in bnx2_poll_work()
3502 struct bnx2_napi *bnapi = container_of(napi, struct bnx2_napi, napi); in bnx2_poll_msix() local
3503 struct bnx2 *bp = bnapi->bp; in bnx2_poll_msix()
3505 struct status_block_msix *sblk = bnapi->status_blk.msix; in bnx2_poll_msix()
3508 work_done = bnx2_poll_work(bp, bnapi, work_done, budget); in bnx2_poll_msix()
3512 bnapi->last_status_idx = sblk->status_idx; in bnx2_poll_msix()
3515 if (likely(!bnx2_has_fast_work(bnapi))) { in bnx2_poll_msix()
3518 BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num | in bnx2_poll_msix()
3520 bnapi->last_status_idx); in bnx2_poll_msix()
3529 struct bnx2_napi *bnapi = container_of(napi, struct bnx2_napi, napi); in bnx2_poll() local
3530 struct bnx2 *bp = bnapi->bp; in bnx2_poll()
3532 struct status_block *sblk = bnapi->status_blk.msi; in bnx2_poll()
3535 bnx2_poll_link(bp, bnapi); in bnx2_poll()
3537 work_done = bnx2_poll_work(bp, bnapi, work_done, budget); in bnx2_poll()
3540 bnx2_poll_cnic(bp, bnapi); in bnx2_poll()
3547 bnapi->last_status_idx = sblk->status_idx; in bnx2_poll()
3553 if (likely(!bnx2_has_work(bnapi))) { in bnx2_poll()
3558 bnapi->last_status_idx); in bnx2_poll()
3564 bnapi->last_status_idx); in bnx2_poll()
3568 bnapi->last_status_idx); in bnx2_poll()
5133 struct bnx2_napi *bnapi; in bnx2_clear_ring_states() local
5139 bnapi = &bp->bnx2_napi[i]; in bnx2_clear_ring_states()
5140 txr = &bnapi->tx_ring; in bnx2_clear_ring_states()
5141 rxr = &bnapi->rx_ring; in bnx2_clear_ring_states()
5188 struct bnx2_napi *bnapi; in bnx2_init_tx_ring() local
5191 bnapi = &bp->bnx2_napi[ring_num]; in bnx2_init_tx_ring()
5192 txr = &bnapi->tx_ring; in bnx2_init_tx_ring()
5245 struct bnx2_napi *bnapi = &bp->bnx2_napi[ring_num]; in bnx2_init_rx_ring() local
5246 struct bnx2_rx_ring_info *rxr = &bnapi->rx_ring; in bnx2_init_rx_ring()
5438 struct bnx2_napi *bnapi = &bp->bnx2_napi[i]; in bnx2_free_tx_skbs() local
5439 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_free_tx_skbs()
5483 struct bnx2_napi *bnapi = &bp->bnx2_napi[i]; in bnx2_free_rx_skbs() local
5484 struct bnx2_rx_ring_info *rxr = &bnapi->rx_ring; in bnx2_free_rx_skbs()
5819 struct bnx2_napi *bnapi = &bp->bnx2_napi[0], *tx_napi; in bnx2_run_loopback() local
5823 tx_napi = bnapi; in bnx2_run_loopback()
5826 rxr = &bnapi->rx_ring; in bnx2_run_loopback()
5864 rx_start_idx = bnx2_get_hw_rx_cons(bnapi); in bnx2_run_loopback()
5897 rx_idx = bnx2_get_hw_rx_cons(bnapi); in bnx2_run_loopback()
6604 struct bnx2_napi *bnapi; in bnx2_start_xmit() local
6610 bnapi = &bp->bnx2_napi[i]; in bnx2_start_xmit()
6611 txr = &bnapi->tx_ring; in bnx2_start_xmit()
8532 struct bnx2_napi *bnapi = &bp->bnx2_napi[i]; in bnx2_init_napi() local
8541 bnapi->bp = bp; in bnx2_init_napi()