hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/infiniband/hw/hfi1/ipoib_tx.c
....@@ -15,6 +15,7 @@
1515 #include "verbs.h"
1616 #include "trace_ibhdrs.h"
1717 #include "ipoib.h"
18
+#include "trace_tx.h"
1819
1920 /* Add a convenience helper */
2021 #define CIRC_ADD(val, add, size) (((val) + (add)) & ((size) - 1))
....@@ -63,12 +64,14 @@
6364
6465 static void hfi1_ipoib_stop_txq(struct hfi1_ipoib_txq *txq)
6566 {
67
+ trace_hfi1_txq_stop(txq);
6668 if (atomic_inc_return(&txq->stops) == 1)
6769 netif_stop_subqueue(txq->priv->netdev, txq->q_idx);
6870 }
6971
7072 static void hfi1_ipoib_wake_txq(struct hfi1_ipoib_txq *txq)
7173 {
74
+ trace_hfi1_txq_wake(txq);
7275 if (atomic_dec_and_test(&txq->stops))
7376 netif_wake_subqueue(txq->priv->netdev, txq->q_idx);
7477 }
....@@ -89,8 +92,10 @@
8992 {
9093 ++txq->sent_txreqs;
9194 if (hfi1_ipoib_used(txq) >= hfi1_ipoib_ring_hwat(txq) &&
92
- !atomic_xchg(&txq->ring_full, 1))
95
+ !atomic_xchg(&txq->ring_full, 1)) {
96
+ trace_hfi1_txq_full(txq);
9397 hfi1_ipoib_stop_txq(txq);
98
+ }
9499 }
95100
96101 static void hfi1_ipoib_check_queue_stopped(struct hfi1_ipoib_txq *txq)
....@@ -112,8 +117,10 @@
112117 * to protect against ring overflow.
113118 */
114119 if (hfi1_ipoib_used(txq) < hfi1_ipoib_ring_lwat(txq) &&
115
- atomic_xchg(&txq->ring_full, 0))
120
+ atomic_xchg(&txq->ring_full, 0)) {
121
+ trace_hfi1_txq_xmit_unstopped(txq);
116122 hfi1_ipoib_wake_txq(txq);
123
+ }
117124 }
118125
119126 static void hfi1_ipoib_free_tx(struct ipoib_txreq *tx, int budget)
....@@ -247,7 +254,8 @@
247254 txreq,
248255 skb_frag_page(frag),
249256 frag->bv_offset,
250
- skb_frag_size(frag));
257
+ skb_frag_size(frag),
258
+ NULL, NULL, NULL);
251259 if (unlikely(ret))
252260 break;
253261 }
....@@ -405,6 +413,7 @@
405413 sdma_select_engine_sc(priv->dd,
406414 txp->flow.tx_queue,
407415 txp->flow.sc5);
416
+ trace_hfi1_flow_switch(txp->txq);
408417 }
409418
410419 return tx;
....@@ -525,6 +534,7 @@
525534 if (txq->flow.as_int != txp->flow.as_int) {
526535 int ret;
527536
537
+ trace_hfi1_flow_flush(txq);
528538 ret = hfi1_ipoib_flush_tx_list(dev, txq);
529539 if (unlikely(ret)) {
530540 if (ret == -EBUSY)
....@@ -635,8 +645,10 @@
635645 /* came from non-list submit */
636646 list_add_tail(&txreq->list, &txq->tx_list);
637647 if (list_empty(&txq->wait.list)) {
638
- if (!atomic_xchg(&txq->no_desc, 1))
648
+ if (!atomic_xchg(&txq->no_desc, 1)) {
649
+ trace_hfi1_txq_queued(txq);
639650 hfi1_ipoib_stop_txq(txq);
651
+ }
640652 iowait_queue(pkts_sent, wait->iow, &sde->dmawait);
641653 }
642654
....@@ -659,6 +671,7 @@
659671 struct hfi1_ipoib_txq *txq =
660672 container_of(wait, struct hfi1_ipoib_txq, wait);
661673
674
+ trace_hfi1_txq_wakeup(txq);
662675 if (likely(txq->priv->netdev->reg_state == NETREG_REGISTERED))
663676 iowait_schedule(wait, system_highpri_wq, WORK_CPU_UNBOUND);
664677 }