From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C53E846108; Fri, 24 Jan 2025 00:07:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A6A440BA4; Fri, 24 Jan 2025 00:07:07 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by mails.dpdk.org (Postfix) with ESMTP id 7452340041 for ; Fri, 24 Jan 2025 00:07:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1737673626; x=1769209626; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=V1Pypk/Z2M2Bejmv6R909u2WhWWHTkJRg5D6rXqJ9tM=; b=dJnzUVlVftnBqK882hc3gN5pxSpMSsSeAQH28kGzqFo3+KA2e3RZV8bp N4ML9GSEfTU3etgBcrGCHoEW/pM6zSWYSP+tKcXBVmSLC/3DiZ8+Tj6VU xJdEMFUpVM2XKhWXpLLJfmP/yPu+Yed2y9IVoUQUiq0HyZf9pPPJjBdD4 DqKKRh7cO1XwXgmASUnobY5b5/ogc6/hNF0IWV2LJFurXafcClKTTlNp/ 9EYTxW3Kx2p+OptcYqJpAmMlZtkX+NDDSgJAQTndTkxFzL+BSS4G7/2Vn kPPV+po4SKgc2dzJBHij7U80v/GIgRCfXW7mSXAOKt+ruS5A1noacuh7t g==; X-CSE-ConnectionGUID: XxcH7cWQSQudCssWrsFdAw== X-CSE-MsgGUID: wgUJAa3ZRmC1Y5ArC3UlEQ== X-IronPort-AV: E=McAfee;i="6700,10204,11324"; a="38368591" X-IronPort-AV: E=Sophos;i="6.13,229,1732608000"; d="scan'208";a="38368591" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jan 2025 15:07:04 -0800 X-CSE-ConnectionGUID: kohlCZ8yTCCBBIgq3oBUdQ== X-CSE-MsgGUID: bTfmuXDtShegbUFSnEBfZw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,229,1732608000"; d="scan'208";a="112599671" Received: from spr-npg-bds1-eec2.sn.intel.com (HELO spr-npg-bds1-eec2..) ([10.233.181.123]) by fmviesa004.fm.intel.com with ESMTP; 23 Jan 2025 15:07:04 -0800 From: Nicolas Chautru To: dev@dpdk.org, maxime.coquelin@redhat.com Cc: hemant.agrawal@nxp.com, hernan.vargas@intel.com, Nicolas Chautru Subject: [PATCH v2 1/3] bbdev: add trace point Date: Thu, 23 Jan 2025 14:55:17 -0800 Message-Id: <20250123225519.2469167-2-nicolas.chautru@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250123225519.2469167-1-nicolas.chautru@intel.com> References: <20250123225519.2469167-1-nicolas.chautru@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Adds trace points for rte_bbdev. Signed-off-by: Nicolas Chautru --- 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 diff --git a/lib/bbdev/bbdev_trace.h b/lib/bbdev/bbdev_trace.h new file mode 100644 index 0000000000..7256d6b703 --- /dev/null +++ b/lib/bbdev/bbdev_trace.h @@ -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 + +#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 */ diff --git a/lib/bbdev/bbdev_trace_points.c b/lib/bbdev/bbdev_trace_points.c new file mode 100644 index 0000000000..6f90e2aa65 --- /dev/null +++ b/lib/bbdev/bbdev_trace_points.c @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(C) 2025 Intel Corporation + */ + +#include + +#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) diff --git a/lib/bbdev/meson.build b/lib/bbdev/meson.build index 07685e7578..d8b95a400e 100644 --- a/lib/bbdev/meson.build +++ b/lib/bbdev/meson.build @@ -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'] diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c index bd32da79b0..d7901cd29d 100644 --- a/lib/bbdev/rte_bbdev.c +++ b/lib/bbdev/rte_bbdev.c @@ -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); diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h index 6d5cdc7b8c..710280f0df 100644 --- a/lib/bbdev/rte_bbdev.h +++ b/lib/bbdev/rte_bbdev.h @@ -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 */ diff --git a/lib/bbdev/rte_bbdev_trace_fp.h b/lib/bbdev/rte_bbdev_trace_fp.h new file mode 100644 index 0000000000..d8b2217d17 --- /dev/null +++ b/lib/bbdev/rte_bbdev_trace_fp.h @@ -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_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_ */ diff --git a/lib/bbdev/version.map b/lib/bbdev/version.map index 1e11485b17..b9b4f31e33 100644 --- a/lib/bbdev/version.map +++ b/lib/bbdev/version.map @@ -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; }; -- 2.34.1