.. | .. |
---|
15 | 15 | #include "verbs.h" |
---|
16 | 16 | #include "trace_ibhdrs.h" |
---|
17 | 17 | #include "ipoib.h" |
---|
| 18 | +#include "trace_tx.h" |
---|
18 | 19 | |
---|
19 | 20 | /* Add a convenience helper */ |
---|
20 | 21 | #define CIRC_ADD(val, add, size) (((val) + (add)) & ((size) - 1)) |
---|
.. | .. |
---|
63 | 64 | |
---|
64 | 65 | static void hfi1_ipoib_stop_txq(struct hfi1_ipoib_txq *txq) |
---|
65 | 66 | { |
---|
| 67 | + trace_hfi1_txq_stop(txq); |
---|
66 | 68 | if (atomic_inc_return(&txq->stops) == 1) |
---|
67 | 69 | netif_stop_subqueue(txq->priv->netdev, txq->q_idx); |
---|
68 | 70 | } |
---|
69 | 71 | |
---|
70 | 72 | static void hfi1_ipoib_wake_txq(struct hfi1_ipoib_txq *txq) |
---|
71 | 73 | { |
---|
| 74 | + trace_hfi1_txq_wake(txq); |
---|
72 | 75 | if (atomic_dec_and_test(&txq->stops)) |
---|
73 | 76 | netif_wake_subqueue(txq->priv->netdev, txq->q_idx); |
---|
74 | 77 | } |
---|
.. | .. |
---|
89 | 92 | { |
---|
90 | 93 | ++txq->sent_txreqs; |
---|
91 | 94 | 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); |
---|
93 | 97 | hfi1_ipoib_stop_txq(txq); |
---|
| 98 | + } |
---|
94 | 99 | } |
---|
95 | 100 | |
---|
96 | 101 | static void hfi1_ipoib_check_queue_stopped(struct hfi1_ipoib_txq *txq) |
---|
.. | .. |
---|
112 | 117 | * to protect against ring overflow. |
---|
113 | 118 | */ |
---|
114 | 119 | 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); |
---|
116 | 122 | hfi1_ipoib_wake_txq(txq); |
---|
| 123 | + } |
---|
117 | 124 | } |
---|
118 | 125 | |
---|
119 | 126 | static void hfi1_ipoib_free_tx(struct ipoib_txreq *tx, int budget) |
---|
.. | .. |
---|
247 | 254 | txreq, |
---|
248 | 255 | skb_frag_page(frag), |
---|
249 | 256 | frag->bv_offset, |
---|
250 | | - skb_frag_size(frag)); |
---|
| 257 | + skb_frag_size(frag), |
---|
| 258 | + NULL, NULL, NULL); |
---|
251 | 259 | if (unlikely(ret)) |
---|
252 | 260 | break; |
---|
253 | 261 | } |
---|
.. | .. |
---|
405 | 413 | sdma_select_engine_sc(priv->dd, |
---|
406 | 414 | txp->flow.tx_queue, |
---|
407 | 415 | txp->flow.sc5); |
---|
| 416 | + trace_hfi1_flow_switch(txp->txq); |
---|
408 | 417 | } |
---|
409 | 418 | |
---|
410 | 419 | return tx; |
---|
.. | .. |
---|
525 | 534 | if (txq->flow.as_int != txp->flow.as_int) { |
---|
526 | 535 | int ret; |
---|
527 | 536 | |
---|
| 537 | + trace_hfi1_flow_flush(txq); |
---|
528 | 538 | ret = hfi1_ipoib_flush_tx_list(dev, txq); |
---|
529 | 539 | if (unlikely(ret)) { |
---|
530 | 540 | if (ret == -EBUSY) |
---|
.. | .. |
---|
635 | 645 | /* came from non-list submit */ |
---|
636 | 646 | list_add_tail(&txreq->list, &txq->tx_list); |
---|
637 | 647 | 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); |
---|
639 | 650 | hfi1_ipoib_stop_txq(txq); |
---|
| 651 | + } |
---|
640 | 652 | iowait_queue(pkts_sent, wait->iow, &sde->dmawait); |
---|
641 | 653 | } |
---|
642 | 654 | |
---|
.. | .. |
---|
659 | 671 | struct hfi1_ipoib_txq *txq = |
---|
660 | 672 | container_of(wait, struct hfi1_ipoib_txq, wait); |
---|
661 | 673 | |
---|
| 674 | + trace_hfi1_txq_wakeup(txq); |
---|
662 | 675 | if (likely(txq->priv->netdev->reg_state == NETREG_REGISTERED)) |
---|
663 | 676 | iowait_schedule(wait, system_highpri_wq, WORK_CPU_UNBOUND); |
---|
664 | 677 | } |
---|