Lines Matching refs:txr

253 static inline u32 bnx2_tx_avail(struct bnx2 *bp, struct bnx2_tx_ring_info *txr)  in bnx2_tx_avail()  argument
260 diff = READ_ONCE(txr->tx_prod) - READ_ONCE(txr->tx_cons); in bnx2_tx_avail()
703 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_free_tx_mem() local
705 if (txr->tx_desc_ring) { in bnx2_free_tx_mem()
707 txr->tx_desc_ring, in bnx2_free_tx_mem()
708 txr->tx_desc_mapping); in bnx2_free_tx_mem()
709 txr->tx_desc_ring = NULL; in bnx2_free_tx_mem()
711 kfree(txr->tx_buf_ring); in bnx2_free_tx_mem()
712 txr->tx_buf_ring = NULL; in bnx2_free_tx_mem()
755 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_alloc_tx_mem() local
757 txr->tx_buf_ring = kzalloc(SW_TXBD_RING_SIZE, GFP_KERNEL); in bnx2_alloc_tx_mem()
758 if (!txr->tx_buf_ring) in bnx2_alloc_tx_mem()
761 txr->tx_desc_ring = in bnx2_alloc_tx_mem()
763 &txr->tx_desc_mapping, GFP_KERNEL); in bnx2_alloc_tx_mem()
764 if (!txr->tx_desc_ring) in bnx2_alloc_tx_mem()
2850 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_tx_int() local
2860 sw_cons = txr->tx_cons; in bnx2_tx_int()
2869 tx_buf = &txr->tx_buf_ring[sw_ring_cons]; in bnx2_tx_int()
2900 tx_buf = &txr->tx_buf_ring[BNX2_TX_RING_IDX(sw_cons)]; in bnx2_tx_int()
2920 txr->hw_tx_cons = hw_cons; in bnx2_tx_int()
2921 txr->tx_cons = sw_cons; in bnx2_tx_int()
2931 (bnx2_tx_avail(bp, txr) > bp->tx_wake_thresh)) { in bnx2_tx_int()
2934 (bnx2_tx_avail(bp, txr) > bp->tx_wake_thresh)) in bnx2_tx_int()
3394 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_has_fast_work() local
3398 (bnx2_get_hw_tx_cons(bnapi) != txr->hw_tx_cons)) in bnx2_has_fast_work()
3488 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_poll_work() local
3491 if (bnx2_get_hw_tx_cons(bnapi) != txr->hw_tx_cons) in bnx2_poll_work()
5134 struct bnx2_tx_ring_info *txr; in bnx2_clear_ring_states() local
5140 txr = &bnapi->tx_ring; in bnx2_clear_ring_states()
5143 txr->tx_cons = 0; in bnx2_clear_ring_states()
5144 txr->hw_tx_cons = 0; in bnx2_clear_ring_states()
5154 bnx2_init_tx_context(struct bnx2 *bp, u32 cid, struct bnx2_tx_ring_info *txr) in bnx2_init_tx_context() argument
5176 val = (u64) txr->tx_desc_mapping >> 32; in bnx2_init_tx_context()
5179 val = (u64) txr->tx_desc_mapping & 0xffffffff; in bnx2_init_tx_context()
5189 struct bnx2_tx_ring_info *txr; in bnx2_init_tx_ring() local
5192 txr = &bnapi->tx_ring; in bnx2_init_tx_ring()
5201 txbd = &txr->tx_desc_ring[BNX2_MAX_TX_DESC_CNT]; in bnx2_init_tx_ring()
5203 txbd->tx_bd_haddr_hi = (u64) txr->tx_desc_mapping >> 32; in bnx2_init_tx_ring()
5204 txbd->tx_bd_haddr_lo = (u64) txr->tx_desc_mapping & 0xffffffff; in bnx2_init_tx_ring()
5206 txr->tx_prod = 0; in bnx2_init_tx_ring()
5207 txr->tx_prod_bseq = 0; in bnx2_init_tx_ring()
5209 txr->tx_bidx_addr = MB_GET_CID_ADDR(cid) + BNX2_L2CTX_TX_HOST_BIDX; in bnx2_init_tx_ring()
5210 txr->tx_bseq_addr = MB_GET_CID_ADDR(cid) + BNX2_L2CTX_TX_HOST_BSEQ; in bnx2_init_tx_ring()
5212 bnx2_init_tx_context(bp, cid, txr); in bnx2_init_tx_ring()
5439 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_free_tx_skbs() local
5442 if (!txr->tx_buf_ring) in bnx2_free_tx_skbs()
5446 struct bnx2_sw_tx_bd *tx_buf = &txr->tx_buf_ring[j]; in bnx2_free_tx_skbs()
5465 tx_buf = &txr->tx_buf_ring[BNX2_TX_RING_IDX(j)]; in bnx2_free_tx_skbs()
5820 struct bnx2_tx_ring_info *txr; in bnx2_run_loopback() local
5825 txr = &tx_napi->tx_ring; in bnx2_run_loopback()
5868 txbd = &txr->tx_desc_ring[BNX2_TX_RING_IDX(txr->tx_prod)]; in bnx2_run_loopback()
5876 txr->tx_prod = BNX2_NEXT_TX_BD(txr->tx_prod); in bnx2_run_loopback()
5877 txr->tx_prod_bseq += pkt_size; in bnx2_run_loopback()
5879 BNX2_WR16(bp, txr->tx_bidx_addr, txr->tx_prod); in bnx2_run_loopback()
5880 BNX2_WR(bp, txr->tx_bseq_addr, txr->tx_prod_bseq); in bnx2_run_loopback()
5894 if (bnx2_get_hw_tx_cons(tx_napi) != txr->tx_prod) in bnx2_run_loopback()
6605 struct bnx2_tx_ring_info *txr; in bnx2_start_xmit() local
6611 txr = &bnapi->tx_ring; in bnx2_start_xmit()
6614 if (unlikely(bnx2_tx_avail(bp, txr) < in bnx2_start_xmit()
6622 prod = txr->tx_prod; in bnx2_start_xmit()
6675 tx_buf = &txr->tx_buf_ring[ring_prod]; in bnx2_start_xmit()
6679 txbd = &txr->tx_desc_ring[ring_prod]; in bnx2_start_xmit()
6695 txbd = &txr->tx_desc_ring[ring_prod]; in bnx2_start_xmit()
6702 dma_unmap_addr_set(&txr->tx_buf_ring[ring_prod], mapping, in bnx2_start_xmit()
6719 txr->tx_prod_bseq += skb->len; in bnx2_start_xmit()
6721 BNX2_WR16(bp, txr->tx_bidx_addr, prod); in bnx2_start_xmit()
6722 BNX2_WR(bp, txr->tx_bseq_addr, txr->tx_prod_bseq); in bnx2_start_xmit()
6724 txr->tx_prod = prod; in bnx2_start_xmit()
6726 if (unlikely(bnx2_tx_avail(bp, txr) <= MAX_SKB_FRAGS)) { in bnx2_start_xmit()
6735 if (bnx2_tx_avail(bp, txr) > bp->tx_wake_thresh) in bnx2_start_xmit()
6745 prod = txr->tx_prod; in bnx2_start_xmit()
6747 tx_buf = &txr->tx_buf_ring[ring_prod]; in bnx2_start_xmit()
6756 tx_buf = &txr->tx_buf_ring[ring_prod]; in bnx2_start_xmit()