Lines Matching refs:tcb
137 bnad_txq_cleanup(struct bnad *bnad, struct bna_tcb *tcb) in bnad_txq_cleanup() argument
139 struct bnad_tx_unmap *unmap_q = tcb->unmap_q; in bnad_txq_cleanup()
143 for (i = 0; i < tcb->q_depth; i++) { in bnad_txq_cleanup()
147 bnad_tx_buff_unmap(bnad, unmap_q, tcb->q_depth, i); in bnad_txq_cleanup()
159 bnad_txcmpl_process(struct bnad *bnad, struct bna_tcb *tcb) in bnad_txcmpl_process() argument
163 struct bnad_tx_unmap *unmap_q = tcb->unmap_q; in bnad_txcmpl_process()
168 if (!test_bit(BNAD_TXQ_TX_STARTED, &tcb->flags)) in bnad_txcmpl_process()
171 hw_cons = *(tcb->hw_consumer_index); in bnad_txcmpl_process()
173 cons = tcb->consumer_index; in bnad_txcmpl_process()
174 q_depth = tcb->q_depth; in bnad_txcmpl_process()
177 BUG_ON(!(wis <= BNA_QE_IN_USE_CNT(tcb, tcb->q_depth))); in bnad_txcmpl_process()
195 tcb->consumer_index = hw_cons; in bnad_txcmpl_process()
197 tcb->txq->tx_packets += sent_packets; in bnad_txcmpl_process()
198 tcb->txq->tx_bytes += sent_bytes; in bnad_txcmpl_process()
204 bnad_tx_complete(struct bnad *bnad, struct bna_tcb *tcb) in bnad_tx_complete() argument
209 if (test_and_set_bit(BNAD_TXQ_FREE_SENT, &tcb->flags)) in bnad_tx_complete()
212 sent = bnad_txcmpl_process(bnad, tcb); in bnad_tx_complete()
216 BNA_QE_FREE_CNT(tcb, tcb->q_depth) >= in bnad_tx_complete()
218 if (test_bit(BNAD_TXQ_TX_STARTED, &tcb->flags)) { in bnad_tx_complete()
225 if (likely(test_bit(BNAD_TXQ_TX_STARTED, &tcb->flags))) in bnad_tx_complete()
226 bna_ib_ack(tcb->i_dbell, sent); in bnad_tx_complete()
229 clear_bit(BNAD_TXQ_FREE_SENT, &tcb->flags); in bnad_tx_complete()
238 struct bna_tcb *tcb = (struct bna_tcb *)data; in bnad_msix_tx() local
239 struct bnad *bnad = tcb->bnad; in bnad_msix_tx()
241 bnad_tx_complete(bnad, tcb); in bnad_msix_tx()
800 struct bna_tcb *tcb = NULL; in bnad_isr() local
827 tcb = bnad->tx_info[i].tcb[j]; in bnad_isr()
828 if (tcb && test_bit(BNAD_TXQ_TX_STARTED, &tcb->flags)) in bnad_isr()
829 bnad_tx_complete(bnad, bnad->tx_info[i].tcb[j]); in bnad_isr()
953 struct bna_tcb *tcb = in bnad_cb_ethport_link_status() local
954 bnad->tx_info[tx_id].tcb[tcb_id]; in bnad_cb_ethport_link_status()
956 if (!tcb) in bnad_cb_ethport_link_status()
959 txq_id = tcb->id; in bnad_cb_ethport_link_status()
962 &tcb->flags)) { in bnad_cb_ethport_link_status()
999 bnad_cb_tcb_setup(struct bnad *bnad, struct bna_tcb *tcb) in bnad_cb_tcb_setup() argument
1002 (struct bnad_tx_info *)tcb->txq->tx->priv; in bnad_cb_tcb_setup()
1004 tcb->priv = tcb; in bnad_cb_tcb_setup()
1005 tx_info->tcb[tcb->id] = tcb; in bnad_cb_tcb_setup()
1009 bnad_cb_tcb_destroy(struct bnad *bnad, struct bna_tcb *tcb) in bnad_cb_tcb_destroy() argument
1012 (struct bnad_tx_info *)tcb->txq->tx->priv; in bnad_cb_tcb_destroy()
1014 tx_info->tcb[tcb->id] = NULL; in bnad_cb_tcb_destroy()
1015 tcb->priv = NULL; in bnad_cb_tcb_destroy()
1042 struct bna_tcb *tcb; in bnad_cb_tx_stall() local
1047 tcb = tx_info->tcb[i]; in bnad_cb_tx_stall()
1048 if (!tcb) in bnad_cb_tx_stall()
1050 txq_id = tcb->id; in bnad_cb_tx_stall()
1051 clear_bit(BNAD_TXQ_TX_STARTED, &tcb->flags); in bnad_cb_tx_stall()
1060 struct bna_tcb *tcb; in bnad_cb_tx_resume() local
1065 tcb = tx_info->tcb[i]; in bnad_cb_tx_resume()
1066 if (!tcb) in bnad_cb_tx_resume()
1068 txq_id = tcb->id; in bnad_cb_tx_resume()
1070 BUG_ON(test_bit(BNAD_TXQ_TX_STARTED, &tcb->flags)); in bnad_cb_tx_resume()
1071 set_bit(BNAD_TXQ_TX_STARTED, &tcb->flags); in bnad_cb_tx_resume()
1072 BUG_ON(*(tcb->hw_consumer_index) != 0); in bnad_cb_tx_resume()
1100 struct bna_tcb *tcb; in bnad_tx_cleanup() local
1105 tcb = tx_info->tcb[i]; in bnad_tx_cleanup()
1106 if (!tcb) in bnad_tx_cleanup()
1109 bnad = tcb->bnad; in bnad_tx_cleanup()
1111 if (test_and_set_bit(BNAD_TXQ_FREE_SENT, &tcb->flags)) { in bnad_tx_cleanup()
1116 bnad_txq_cleanup(bnad, tcb); in bnad_tx_cleanup()
1119 clear_bit(BNAD_TXQ_FREE_SENT, &tcb->flags); in bnad_tx_cleanup()
1137 struct bna_tcb *tcb; in bnad_cb_tx_cleanup() local
1141 tcb = tx_info->tcb[i]; in bnad_cb_tx_cleanup()
1142 if (!tcb) in bnad_cb_tx_cleanup()
1517 if (tx_info->tcb[i] == NULL) in bnad_tx_msix_unregister()
1520 vector_num = tx_info->tcb[i]->intr_vector; in bnad_tx_msix_unregister()
1521 free_irq(bnad->msix_table[vector_num].vector, tx_info->tcb[i]); in bnad_tx_msix_unregister()
1537 vector_num = tx_info->tcb[i]->intr_vector; in bnad_tx_msix_register()
1538 sprintf(tx_info->tcb[i]->name, "%s TXQ %d", bnad->netdev->name, in bnad_tx_msix_register()
1539 tx_id + tx_info->tcb[i]->id); in bnad_tx_msix_register()
1542 tx_info->tcb[i]->name, in bnad_tx_msix_register()
1543 tx_info->tcb[i]); in bnad_tx_msix_register()
1925 if (tx_info->tcb[0]->intr_type == BNA_INTR_T_MSIX) in bnad_destroy_tx()
2411 if (bnad->tx_info[i].tcb[j]) { in bnad_netdev_qstats_fill()
2413 bnad->tx_info[i].tcb[j]->txq->tx_packets; in bnad_netdev_qstats_fill()
2415 bnad->tx_info[i].tcb[j]->txq->tx_bytes; in bnad_netdev_qstats_fill()
2802 bnad_txq_wi_prepare(struct bnad *bnad, struct bna_tcb *tcb, in bnad_txq_wi_prepare() argument
2814 vlan_tag = ((tcb->priority & 0x7) << VLAN_PRIO_SHIFT) in bnad_txq_wi_prepare()
2915 struct bna_tcb *tcb = NULL; in bnad_start_xmit() local
2943 tcb = bnad->tx_info[0].tcb[txq_id]; in bnad_start_xmit()
2949 if (unlikely(!tcb || !test_bit(BNAD_TXQ_TX_STARTED, &tcb->flags))) { in bnad_start_xmit()
2955 q_depth = tcb->q_depth; in bnad_start_xmit()
2956 prod = tcb->producer_index; in bnad_start_xmit()
2957 unmap_q = tcb->unmap_q; in bnad_start_xmit()
2969 if (unlikely(wis > BNA_QE_FREE_CNT(tcb, q_depth))) { in bnad_start_xmit()
2970 if ((*tcb->hw_consumer_index != tcb->consumer_index) && in bnad_start_xmit()
2971 !test_and_set_bit(BNAD_TXQ_FREE_SENT, &tcb->flags)) { in bnad_start_xmit()
2973 sent = bnad_txcmpl_process(bnad, tcb); in bnad_start_xmit()
2974 if (likely(test_bit(BNAD_TXQ_TX_STARTED, &tcb->flags))) in bnad_start_xmit()
2975 bna_ib_ack(tcb->i_dbell, sent); in bnad_start_xmit()
2977 clear_bit(BNAD_TXQ_FREE_SENT, &tcb->flags); in bnad_start_xmit()
2989 if (likely(wis > BNA_QE_FREE_CNT(tcb, q_depth))) { in bnad_start_xmit()
2998 txqent = &((struct bna_txq_entry *)tcb->sw_q)[prod]; in bnad_start_xmit()
3002 if (bnad_txq_wi_prepare(bnad, tcb, skb, txqent)) { in bnad_start_xmit()
3033 tcb->producer_index); in bnad_start_xmit()
3045 txqent = &((struct bna_txq_entry *)tcb->sw_q)[prod]; in bnad_start_xmit()
3055 tcb->producer_index); in bnad_start_xmit()
3071 bnad_tx_buff_unmap(bnad, unmap_q, q_depth, tcb->producer_index); in bnad_start_xmit()
3078 tcb->producer_index = prod; in bnad_start_xmit()
3082 if (unlikely(!test_bit(BNAD_TXQ_TX_STARTED, &tcb->flags))) in bnad_start_xmit()
3087 bna_txq_prod_indx_doorbell(tcb); in bnad_start_xmit()