Lines Matching defs:txo

220 static void be_txq_notify(struct be_adapter *adapter, struct be_tx_obj *txo,
228 val |= txo->q.id & DB_TXULP_RING_ID_MASK;
232 iowrite32(val, adapter->db + txo->db_offset);
658 struct be_tx_obj *txo;
678 for_all_tx_queues(adapter, txo, i) {
679 const struct be_tx_stats *tx_stats = tx_stats(txo);
683 pkts = tx_stats(txo)->tx_pkts;
684 bytes = tx_stats(txo)->tx_bytes;
744 static void be_tx_stats_update(struct be_tx_obj *txo, struct sk_buff *skb)
746 struct be_tx_stats *stats = tx_stats(txo);
815 static inline bool be_is_txq_full(struct be_tx_obj *txo)
817 return atomic_read(&txo->q.used) + BE_MAX_TX_FRAG_COUNT >= txo->q.len;
820 static inline bool be_can_txq_wake(struct be_tx_obj *txo)
822 return atomic_read(&txo->q.used) < txo->q.len / 2;
825 static inline bool be_is_tx_compl_pending(struct be_tx_obj *txo)
827 return atomic_read(&txo->q.used) > txo->pend_wrb_cnt;
917 static u32 be_tx_get_wrb_hdr(struct be_tx_obj *txo)
919 u32 head = txo->q.head;
921 queue_head_inc(&txo->q);
927 struct be_tx_obj *txo,
932 struct be_queue_info *txq = &txo->q;
938 BUG_ON(txo->sent_skb_list[head]);
939 txo->sent_skb_list[head] = skb;
940 txo->last_req_hdr = head;
942 txo->last_req_wrb_cnt = num_frags;
943 txo->pend_wrb_cnt += num_frags;
947 static void be_tx_setup_wrb_frag(struct be_tx_obj *txo, dma_addr_t busaddr,
951 struct be_queue_info *txq = &txo->q;
963 struct be_tx_obj *txo, u32 head, bool map_single,
968 struct be_queue_info *txq = &txo->q;
990 static u32 be_xmit_enqueue(struct be_adapter *adapter, struct be_tx_obj *txo,
1001 head = be_tx_get_wrb_hdr(txo);
1010 be_tx_setup_wrb_frag(txo, busaddr, len);
1021 be_tx_setup_wrb_frag(txo, busaddr, len);
1025 be_tx_setup_wrb_hdr(adapter, txo, wrb_params, skb, head);
1027 be_tx_stats_update(txo, skb);
1032 be_xmit_restore(adapter, txo, head, map_single, copied);
1224 static void be_xmit_flush(struct be_adapter *adapter, struct be_tx_obj *txo)
1226 struct be_queue_info *txq = &txo->q;
1227 struct be_eth_hdr_wrb *hdr = queue_index_node(txq, txo->last_req_hdr);
1234 if (!lancer_chip(adapter) && (txo->pend_wrb_cnt & 1)) {
1238 txo->pend_wrb_cnt++;
1241 hdr->dw[2] |= cpu_to_le32((txo->last_req_wrb_cnt + 1) <<
1244 be_txq_notify(adapter, txo, txo->pend_wrb_cnt);
1245 txo->pend_wrb_cnt = 0;
1372 struct be_tx_obj *txo = &adapter->tx_obj[q_idx];
1383 wrb_cnt = be_xmit_enqueue(adapter, txo, skb, &wrb_params);
1392 wrb_cnt = be_xmit_enqueue(adapter, txo, skb, &wrb_params);
1399 if (be_is_txq_full(txo)) {
1401 tx_stats(txo)->tx_stops++;
1405 be_xmit_flush(adapter, txo);
1411 tx_stats(txo)->tx_drv_drops++;
1413 if (flush && txo->pend_wrb_cnt)
1414 be_xmit_flush(adapter, txo);
1423 struct be_tx_obj *txo;
1431 for_all_tx_queues(adapter, txo, i) {
1433 i, txo->q.head, txo->q.tail,
1434 atomic_read(&txo->q.used), txo->q.id);
1436 entry = txo->q.dma_mem.va;
1446 entry = txo->cq.dma_mem.va;
1448 i, txo->cq.head, txo->cq.tail,
1449 atomic_read(&txo->cq.used));
1460 if (txo->sent_skb_list[j]) {
1461 skb = txo->sent_skb_list[j];
2142 struct be_tx_obj *txo;
2163 for_all_tx_queues_on_eq(adapter, eqo, txo, i) {
2165 start = u64_stats_fetch_begin(&txo->stats.sync);
2166 tx_pkts += txo->stats.tx_reqs;
2167 } while (u64_stats_fetch_retry(&txo->stats.sync, start));
2669 static inline void be_update_tx_err(struct be_tx_obj *txo, u8 status)
2673 tx_stats(txo)->tx_hdr_parse_err++;
2676 tx_stats(txo)->tx_dma_err++;
2679 tx_stats(txo)->tx_spoof_check_err++;
2684 static inline void lancer_update_tx_err(struct be_tx_obj *txo, u8 status)
2688 tx_stats(txo)->tx_tso_err++;
2692 tx_stats(txo)->tx_spoof_check_err++;
2695 tx_stats(txo)->tx_qinq_err++;
2698 tx_stats(txo)->tx_internal_parity_err++;
2701 tx_stats(txo)->tx_dma_err++;
2704 tx_stats(txo)->tx_sge_err++;
2710 struct be_tx_obj *txo)
2712 struct be_queue_info *tx_cq = &txo->cq;
2713 struct be_tx_compl_info *txcp = &txo->txcp;
2728 lancer_update_tx_err(txo, txcp->status);
2737 be_update_tx_err(txo, txcp->status);
2750 struct be_tx_obj *txo, u16 last_index)
2752 struct sk_buff **sent_skbs = txo->sent_skb_list;
2753 struct be_queue_info *txq = &txo->q;
2875 struct be_tx_obj *txo;
2882 for_all_tx_queues(adapter, txo, i) {
2885 txq = &txo->q;
2886 while ((txcp = be_tx_compl_get(adapter, txo))) {
2888 be_tx_compl_process(adapter, txo,
2893 be_cq_notify(adapter, txo->cq.id, false, cmpl);
2897 if (!be_is_tx_compl_pending(txo))
2909 for_all_tx_queues(adapter, txo, i) {
2910 txq = &txo->q;
2922 num_wrbs = be_tx_compl_process(adapter, txo, end_idx);
2925 txo->pend_wrb_cnt = 0;
3043 struct be_tx_obj *txo;
3046 for_all_tx_queues(adapter, txo, i) {
3047 q = &txo->q;
3052 q = &txo->cq;
3062 struct be_tx_obj *txo;
3068 for_all_tx_queues(adapter, txo, i) {
3069 cq = &txo->cq;
3075 u64_stats_init(&txo->stats.sync);
3076 u64_stats_init(&txo->stats.sync_compl);
3086 status = be_queue_alloc(adapter, &txo->q, TX_Q_LEN,
3091 status = be_cmd_txq_create(adapter, txo);
3266 static void be_process_tx(struct be_adapter *adapter, struct be_tx_obj *txo,
3272 while ((txcp = be_tx_compl_get(adapter, txo))) {
3273 num_wrbs += be_tx_compl_process(adapter, txo, txcp->end_index);
3278 be_cq_notify(adapter, txo->cq.id, true, work_done);
3279 atomic_sub(num_wrbs, &txo->q.used);
3284 be_can_txq_wake(txo)) {
3288 u64_stats_update_begin(&tx_stats(txo)->sync_compl);
3289 tx_stats(txo)->tx_compl += work_done;
3290 u64_stats_update_end(&tx_stats(txo)->sync_compl);
3300 struct be_tx_obj *txo;
3305 for_all_tx_queues_on_eq(adapter, eqo, txo, i)
3306 be_process_tx(adapter, txo, i);
3798 struct be_tx_obj *txo;
3817 for_all_tx_queues(adapter, txo, i)
3818 be_cq_notify(adapter, txo->cq.id, true, 0);