octeontx2-pf: Add tracepoints for PF/VF mailbox
authorSubbaraya Sundeep <sbhatta@marvell.com>
Tue, 22 Sep 2020 02:57:05 +0000 (08:27 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Sep 2020 00:35:26 +0000 (17:35 -0700)
With tracepoints support present in the mailbox
code this patch adds tracepoints in PF and VF drivers
at places where mailbox messages are allocated,
sent and at message interrupts.

Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c

index ac47762..d6253f2 100644 (file)
@@ -20,6 +20,7 @@
 #include <mbox.h>
 #include "otx2_reg.h"
 #include "otx2_txrx.h"
+#include <rvu_trace.h>
 
 /* PCI device IDs */
 #define PCI_DEVID_OCTEONTX2_RVU_PF              0xA063
@@ -523,6 +524,7 @@ static struct _req_type __maybe_unused                                      \
                return NULL;                                            \
        req->hdr.sig = OTX2_MBOX_REQ_SIG;                               \
        req->hdr.id = _id;                                              \
+       trace_otx2_msg_alloc(mbox->mbox.pdev, _id, sizeof(*req));       \
        return req;                                                     \
 }
 
index aac2845..265e4d1 100644 (file)
@@ -22,6 +22,7 @@
 #include "otx2_txrx.h"
 #include "otx2_struct.h"
 #include "otx2_ptp.h"
+#include <rvu_trace.h>
 
 #define DRV_NAME       "octeontx2-nicpf"
 #define DRV_STRING     "Marvell OcteonTX2 NIC Physical Function Driver"
@@ -558,6 +559,8 @@ static irqreturn_t otx2_pfvf_mbox_intr_handler(int irq, void *pf_irq)
 
        otx2_queue_work(mbox, pf->mbox_pfvf_wq, 0, vfs, intr, TYPE_PFVF);
 
+       trace_otx2_msg_interrupt(mbox->mbox.pdev, "VF(s) to PF", intr);
+
        return IRQ_HANDLED;
 }
 
@@ -940,6 +943,9 @@ static irqreturn_t otx2_pfaf_mbox_intr_handler(int irq, void *pf_irq)
        otx2_write64(pf, RVU_PF_INT, BIT_ULL(0));
 
        mbox = &pf->mbox;
+
+       trace_otx2_msg_interrupt(mbox->mbox.pdev, "AF to PF", BIT_ULL(0));
+
        otx2_queue_work(mbox, pf->mbox_wq, 0, 1, 1, TYPE_PFAF);
 
        return IRQ_HANDLED;
index 70e0d4c..32daa3e 100644 (file)
@@ -187,6 +187,8 @@ static irqreturn_t otx2vf_vfaf_mbox_intr_handler(int irq, void *vf_irq)
        mdev = &mbox->dev[0];
        otx2_sync_mbox_bbuf(mbox, 0);
 
+       trace_otx2_msg_interrupt(mbox->pdev, "PF to VF", BIT_ULL(0));
+
        hdr = (struct mbox_hdr *)(mdev->mbase + mbox->rx_start);
        if (hdr->num_msgs) {
                vf->mbox.num_msgs = hdr->num_msgs;