Skip to content

Commit fa00077

Browse files
Subbaraya SundeepPaolo Abeni
authored andcommitted
octeontx2: Add new tracepoint otx2_msg_status
Apart from netdev interface Octeontx2 PF does the following: 1. Sends its own requests to AF and receives responses from AF. 2. Receives async messages from AF. 3. Forwards VF requests to AF, sends respective responses from AF to VFs. 4. Sends async messages to VFs. This patch adds new tracepoint otx2_msg_status to display the status of PF wrt mailbox handling. Signed-off-by: Subbaraya Sundeep <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 27d27a0 commit fa00077

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
EXPORT_TRACEPOINT_SYMBOL(otx2_msg_alloc);
1212
EXPORT_TRACEPOINT_SYMBOL(otx2_msg_interrupt);
1313
EXPORT_TRACEPOINT_SYMBOL(otx2_msg_process);
14+
EXPORT_TRACEPOINT_SYMBOL(otx2_msg_status);

drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,21 @@ TRACE_EVENT(otx2_msg_wait_rsp,
118118
__get_str(dev))
119119
);
120120

121+
TRACE_EVENT(otx2_msg_status,
122+
TP_PROTO(const struct pci_dev *pdev, const char *msg, u16 num_msgs),
123+
TP_ARGS(pdev, msg, num_msgs),
124+
TP_STRUCT__entry(__string(dev, pci_name(pdev))
125+
__string(str, msg)
126+
__field(u16, num_msgs)
127+
),
128+
TP_fast_assign(__assign_str(dev);
129+
__assign_str(str);
130+
__entry->num_msgs = num_msgs;
131+
),
132+
TP_printk("[%s] %s num_msgs:%d\n", __get_str(dev),
133+
__get_str(str), __entry->num_msgs)
134+
);
135+
121136
#endif /* __RVU_TRACE_H */
122137

123138
#undef TRACE_INCLUDE_PATH

drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,9 @@ static void otx2_pfvf_mbox_handler(struct work_struct *work)
465465

466466
offset = ALIGN(sizeof(struct mbox_hdr), MBOX_MSG_ALIGN);
467467

468+
trace_otx2_msg_status(pf->pdev, "PF-VF down queue handler(forwarding)",
469+
vf_mbox->num_msgs);
470+
468471
for (id = 0; id < vf_mbox->num_msgs; id++) {
469472
msg = (struct mbox_msghdr *)(mdev->mbase + mbox->rx_start +
470473
offset);
@@ -503,6 +506,9 @@ static void otx2_pfvf_mbox_up_handler(struct work_struct *work)
503506

504507
offset = mbox->rx_start + ALIGN(sizeof(struct mbox_hdr), MBOX_MSG_ALIGN);
505508

509+
trace_otx2_msg_status(pf->pdev, "PF-VF up queue handler(response)",
510+
vf_mbox->up_num_msgs);
511+
506512
for (id = 0; id < vf_mbox->up_num_msgs; id++) {
507513
msg = mdev->mbase + offset;
508514

@@ -819,6 +825,9 @@ static void otx2_pfaf_mbox_handler(struct work_struct *work)
819825
offset = mbox->rx_start + ALIGN(sizeof(*rsp_hdr), MBOX_MSG_ALIGN);
820826
pf = af_mbox->pfvf;
821827

828+
trace_otx2_msg_status(pf->pdev, "PF-AF down queue handler(response)",
829+
num_msgs);
830+
822831
for (id = 0; id < num_msgs; id++) {
823832
msg = (struct mbox_msghdr *)(mdev->mbase + offset);
824833
otx2_process_pfaf_mbox_msg(pf, msg);
@@ -974,6 +983,9 @@ static void otx2_pfaf_mbox_up_handler(struct work_struct *work)
974983

975984
offset = mbox->rx_start + ALIGN(sizeof(*rsp_hdr), MBOX_MSG_ALIGN);
976985

986+
trace_otx2_msg_status(pf->pdev, "PF-AF up queue handler(notification)",
987+
num_msgs);
988+
977989
for (id = 0; id < num_msgs; id++) {
978990
msg = (struct mbox_msghdr *)(mdev->mbase + offset);
979991

@@ -1023,6 +1035,9 @@ static irqreturn_t otx2_pfaf_mbox_intr_handler(int irq, void *pf_irq)
10231035

10241036
trace_otx2_msg_interrupt(pf->pdev, "UP message from AF to PF",
10251037
BIT_ULL(0));
1038+
1039+
trace_otx2_msg_status(pf->pdev, "PF-AF up work queued(interrupt)",
1040+
hdr->num_msgs);
10261041
}
10271042

10281043
if (mbox_data & MBOX_DOWN_MSG) {
@@ -1039,6 +1054,9 @@ static irqreturn_t otx2_pfaf_mbox_intr_handler(int irq, void *pf_irq)
10391054

10401055
trace_otx2_msg_interrupt(pf->pdev, "DOWN reply from AF to PF",
10411056
BIT_ULL(0));
1057+
1058+
trace_otx2_msg_status(pf->pdev, "PF-AF down work queued(interrupt)",
1059+
hdr->num_msgs);
10421060
}
10431061

10441062
return IRQ_HANDLED;

0 commit comments

Comments
 (0)