octeontx2: Add new tracepoint otx2_msg_status
authorSubbaraya Sundeep <sbhatta@marvell.com>
Tue, 13 May 2025 11:40:08 +0000 (17:10 +0530)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 15 May 2025 11:25:16 +0000 (13:25 +0200)
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 <sbhatta@marvell.com>
Link: https://patch.msgid.link/1747136408-30685-5-git-send-email-sbhatta@marvell.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.c
drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c

index 775fd4c3579470a31589714e26c97b3225a14c72..5f69380ccc82c332fbb46c9977fd875c9affe2c8 100644 (file)
@@ -11,3 +11,4 @@
 EXPORT_TRACEPOINT_SYMBOL(otx2_msg_alloc);
 EXPORT_TRACEPOINT_SYMBOL(otx2_msg_interrupt);
 EXPORT_TRACEPOINT_SYMBOL(otx2_msg_process);
+EXPORT_TRACEPOINT_SYMBOL(otx2_msg_status);
index abbdb0361fb8bf07614b604b091f3020c8edc114..db02b4d6ed4bf73a59ff24be061fd445db321dd6 100644 (file)
@@ -118,6 +118,21 @@ TRACE_EVENT(otx2_msg_wait_rsp,
                      __get_str(dev))
 );
 
+TRACE_EVENT(otx2_msg_status,
+           TP_PROTO(const struct pci_dev *pdev, const char *msg, u16 num_msgs),
+           TP_ARGS(pdev, msg, num_msgs),
+           TP_STRUCT__entry(__string(dev, pci_name(pdev))
+                            __string(str, msg)
+                            __field(u16, num_msgs)
+           ),
+           TP_fast_assign(__assign_str(dev);
+                          __assign_str(str);
+                          __entry->num_msgs = num_msgs;
+           ),
+           TP_printk("[%s] %s num_msgs:%d\n", __get_str(dev),
+                     __get_str(str), __entry->num_msgs)
+);
+
 #endif /* __RVU_TRACE_H */
 
 #undef TRACE_INCLUDE_PATH
index 1bbc17b34d7c6f984d8fafd50c04aa3fda17449a..d79b4b30176d9da04eaae08559bcd2776025d9d4 100644 (file)
@@ -465,6 +465,9 @@ static void otx2_pfvf_mbox_handler(struct work_struct *work)
 
        offset = ALIGN(sizeof(struct mbox_hdr), MBOX_MSG_ALIGN);
 
+       trace_otx2_msg_status(pf->pdev, "PF-VF down queue handler(forwarding)",
+                             vf_mbox->num_msgs);
+
        for (id = 0; id < vf_mbox->num_msgs; id++) {
                msg = (struct mbox_msghdr *)(mdev->mbase + mbox->rx_start +
                                             offset);
@@ -503,6 +506,9 @@ static void otx2_pfvf_mbox_up_handler(struct work_struct *work)
 
        offset = mbox->rx_start + ALIGN(sizeof(struct mbox_hdr), MBOX_MSG_ALIGN);
 
+       trace_otx2_msg_status(pf->pdev, "PF-VF up queue handler(response)",
+                             vf_mbox->up_num_msgs);
+
        for (id = 0; id < vf_mbox->up_num_msgs; id++) {
                msg = mdev->mbase + offset;
 
@@ -819,6 +825,9 @@ static void otx2_pfaf_mbox_handler(struct work_struct *work)
        offset = mbox->rx_start + ALIGN(sizeof(*rsp_hdr), MBOX_MSG_ALIGN);
        pf = af_mbox->pfvf;
 
+       trace_otx2_msg_status(pf->pdev, "PF-AF down queue handler(response)",
+                             num_msgs);
+
        for (id = 0; id < num_msgs; id++) {
                msg = (struct mbox_msghdr *)(mdev->mbase + offset);
                otx2_process_pfaf_mbox_msg(pf, msg);
@@ -974,6 +983,9 @@ static void otx2_pfaf_mbox_up_handler(struct work_struct *work)
 
        offset = mbox->rx_start + ALIGN(sizeof(*rsp_hdr), MBOX_MSG_ALIGN);
 
+       trace_otx2_msg_status(pf->pdev, "PF-AF up queue handler(notification)",
+                             num_msgs);
+
        for (id = 0; id < num_msgs; id++) {
                msg = (struct mbox_msghdr *)(mdev->mbase + offset);
 
@@ -1023,6 +1035,9 @@ static irqreturn_t otx2_pfaf_mbox_intr_handler(int irq, void *pf_irq)
 
                trace_otx2_msg_interrupt(pf->pdev, "UP message from AF to PF",
                                         BIT_ULL(0));
+
+               trace_otx2_msg_status(pf->pdev, "PF-AF up work queued(interrupt)",
+                                     hdr->num_msgs);
        }
 
        if (mbox_data & MBOX_DOWN_MSG) {
@@ -1039,6 +1054,9 @@ static irqreturn_t otx2_pfaf_mbox_intr_handler(int irq, void *pf_irq)
 
                trace_otx2_msg_interrupt(pf->pdev, "DOWN reply from AF to PF",
                                         BIT_ULL(0));
+
+               trace_otx2_msg_status(pf->pdev, "PF-AF down work queued(interrupt)",
+                                     hdr->num_msgs);
        }
 
        return IRQ_HANDLED;