Skip to contentSkip to conversation

octeontx2: Improve mailbox tracing

PATCH Superseded Subbaraya Sundeep 3 participants 11 messages May 12, 2025 – May 13, 2025

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Subbaraya Sundeep

author maintainer
#0 lore raw

cover octeontx2: Improve mailbox tracing

Octeontx2 VF,PF and AF devices communicate using hardware shared mailbox region where VFs can only to talk to its PFs and PFs can only talk to AF. AF does the entire resource management for all PFs and VFs. The shared mbox region is used for synchronous requests (requests from PF to AF or VF to PF) and async notifications (notifications from AF to PFs or PF to VFs). Sending a request to AF from VF involves various stages like
1. VF allocates message in shared region
2. Triggers interrupt to PF
3. PF upon receiving interrupt from VF will copy the message from VF<->PF region to PF<->AF region
4. Triggers interrupt to AF
5. AF processes it and writes response in PF<->AF region
6. Triggers interrupt to PF
7. PF copies responses from PF<->AF region to VF<->PF region
8. Triggers interrupt to Vf
9. VF reads response in VF<->PF region

Due to various stages involved, Tracepoints are used in mailbox code for debugging. Existing tracepoints need some improvements so that maximum information can be inferred from trace logs during an issue. This patchset tries to enhance existing tracepoints and also adds a couple of tracepoints.

Subbaraya Sundeep (4):
octeontx2-af: convert dev_dbg to tracepoint in mbox
octeontx2-af: Display names for CPT and UP messages
octeontx2: Add pcifunc also to mailbox tracepoints
octeontx2: Add new tracepoint otx2_msg_status

 drivers/net/ethernet/marvell/octeontx2/af/mbox.c   | 17 ++++--
 drivers/net/ethernet/marvell/octeontx2/af/rvu.c    |  2 +-
 .../net/ethernet/marvell/octeontx2/af/rvu_cgx.c    |  2 +-
 .../net/ethernet/marvell/octeontx2/af/rvu_trace.c  |  1 +
 .../net/ethernet/marvell/octeontx2/af/rvu_trace.h  | 62 +++++++++++++++++-----
 .../ethernet/marvell/octeontx2/nic/otx2_common.h   |  4 +-
 .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c   | 21 +++++++-
 .../net/ethernet/marvell/octeontx2/nic/otx2_vf.c   |  2 +-
 8 files changed, 91 insertions(+), 20 deletions(-)
Signature · 1 line
2.7.4
author maintainer
#1 lore raw

PATCH 1/4 octeontx2-af: convert dev_dbg to tracepoint in mbox

Use tracepoint instead of dev_dbg since the entire mailbox code uses tracepoints for debugging.

---
 drivers/net/ethernet/marvell/octeontx2/af/mbox.c      |  3 +--
 drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h | 11 +++++++++++
 2 files changed, 12 insertions(+), 2 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/mbox.c +1 -2
index 1e5aa53..5547d20 100644
@@ -188,14 +188,13 @@ int otx2_mbox_wait_for_rsp(struct otx2_mbox *mbox, int devid)
 {
 	unsigned long timeout = jiffies + msecs_to_jiffies(MBOX_RSP_TIMEOUT);
 	struct otx2_mbox_dev *mdev = &mbox->dev[devid];
-	struct device *sender = &mbox->pdev->dev;
 
 	while (!time_after(jiffies, timeout)) {
 		if (mdev->num_msgs == mdev->msgs_acked)
 			return 0;
 		usleep_range(800, 1000);
 	}
-	dev_dbg(sender, "timed out while waiting for rsp\n");
+	trace_otx2_msg_wait_rsp(mbox->pdev);
 	return -EIO;
 }
 EXPORT_SYMBOL(otx2_mbox_wait_for_rsp);
drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h +11 -0
index 5704520f..f3b28c1 100644
@@ -95,6 +95,17 @@ TRACE_EVENT(otx2_msg_process,
 		      otx2_mbox_id2name(__entry->id), __entry->err)
 );
 
+TRACE_EVENT(otx2_msg_wait_rsp,
+	    TP_PROTO(const struct pci_dev *pdev),
+	    TP_ARGS(pdev),
+	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
+	    ),
+	    TP_fast_assign(__assign_str(dev, pci_name(pdev))
+	    ),
+	    TP_printk("[%s] timed out while waiting for response\n",
+		      __get_str(dev))
+);
+
 #endif /* __RVU_TRACE_H */
 
 #undef TRACE_INCLUDE_PATH
Signature · 1 line
2.7.4
#2 lore raw

Re: [net-next PATCH 1/4] octeontx2-af: convert dev_dbg to tracepoint in mbox

kernel test robot noticed the following build errors:

Hi Subbaraya,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Subbaraya-Sundeep/octeontx2-af-convert-dev_dbg-to-tracepoint-in-mbox/20250512-164344
base:   net-next/main
patch link:    https://lore.kernel.org/r/1747039315-3372-2-git-send-email-sbhatta%40marvell.com
patch subject: [net-next PATCH 1/4] octeontx2-af: convert dev_dbg to tracepoint in mbox
config: x86_64-buildonly-randconfig-002-20250513 (https://download.01.org/0day-ci/archive/20250513/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250513/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

In file included from include/trace/trace_events.h:468,
from include/trace/define_trace.h:119,
from drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h:117, from drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.c:9:

>> drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:107:1: error: macro "__assign_str" passed 2 arguments, but takes just 1
     107 | );
         | ^~            
   In file included from include/trace/trace_events.h:400:
   include/trace/stages/stage6_event_callback.h:34: note: macro "__assign_str" defined here
      34 | #define __assign_str(dst)                                               \
         | 
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h: In function 'do_trace_event_raw_event_otx2_msg_wait_rsp':
>> drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:103:28: error: '__assign_str' undeclared (first use in this function)
     103 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |                            ^~~~~~~~~~~~
   include/trace/trace_events.h:427:11: note: in definition of macro '__DECLARE_EVENT_CLASS'
     427 |         { assign; }                                                     \
         |           ^~~~~~
   include/trace/trace_events.h:435:23: note: in expansion of macro 'PARAMS'
     435 |                       PARAMS(assign), PARAMS(print))                    \
         |                       ^~~~~~
   include/trace/trace_events.h:40:9: note: in expansion of macro 'DECLARE_EVENT_CLASS'
      40 |         DECLARE_EVENT_CLASS(name,                              \
         |         ^~~~~~~~~~~~~~~~~~~
   include/trace/trace_events.h:44:30: note: in expansion of macro 'PARAMS'
      44 |                              PARAMS(assign),                   \
         |                              ^~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:98:1: note: in expansion of macro 'TRACE_EVENT'
      98 | TRACE_EVENT(otx2_msg_wait_rsp,
         | ^~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:103:13: note: in expansion of macro 'TP_fast_assign'
     103 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |             ^~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:103:28: note: each undeclared identifier is reported only once for each function it appears in
     103 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |                            ^~~~~~~~~~~~
   include/trace/trace_events.h:427:11: note: in definition of macro '__DECLARE_EVENT_CLASS'
     427 |         { assign; }                                                     \
         |           ^~~~~~
   include/trace/trace_events.h:435:23: note: in expansion of macro 'PARAMS'
     435 |                       PARAMS(assign), PARAMS(print))                    \
         |                       ^~~~~~
   include/trace/trace_events.h:40:9: note: in expansion of macro 'DECLARE_EVENT_CLASS'
      40 |         DECLARE_EVENT_CLASS(name,                              \
         |         ^~~~~~~~~~~~~~~~~~~
   include/trace/trace_events.h:44:30: note: in expansion of macro 'PARAMS'
      44 |                              PARAMS(assign),                   \
         |                              ^~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:98:1: note: in expansion of macro 'TRACE_EVENT'
      98 | TRACE_EVENT(otx2_msg_wait_rsp,
         | ^~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:103:13: note: in expansion of macro 'TP_fast_assign'
     103 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |             ^~~~~~~~~~~~~~
   In file included from include/trace/trace_events.h:523:
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h: At top level:
>> drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:107:1: error: macro "__assign_str" passed 2 arguments, but takes just 1
     107 | );
         | ^~            
   include/trace/stages/stage6_event_callback.h:34: note: macro "__assign_str" defined here
      34 | #define __assign_str(dst)                                               \
         | 
   In file included from include/trace/perf.h:110,
                    from include/trace/define_trace.h:120:
>> drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:107:1: error: macro "__assign_str" passed 2 arguments, but takes just 1
     107 | );
         | ^~            
   In file included from include/trace/perf.h:7:
   include/trace/stages/stage6_event_callback.h:34: note: macro "__assign_str" defined here
      34 | #define __assign_str(dst)                                               \
         | 
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h: In function 'do_perf_trace_otx2_msg_wait_rsp':
>> drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:103:28: error: '__assign_str' undeclared (first use in this function)
     103 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |                            ^~~~~~~~~~~~
   include/trace/perf.h:51:11: note: in definition of macro '__DECLARE_EVENT_CLASS'
      51 |         { assign; }                                                     \
         |           ^~~~~~
   include/trace/perf.h:67:23: note: in expansion of macro 'PARAMS'
      67 |                       PARAMS(assign), PARAMS(print))                    \
         |                       ^~~~~~
   include/trace/trace_events.h:40:9: note: in expansion of macro 'DECLARE_EVENT_CLASS'
      40 |         DECLARE_EVENT_CLASS(name,                              \
         |         ^~~~~~~~~~~~~~~~~~~
   include/trace/trace_events.h:44:30: note: in expansion of macro 'PARAMS'
      44 |                              PARAMS(assign),                   \
         |                              ^~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:98:1: note: in expansion of macro 'TRACE_EVENT'
      98 | TRACE_EVENT(otx2_msg_wait_rsp,
         | ^~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:103:13: note: in expansion of macro 'TP_fast_assign'
     103 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |             ^~~~~~~~~~~~~~
   In file included from include/trace/bpf_probe.h:131,
                    from include/trace/define_trace.h:121:
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h: At top level:
>> drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:107:1: error: macro "__assign_str" passed 2 arguments, but takes just 1
     107 | );
         | ^~            
   In file included from include/trace/bpf_probe.h:7:
   include/trace/stages/stage6_event_callback.h:34: note: macro "__assign_str" defined here
      34 | #define __assign_str(dst)                                               \
         | 

vim +/__assign_str +107 drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h

    97	
    98	TRACE_EVENT(otx2_msg_wait_rsp,
    99		    TP_PROTO(const struct pci_dev *pdev),
   100		    TP_ARGS(pdev),
   101		    TP_STRUCT__entry(__string(dev, pci_name(pdev))
   102		    ),
 > 103		    TP_fast_assign(__assign_str(dev, pci_name(pdev))
   104		    ),
   105		    TP_printk("[%s] timed out while waiting for response\n",
   106			      __get_str(dev))
 > 107	);

108

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
author maintainer
#3 lore raw

PATCH 2/4 octeontx2-af: Display names for CPT and UP messages

In reply to Subbaraya Sundeep

Mailbox UP messages and CPT messages names are not being displayed with their names in trace log files. Add those messages too in otx2_mbox_id2name.

---
 drivers/net/ethernet/marvell/octeontx2/af/mbox.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/mbox.c +8 -0
index 5547d20..5c457e4 100644
@@ -444,6 +444,14 @@ const char *otx2_mbox_id2name(u16 id)
 #define M(_name, _id, _1, _2, _3) case _id: return # _name;
 	MBOX_MESSAGES
 #undef M
+
+#define M(_name, _id, _1, _2, _3) case _id: return # _name;
+	MBOX_UP_CGX_MESSAGES
+#undef M
+
+#define M(_name, _id, _1, _2, _3) case _id: return # _name;
+	MBOX_UP_CPT_MESSAGES
+#undef M
 	default:
 		return "INVALID ID";
 	}
Signature · 1 line
2.7.4
author maintainer
#4 lore raw

PATCH 3/4 octeontx2: Add pcifunc also to mailbox tracepoints

In reply to Subbaraya Sundeep

This patch adds pcifunc which represents PF and VF device to the tracepoints otx2_msg_alloc, otx2_msg_send, otx2_msg_process so that it is easier to correlate which device allocated the message, which device forwarded it and which device processed that message. Also add message id in otx2_msg_send tracepoint to check which message is sent at any point of time from a device.

---
 drivers/net/ethernet/marvell/octeontx2/af/mbox.c   |  6 +++-
 drivers/net/ethernet/marvell/octeontx2/af/rvu.c    |  2 +-
 .../net/ethernet/marvell/octeontx2/af/rvu_cgx.c    |  2 +-
 .../net/ethernet/marvell/octeontx2/af/rvu_trace.h  | 36 ++++++++++++++--------
 .../ethernet/marvell/octeontx2/nic/otx2_common.h   |  4 ++-
 .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c   |  3 +-
 .../net/ethernet/marvell/octeontx2/nic/otx2_vf.c   |  2 +-
 7 files changed, 37 insertions(+), 18 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/mbox.c +5 -1
index 5c457e4..7d21905 100644
@@ -218,6 +218,7 @@ static void otx2_mbox_msg_send_data(struct otx2_mbox *mbox, int devid, u64 data)
 	struct otx2_mbox_dev *mdev = &mbox->dev[devid];
 	struct mbox_hdr *tx_hdr, *rx_hdr;
 	void *hw_mbase = mdev->hwbase;
+	struct mbox_msghdr *msg;
 	u64 intr_val;
 
 	tx_hdr = hw_mbase + mbox->tx_start;
@@ -250,7 +251,10 @@ static void otx2_mbox_msg_send_data(struct otx2_mbox *mbox, int devid, u64 data)
 	tx_hdr->num_msgs = mdev->num_msgs;
 	rx_hdr->num_msgs = 0;
 
-	trace_otx2_msg_send(mbox->pdev, tx_hdr->num_msgs, tx_hdr->msg_size);
+	msg = (struct mbox_msghdr *)(hw_mbase + mbox->tx_start + msgs_offset);
+
+	trace_otx2_msg_send(mbox->pdev, tx_hdr->num_msgs, tx_hdr->msg_size,
+			    msg->id, msg->pcifunc);
 
 	spin_unlock(&mdev->mbox_lock);
 
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +1 -1
index 6575c42..511eb5b 100644
@@ -2173,7 +2173,7 @@ static int rvu_process_mbox_msg(struct otx2_mbox *mbox, int devid,
 		if (rsp && err)						\
 			rsp->hdr.rc = err;				\
 									\
-		trace_otx2_msg_process(mbox->pdev, _id, err);		\
+		trace_otx2_msg_process(mbox->pdev, _id, err, req->pcifunc); \
 		return rsp ? err : -ENOMEM;				\
 	}
 MBOX_MESSAGES
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +1 -1
index 992fa0b..38db06b 100644
@@ -34,7 +34,7 @@ static struct _req_type __maybe_unused					\
 		return NULL;						\
 	req->hdr.sig = OTX2_MBOX_REQ_SIG;				\
 	req->hdr.id = _id;						\
-	trace_otx2_msg_alloc(rvu->pdev, _id, sizeof(*req));		\
+	trace_otx2_msg_alloc(rvu->pdev, _id, sizeof(*req), 0);		\
 	return req;							\
 }
 
drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h +24 -12
index f3b28c1..721d4a5 100644
@@ -18,33 +18,42 @@
 #include "mbox.h"
 
 TRACE_EVENT(otx2_msg_alloc,
-	    TP_PROTO(const struct pci_dev *pdev, u16 id, u64 size),
-	    TP_ARGS(pdev, id, size),
+	    TP_PROTO(const struct pci_dev *pdev, u16 id, u64 size, u16 pcifunc),
+	    TP_ARGS(pdev, id, size, pcifunc),
 	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
 			     __field(u16, id)
 			     __field(u64, size)
+			     __field(u16, pcifunc)
 	    ),
 	    TP_fast_assign(__assign_str(dev);
 			   __entry->id = id;
 			   __entry->size = size;
+			   __entry->pcifunc = pcifunc;
 	    ),
-	    TP_printk("[%s] msg:(%s) size:%lld\n", __get_str(dev),
-		      otx2_mbox_id2name(__entry->id), __entry->size)
+	    TP_printk("[%s] msg:(%s) size:%lld pcifunc:0x%x\n", __get_str(dev),
+		      otx2_mbox_id2name(__entry->id), __entry->size,
+		      __entry->pcifunc)
 );
 
 TRACE_EVENT(otx2_msg_send,
-	    TP_PROTO(const struct pci_dev *pdev, u16 num_msgs, u64 msg_size),
-	    TP_ARGS(pdev, num_msgs, msg_size),
+	    TP_PROTO(const struct pci_dev *pdev, u16 num_msgs, u64 msg_size,
+		     u16 id, u16 pcifunc),
+	    TP_ARGS(pdev, num_msgs, msg_size, id, pcifunc),
 	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
 			     __field(u16, num_msgs)
 			     __field(u64, msg_size)
+			     __field(u16, id)
+			     __field(u16, pcifunc)
 	    ),
 	    TP_fast_assign(__assign_str(dev);
 			   __entry->num_msgs = num_msgs;
 			   __entry->msg_size = msg_size;
+			   __entry->id = id;
+			   __entry->pcifunc = pcifunc;
 	    ),
-	    TP_printk("[%s] sent %d msg(s) of size:%lld\n", __get_str(dev),
-		      __entry->num_msgs, __entry->msg_size)
+	    TP_printk("[%s] sent %d msg(s) of size:%lld msg:(%s) pcifunc:0x%x\n",
+		      __get_str(dev), __entry->num_msgs, __entry->msg_size,
+		      otx2_mbox_id2name(__entry->id), __entry->pcifunc)
 );
 
 TRACE_EVENT(otx2_msg_check,
@@ -81,18 +90,21 @@ TRACE_EVENT(otx2_msg_interrupt,
 );
 
 TRACE_EVENT(otx2_msg_process,
-	    TP_PROTO(const struct pci_dev *pdev, u16 id, int err),
-	    TP_ARGS(pdev, id, err),
+	    TP_PROTO(const struct pci_dev *pdev, u16 id, int err, u16 pcifunc),
+	    TP_ARGS(pdev, id, err, pcifunc),
 	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
 			     __field(u16, id)
 			     __field(int, err)
+			     __field(u16, pcifunc)
 	    ),
 	    TP_fast_assign(__assign_str(dev);
 			   __entry->id = id;
 			   __entry->err = err;
+			   __entry->pcifunc = pcifunc;
 	    ),
-	    TP_printk("[%s] msg:(%s) error:%d\n", __get_str(dev),
-		      otx2_mbox_id2name(__entry->id), __entry->err)
+	    TP_printk("[%s] msg:(%s) error:%d pcifunc:0x%x\n", __get_str(dev),
+		      otx2_mbox_id2name(__entry->id),
+		      __entry->err, __entry->pcifunc)
 );
 
 TRACE_EVENT(otx2_msg_wait_rsp,
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +3 -1
index 7e3ddb0..d188936 100644
@@ -871,6 +871,7 @@ static struct _req_type __maybe_unused					\
 *otx2_mbox_alloc_msg_ ## _fn_name(struct mbox *mbox)                    \
 {									\
 	struct _req_type *req;						\
+	u16 pcifunc = mbox->pfvf->pcifunc;				\
 									\
 	req = (struct _req_type *)otx2_mbox_alloc_msg_rsp(		\
 		&mbox->mbox, 0, sizeof(struct _req_type),		\
@@ -879,7 +880,8 @@ 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));	\
+	req->hdr.pcifunc = pcifunc;					\
+	trace_otx2_msg_alloc(mbox->mbox.pdev, _id, sizeof(*req), pcifunc); \
 	return req;							\
 }
 
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +2 -1
index 0aee8e3..1bbc17b 100644
@@ -473,7 +473,7 @@ static void otx2_pfvf_mbox_handler(struct work_struct *work)
 			goto inval_msg;
 
 		/* Set VF's number in each of the msg */
-		msg->pcifunc &= RVU_PFVF_FUNC_MASK;
+		msg->pcifunc &= ~RVU_PFVF_FUNC_MASK;
 		msg->pcifunc |= (vf_idx + 1) & RVU_PFVF_FUNC_MASK;
 		offset = msg->next_msgoff;
 	}
@@ -3285,6 +3285,7 @@ static void otx2_vf_link_event_task(struct work_struct *work)
 	req = (struct cgx_link_info_msg *)msghdr;
 	req->hdr.id = MBOX_MSG_CGX_LINK_EVENT;
 	req->hdr.sig = OTX2_MBOX_REQ_SIG;
+	req->hdr.pcifunc = pf->pcifunc;
 	memcpy(&req->link_info, &pf->linfo, sizeof(req->link_info));
 
 	otx2_mbox_wait_for_zero(&pf->mbox_pfvf[0].mbox_up, vf_idx);
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c +1 -1
index fb4da81..ba4ae6d 100644
@@ -136,7 +136,7 @@ static int otx2vf_process_mbox_msg_up(struct otx2_nic *vf,
 
 		rsp->hdr.id = MBOX_MSG_CGX_LINK_EVENT;
 		rsp->hdr.sig = OTX2_MBOX_RSP_SIG;
-		rsp->hdr.pcifunc = 0;
+		rsp->hdr.pcifunc = req->pcifunc;
 		rsp->hdr.rc = 0;
 		err = otx2_mbox_up_handler_cgx_link_event(
 				vf, (struct cgx_link_info_msg *)req, rsp);
Signature · 1 line
2.7.4
author maintainer
#5 lore raw

PATCH 3/5 octeontx2: Improve mailbox tracepoints for debugging

In reply to Subbaraya Sundeep

There are various stages involved when a VF sends a message to AF. Say for a VF to send a message to AF below are the steps:
1. VF sends message to PF
2. PF receives interrupt from VF
3. PF forwards to AF
4. AF processes it and sends response back to PF
5. PF sends back the response to VF.
This patch adds pcifunc which represents PF and VF device to the tracepoints otx2_msg_alloc, otx2_msg_send, otx2_msg_process so that it is easier to correlate which device allocated the message, which device forwarded it and which device processed that message. Also add message id in otx2_msg_send tracepoint to check which message is sent at any point of time from a device.

---
 drivers/net/ethernet/marvell/octeontx2/af/mbox.c   |  6 +++-
 drivers/net/ethernet/marvell/octeontx2/af/rvu.c    |  2 +-
 .../net/ethernet/marvell/octeontx2/af/rvu_cgx.c    |  2 +-
 .../net/ethernet/marvell/octeontx2/af/rvu_trace.h  | 36 ++++++++++++++--------
 .../ethernet/marvell/octeontx2/nic/otx2_common.h   |  4 ++-
 .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c   |  3 +-
 .../net/ethernet/marvell/octeontx2/nic/otx2_vf.c   |  2 +-
 7 files changed, 37 insertions(+), 18 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/mbox.c +5 -1
index 5c457e4..7d21905 100644
@@ -218,6 +218,7 @@ static void otx2_mbox_msg_send_data(struct otx2_mbox *mbox, int devid, u64 data)
 	struct otx2_mbox_dev *mdev = &mbox->dev[devid];
 	struct mbox_hdr *tx_hdr, *rx_hdr;
 	void *hw_mbase = mdev->hwbase;
+	struct mbox_msghdr *msg;
 	u64 intr_val;
 
 	tx_hdr = hw_mbase + mbox->tx_start;
@@ -250,7 +251,10 @@ static void otx2_mbox_msg_send_data(struct otx2_mbox *mbox, int devid, u64 data)
 	tx_hdr->num_msgs = mdev->num_msgs;
 	rx_hdr->num_msgs = 0;
 
-	trace_otx2_msg_send(mbox->pdev, tx_hdr->num_msgs, tx_hdr->msg_size);
+	msg = (struct mbox_msghdr *)(hw_mbase + mbox->tx_start + msgs_offset);
+
+	trace_otx2_msg_send(mbox->pdev, tx_hdr->num_msgs, tx_hdr->msg_size,
+			    msg->id, msg->pcifunc);
 
 	spin_unlock(&mdev->mbox_lock);
 
drivers/net/ethernet/marvell/octeontx2/af/rvu.c +1 -1
index 6575c42..511eb5b 100644
@@ -2173,7 +2173,7 @@ static int rvu_process_mbox_msg(struct otx2_mbox *mbox, int devid,
 		if (rsp && err)						\
 			rsp->hdr.rc = err;				\
 									\
-		trace_otx2_msg_process(mbox->pdev, _id, err);		\
+		trace_otx2_msg_process(mbox->pdev, _id, err, req->pcifunc); \
 		return rsp ? err : -ENOMEM;				\
 	}
 MBOX_MESSAGES
drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +1 -1
index 992fa0b..38db06b 100644
@@ -34,7 +34,7 @@ static struct _req_type __maybe_unused					\
 		return NULL;						\
 	req->hdr.sig = OTX2_MBOX_REQ_SIG;				\
 	req->hdr.id = _id;						\
-	trace_otx2_msg_alloc(rvu->pdev, _id, sizeof(*req));		\
+	trace_otx2_msg_alloc(rvu->pdev, _id, sizeof(*req), 0);		\
 	return req;							\
 }
 
drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h +24 -12
index f3b28c1..721d4a5 100644
@@ -18,33 +18,42 @@
 #include "mbox.h"
 
 TRACE_EVENT(otx2_msg_alloc,
-	    TP_PROTO(const struct pci_dev *pdev, u16 id, u64 size),
-	    TP_ARGS(pdev, id, size),
+	    TP_PROTO(const struct pci_dev *pdev, u16 id, u64 size, u16 pcifunc),
+	    TP_ARGS(pdev, id, size, pcifunc),
 	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
 			     __field(u16, id)
 			     __field(u64, size)
+			     __field(u16, pcifunc)
 	    ),
 	    TP_fast_assign(__assign_str(dev);
 			   __entry->id = id;
 			   __entry->size = size;
+			   __entry->pcifunc = pcifunc;
 	    ),
-	    TP_printk("[%s] msg:(%s) size:%lld\n", __get_str(dev),
-		      otx2_mbox_id2name(__entry->id), __entry->size)
+	    TP_printk("[%s] msg:(%s) size:%lld pcifunc:0x%x\n", __get_str(dev),
+		      otx2_mbox_id2name(__entry->id), __entry->size,
+		      __entry->pcifunc)
 );
 
 TRACE_EVENT(otx2_msg_send,
-	    TP_PROTO(const struct pci_dev *pdev, u16 num_msgs, u64 msg_size),
-	    TP_ARGS(pdev, num_msgs, msg_size),
+	    TP_PROTO(const struct pci_dev *pdev, u16 num_msgs, u64 msg_size,
+		     u16 id, u16 pcifunc),
+	    TP_ARGS(pdev, num_msgs, msg_size, id, pcifunc),
 	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
 			     __field(u16, num_msgs)
 			     __field(u64, msg_size)
+			     __field(u16, id)
+			     __field(u16, pcifunc)
 	    ),
 	    TP_fast_assign(__assign_str(dev);
 			   __entry->num_msgs = num_msgs;
 			   __entry->msg_size = msg_size;
+			   __entry->id = id;
+			   __entry->pcifunc = pcifunc;
 	    ),
-	    TP_printk("[%s] sent %d msg(s) of size:%lld\n", __get_str(dev),
-		      __entry->num_msgs, __entry->msg_size)
+	    TP_printk("[%s] sent %d msg(s) of size:%lld msg:(%s) pcifunc:0x%x\n",
+		      __get_str(dev), __entry->num_msgs, __entry->msg_size,
+		      otx2_mbox_id2name(__entry->id), __entry->pcifunc)
 );
 
 TRACE_EVENT(otx2_msg_check,
@@ -81,18 +90,21 @@ TRACE_EVENT(otx2_msg_interrupt,
 );
 
 TRACE_EVENT(otx2_msg_process,
-	    TP_PROTO(const struct pci_dev *pdev, u16 id, int err),
-	    TP_ARGS(pdev, id, err),
+	    TP_PROTO(const struct pci_dev *pdev, u16 id, int err, u16 pcifunc),
+	    TP_ARGS(pdev, id, err, pcifunc),
 	    TP_STRUCT__entry(__string(dev, pci_name(pdev))
 			     __field(u16, id)
 			     __field(int, err)
+			     __field(u16, pcifunc)
 	    ),
 	    TP_fast_assign(__assign_str(dev);
 			   __entry->id = id;
 			   __entry->err = err;
+			   __entry->pcifunc = pcifunc;
 	    ),
-	    TP_printk("[%s] msg:(%s) error:%d\n", __get_str(dev),
-		      otx2_mbox_id2name(__entry->id), __entry->err)
+	    TP_printk("[%s] msg:(%s) error:%d pcifunc:0x%x\n", __get_str(dev),
+		      otx2_mbox_id2name(__entry->id),
+		      __entry->err, __entry->pcifunc)
 );
 
 TRACE_EVENT(otx2_msg_wait_rsp,
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +3 -1
index 7e3ddb0..d188936 100644
@@ -871,6 +871,7 @@ static struct _req_type __maybe_unused					\
 *otx2_mbox_alloc_msg_ ## _fn_name(struct mbox *mbox)                    \
 {									\
 	struct _req_type *req;						\
+	u16 pcifunc = mbox->pfvf->pcifunc;				\
 									\
 	req = (struct _req_type *)otx2_mbox_alloc_msg_rsp(		\
 		&mbox->mbox, 0, sizeof(struct _req_type),		\
@@ -879,7 +880,8 @@ 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));	\
+	req->hdr.pcifunc = pcifunc;					\
+	trace_otx2_msg_alloc(mbox->mbox.pdev, _id, sizeof(*req), pcifunc); \
 	return req;							\
 }
 
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +2 -1
index 0aee8e3..1bbc17b 100644
@@ -473,7 +473,7 @@ static void otx2_pfvf_mbox_handler(struct work_struct *work)
 			goto inval_msg;
 
 		/* Set VF's number in each of the msg */
-		msg->pcifunc &= RVU_PFVF_FUNC_MASK;
+		msg->pcifunc &= ~RVU_PFVF_FUNC_MASK;
 		msg->pcifunc |= (vf_idx + 1) & RVU_PFVF_FUNC_MASK;
 		offset = msg->next_msgoff;
 	}
@@ -3285,6 +3285,7 @@ static void otx2_vf_link_event_task(struct work_struct *work)
 	req = (struct cgx_link_info_msg *)msghdr;
 	req->hdr.id = MBOX_MSG_CGX_LINK_EVENT;
 	req->hdr.sig = OTX2_MBOX_REQ_SIG;
+	req->hdr.pcifunc = pf->pcifunc;
 	memcpy(&req->link_info, &pf->linfo, sizeof(req->link_info));
 
 	otx2_mbox_wait_for_zero(&pf->mbox_pfvf[0].mbox_up, vf_idx);
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c +1 -1
index fb4da81..ba4ae6d 100644
@@ -136,7 +136,7 @@ static int otx2vf_process_mbox_msg_up(struct otx2_nic *vf,
 
 		rsp->hdr.id = MBOX_MSG_CGX_LINK_EVENT;
 		rsp->hdr.sig = OTX2_MBOX_RSP_SIG;
-		rsp->hdr.pcifunc = 0;
+		rsp->hdr.pcifunc = req->pcifunc;
 		rsp->hdr.rc = 0;
 		err = otx2_mbox_up_handler_cgx_link_event(
 				vf, (struct cgx_link_info_msg *)req, rsp);
Signature · 1 line
2.7.4
reviewer
#6 lore raw

Re: [net-next PATCH 3/5] octeontx2: Improve mailbox tracepoints for debugging

Quoted 14 lines · Subbaraya Sundeep

There are various stages involved when a VF sends a message to AF. Say for a VF to send a message to AF below are the steps:
1. VF sends message to PF
2. PF receives interrupt from VF
3. PF forwards to AF
4. AF processes it and sends response back to PF
5. PF sends back the response to VF.
This patch adds pcifunc which represents PF and VF device to the tracepoints otx2_msg_alloc, otx2_msg_send, otx2_msg_process so that it is easier to correlate which device allocated the message, which device forwarded it and which device processed that message. Also add message id in otx2_msg_send tracepoint to check which message is sent at any point of time from a device.

Quoted 1 line

The cover letter and other patches in this series are n/4. But this is patch 3/5 (there is also a patch 3/4). This doesn't seem right.

author maintainer
#7 lore raw

Re: [net-next PATCH 3/5] octeontx2: Improve mailbox tracepoints for debugging

Hi Simon,

Quoted 15 lines · Simon Horman
Quoted 14 lines · Subbaraya Sundeep

There are various stages involved when a VF sends a message to AF. Say for a VF to send a message to AF below are the steps:
1. VF sends message to PF
2. PF receives interrupt from VF
3. PF forwards to AF
4. AF processes it and sends response back to PF
5. PF sends back the response to VF.
This patch adds pcifunc which represents PF and VF device to the tracepoints otx2_msg_alloc, otx2_msg_send, otx2_msg_process so that it is easier to correlate which device allocated the message, which device forwarded it and which device processed that message. Also add message id in otx2_msg_send tracepoint to check which message is sent at any point of time from a device.

Quoted 5 lines
Quoted 1 line

The cover letter and other patches in this series are n/4. But this is patch 3/5 (there is also a patch 3/4). This doesn't seem right.

Yes you are right. Some stale patch in the directory sent by mistake. Please ignore this. Will send v2.

Thanks,
Sundeep

author maintainer
#8 lore raw

PATCH 4/4 octeontx2: Add new tracepoint otx2_msg_status

In reply to Subbaraya Sundeep

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.

---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.c |  1 +
 drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h | 15 +++++++++++++++
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c  | 18 ++++++++++++++++++
 3 files changed, 34 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.c +1 -0
index 775fd4c..5f69380 100644
@@ -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);
drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h +15 -0
index 721d4a5..e7c2160 100644
@@ -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, pci_name(pdev))
+			   __assign_str(str, msg)
+			   __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
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +18 -0
index 1bbc17b..d79b4b3 100644
@@ -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;
Signature · 1 line
2.7.4
reviewer
#9 lore raw

Re: [net-next PATCH 4/4] octeontx2: Add new tracepoint otx2_msg_status

Quoted 31 lines · Subbaraya Sundeep

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.

---
 drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.c |  1 +
 drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h | 15 +++++++++++++++
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c  | 18 ++++++++++++++++++
 3 files changed, 34 insertions(+)
drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.c +1 -0
index 775fd4c..5f69380 100644
@@ -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);
drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h +0 -0
index 721d4a5..e7c2160 100644
@@ -118,6 +118,21 @@ TRACE_EVENT(otx2_msg_wait_rsp,
 		      __get_str(dev))
 );

drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h TRACE_EVENT(otx2_msg_wait_rsp, · line 129

Quoted 10 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h +9 -0
 
+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, pci_name(pdev))
+			   __assign_str(str, msg)

In order to compile against net-next __assign_str() should only be passed one argument. Likewise elsewhere in this series.

And, also in order to compile against net-next there needs to be a ';' after each __assign_str(..).

Quoted 9 lines
drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h +6 -0
+			   __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

...

Signature · 1 line
pw-bot: changes-requested
#10 lore raw

Re: [net-next PATCH 4/4] octeontx2: Add new tracepoint otx2_msg_status

In reply to Subbaraya Sundeep
kernel test robot noticed the following build errors:

Hi Subbaraya,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Subbaraya-Sundeep/octeontx2-af-convert-dev_dbg-to-tracepoint-in-mbox/20250512-164344
base:   net-next/main
patch link:    https://lore.kernel.org/r/1747039315-3372-6-git-send-email-sbhatta%40marvell.com
patch subject: [net-next PATCH 4/4] octeontx2: Add new tracepoint otx2_msg_status
config: x86_64-buildonly-randconfig-002-20250513 (https://download.01.org/0day-ci/archive/20250513/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250513/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

In file included from include/trace/trace_events.h:468,
from include/trace/define_trace.h:119,
from drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.h:144,
from drivers/net/ethernet/marvell/octeontx2/af/rvu_trace.c:9:
drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:119:1: error: macro "__assign_str" passed 2 arguments, but takes just 1

     119 | );
         | ^~            
   In file included from include/trace/trace_events.h:400:
   include/trace/stages/stage6_event_callback.h:34: note: macro "__assign_str" defined here
      34 | #define __assign_str(dst)                                               \
         | 
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h: In function 'do_trace_event_raw_event_otx2_msg_wait_rsp':
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:115:28: error: '__assign_str' undeclared (first use in this function)
     115 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |                            ^~~~~~~~~~~~
   include/trace/trace_events.h:427:11: note: in definition of macro '__DECLARE_EVENT_CLASS'
     427 |         { assign; }                                                     \
         |           ^~~~~~
   include/trace/trace_events.h:435:23: note: in expansion of macro 'PARAMS'
     435 |                       PARAMS(assign), PARAMS(print))                    \
         |                       ^~~~~~
   include/trace/trace_events.h:40:9: note: in expansion of macro 'DECLARE_EVENT_CLASS'
      40 |         DECLARE_EVENT_CLASS(name,                              \
         |         ^~~~~~~~~~~~~~~~~~~
   include/trace/trace_events.h:44:30: note: in expansion of macro 'PARAMS'
      44 |                              PARAMS(assign),                   \
         |                              ^~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:110:1: note: in expansion of macro 'TRACE_EVENT'
     110 | TRACE_EVENT(otx2_msg_wait_rsp,
         | ^~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:115:13: note: in expansion of macro 'TP_fast_assign'
     115 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |             ^~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:115:28: note: each undeclared identifier is reported only once for each function it appears in
     115 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |                            ^~~~~~~~~~~~
   include/trace/trace_events.h:427:11: note: in definition of macro '__DECLARE_EVENT_CLASS'
     427 |         { assign; }                                                     \
         |           ^~~~~~
   include/trace/trace_events.h:435:23: note: in expansion of macro 'PARAMS'
     435 |                       PARAMS(assign), PARAMS(print))                    \
         |                       ^~~~~~
   include/trace/trace_events.h:40:9: note: in expansion of macro 'DECLARE_EVENT_CLASS'
      40 |         DECLARE_EVENT_CLASS(name,                              \
         |         ^~~~~~~~~~~~~~~~~~~
   include/trace/trace_events.h:44:30: note: in expansion of macro 'PARAMS'
      44 |                              PARAMS(assign),                   \
         |                              ^~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:110:1: note: in expansion of macro 'TRACE_EVENT'
     110 | TRACE_EVENT(otx2_msg_wait_rsp,
         | ^~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:115:13: note: in expansion of macro 'TP_fast_assign'
     115 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |             ^~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h: At top level:
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:134:1: error: macro "__assign_str" passed 2 arguments, but takes just 1
     134 | );
         | ^~            
   include/trace/stages/stage6_event_callback.h:34: note: macro "__assign_str" defined here
      34 | #define __assign_str(dst)                                               \
         | 
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:134:1: error: macro "__assign_str" passed 2 arguments, but takes just 1
     134 | );
         | ^~            
   include/trace/stages/stage6_event_callback.h:34: note: macro "__assign_str" defined here
      34 | #define __assign_str(dst)                                               \
         | 
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h: In function 'do_trace_event_raw_event_otx2_msg_status':
>> drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:128:28: error: unknown type name '__assign_str'
     128 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |                            ^~~~~~~~~~~~
   include/trace/trace_events.h:427:11: note: in definition of macro '__DECLARE_EVENT_CLASS'
     427 |         { assign; }                                                     \
         |           ^~~~~~
   include/trace/trace_events.h:435:23: note: in expansion of macro 'PARAMS'
     435 |                       PARAMS(assign), PARAMS(print))                    \
         |                       ^~~~~~
   include/trace/trace_events.h:40:9: note: in expansion of macro 'DECLARE_EVENT_CLASS'
      40 |         DECLARE_EVENT_CLASS(name,                              \
         |         ^~~~~~~~~~~~~~~~~~~
   include/trace/trace_events.h:44:30: note: in expansion of macro 'PARAMS'
      44 |                              PARAMS(assign),                   \
         |                              ^~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:121:1: note: in expansion of macro 'TRACE_EVENT'
     121 | TRACE_EVENT(otx2_msg_status,
         | ^~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:128:13: note: in expansion of macro 'TP_fast_assign'
     128 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |             ^~~~~~~~~~~~~~
>> include/trace/stages/stage6_event_callback.h:9:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'entry'
       9 | #define __entry entry
         |                 ^~~~~
   include/trace/trace_events.h:427:11: note: in definition of macro '__DECLARE_EVENT_CLASS'
     427 |         { assign; }                                                     \
         |           ^~~~~~
   include/trace/trace_events.h:435:23: note: in expansion of macro 'PARAMS'
     435 |                       PARAMS(assign), PARAMS(print))                    \
         |                       ^~~~~~
   include/trace/trace_events.h:40:9: note: in expansion of macro 'DECLARE_EVENT_CLASS'
      40 |         DECLARE_EVENT_CLASS(name,                              \
         |         ^~~~~~~~~~~~~~~~~~~
   include/trace/trace_events.h:44:30: note: in expansion of macro 'PARAMS'
      44 |                              PARAMS(assign),                   \
         |                              ^~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:121:1: note: in expansion of macro 'TRACE_EVENT'
     121 | TRACE_EVENT(otx2_msg_status,
         | ^~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:128:13: note: in expansion of macro 'TP_fast_assign'
     128 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |             ^~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:130:28: note: in expansion of macro '__entry'
     130 |                            __entry->num_msgs = num_msgs;
         |                            ^~~~~~~
   In file included from include/trace/trace_events.h:523:
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h: At top level:
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:119:1: error: macro "__assign_str" passed 2 arguments, but takes just 1
     119 | );
         | ^~            
   include/trace/stages/stage6_event_callback.h:34: note: macro "__assign_str" defined here
      34 | #define __assign_str(dst)                                               \
         | 
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:134:1: error: macro "__assign_str" passed 2 arguments, but takes just 1
     134 | );
         | ^~            
   include/trace/stages/stage6_event_callback.h:34: note: macro "__assign_str" defined here
      34 | #define __assign_str(dst)                                               \
         | 
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:134:1: error: macro "__assign_str" passed 2 arguments, but takes just 1
     134 | );
         | ^~            
   include/trace/stages/stage6_event_callback.h:34: note: macro "__assign_str" defined here
      34 | #define __assign_str(dst)                                               \
         | 
   In file included from include/trace/perf.h:110,
                    from include/trace/define_trace.h:120:
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:119:1: error: macro "__assign_str" passed 2 arguments, but takes just 1
     119 | );
         | ^~            
   In file included from include/trace/perf.h:7:
   include/trace/stages/stage6_event_callback.h:34: note: macro "__assign_str" defined here
      34 | #define __assign_str(dst)                                               \
         | 
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h: In function 'do_perf_trace_otx2_msg_wait_rsp':
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:115:28: error: '__assign_str' undeclared (first use in this function)
     115 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |                            ^~~~~~~~~~~~
   include/trace/perf.h:51:11: note: in definition of macro '__DECLARE_EVENT_CLASS'
      51 |         { assign; }                                                     \
         |           ^~~~~~
   include/trace/perf.h:67:23: note: in expansion of macro 'PARAMS'
      67 |                       PARAMS(assign), PARAMS(print))                    \
         |                       ^~~~~~
   include/trace/trace_events.h:40:9: note: in expansion of macro 'DECLARE_EVENT_CLASS'
      40 |         DECLARE_EVENT_CLASS(name,                              \
         |         ^~~~~~~~~~~~~~~~~~~
   include/trace/trace_events.h:44:30: note: in expansion of macro 'PARAMS'
      44 |                              PARAMS(assign),                   \
         |                              ^~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:110:1: note: in expansion of macro 'TRACE_EVENT'
     110 | TRACE_EVENT(otx2_msg_wait_rsp,
         | ^~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:115:13: note: in expansion of macro 'TP_fast_assign'
     115 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |             ^~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h: At top level:
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:134:1: error: macro "__assign_str" passed 2 arguments, but takes just 1
     134 | );
         | ^~            
   include/trace/stages/stage6_event_callback.h:34: note: macro "__assign_str" defined here
      34 | #define __assign_str(dst)                                               \
         | 
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:134:1: error: macro "__assign_str" passed 2 arguments, but takes just 1
     134 | );
         | ^~            
   include/trace/stages/stage6_event_callback.h:34: note: macro "__assign_str" defined here
      34 | #define __assign_str(dst)                                               \
         | 
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h: In function 'do_perf_trace_otx2_msg_status':
>> drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:128:28: error: unknown type name '__assign_str'
     128 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |                            ^~~~~~~~~~~~
   include/trace/perf.h:51:11: note: in definition of macro '__DECLARE_EVENT_CLASS'
      51 |         { assign; }                                                     \
         |           ^~~~~~
   include/trace/perf.h:67:23: note: in expansion of macro 'PARAMS'
      67 |                       PARAMS(assign), PARAMS(print))                    \
         |                       ^~~~~~
   include/trace/trace_events.h:40:9: note: in expansion of macro 'DECLARE_EVENT_CLASS'
      40 |         DECLARE_EVENT_CLASS(name,                              \
         |         ^~~~~~~~~~~~~~~~~~~
   include/trace/trace_events.h:44:30: note: in expansion of macro 'PARAMS'
      44 |                              PARAMS(assign),                   \
         |                              ^~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:121:1: note: in expansion of macro 'TRACE_EVENT'
     121 | TRACE_EVENT(otx2_msg_status,
         | ^~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:128:13: note: in expansion of macro 'TP_fast_assign'
     128 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |             ^~~~~~~~~~~~~~
>> include/trace/stages/stage6_event_callback.h:9:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'entry'
       9 | #define __entry entry
         |                 ^~~~~
   include/trace/perf.h:51:11: note: in definition of macro '__DECLARE_EVENT_CLASS'
      51 |         { assign; }                                                     \
         |           ^~~~~~
   include/trace/perf.h:67:23: note: in expansion of macro 'PARAMS'
      67 |                       PARAMS(assign), PARAMS(print))                    \
         |                       ^~~~~~
   include/trace/trace_events.h:40:9: note: in expansion of macro 'DECLARE_EVENT_CLASS'
      40 |         DECLARE_EVENT_CLASS(name,                              \
         |         ^~~~~~~~~~~~~~~~~~~
   include/trace/trace_events.h:44:30: note: in expansion of macro 'PARAMS'
      44 |                              PARAMS(assign),                   \
         |                              ^~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:121:1: note: in expansion of macro 'TRACE_EVENT'
     121 | TRACE_EVENT(otx2_msg_status,
         | ^~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:128:13: note: in expansion of macro 'TP_fast_assign'
     128 |             TP_fast_assign(__assign_str(dev, pci_name(pdev))
         |             ^~~~~~~~~~~~~~
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:130:28: note: in expansion of macro '__entry'
     130 |                            __entry->num_msgs = num_msgs;
         |                            ^~~~~~~
   In file included from include/trace/bpf_probe.h:131,
                    from include/trace/define_trace.h:121:
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h: At top level:
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:119:1: error: macro "__assign_str" passed 2 arguments, but takes just 1
     119 | );
         | ^~            
   In file included from include/trace/bpf_probe.h:7:
   include/trace/stages/stage6_event_callback.h:34: note: macro "__assign_str" defined here
      34 | #define __assign_str(dst)                                               \
         | 
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:134:1: error: macro "__assign_str" passed 2 arguments, but takes just 1
     134 | );
         | ^~            
   include/trace/stages/stage6_event_callback.h:34: note: macro "__assign_str" defined here
      34 | #define __assign_str(dst)                                               \
         | 
   drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h:134:1: error: macro "__assign_str" passed 2 arguments, but takes just 1
     134 | );
         | ^~            
   include/trace/stages/stage6_event_callback.h:34: note: macro "__assign_str" defined here
      34 | #define __assign_str(dst)                                               \
         | 

vim +/__assign_str +128 drivers/net/ethernet/marvell/octeontx2/af/./rvu_trace.h

120
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, pci_name(pdev))

129 __assign_str(str, msg)
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

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki