Skip to contentSkip to conversation

bbdev: trace point and logging

PATCH In review Nicolas Chautru 3 participants 15 messages Jan 23, 2025 – Mar 4, 2025 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

v2 cover bbdev: trace point and logging

v2: fix build error.

Hi,

Based on previous discussion improving logging for bbdev and PMD using notably trace points and internal logging extension.
The trace point impacting real time are not built by default. This is added at bbdev level and also in the PMD specific implementation.

Thanks
Nic

Nicolas Chautru (3):
bbdev: add trace point
baseband/acc: add trace point
baseband/acc: add internal logging

 drivers/baseband/acc/acc_common.c  |  8 +++
 drivers/baseband/acc/acc_common.h  | 71 ++++++++++++++++++++++++++
 drivers/baseband/acc/rte_vrb_pmd.c | 81 +++++++++++++++++++-----------
 drivers/baseband/acc/vrb_trace.h   | 35 +++++++++++++
 lib/bbdev/bbdev_trace.h            | 69 +++++++++++++++++++++++++
 lib/bbdev/bbdev_trace_points.c     | 27 ++++++++++
 lib/bbdev/meson.build              |  6 ++-
 lib/bbdev/rte_bbdev.c              | 17 +++++++
 lib/bbdev/rte_bbdev.h              | 50 +++++++++++++++---
 lib/bbdev/rte_bbdev_trace_fp.h     | 41 +++++++++++++++
 lib/bbdev/version.map              |  4 ++
 11 files changed, 372 insertions(+), 37 deletions(-)
 create mode 100644 drivers/baseband/acc/vrb_trace.h
 create mode 100644 lib/bbdev/bbdev_trace.h
 create mode 100644 lib/bbdev/bbdev_trace_points.c
 create mode 100644 lib/bbdev/rte_bbdev_trace_fp.h
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/3 bbdev: add trace point

Adds trace points for rte_bbdev.

---
 lib/bbdev/bbdev_trace.h        | 69 ++++++++++++++++++++++++++++++++++
 lib/bbdev/bbdev_trace_points.c | 27 +++++++++++++
 lib/bbdev/meson.build          |  6 ++-
 lib/bbdev/rte_bbdev.c          | 17 +++++++++
 lib/bbdev/rte_bbdev.h          | 50 +++++++++++++++++++++---
 lib/bbdev/rte_bbdev_trace_fp.h | 41 ++++++++++++++++++++
 lib/bbdev/version.map          |  4 ++
 7 files changed, 206 insertions(+), 8 deletions(-)
 create mode 100644 lib/bbdev/bbdev_trace.h
 create mode 100644 lib/bbdev/bbdev_trace_points.c
 create mode 100644 lib/bbdev/rte_bbdev_trace_fp.h
lib/bbdev/bbdev_trace.h new file +69 -0
new file mode 100644
index 0000000000..7256d6b703
@@ -0,0 +1,69 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2025 Intel Corporation
+ */
+
+#ifndef BBDEV_TRACE_H
+#define BBDEV_TRACE_H
+
+/**
+ * @file
+ *
+ * API for bbdev trace support
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rte_trace_point.h>
+
+#include "rte_bbdev.h"
+
+RTE_TRACE_POINT(
+	rte_bbdev_trace_setup_queues,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t num_queues, int socket_id),
+	rte_trace_point_emit_u8(dev_id);
+	rte_trace_point_emit_u16(num_queues);
+	rte_trace_point_emit_int(socket_id);
+)
+RTE_TRACE_POINT(
+	rte_bbdev_trace_queue_configure,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t queue_id, const char *op_str, uint8_t pri),
+	rte_trace_point_emit_u8(dev_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_string(op_str);
+	rte_trace_point_emit_u8(pri);
+)
+RTE_TRACE_POINT(
+	rte_bbdev_trace_start,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+	rte_trace_point_emit_u8(dev_id);
+)
+RTE_TRACE_POINT(
+	rte_bbdev_trace_stop,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+	rte_trace_point_emit_u8(dev_id);
+)
+RTE_TRACE_POINT(
+	rte_bbdev_trace_close,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+	rte_trace_point_emit_u8(dev_id);
+)
+RTE_TRACE_POINT(
+	rte_bbdev_trace_queue_start,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t queue_id),
+	rte_trace_point_emit_u8(dev_id);
+	rte_trace_point_emit_u16(queue_id);
+)
+RTE_TRACE_POINT(
+	rte_bbdev_trace_queue_stop,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t queue_id),
+	rte_trace_point_emit_u8(dev_id);
+	rte_trace_point_emit_u16(queue_id);
+)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BBDEV_TRACE_H */
lib/bbdev/bbdev_trace_points.c new file +27 -0
new file mode 100644
index 0000000000..6f90e2aa65
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2025 Intel Corporation
+ */
+
+#include <rte_trace_point_register.h>
+
+#include "bbdev_trace.h"
+
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_setup_queues,
+	lib.bbdev.queue.setup)
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_queue_configure,
+	lib.bbdev.queue.configure)
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_start,
+	lib.bbdev.start)
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_stop,
+	lib.bbdev.stop)
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_close,
+	lib.bbdev.close)
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_queue_start,
+	lib.bbdev.queue.start)
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_queue_stop,
+	lib.bbdev.queue.stop)
+
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_enqueue,
+	lib.bbdev.enq)
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_dequeue,
+	lib.bbdev.deq)
lib/bbdev/meson.build +4 -2
index 07685e7578..d8b95a400e 100644
@@ -7,8 +7,10 @@ if is_windows
     subdir_done()
 endif
 
-sources = files('rte_bbdev.c')
+sources = files('rte_bbdev.c',
+        'bbdev_trace_points.c')
 headers = files('rte_bbdev.h',
         'rte_bbdev_pmd.h',
-        'rte_bbdev_op.h')
+        'rte_bbdev_op.h',
+        'rte_bbdev_trace_fp.h')
 deps += ['mbuf']
lib/bbdev/rte_bbdev.c +17 -0
index bd32da79b0..d7901cd29d 100644
@@ -20,6 +20,7 @@
 #include "rte_bbdev_op.h"
 #include "rte_bbdev.h"
 #include "rte_bbdev_pmd.h"
+#include "bbdev_trace.h"
 
 #define DEV_NAME "BBDEV"
 
@@ -321,6 +322,8 @@ rte_bbdev_setup_queues(uint16_t dev_id, uint16_t num_queues, int socket_id)
 
 	VALID_DEV_OPS_OR_RET_ERR(dev, dev_id);
 
+	rte_bbdev_trace_setup_queues(dev_id, num_queues, socket_id);
+
 	if (dev->data->started) {
 		rte_bbdev_log(ERR,
 				"Device %u cannot be configured when started",
@@ -436,6 +439,10 @@ int
 rte_bbdev_queue_configure(uint16_t dev_id, uint16_t queue_id,
 		const struct rte_bbdev_queue_conf *conf)
 {
+
+	rte_bbdev_trace_queue_configure(dev_id, queue_id, rte_bbdev_op_type_str(conf->op_type),
+			conf->priority);
+
 	int ret = 0;
 	struct rte_bbdev_driver_info dev_info;
 	struct rte_bbdev *dev = get_dev(dev_id);
@@ -557,6 +564,8 @@ rte_bbdev_start(uint16_t dev_id)
 
 	VALID_DEV_OPS_OR_RET_ERR(dev, dev_id);
 
+	rte_bbdev_trace_start(dev_id);
+
 	if (dev->data->started) {
 		rte_bbdev_log_debug("Device %u is already started", dev_id);
 		return 0;
@@ -588,6 +597,8 @@ rte_bbdev_stop(uint16_t dev_id)
 
 	VALID_DEV_OPS_OR_RET_ERR(dev, dev_id);
 
+	rte_bbdev_trace_stop(dev_id);
+
 	if (!dev->data->started) {
 		rte_bbdev_log_debug("Device %u is already stopped", dev_id);
 		return 0;
@@ -611,6 +622,8 @@ rte_bbdev_close(uint16_t dev_id)
 
 	VALID_DEV_OPS_OR_RET_ERR(dev, dev_id);
 
+	rte_bbdev_trace_close(dev_id);
+
 	if (dev->data->started) {
 		ret = rte_bbdev_stop(dev_id);
 		if (ret < 0) {
@@ -656,6 +669,8 @@ rte_bbdev_queue_start(uint16_t dev_id, uint16_t queue_id)
 
 	VALID_QUEUE_OR_RET_ERR(queue_id, dev);
 
+	rte_bbdev_trace_queue_start(dev_id, queue_id);
+
 	if (dev->data->queues[queue_id].started) {
 		rte_bbdev_log_debug("Queue %u of device %u already started",
 				queue_id, dev_id);
@@ -686,6 +701,8 @@ rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id)
 
 	VALID_QUEUE_OR_RET_ERR(queue_id, dev);
 
+	rte_bbdev_trace_queue_stop(dev_id, queue_id);
+
 	if (!dev->data->queues[queue_id].started) {
 		rte_bbdev_log_debug("Queue %u of device %u already stopped",
 				queue_id, dev_id);
lib/bbdev/rte_bbdev.h +44 -6

128 lines not on this page · raw message

lib/bbdev/rte_bbdev_trace_fp.h new file +41 -0

41 lines not on this page · raw message

lib/bbdev/version.map +4 -0
index 1e11485b17..b9b4f31e33 100644
@@ -40,4 +40,8 @@ EXPERIMENTAL {
 	# added in 24.11
 	rte_bbdev_queue_ops_dump;
 	rte_bbdev_ops_param_string;
+
+	# added in 25.03
+	__rte_bbdev_trace_dequeue;
+	__rte_bbdev_trace_enqueue;
 };
Signature · 1 line
2.34.1
Reviewed-by on v2 1/3
#2 lore raw

Re: [PATCH v2 1/3] bbdev: add trace point

Quoted 415 lines · Nicolas Chautru

Adds trace points for rte_bbdev.

---
  lib/bbdev/bbdev_trace.h        | 69 ++++++++++++++++++++++++++++++++++
  lib/bbdev/bbdev_trace_points.c | 27 +++++++++++++
  lib/bbdev/meson.build          |  6 ++-
  lib/bbdev/rte_bbdev.c          | 17 +++++++++
  lib/bbdev/rte_bbdev.h          | 50 +++++++++++++++++++++---
  lib/bbdev/rte_bbdev_trace_fp.h | 41 ++++++++++++++++++++
  lib/bbdev/version.map          |  4 ++
  7 files changed, 206 insertions(+), 8 deletions(-)

create mode 100644 lib/bbdev/bbdev_trace.h create mode 100644 lib/bbdev/bbdev_trace_points.c create mode 100644 lib/bbdev/rte_bbdev_trace_fp.h

lib/bbdev/bbdev_trace.h new file +69 -0
new file mode 100644
index 0000000000..7256d6b703
@@ -0,0 +1,69 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2025 Intel Corporation
+ */
+
+#ifndef BBDEV_TRACE_H
+#define BBDEV_TRACE_H
+
+/**
+ * @file
+ *
+ * API for bbdev trace support
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rte_trace_point.h>
+
+#include "rte_bbdev.h"
+
+RTE_TRACE_POINT(
+	rte_bbdev_trace_setup_queues,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t num_queues, int socket_id),
+	rte_trace_point_emit_u8(dev_id);
+	rte_trace_point_emit_u16(num_queues);
+	rte_trace_point_emit_int(socket_id);
+)
+RTE_TRACE_POINT(
+	rte_bbdev_trace_queue_configure,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t queue_id, const char *op_str, uint8_t pri),
+	rte_trace_point_emit_u8(dev_id);
+	rte_trace_point_emit_u16(queue_id);
+	rte_trace_point_emit_string(op_str);
+	rte_trace_point_emit_u8(pri);
+)
+RTE_TRACE_POINT(
+	rte_bbdev_trace_start,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+	rte_trace_point_emit_u8(dev_id);
+)
+RTE_TRACE_POINT(
+	rte_bbdev_trace_stop,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+	rte_trace_point_emit_u8(dev_id);
+)
+RTE_TRACE_POINT(
+	rte_bbdev_trace_close,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+	rte_trace_point_emit_u8(dev_id);
+)
+RTE_TRACE_POINT(
+	rte_bbdev_trace_queue_start,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t queue_id),
+	rte_trace_point_emit_u8(dev_id);
+	rte_trace_point_emit_u16(queue_id);
+)
+RTE_TRACE_POINT(
+	rte_bbdev_trace_queue_stop,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t queue_id),
+	rte_trace_point_emit_u8(dev_id);
+	rte_trace_point_emit_u16(queue_id);
+)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BBDEV_TRACE_H */
lib/bbdev/bbdev_trace_points.c new file +27 -0
new file mode 100644
index 0000000000..6f90e2aa65
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2025 Intel Corporation
+ */
+
+#include <rte_trace_point_register.h>
+
+#include "bbdev_trace.h"
+
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_setup_queues,
+	lib.bbdev.queue.setup)
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_queue_configure,
+	lib.bbdev.queue.configure)
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_start,
+	lib.bbdev.start)
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_stop,
+	lib.bbdev.stop)
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_close,
+	lib.bbdev.close)
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_queue_start,
+	lib.bbdev.queue.start)
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_queue_stop,
+	lib.bbdev.queue.stop)
+
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_enqueue,
+	lib.bbdev.enq)
+RTE_TRACE_POINT_REGISTER(rte_bbdev_trace_dequeue,
+	lib.bbdev.deq)
lib/bbdev/meson.build +4 -2
index 07685e7578..d8b95a400e 100644
@@ -7,8 +7,10 @@ if is_windows
      subdir_done()
  endif
 
-sources = files('rte_bbdev.c')
+sources = files('rte_bbdev.c',
+        'bbdev_trace_points.c')
  headers = files('rte_bbdev.h',
          'rte_bbdev_pmd.h',
-        'rte_bbdev_op.h')
+        'rte_bbdev_op.h',
+        'rte_bbdev_trace_fp.h')
  deps += ['mbuf']
lib/bbdev/rte_bbdev.c +17 -0
index bd32da79b0..d7901cd29d 100644
@@ -20,6 +20,7 @@
  #include "rte_bbdev_op.h"
  #include "rte_bbdev.h"
  #include "rte_bbdev_pmd.h"
+#include "bbdev_trace.h"
 
  #define DEV_NAME "BBDEV"
 
@@ -321,6 +322,8 @@ rte_bbdev_setup_queues(uint16_t dev_id, uint16_t num_queues, int socket_id)
 
  	VALID_DEV_OPS_OR_RET_ERR(dev, dev_id);
 
+	rte_bbdev_trace_setup_queues(dev_id, num_queues, socket_id);
+
  	if (dev->data->started) {
  		rte_bbdev_log(ERR,
  				"Device %u cannot be configured when started",
@@ -436,6 +439,10 @@ int
  rte_bbdev_queue_configure(uint16_t dev_id, uint16_t queue_id,
  		const struct rte_bbdev_queue_conf *conf)
  {
+
+	rte_bbdev_trace_queue_configure(dev_id, queue_id, rte_bbdev_op_type_str(conf->op_type),
+			conf->priority);
+
  	int ret = 0;
  	struct rte_bbdev_driver_info dev_info;
  	struct rte_bbdev *dev = get_dev(dev_id);
@@ -557,6 +564,8 @@ rte_bbdev_start(uint16_t dev_id)
 
  	VALID_DEV_OPS_OR_RET_ERR(dev, dev_id);
 
+	rte_bbdev_trace_start(dev_id);
+
  	if (dev->data->started) {
  		rte_bbdev_log_debug("Device %u is already started", dev_id);
  		return 0;
@@ -588,6 +597,8 @@ rte_bbdev_stop(uint16_t dev_id)
 
  	VALID_DEV_OPS_OR_RET_ERR(dev, dev_id);
 
+	rte_bbdev_trace_stop(dev_id);
+
  	if (!dev->data->started) {
  		rte_bbdev_log_debug("Device %u is already stopped", dev_id);
  		return 0;
@@ -611,6 +622,8 @@ rte_bbdev_close(uint16_t dev_id)
 
  	VALID_DEV_OPS_OR_RET_ERR(dev, dev_id);
 
+	rte_bbdev_trace_close(dev_id);
+
  	if (dev->data->started) {
  		ret = rte_bbdev_stop(dev_id);
  		if (ret < 0) {
@@ -656,6 +669,8 @@ rte_bbdev_queue_start(uint16_t dev_id, uint16_t queue_id)
 
  	VALID_QUEUE_OR_RET_ERR(queue_id, dev);
 
+	rte_bbdev_trace_queue_start(dev_id, queue_id);
+
  	if (dev->data->queues[queue_id].started) {
  		rte_bbdev_log_debug("Queue %u of device %u already started",
  				queue_id, dev_id);
@@ -686,6 +701,8 @@ rte_bbdev_queue_stop(uint16_t dev_id, uint16_t queue_id)
 
  	VALID_QUEUE_OR_RET_ERR(queue_id, dev);
 
+	rte_bbdev_trace_queue_stop(dev_id, queue_id);
+
  	if (!dev->data->queues[queue_id].started) {
  		rte_bbdev_log_debug("Queue %u of device %u already stopped",
  				queue_id, dev_id);
lib/bbdev/rte_bbdev.h +44 -6
index 6d5cdc7b8c..710280f0df 100644
@@ -32,6 +32,8 @@
  extern "C" {
  #endif
 
+#include "rte_bbdev_trace_fp.h"
+
  #ifndef RTE_BBDEV_MAX_DEVS
  #define RTE_BBDEV_MAX_DEVS 128  /**< Max number of devices */
  #endif
@@ -569,6 +571,8 @@ rte_bbdev_enqueue_enc_ops(uint16_t dev_id, uint16_t queue_id,
  {
  	struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
  	struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
+	rte_bbdev_trace_enqueue(dev_id, queue_id, (void **)ops, num_ops,
+			rte_bbdev_op_type_str(RTE_BBDEV_OP_TURBO_DEC));
  	return dev->enqueue_enc_ops(q_data, ops, num_ops);
  }
 
@@ -599,6 +603,8 @@ rte_bbdev_enqueue_dec_ops(uint16_t dev_id, uint16_t queue_id,
  {
  	struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
  	struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
+	rte_bbdev_trace_enqueue(dev_id, queue_id, (void **)ops, num_ops,
+			rte_bbdev_op_type_str(RTE_BBDEV_OP_TURBO_ENC));
  	return dev->enqueue_dec_ops(q_data, ops, num_ops);
  }
 
@@ -629,6 +635,8 @@ rte_bbdev_enqueue_ldpc_enc_ops(uint16_t dev_id, uint16_t queue_id,
  {
  	struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
  	struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
+	rte_bbdev_trace_enqueue(dev_id, queue_id, (void **)ops, num_ops,
+			rte_bbdev_op_type_str(RTE_BBDEV_OP_LDPC_ENC));
  	return dev->enqueue_ldpc_enc_ops(q_data, ops, num_ops);
  }
 
@@ -659,6 +667,8 @@ rte_bbdev_enqueue_ldpc_dec_ops(uint16_t dev_id, uint16_t queue_id,
  {
  	struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
  	struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
+	rte_bbdev_trace_enqueue(dev_id, queue_id, (void **)ops, num_ops,
+			rte_bbdev_op_type_str(RTE_BBDEV_OP_LDPC_DEC));
  	return dev->enqueue_ldpc_dec_ops(q_data, ops, num_ops);
  }
 
@@ -689,6 +699,8 @@ rte_bbdev_enqueue_fft_ops(uint16_t dev_id, uint16_t queue_id,
  {
  	struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
  	struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
+	rte_bbdev_trace_enqueue(dev_id, queue_id, (void **)ops, num_ops,
+			rte_bbdev_op_type_str(RTE_BBDEV_OP_FFT));
  	return dev->enqueue_fft_ops(q_data, ops, num_ops);
  }
 
@@ -719,6 +731,8 @@ rte_bbdev_enqueue_mldts_ops(uint16_t dev_id, uint16_t queue_id,
  {
  	struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
  	struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
+	rte_bbdev_trace_enqueue(dev_id, queue_id, (void **)ops, num_ops,
+			rte_bbdev_op_type_str(RTE_BBDEV_OP_MLDTS));
  	return dev->enqueue_mldts_ops(q_data, ops, num_ops);
  }
 
@@ -750,7 +764,11 @@ rte_bbdev_dequeue_enc_ops(uint16_t dev_id, uint16_t queue_id,
  {
  	struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
  	struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
-	return dev->dequeue_enc_ops(q_data, ops, num_ops);
+	uint16_t num_ops_dequeued = dev->dequeue_enc_ops(q_data, ops, num_ops);
+	if (num_ops_dequeued > 0)
+		rte_bbdev_trace_dequeue(dev_id, queue_id, (void **)ops, num_ops,
+				num_ops_dequeued, rte_bbdev_op_type_str(RTE_BBDEV_OP_TURBO_ENC));
+	return num_ops_dequeued;
  }
 
  /**
@@ -782,7 +800,11 @@ rte_bbdev_dequeue_dec_ops(uint16_t dev_id, uint16_t queue_id,
  {
  	struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
  	struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
-	return dev->dequeue_dec_ops(q_data, ops, num_ops);
+	uint16_t num_ops_dequeued = dev->dequeue_dec_ops(q_data, ops, num_ops);
+	if (num_ops_dequeued > 0)
+		rte_bbdev_trace_dequeue(dev_id, queue_id, (void **)ops, num_ops,
+				num_ops_dequeued, rte_bbdev_op_type_str(RTE_BBDEV_OP_TURBO_DEC));
+	return num_ops_dequeued;
  }
 
 
@@ -813,7 +835,11 @@ rte_bbdev_dequeue_ldpc_enc_ops(uint16_t dev_id, uint16_t queue_id,
  {
  	struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
  	struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
-	return dev->dequeue_ldpc_enc_ops(q_data, ops, num_ops);
+	uint16_t num_ops_dequeued = dev->dequeue_ldpc_enc_ops(q_data, ops, num_ops);
+	if (num_ops_dequeued > 0)
+		rte_bbdev_trace_dequeue(dev_id, queue_id, (void **)ops, num_ops,
+				num_ops_dequeued, rte_bbdev_op_type_str(RTE_BBDEV_OP_LDPC_ENC));
+	return num_ops_dequeued;
  }
 
  /**
@@ -843,7 +869,11 @@ rte_bbdev_dequeue_ldpc_dec_ops(uint16_t dev_id, uint16_t queue_id,
  {
  	struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
  	struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
-	return dev->dequeue_ldpc_dec_ops(q_data, ops, num_ops);
+	uint16_t num_ops_dequeued = dev->dequeue_ldpc_dec_ops(q_data, ops, num_ops);
+	if (num_ops_dequeued > 0)
+		rte_bbdev_trace_dequeue(dev_id, queue_id, (void **)ops, num_ops,
+				num_ops_dequeued, rte_bbdev_op_type_str(RTE_BBDEV_OP_LDPC_DEC));
+	return num_ops_dequeued;
  }
 
  /**
@@ -873,7 +903,11 @@ rte_bbdev_dequeue_fft_ops(uint16_t dev_id, uint16_t queue_id,
  {
  	struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
  	struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
-	return dev->dequeue_fft_ops(q_data, ops, num_ops);
+	uint16_t num_ops_dequeued = dev->dequeue_fft_ops(q_data, ops, num_ops);
+	if (num_ops_dequeued > 0)
+		rte_bbdev_trace_dequeue(dev_id, queue_id, (void **)ops, num_ops,
+				num_ops_dequeued, rte_bbdev_op_type_str(RTE_BBDEV_OP_FFT));
+	return num_ops_dequeued;
  }
 
  /**
@@ -903,7 +937,11 @@ rte_bbdev_dequeue_mldts_ops(uint16_t dev_id, uint16_t queue_id,
  {
  	struct rte_bbdev *dev = &rte_bbdev_devices[dev_id];
  	struct rte_bbdev_queue_data *q_data = &dev->data->queues[queue_id];
-	return dev->dequeue_mldts_ops(q_data, ops, num_ops);
+	uint16_t num_ops_dequeued = dev->dequeue_mldts_ops(q_data, ops, num_ops);
+	if (num_ops_dequeued > 0)
+		rte_bbdev_trace_dequeue(dev_id, queue_id, (void **)ops, num_ops,
+				num_ops_dequeued, rte_bbdev_op_type_str(RTE_BBDEV_OP_MLDTS));
+	return num_ops_dequeued;
  }
 
  /** Definitions of device event types */
lib/bbdev/rte_bbdev_trace_fp.h new file +41 -0
new file mode 100644
index 0000000000..d8b2217d17
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(C) 2025 Intel Corporation
+ */
+
+#ifndef _RTE_BBDEV_TRACE_FP_H_
+#define _RTE_BBDEV_TRACE_FP_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rte_trace_point.h>
+
+RTE_TRACE_POINT_FP(
+	rte_bbdev_trace_enqueue,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, void **ops,
+		uint16_t nb_ops, const char *op_string),
+	rte_trace_point_emit_u8(dev_id);
+	rte_trace_point_emit_u16(qp_id);
+	rte_trace_point_emit_ptr(ops);
+	rte_trace_point_emit_u16(nb_ops);
+	rte_trace_point_emit_string(op_string);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_bbdev_trace_dequeue,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, void **ops,
+		uint16_t nb_ops, uint16_t nb_ops_deq, const char *op_string),
+	rte_trace_point_emit_u8(dev_id);
+	rte_trace_point_emit_u16(qp_id);
+	rte_trace_point_emit_ptr(ops);
+	rte_trace_point_emit_u16(nb_ops);
+	rte_trace_point_emit_u16(nb_ops_deq);
+	rte_trace_point_emit_string(op_string);
+)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _RTE_BBDEV_TRACE_FP_H_ */
lib/bbdev/version.map +0 -0
index 1e11485b17..b9b4f31e33 100644

lib/bbdev/version.map EXPERIMENTAL { · line 47

Quoted 8 lines
lib/bbdev/version.map +4 -0
@@ -40,4 +40,8 @@ EXPERIMENTAL {
  	# added in 24.11
  	rte_bbdev_queue_ops_dump;
  	rte_bbdev_ops_param_string;
+
+	# added in 25.03
+	__rte_bbdev_trace_dequeue;
+	__rte_bbdev_trace_enqueue;
  };

Thanks,
Maxime

#3 lore raw

PATCH v2 2/3 baseband/acc: add trace point

In reply to Nicolas Chautru

Improvement of logging to notably use trace point
for driver specific error logging and tracepoint.

---
 drivers/baseband/acc/acc_common.c  |  8 ++++
 drivers/baseband/acc/acc_common.h  | 55 ++++++++++++++++++++++++++
 drivers/baseband/acc/rte_vrb_pmd.c | 63 +++++++++++++++++-------------
 drivers/baseband/acc/vrb_trace.h   | 35 +++++++++++++++++
 4 files changed, 133 insertions(+), 28 deletions(-)
 create mode 100644 drivers/baseband/acc/vrb_trace.h
drivers/baseband/acc/acc_common.c +8 -0
index f8d2b19570..25ddef8a6c 100644
@@ -3,5 +3,13 @@
  */
 
 #include <rte_log.h>
+#include <rte_trace_point_register.h>
+#include "vrb_trace.h"
 
 RTE_LOG_REGISTER_SUFFIX(acc_common_logtype, common, INFO);
+
+RTE_TRACE_POINT_REGISTER(rte_bbdev_vrb_trace_error,
+	bbdev.vrb.device.error);
+
+RTE_TRACE_POINT_REGISTER(rte_bbdev_vrb_trace_queue_error,
+	bbdev.vrb.queue.error);
drivers/baseband/acc/acc_common.h +55 -0

73 lines not on this page · raw message

drivers/baseband/acc/rte_vrb_pmd.c +35 -28

177 lines not on this page · raw message

drivers/baseband/acc/vrb_trace.h new file +35 -0
new file mode 100644
index 0000000000..0bbfdc47d1
@@ -0,0 +1,35 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2025 Intel Corporation
+ */
+
+#ifndef VRB_TRACE_H_
+#define VRB_TRACE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <rte_trace_point.h>
+
+RTE_TRACE_POINT_FP(
+	rte_bbdev_vrb_trace_error,
+	RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *op_string, const char *err_string),
+	rte_trace_point_emit_u8(dev_id);
+	rte_trace_point_emit_string(op_string);
+	rte_trace_point_emit_string(err_string);
+)
+
+RTE_TRACE_POINT_FP(
+	rte_bbdev_vrb_trace_queue_error,
+	RTE_TRACE_POINT_ARGS(uint8_t qg_id, uint8_t aq_id, const char *str),
+	rte_trace_point_emit_u8(qg_id);
+	rte_trace_point_emit_u8(aq_id);
+	rte_trace_point_emit_string(str);
+)
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* VRB_TRACE_H_ */
Signature · 1 line
2.34.1
Reviewed-by on v2 2/3
#4 lore raw

Re: [PATCH v2 2/3] baseband/acc: add trace point

Quoted 12 lines · Nicolas Chautru

Improvement of logging to notably use trace point
for driver specific error logging and tracepoint.

---
  drivers/baseband/acc/acc_common.c  |  8 ++++
  drivers/baseband/acc/acc_common.h  | 55 ++++++++++++++++++++++++++
  drivers/baseband/acc/rte_vrb_pmd.c | 63 +++++++++++++++++-------------
  drivers/baseband/acc/vrb_trace.h   | 35 +++++++++++++++++
  4 files changed, 133 insertions(+), 28 deletions(-)

create mode 100644 drivers/baseband/acc/vrb_trace.h

Thanks,
Maxime

#5 lore raw

PATCH v2 3/3 baseband/acc: add internal logging

In reply to Nicolas Chautru

Adds internal buffer for more flexible logging.

---
 drivers/baseband/acc/acc_common.h  | 22 +++++++++++++++++++---
 drivers/baseband/acc/rte_vrb_pmd.c | 18 +++++++++++++++++-
 2 files changed, 36 insertions(+), 4 deletions(-)
drivers/baseband/acc/acc_common.h +19 -3
index 4880444450..06255ff5f1 100644
@@ -152,6 +152,8 @@
 #define ACC_MAX_FFT_WIN      16
 #define ACC_MAX_RING_BUFFER  64
 #define VRB2_MAX_Q_PER_OP 256
+#define ACC_MAX_LOGLEN    256
+#define ACC_MAX_BUFFERLEN 256
 
 extern int acc_common_logtype;
 #define RTE_LOGTYPE_ACC_COMMON acc_common_logtype
@@ -652,6 +654,9 @@ struct __rte_cache_aligned acc_queue {
 	rte_iova_t fcw_ring_addr_iova;
 	int8_t *derm_buffer; /* interim buffer for de-rm in SDK */
 	struct acc_device *d;
+	char error_bufs[ACC_MAX_BUFFERLEN][ACC_MAX_LOGLEN]; /**< Buffer for error log. */
+	uint16_t error_head;  /**< Head - Buffer for error log. */
+	uint16_t  error_wrap; /**< Wrap Counter - Buffer for error log. */
 };
 
 /* These strings for rte_trace must be limited to RTE_TRACE_EMIT_STRING_LEN_MAX. */
@@ -690,11 +695,21 @@ __rte_format_printf(4, 5)
 static inline void
 acc_error_log(struct acc_queue *q, void *op, uint8_t acc_error_idx, const char *fmt, ...)
 {
-	va_list args;
-	RTE_SET_USED(op);
+	va_list args, args2;
+	static char str[1024];
+
 	va_start(args, fmt);
+	va_copy(args2, args);
 	rte_vlog(RTE_LOG_ERR, acc_common_logtype, fmt, args);
-
+	vsnprintf(q->error_bufs[q->error_head], ACC_MAX_LOGLEN, fmt, args2);
+	q->error_head++;
+	snprintf(q->error_bufs[q->error_head], ACC_MAX_LOGLEN,
+			"%s", rte_bbdev_ops_param_string(op, q->op_type, str, sizeof(str)));
+	q->error_head++;
+	if (q->error_head == ACC_MAX_LOGLEN) {
+		q->error_head = 0;
+		q->error_wrap++;
+	}
 	if (acc_error_idx > ACC_ERR_MAX)
 		acc_error_idx = ACC_ERR_MAX;
 
@@ -702,6 +717,7 @@ acc_error_log(struct acc_queue *q, void *op, uint8_t acc_error_idx, const char *
 			acc_error_string[acc_error_idx]);
 
 	va_end(args);
+	va_end(args2);
 }
 
 /* Write to MMIO register address */
drivers/baseband/acc/rte_vrb_pmd.c +17 -1
index 27620ccc10..d81c5d460c 100644
@@ -1135,6 +1135,10 @@ vrb_queue_setup(struct rte_bbdev *dev, uint16_t queue_id,
 	q->mmio_reg_enqueue = RTE_PTR_ADD(d->mmio_base,
 			d->queue_offset(d->pf_device, q->vf_id, q->qgrp_id, q->aq_id));
 
+	/** initialize the error buffer. */
+	q->error_head = 0;
+	q->error_wrap = 0;
+
 	rte_bbdev_log_debug(
 			"Setup dev%u q%u: qgrp_id=%u, vf_id=%u, aq_id=%u, aq_depth=%u, mmio_reg_enqueue=%p base %p",
 			dev->data->dev_id, queue_id, q->qgrp_id, q->vf_id,
@@ -1516,7 +1520,7 @@ vrb_queue_ops_dump(struct rte_bbdev *dev, uint16_t queue_id, FILE *f)
 {
 	struct acc_queue *q = dev->data->queues[queue_id].queue_private;
 	struct rte_bbdev_dec_op *op;
-	uint16_t i, int_nb;
+	uint16_t start_err, end_err, i, int_nb;
 	volatile union acc_info_ring_data *ring_data;
 	uint16_t info_ring_head = q->d->info_ring_head;
 	static char str[1024];
@@ -1533,6 +1537,18 @@ vrb_queue_ops_dump(struct rte_bbdev *dev, uint16_t queue_id, FILE *f)
 			q->aq_enqueued, q->aq_dequeued, q->aq_depth,
 			acc_ring_avail_enq(q), acc_ring_avail_deq(q));
 
+	/** Print information captured in the error buffer. */
+	if (q->error_wrap == 0) {
+		start_err = 0;
+		end_err = q->error_head;
+	} else {
+		start_err = q->error_head;
+		end_err = q->error_head + ACC_MAX_BUFFERLEN;
+	}
+	fprintf(f, "Error Buffer - Head %d Wrap %d\n", q->error_head, q->error_wrap);
+	for (i = start_err; i < end_err; ++i)
+		fprintf(f, "  %d\t%s", i, q->error_bufs[i % ACC_MAX_BUFFERLEN]);
+
 	/** Print information captured in the info ring. */
 	if (q->d->info_ring != NULL) {
 		fprintf(f, "Info Ring Buffer - Head %d\n", q->d->info_ring_head);
Signature · 1 line
2.34.1
#6 lore raw

Re: [PATCH v2 3/3] baseband/acc: add internal logging

Quoted 3 lines · On Thu, 23 Jan 2025 14:55:19 -0800 Nicolas Chautru <[email protected]>…

Adds internal buffer for more flexible logging.

Inventing another device specific error log seems like a short sighted concept. Why doesn't existing DPDK logging work well enough?

#7 lore raw

RE: [PATCH v2 3/3] baseband/acc: add internal logging

Hi Stephen,

The commit message may be misleading, the logging interface doesn't change here. Note also that I reuse existing trace point framework for some of the error logging when relevant (see previous commit). Here the scope for that buffer is more limited, not a new logging method really (the commit message is misleading).
The queue_ops_dump() already provides api to dump device specific information related to queue into file (logging in real time is not an option) based on information already in PMD memory. This new buffer is purely there to add storage for the string out of rte_bbdev_ops_param_string() for failed operation on that queue, so that extend that capture as this info is not stored by PMD. The name of the buffer could be renamed probably, or I could store copy of the actual operation instead of the string in case that makes a difference for you.

I guess it would possible to move this to trace point but I thought it would be quite convoluted. That information would fits nicely in the queue dump capture, and this would require adding trace point for each operation type (I don't believe it can manage arbitrary string) and would be a bit of an unconventional use of trace point.

Any thought?

Thanks
Nic

Quoted 18 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Thursday, January 23, 2025 3:24 PM
To: Chautru, Nicolas <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Vargas, Hernan <[email protected]>
Subject: Re: [PATCH v2 3/3] baseband/acc: add internal logging

Quoted 3 lines · On Thu, 23 Jan 2025 14:55:19 -0800 Nicolas Chautru <[email protected]>…

Adds internal buffer for more flexible logging.

Inventing another device specific error log seems like a short sighted concept.
Why doesn't existing DPDK logging work well enough?

#8 lore raw

Re: [PATCH v2 3/3] baseband/acc: add internal logging

Quoted 8 lines · Nicolas

Hi Stephen,

The commit message may be misleading, the logging interface doesn't change here. Note also that I reuse existing trace point framework for some of the error logging when relevant (see previous commit). Here the scope for that buffer is more limited, not a new logging method really (the commit message is misleading).
The queue_ops_dump() already provides api to dump device specific information related to queue into file (logging in real time is not an option) based on information already in PMD memory. This new buffer is purely there to add storage for the string out of rte_bbdev_ops_param_string() for failed operation on that queue, so that extend that capture as this info is not stored by PMD. The name of the buffer could be renamed probably, or I could store copy of the actual operation instead of the string in case that makes a difference for you.

Quoted 27 lines

I guess it would possible to move this to trace point but I thought it would be quite convoluted. That information would fits nicely in the queue dump capture, and this would require adding trace point for each operation type (I don't believe it can manage arbitrary string) and would be a bit of an unconventional use of trace point.

Any thought?

Thanks
Nic

Quoted 18 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Thursday, January 23, 2025 3:24 PM
To: Chautru, Nicolas <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Vargas, Hernan <[email protected]>
Subject: Re: [PATCH v2 3/3] baseband/acc: add internal logging

Quoted 3 lines · On Thu, 23 Jan 2025 14:55:19 -0800 Nicolas Chautru <[email protected]>…

Adds internal buffer for more flexible logging.

Inventing another device specific error log seems like a short sighted concept.
Why doesn't existing DPDK logging work well enough?

My feedback is that why can't you just use DEBUG logging for this.

#9 lore raw

RE: [PATCH v2 3/3] baseband/acc: add internal logging

Hi Stephen,

Quoted 53 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Friday, January 24, 2025 10:01 AM
To: Chautru, Nicolas <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Vargas, Hernan <[email protected]>
Subject: Re: [PATCH v2 3/3] baseband/acc: add internal logging

Quoted 3 lines · Nicolas

Hi Stephen,

The commit message may be misleading, the logging interface doesn't

change here. Note also that I reuse existing trace point framework for some of the error logging when relevant (see previous commit).

Quoted 1 line

Here the scope for that buffer is more limited, not a new logging method

really (the commit message is misleading).

Quoted 1 line

The queue_ops_dump() already provides api to dump device specific

information related to queue into file (logging in real time is not an option) based on information already in PMD memory.

Quoted 1 line

This new buffer is purely there to add storage for the string out of

rte_bbdev_ops_param_string() for failed operation on that queue, so that extend that capture as this info is not stored by PMD.

Quoted 1 line

The name of the buffer could be renamed probably, or I could store copy

of the actual operation instead of the string in case that makes a difference for you.

Quoted 2 lines

I guess it would possible to move this to trace point but I thought it would

be quite convoluted. That information would fits nicely in the queue dump capture, and this would require adding trace point for each operation type (I don't believe it can manage arbitrary string) and would be a bit of an unconventional use of trace point.

Quoted 20 lines

Any thought?

Thanks
Nic

Quoted 13 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Thursday, January 23, 2025 3:24 PM
To: Chautru, Nicolas <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Vargas, Hernan <[email protected]>
Subject: Re: [PATCH v2 3/3] baseband/acc: add internal logging

Quoted 2 lines · On Thu, 23 Jan 2025 14:55:19 -0800 Nicolas Chautru <[email protected]>…

Adds internal buffer for more flexible logging.

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 1 line

Inventing another device specific error log seems like a short sighted concept.
Why doesn't existing DPDK logging work well enough?

My feedback is that why can't you just use DEBUG logging for this.

In practice this logging cannot be enabled as this impact real time workload. This is disabled by default for deployment as too intrusive, ie. logging some warning causing application to miss the tight real time constraints. Hence meaningful logging is being done in practice after the fact using trace point (ie. rte_trace_save()) and/or using the bbdev queue_ops_dump() which are both called outside of real time constraints when we can write to file system.

#10 lore raw

Re: [PATCH v2 3/3] baseband/acc: add internal logging

In reply to Stephen Hemminger

Hi Nicolas,

Quoted 11 lines · Stephen Hemminger
Quoted 8 lines · Nicolas

Hi Stephen,

The commit message may be misleading, the logging interface doesn't change here. Note also that I reuse existing trace point framework for some of the error logging when relevant (see previous commit). Here the scope for that buffer is more limited, not a new logging method really (the commit message is misleading).
The queue_ops_dump() already provides api to dump device specific information related to queue into file (logging in real time is not an option) based on information already in PMD memory. This new buffer is purely there to add storage for the string out of rte_bbdev_ops_param_string() for failed operation on that queue, so that extend that capture as this info is not stored by PMD. The name of the buffer could be renamed probably, or I could store copy of the actual operation instead of the string in case that makes a difference for you.

Quoted 3 lines
Quoted 3 lines

I guess it would possible to move this to trace point but I thought it would be quite convoluted. That information would fits nicely in the queue dump capture, and this would require adding trace point for each operation type (I don't believe it can manage arbitrary string) and would be a bit of an unconventional use of trace point.

Any thought?

I think the introduction of trace points in patch 2 is a good addition, and could be extended further to not just emit a simple string but also the necessary values to enable debugging (basically what you write in the buffers).

It would have the advantage of having the different traces to be synchronized (bbdev and acc ones), and also would have less performance impact.

Quoted 17 lines
Quoted 17 lines

Thanks
Nic

Quoted 13 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Thursday, January 23, 2025 3:24 PM
To: Chautru, Nicolas <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Vargas, Hernan <[email protected]>
Subject: Re: [PATCH v2 3/3] baseband/acc: add internal logging

Quoted 2 lines · On Thu, 23 Jan 2025 14:55:19 -0800 Nicolas Chautru <[email protected]>…

Adds internal buffer for more flexible logging.

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 1 line

Inventing another device specific error log seems like a short sighted concept.
Why doesn't existing DPDK logging work well enough?

My feedback is that why can't you just use DEBUG logging for this.

Or indeed could use the existing logging mechanism.

Quoted 1 line

Thanks,
Maxime

#11 lore raw

Re: [PATCH v2 3/3] baseband/acc: add internal logging

Hi Nicolas,

Quoted 18 lines · Maxime Coquelin

Hi Nicolas,

Quoted 11 lines · Stephen Hemminger
Quoted 8 lines · Nicolas

Hi Stephen,

The commit message may be misleading, the logging interface doesn't change here. Note also that I reuse existing trace point framework for some of the error logging when relevant (see previous commit). Here the scope for that buffer is more limited, not a new logging method really (the commit message is misleading).
The queue_ops_dump() already provides api to dump device specific information related to queue into file (logging in real time is not an option) based on information already in PMD memory. This new buffer is purely there to add storage for the string out of rte_bbdev_ops_param_string() for failed operation on that queue, so that extend that capture as this info is not stored by PMD. The name of the buffer could be renamed probably, or I could store copy of the actual operation instead of the string in case that makes a difference for you.

Quoted 3 lines
Quoted 3 lines

I guess it would possible to move this to trace point but I thought it would be quite convoluted. That information would fits nicely in the queue dump capture, and this would require adding trace point for each operation type (I don't believe it can manage arbitrary string) and would be a bit of an unconventional use of trace point.

Any thought?

Quoted 8 lines

I think the introduction of trace points in patch 2 is a good addition, and could be extended further to not just emit a simple string but also the necessary values to enable debugging (basically what you write in the buffers).

It would have the advantage of having the different traces to be synchronized (bbdev and acc ones), and also would have less performance impact.

What do you think of this proposal?
how do we proceed for v25.03?

Thanks,
Maxime

Quoted 31 lines
Quoted 16 lines
Quoted 16 lines

Thanks
Nic

Quoted 12 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Thursday, January 23, 2025 3:24 PM
To: Chautru, Nicolas <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Vargas, Hernan <[email protected]>
Subject: Re: [PATCH v2 3/3] baseband/acc: add internal logging

Quoted 2 lines · On Thu, 23 Jan 2025 14:55:19 -0800 Nicolas Chautru <[email protected]>…

Adds internal buffer for more flexible logging.

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 1 line

Inventing another device specific error log seems like a short sighted concept.
Why doesn't existing DPDK logging work well enough?

My feedback is that why can't you just use DEBUG logging for this.

Or indeed could use the existing logging mechanism.

Quoted 1 line

Thanks,
Maxime

#12 lore raw

RE: [PATCH v2 3/3] baseband/acc: add internal logging

Hi Maxime,

I believe that for 25.03 we can just apply the first 2 commits of the serie.

For the last commit, it will take more time to try your suggestion out, we can do this in subsequent release.

Does that sound okay with you?

Thanks
Nic

Quoted 90 lines

-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Friday, February 28, 2025 12:52 AM
To: Stephen Hemminger <[email protected]>; Chautru, Nicolas <[email protected]>
Cc: [email protected]; [email protected]; Vargas, Hernan <[email protected]>
Subject: Re: [PATCH v2 3/3] baseband/acc: add internal logging

Hi Nicolas,

Quoted 31 lines · Maxime Coquelin

Hi Nicolas,

Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · Nicolas

Hi Stephen,

The commit message may be misleading, the logging interface doesn't change here. Note also that I reuse existing trace point framework for some of the error logging when relevant (see previous commit). Here the scope for that buffer is more limited, not a new logging method really (the commit message is misleading).
The queue_ops_dump() already provides api to dump device specific information related to queue into file (logging in real time is not an option) based on information already in PMD memory. This new buffer is purely there to add storage for the string out of rte_bbdev_ops_param_string() for failed operation on that queue, so that extend that capture as this info is not stored by PMD. The name of the buffer could be renamed probably, or I could store copy of the actual operation instead of the string in case that makes a difference for you.

Quoted 7 lines
Quoted 7 lines

I guess it would possible to move this to trace point but I thought it would be quite convoluted. That information would fits nicely in the queue dump capture, and this would require adding trace point for each operation type (I don't believe it can manage arbitrary string) and would be a bit of an unconventional use of trace point.

Any thought?

Quoted 8 lines

I think the introduction of trace points in patch 2 is a good addition, and could be extended further to not just emit a simple string but also the necessary values to enable debugging (basically what you write in the buffers).

It would have the advantage of having the different traces to be synchronized (bbdev and acc ones), and also would have less performance impact.

What do you think of this proposal?
how do we proceed for v25.03?

Thanks,
Maxime

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

Thanks
Nic

Quoted 6 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Thursday, January 23, 2025 3:24 PM
To: Chautru, Nicolas <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Vargas, Hernan

<[email protected]>

Quoted 21 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Subject: Re: [PATCH v2 3/3] baseband/acc: add internal logging

Quoted 2 lines · On Thu, 23 Jan 2025 14:55:19 -0800 Nicolas Chautru <[email protected]>…

Adds internal buffer for more flexible logging.

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 1 line

Inventing another device specific error log seems like a short sighted concept.
Why doesn't existing DPDK logging work well enough?

My feedback is that why can't you just use DEBUG logging for this.

Or indeed could use the existing logging mechanism.

Quoted 1 line

Thanks,
Maxime

#13 lore raw

Re: [PATCH v2 3/3] baseband/acc: add internal logging

Hi Nicolas,

Quoted 7 lines · Nicolas

Hi Maxime,

I believe that for 25.03 we can just apply the first 2 commits of the serie.

For the last commit, it will take more time to try your suggestion out, we can do this in subsequent release.

Does that sound okay with you?

Yes, that sounds good to me.

Thanks,
Maxime

Quoted 94 lines

Thanks
Nic

Quoted 90 lines

-----Original Message-----
From: Maxime Coquelin <[email protected]>
Sent: Friday, February 28, 2025 12:52 AM
To: Stephen Hemminger <[email protected]>; Chautru, Nicolas <[email protected]>
Cc: [email protected]; [email protected]; Vargas, Hernan <[email protected]>
Subject: Re: [PATCH v2 3/3] baseband/acc: add internal logging

Hi Nicolas,

Quoted 31 lines · Maxime Coquelin

Hi Nicolas,

Quoted 20 lines · Stephen Hemminger
Quoted 17 lines · Nicolas

Hi Stephen,

The commit message may be misleading, the logging interface doesn't change here. Note also that I reuse existing trace point framework for some of the error logging when relevant (see previous commit). Here the scope for that buffer is more limited, not a new logging method really (the commit message is misleading).
The queue_ops_dump() already provides api to dump device specific information related to queue into file (logging in real time is not an option) based on information already in PMD memory. This new buffer is purely there to add storage for the string out of rte_bbdev_ops_param_string() for failed operation on that queue, so that extend that capture as this info is not stored by PMD. The name of the buffer could be renamed probably, or I could store copy of the actual operation instead of the string in case that makes a difference for you.

Quoted 7 lines
Quoted 7 lines

I guess it would possible to move this to trace point but I thought it would be quite convoluted. That information would fits nicely in the queue dump capture, and this would require adding trace point for each operation type (I don't believe it can manage arbitrary string) and would be a bit of an unconventional use of trace point.

Any thought?

Quoted 8 lines

I think the introduction of trace points in patch 2 is a good addition, and could be extended further to not just emit a simple string but also the necessary values to enable debugging (basically what you write in the buffers).

It would have the advantage of having the different traces to be synchronized (bbdev and acc ones), and also would have less performance impact.

What do you think of this proposal?
how do we proceed for v25.03?

Thanks,
Maxime

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

Thanks
Nic

Quoted 6 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Thursday, January 23, 2025 3:24 PM
To: Chautru, Nicolas <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Vargas, Hernan

<[email protected]>

Quoted 21 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Subject: Re: [PATCH v2 3/3] baseband/acc: add internal logging

Quoted 2 lines · On Thu, 23 Jan 2025 14:55:19 -0800 Nicolas Chautru <[email protected]>…

Adds internal buffer for more flexible logging.

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 1 line

Inventing another device specific error log seems like a short sighted concept.
Why doesn't existing DPDK logging work well enough?

My feedback is that why can't you just use DEBUG logging for this.

Or indeed could use the existing logging mechanism.

Quoted 1 line

Thanks,
Maxime

#14 lore raw
In reply to Nicolas Chautru
Quoted 31 lines · Nicolas Chautru

v2: fix build error.

Hi,

Based on previous discussion improving logging for bbdev and PMD using notably trace points and internal logging extension.
The trace point impacting real time are not built by default. This is added at bbdev level and also in the PMD specific implementation.

Thanks
Nic

Nicolas Chautru (3):
bbdev: add trace point
baseband/acc: add trace point
baseband/acc: add internal logging

  drivers/baseband/acc/acc_common.c  |  8 +++
  drivers/baseband/acc/acc_common.h  | 71 ++++++++++++++++++++++++++
  drivers/baseband/acc/rte_vrb_pmd.c | 81 +++++++++++++++++++-----------
  drivers/baseband/acc/vrb_trace.h   | 35 +++++++++++++
  lib/bbdev/bbdev_trace.h            | 69 +++++++++++++++++++++++++
  lib/bbdev/bbdev_trace_points.c     | 27 ++++++++++
  lib/bbdev/meson.build              |  6 ++-
  lib/bbdev/rte_bbdev.c              | 17 +++++++
  lib/bbdev/rte_bbdev.h              | 50 +++++++++++++++---
  lib/bbdev/rte_bbdev_trace_fp.h     | 41 +++++++++++++++
  lib/bbdev/version.map              |  4 ++
  11 files changed, 372 insertions(+), 37 deletions(-)
Quoted 5 lines

create mode 100644 drivers/baseband/acc/vrb_trace.h create mode 100644 lib/bbdev/bbdev_trace.h create mode 100644 lib/bbdev/bbdev_trace_points.c create mode 100644 lib/bbdev/rte_bbdev_trace_fp.h

Patches 1 & 2 of the series applied to next-baseband/for-main. Patch 3 is dropped as agreed on the list.

Thanks,
Maxime