Lines Matching refs:txr
334 void bnxt_sched_reset_txr(struct bnxt *bp, struct bnxt_tx_ring_info *txr, in bnxt_sched_reset_txr() argument
337 struct bnxt_napi *bnapi = txr->bnapi; in bnxt_sched_reset_txr()
343 txr->txq_index, bnapi->tx_pkts, in bnxt_sched_reset_txr()
344 txr->tx_cons, txr->tx_prod, idx); in bnxt_sched_reset_txr()
382 static void bnxt_txr_db_kick(struct bnxt *bp, struct bnxt_tx_ring_info *txr, in bnxt_txr_db_kick() argument
385 bnxt_db_write(bp, &txr->tx_db, prod); in bnxt_txr_db_kick()
386 txr->kick_pending = 0; in bnxt_txr_db_kick()
401 struct bnxt_tx_ring_info *txr; in bnxt_start_xmit() local
413 txr = &bp->tx_ring[bp->tx_ring_map[i]]; in bnxt_start_xmit()
414 prod = txr->tx_prod; in bnxt_start_xmit()
416 free_size = bnxt_tx_avail(bp, txr); in bnxt_start_xmit()
419 if (net_ratelimit() && txr->kick_pending) in bnxt_start_xmit()
422 if (!netif_txq_try_stop(txq, bnxt_tx_avail(bp, txr), in bnxt_start_xmit()
434 txbd = &txr->tx_desc_ring[TX_RING(prod)][TX_IDX(prod)]; in bnxt_start_xmit()
438 tx_buf = &txr->tx_buf_ring[prod]; in bnxt_start_xmit()
476 struct tx_push_buffer *tx_push_buf = txr->tx_push; in bnxt_start_xmit()
479 void __iomem *db = txr->tx_db.doorbell; in bnxt_start_xmit()
522 txbd->tx_bd_haddr = txr->data_mapping; in bnxt_start_xmit()
524 txbd = &txr->tx_desc_ring[TX_RING(prod)][TX_IDX(prod)]; in bnxt_start_xmit()
529 WRITE_ONCE(txr->tx_prod, prod); in bnxt_start_xmit()
569 &txr->tx_desc_ring[TX_RING(prod)][TX_IDX(prod)]; in bnxt_start_xmit()
609 txbd = &txr->tx_desc_ring[TX_RING(prod)][TX_IDX(prod)]; in bnxt_start_xmit()
618 tx_buf = &txr->tx_buf_ring[prod]; in bnxt_start_xmit()
640 WRITE_ONCE(txr->tx_prod, prod); in bnxt_start_xmit()
643 bnxt_txr_db_kick(bp, txr, prod); in bnxt_start_xmit()
645 txr->kick_pending = 1; in bnxt_start_xmit()
649 if (unlikely(bnxt_tx_avail(bp, txr) <= MAX_SKB_FRAGS + 1)) { in bnxt_start_xmit()
651 bnxt_txr_db_kick(bp, txr, prod); in bnxt_start_xmit()
653 netif_txq_try_stop(txq, bnxt_tx_avail(bp, txr), in bnxt_start_xmit()
665 prod = txr->tx_prod; in bnxt_start_xmit()
666 tx_buf = &txr->tx_buf_ring[prod]; in bnxt_start_xmit()
674 tx_buf = &txr->tx_buf_ring[prod]; in bnxt_start_xmit()
683 if (txr->kick_pending) in bnxt_start_xmit()
684 bnxt_txr_db_kick(bp, txr, txr->tx_prod); in bnxt_start_xmit()
685 txr->tx_buf_ring[txr->tx_prod].skb = NULL; in bnxt_start_xmit()
692 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in bnxt_tx_int() local
693 struct netdev_queue *txq = netdev_get_tx_queue(bp->dev, txr->txq_index); in bnxt_tx_int()
694 u16 cons = txr->tx_cons; in bnxt_tx_int()
705 tx_buf = &txr->tx_buf_ring[cons]; in bnxt_tx_int()
711 bnxt_sched_reset_txr(bp, txr, i); in bnxt_tx_int()
728 tx_buf = &txr->tx_buf_ring[cons]; in bnxt_tx_int()
752 WRITE_ONCE(txr->tx_cons, cons); in bnxt_tx_int()
755 bnxt_tx_avail(bp, txr), bp->tx_wake_thresh, in bnxt_tx_int()
756 READ_ONCE(txr->dev_state) == BNXT_DEV_STATE_CLOSING); in bnxt_tx_int()
2570 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in __bnxt_poll_work() local
2571 u16 prod = txr->tx_prod; in __bnxt_poll_work()
2576 bnxt_db_write_relaxed(bp, &txr->tx_db, prod); in __bnxt_poll_work()
2860 struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; in bnxt_free_tx_skbs() local
2863 if (!txr->tx_buf_ring) in bnxt_free_tx_skbs()
2867 struct bnxt_sw_tx_bd *tx_buf = &txr->tx_buf_ring[j]; in bnxt_free_tx_skbs()
2909 tx_buf = &txr->tx_buf_ring[ring_idx]; in bnxt_free_tx_skbs()
3297 struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; in bnxt_free_tx_rings() local
3300 if (txr->tx_push) { in bnxt_free_tx_rings()
3302 txr->tx_push, txr->tx_push_mapping); in bnxt_free_tx_rings()
3303 txr->tx_push = NULL; in bnxt_free_tx_rings()
3306 ring = &txr->tx_ring_struct; in bnxt_free_tx_rings()
3333 struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; in bnxt_alloc_tx_rings() local
3337 ring = &txr->tx_ring_struct; in bnxt_alloc_tx_rings()
3343 ring->grp_idx = txr->bnapi->index; in bnxt_alloc_tx_rings()
3350 txr->tx_push = dma_alloc_coherent(&pdev->dev, in bnxt_alloc_tx_rings()
3352 &txr->tx_push_mapping, in bnxt_alloc_tx_rings()
3355 if (!txr->tx_push) in bnxt_alloc_tx_rings()
3358 mapping = txr->tx_push_mapping + in bnxt_alloc_tx_rings()
3360 txr->data_mapping = cpu_to_le64(mapping); in bnxt_alloc_tx_rings()
3364 spin_lock_init(&txr->xdp_tx_lock); in bnxt_alloc_tx_rings()
3561 struct bnxt_tx_ring_info *txr; in bnxt_init_ring_struct() local
3599 txr = bnapi->tx_ring; in bnxt_init_ring_struct()
3600 if (!txr) in bnxt_init_ring_struct()
3603 ring = &txr->tx_ring_struct; in bnxt_init_ring_struct()
3607 rmem->pg_arr = (void **)txr->tx_desc_ring; in bnxt_init_ring_struct()
3608 rmem->dma_arr = txr->tx_desc_mapping; in bnxt_init_ring_struct()
3610 rmem->vmem = (void **)&txr->tx_buf_ring; in bnxt_init_ring_struct()
3774 struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; in bnxt_init_tx_rings() local
3775 struct bnxt_ring_struct *ring = &txr->tx_ring_struct; in bnxt_init_tx_rings()
4419 struct bnxt_tx_ring_info *txr; in bnxt_clear_ring_indices() local
4427 txr = bnapi->tx_ring; in bnxt_clear_ring_indices()
4428 if (txr) { in bnxt_clear_ring_indices()
4429 txr->tx_prod = 0; in bnxt_clear_ring_indices()
4430 txr->tx_cons = 0; in bnxt_clear_ring_indices()
4589 struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; in bnxt_alloc_mem() local
4592 txr->tx_ring_struct.ring_mem.flags = 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()
4598 txr->txq_index = i - bp->tx_nr_rings_xdp; in bnxt_alloc_mem()
5165 static u16 bnxt_cp_ring_for_tx(struct bnxt *bp, struct bnxt_tx_ring_info *txr) in bnxt_cp_ring_for_tx() argument
5168 struct bnxt_napi *bnapi = txr->bnapi; in bnxt_cp_ring_for_tx()
5174 return bnxt_cp_ring_from_grp(bp, &txr->tx_ring_struct); in bnxt_cp_ring_for_tx()
5733 struct bnxt_tx_ring_info *txr; in hwrm_ring_alloc_send_msg() local
5735 txr = container_of(ring, struct bnxt_tx_ring_info, in hwrm_ring_alloc_send_msg()
5740 req->cmpl_ring_id = cpu_to_le16(bnxt_cp_ring_for_tx(bp, txr)); in hwrm_ring_alloc_send_msg()
5929 struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; in bnxt_hwrm_ring_alloc() local
5934 struct bnxt_napi *bnapi = txr->bnapi; in bnxt_hwrm_ring_alloc()
5950 ring = &txr->tx_ring_struct; in bnxt_hwrm_ring_alloc()
5955 bnxt_set_db(bp, &txr->tx_db, type, map_idx, ring->fw_ring_id); in bnxt_hwrm_ring_alloc()
6056 struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; in bnxt_hwrm_ring_free() local
6057 struct bnxt_ring_struct *ring = &txr->tx_ring_struct; in bnxt_hwrm_ring_free()
6060 u32 cmpl_ring_id = bnxt_cp_ring_for_tx(bp, txr); in bnxt_hwrm_ring_free()
9457 struct bnxt_tx_ring_info *txr; in bnxt_tx_disable() local
9461 txr = &bp->tx_ring[i]; in bnxt_tx_disable()
9462 WRITE_ONCE(txr->dev_state, BNXT_DEV_STATE_CLOSING); in bnxt_tx_disable()
9476 struct bnxt_tx_ring_info *txr; in bnxt_tx_enable() local
9479 txr = &bp->tx_ring[i]; in bnxt_tx_enable()
9480 WRITE_ONCE(txr->dev_state, 0); in bnxt_tx_enable()
11554 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in bnxt_dump_tx_sw_state() local
11557 if (!txr) in bnxt_dump_tx_sw_state()
11561 i, txr->tx_ring_struct.fw_ring_id, txr->tx_prod, in bnxt_dump_tx_sw_state()
11562 txr->tx_cons); in bnxt_dump_tx_sw_state()