Lines Matching refs:txr
325 static void bnxt_txr_db_kick(struct bnxt *bp, struct bnxt_tx_ring_info *txr, in bnxt_txr_db_kick() argument
328 bnxt_db_write(bp, &txr->tx_db, prod); in bnxt_txr_db_kick()
329 txr->kick_pending = 0; in bnxt_txr_db_kick()
333 struct bnxt_tx_ring_info *txr, in bnxt_txr_netif_try_stop_queue() argument
344 if (bnxt_tx_avail(bp, txr) >= bp->tx_wake_thresh) { in bnxt_txr_netif_try_stop_queue()
364 struct bnxt_tx_ring_info *txr; in bnxt_start_xmit() local
376 txr = &bp->tx_ring[bp->tx_ring_map[i]]; in bnxt_start_xmit()
377 prod = txr->tx_prod; in bnxt_start_xmit()
379 free_size = bnxt_tx_avail(bp, txr); in bnxt_start_xmit()
382 if (net_ratelimit() && txr->kick_pending) in bnxt_start_xmit()
385 if (bnxt_txr_netif_try_stop_queue(bp, txr, txq)) in bnxt_start_xmit()
393 txbd = &txr->tx_desc_ring[TX_RING(prod)][TX_IDX(prod)]; in bnxt_start_xmit()
397 tx_buf = &txr->tx_buf_ring[prod]; in bnxt_start_xmit()
435 struct tx_push_buffer *tx_push_buf = txr->tx_push; in bnxt_start_xmit()
438 void __iomem *db = txr->tx_db.doorbell; in bnxt_start_xmit()
481 txbd->tx_bd_haddr = txr->data_mapping; in bnxt_start_xmit()
483 txbd = &txr->tx_desc_ring[TX_RING(prod)][TX_IDX(prod)]; in bnxt_start_xmit()
488 txr->tx_prod = prod; in bnxt_start_xmit()
528 &txr->tx_desc_ring[TX_RING(prod)][TX_IDX(prod)]; in bnxt_start_xmit()
571 txbd = &txr->tx_desc_ring[TX_RING(prod)][TX_IDX(prod)]; in bnxt_start_xmit()
580 tx_buf = &txr->tx_buf_ring[prod]; in bnxt_start_xmit()
602 txr->tx_prod = prod; in bnxt_start_xmit()
605 bnxt_txr_db_kick(bp, txr, prod); in bnxt_start_xmit()
607 txr->kick_pending = 1; in bnxt_start_xmit()
611 if (unlikely(bnxt_tx_avail(bp, txr) <= MAX_SKB_FRAGS + 1)) { in bnxt_start_xmit()
613 bnxt_txr_db_kick(bp, txr, prod); in bnxt_start_xmit()
615 bnxt_txr_netif_try_stop_queue(bp, txr, txq); in bnxt_start_xmit()
626 prod = txr->tx_prod; in bnxt_start_xmit()
627 tx_buf = &txr->tx_buf_ring[prod]; in bnxt_start_xmit()
635 tx_buf = &txr->tx_buf_ring[prod]; in bnxt_start_xmit()
644 if (txr->kick_pending) in bnxt_start_xmit()
645 bnxt_txr_db_kick(bp, txr, txr->tx_prod); in bnxt_start_xmit()
646 txr->tx_buf_ring[txr->tx_prod].skb = NULL; in bnxt_start_xmit()
653 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in bnxt_tx_int() local
654 struct netdev_queue *txq = netdev_get_tx_queue(bp->dev, txr->txq_index); in bnxt_tx_int()
655 u16 cons = txr->tx_cons; in bnxt_tx_int()
666 tx_buf = &txr->tx_buf_ring[cons]; in bnxt_tx_int()
682 tx_buf = &txr->tx_buf_ring[cons]; in bnxt_tx_int()
707 txr->tx_cons = cons; in bnxt_tx_int()
717 bnxt_tx_avail(bp, txr) >= bp->tx_wake_thresh && in bnxt_tx_int()
718 READ_ONCE(txr->dev_state) != BNXT_DEV_STATE_CLOSING) in bnxt_tx_int()
2425 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in __bnxt_poll_work() local
2426 u16 prod = txr->tx_prod; in __bnxt_poll_work()
2431 bnxt_db_write_relaxed(bp, &txr->tx_db, prod); in __bnxt_poll_work()
2691 struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; in bnxt_free_tx_skbs() local
2694 if (!txr->tx_buf_ring) in bnxt_free_tx_skbs()
2698 struct bnxt_sw_tx_bd *tx_buf = &txr->tx_buf_ring[j]; in bnxt_free_tx_skbs()
2740 tx_buf = &txr->tx_buf_ring[ring_idx]; in bnxt_free_tx_skbs()
3132 struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; in bnxt_free_tx_rings() local
3135 if (txr->tx_push) { in bnxt_free_tx_rings()
3137 txr->tx_push, txr->tx_push_mapping); in bnxt_free_tx_rings()
3138 txr->tx_push = NULL; in bnxt_free_tx_rings()
3141 ring = &txr->tx_ring_struct; in bnxt_free_tx_rings()
3168 struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; in bnxt_alloc_tx_rings() local
3172 ring = &txr->tx_ring_struct; in bnxt_alloc_tx_rings()
3178 ring->grp_idx = txr->bnapi->index; in bnxt_alloc_tx_rings()
3185 txr->tx_push = dma_alloc_coherent(&pdev->dev, in bnxt_alloc_tx_rings()
3187 &txr->tx_push_mapping, in bnxt_alloc_tx_rings()
3190 if (!txr->tx_push) in bnxt_alloc_tx_rings()
3193 mapping = txr->tx_push_mapping + in bnxt_alloc_tx_rings()
3195 txr->data_mapping = cpu_to_le64(mapping); in bnxt_alloc_tx_rings()
3395 struct bnxt_tx_ring_info *txr; in bnxt_init_ring_struct() local
3433 txr = bnapi->tx_ring; in bnxt_init_ring_struct()
3434 if (!txr) in bnxt_init_ring_struct()
3437 ring = &txr->tx_ring_struct; in bnxt_init_ring_struct()
3441 rmem->pg_arr = (void **)txr->tx_desc_ring; in bnxt_init_ring_struct()
3442 rmem->dma_arr = txr->tx_desc_mapping; in bnxt_init_ring_struct()
3444 rmem->vmem = (void **)&txr->tx_buf_ring; in bnxt_init_ring_struct()
3608 struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; in bnxt_init_tx_rings() local
3609 struct bnxt_ring_struct *ring = &txr->tx_ring_struct; in bnxt_init_tx_rings()
4235 struct bnxt_tx_ring_info *txr; in bnxt_clear_ring_indices() local
4243 txr = bnapi->tx_ring; in bnxt_clear_ring_indices()
4244 if (txr) { in bnxt_clear_ring_indices()
4245 txr->tx_prod = 0; in bnxt_clear_ring_indices()
4246 txr->tx_cons = 0; in bnxt_clear_ring_indices()
4407 struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; in bnxt_alloc_mem() local
4410 txr->tx_ring_struct.ring_mem.flags = 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()
4416 txr->txq_index = i - bp->tx_nr_rings_xdp; in bnxt_alloc_mem()
4978 static u16 bnxt_cp_ring_for_tx(struct bnxt *bp, struct bnxt_tx_ring_info *txr) in bnxt_cp_ring_for_tx() argument
4981 struct bnxt_napi *bnapi = txr->bnapi; in bnxt_cp_ring_for_tx()
4987 return bnxt_cp_ring_from_grp(bp, &txr->tx_ring_struct); in bnxt_cp_ring_for_tx()
5514 struct bnxt_tx_ring_info *txr; in hwrm_ring_alloc_send_msg() local
5516 txr = container_of(ring, struct bnxt_tx_ring_info, in hwrm_ring_alloc_send_msg()
5521 req->cmpl_ring_id = cpu_to_le16(bnxt_cp_ring_for_tx(bp, txr)); in hwrm_ring_alloc_send_msg()
5710 struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; in bnxt_hwrm_ring_alloc() local
5715 struct bnxt_napi *bnapi = txr->bnapi; in bnxt_hwrm_ring_alloc()
5731 ring = &txr->tx_ring_struct; in bnxt_hwrm_ring_alloc()
5736 bnxt_set_db(bp, &txr->tx_db, type, map_idx, ring->fw_ring_id); in bnxt_hwrm_ring_alloc()
5837 struct bnxt_tx_ring_info *txr = &bp->tx_ring[i]; in bnxt_hwrm_ring_free() local
5838 struct bnxt_ring_struct *ring = &txr->tx_ring_struct; in bnxt_hwrm_ring_free()
5841 u32 cmpl_ring_id = bnxt_cp_ring_for_tx(bp, txr); in bnxt_hwrm_ring_free()
9201 struct bnxt_tx_ring_info *txr; in bnxt_tx_disable() local
9205 txr = &bp->tx_ring[i]; in bnxt_tx_disable()
9206 WRITE_ONCE(txr->dev_state, BNXT_DEV_STATE_CLOSING); in bnxt_tx_disable()
9220 struct bnxt_tx_ring_info *txr; in bnxt_tx_enable() local
9223 txr = &bp->tx_ring[i]; in bnxt_tx_enable()
9224 WRITE_ONCE(txr->dev_state, 0); in bnxt_tx_enable()
11199 struct bnxt_tx_ring_info *txr = bnapi->tx_ring; in bnxt_dump_tx_sw_state() local
11202 if (!txr) in bnxt_dump_tx_sw_state()
11206 i, txr->tx_ring_struct.fw_ring_id, txr->tx_prod, in bnxt_dump_tx_sw_state()
11207 txr->tx_cons); in bnxt_dump_tx_sw_state()