Lines Matching refs:txr

247 static inline u32 bnx2_tx_avail(struct bnx2 *bp, struct bnx2_tx_ring_info *txr)  in bnx2_tx_avail()  argument
254 diff = READ_ONCE(txr->tx_prod) - READ_ONCE(txr->tx_cons); in bnx2_tx_avail()
697 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_free_tx_mem() local
699 if (txr->tx_desc_ring) { in bnx2_free_tx_mem()
701 txr->tx_desc_ring, in bnx2_free_tx_mem()
702 txr->tx_desc_mapping); in bnx2_free_tx_mem()
703 txr->tx_desc_ring = NULL; in bnx2_free_tx_mem()
705 kfree(txr->tx_buf_ring); in bnx2_free_tx_mem()
706 txr->tx_buf_ring = NULL; in bnx2_free_tx_mem()
749 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_alloc_tx_mem() local
751 txr->tx_buf_ring = kzalloc(SW_TXBD_RING_SIZE, GFP_KERNEL); in bnx2_alloc_tx_mem()
752 if (!txr->tx_buf_ring) in bnx2_alloc_tx_mem()
755 txr->tx_desc_ring = in bnx2_alloc_tx_mem()
757 &txr->tx_desc_mapping, GFP_KERNEL); in bnx2_alloc_tx_mem()
758 if (!txr->tx_desc_ring) in bnx2_alloc_tx_mem()
2844 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_tx_int() local
2854 sw_cons = txr->tx_cons; in bnx2_tx_int()
2863 tx_buf = &txr->tx_buf_ring[sw_ring_cons]; in bnx2_tx_int()
2894 tx_buf = &txr->tx_buf_ring[BNX2_TX_RING_IDX(sw_cons)]; in bnx2_tx_int()
2914 txr->hw_tx_cons = hw_cons; in bnx2_tx_int()
2915 txr->tx_cons = sw_cons; in bnx2_tx_int()
2925 (bnx2_tx_avail(bp, txr) > bp->tx_wake_thresh)) { in bnx2_tx_int()
2928 (bnx2_tx_avail(bp, txr) > bp->tx_wake_thresh)) in bnx2_tx_int()
3388 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_has_fast_work() local
3392 (bnx2_get_hw_tx_cons(bnapi) != txr->hw_tx_cons)) in bnx2_has_fast_work()
3482 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_poll_work() local
3485 if (bnx2_get_hw_tx_cons(bnapi) != txr->hw_tx_cons) in bnx2_poll_work()
5128 struct bnx2_tx_ring_info *txr; in bnx2_clear_ring_states() local
5134 txr = &bnapi->tx_ring; in bnx2_clear_ring_states()
5137 txr->tx_cons = 0; in bnx2_clear_ring_states()
5138 txr->hw_tx_cons = 0; in bnx2_clear_ring_states()
5148 bnx2_init_tx_context(struct bnx2 *bp, u32 cid, struct bnx2_tx_ring_info *txr) in bnx2_init_tx_context() argument
5170 val = (u64) txr->tx_desc_mapping >> 32; in bnx2_init_tx_context()
5173 val = (u64) txr->tx_desc_mapping & 0xffffffff; in bnx2_init_tx_context()
5183 struct bnx2_tx_ring_info *txr; in bnx2_init_tx_ring() local
5186 txr = &bnapi->tx_ring; in bnx2_init_tx_ring()
5195 txbd = &txr->tx_desc_ring[BNX2_MAX_TX_DESC_CNT]; in bnx2_init_tx_ring()
5197 txbd->tx_bd_haddr_hi = (u64) txr->tx_desc_mapping >> 32; in bnx2_init_tx_ring()
5198 txbd->tx_bd_haddr_lo = (u64) txr->tx_desc_mapping & 0xffffffff; in bnx2_init_tx_ring()
5200 txr->tx_prod = 0; in bnx2_init_tx_ring()
5201 txr->tx_prod_bseq = 0; in bnx2_init_tx_ring()
5203 txr->tx_bidx_addr = MB_GET_CID_ADDR(cid) + BNX2_L2CTX_TX_HOST_BIDX; in bnx2_init_tx_ring()
5204 txr->tx_bseq_addr = MB_GET_CID_ADDR(cid) + BNX2_L2CTX_TX_HOST_BSEQ; in bnx2_init_tx_ring()
5206 bnx2_init_tx_context(bp, cid, txr); in bnx2_init_tx_ring()
5433 struct bnx2_tx_ring_info *txr = &bnapi->tx_ring; in bnx2_free_tx_skbs() local
5436 if (!txr->tx_buf_ring) in bnx2_free_tx_skbs()
5440 struct bnx2_sw_tx_bd *tx_buf = &txr->tx_buf_ring[j]; in bnx2_free_tx_skbs()
5459 tx_buf = &txr->tx_buf_ring[BNX2_TX_RING_IDX(j)]; in bnx2_free_tx_skbs()
5814 struct bnx2_tx_ring_info *txr; in bnx2_run_loopback() local
5819 txr = &tx_napi->tx_ring; in bnx2_run_loopback()
5862 txbd = &txr->tx_desc_ring[BNX2_TX_RING_IDX(txr->tx_prod)]; in bnx2_run_loopback()
5870 txr->tx_prod = BNX2_NEXT_TX_BD(txr->tx_prod); in bnx2_run_loopback()
5871 txr->tx_prod_bseq += pkt_size; in bnx2_run_loopback()
5873 BNX2_WR16(bp, txr->tx_bidx_addr, txr->tx_prod); in bnx2_run_loopback()
5874 BNX2_WR(bp, txr->tx_bseq_addr, txr->tx_prod_bseq); in bnx2_run_loopback()
5888 if (bnx2_get_hw_tx_cons(tx_napi) != txr->tx_prod) in bnx2_run_loopback()
6599 struct bnx2_tx_ring_info *txr; in bnx2_start_xmit() local
6605 txr = &bnapi->tx_ring; in bnx2_start_xmit()
6608 if (unlikely(bnx2_tx_avail(bp, txr) < in bnx2_start_xmit()
6616 prod = txr->tx_prod; in bnx2_start_xmit()
6670 tx_buf = &txr->tx_buf_ring[ring_prod]; in bnx2_start_xmit()
6674 txbd = &txr->tx_desc_ring[ring_prod]; in bnx2_start_xmit()
6690 txbd = &txr->tx_desc_ring[ring_prod]; in bnx2_start_xmit()
6697 dma_unmap_addr_set(&txr->tx_buf_ring[ring_prod], mapping, in bnx2_start_xmit()
6714 txr->tx_prod_bseq += skb->len; in bnx2_start_xmit()
6716 BNX2_WR16(bp, txr->tx_bidx_addr, prod); in bnx2_start_xmit()
6717 BNX2_WR(bp, txr->tx_bseq_addr, txr->tx_prod_bseq); in bnx2_start_xmit()
6719 txr->tx_prod = prod; in bnx2_start_xmit()
6721 if (unlikely(bnx2_tx_avail(bp, txr) <= MAX_SKB_FRAGS)) { in bnx2_start_xmit()
6730 if (bnx2_tx_avail(bp, txr) > bp->tx_wake_thresh) in bnx2_start_xmit()
6740 prod = txr->tx_prod; in bnx2_start_xmit()
6742 tx_buf = &txr->tx_buf_ring[ring_prod]; in bnx2_start_xmit()
6751 tx_buf = &txr->tx_buf_ring[ring_prod]; in bnx2_start_xmit()