* [PATCH] cryptodev: add trace points
@ 2022-09-16 17:32 Amit Prakash Shukla
2022-09-27 8:06 ` Akhil Goyal
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Amit Prakash Shukla @ 2022-09-16 17:32 UTC (permalink / raw)
To: Akhil Goyal, Fan Zhang, Ray Kinsella; +Cc: dev, jerinj, Amit Prakash Shukla
Add trace points for cryptodev functions.
Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
---
lib/cryptodev/cryptodev_pmd.c | 13 +
lib/cryptodev/cryptodev_trace_points.c | 165 ++++++++++
lib/cryptodev/rte_cryptodev.c | 109 ++++++-
lib/cryptodev/rte_cryptodev_trace.h | 423 +++++++++++++++++++++++++
lib/cryptodev/rte_cryptodev_trace_fp.h | 6 +
lib/cryptodev/version.map | 57 ++++
6 files changed, 772 insertions(+), 1 deletion(-)
diff --git a/lib/cryptodev/cryptodev_pmd.c b/lib/cryptodev/cryptodev_pmd.c
index 1903ade388..c8829dbebe 100644
--- a/lib/cryptodev/cryptodev_pmd.c
+++ b/lib/cryptodev/cryptodev_pmd.c
@@ -8,6 +8,7 @@
#include <rte_malloc.h>
#include "cryptodev_pmd.h"
+#include "rte_cryptodev_trace.h"
/**
* Parse name from argument
@@ -84,6 +85,9 @@ rte_cryptodev_pmd_parse_input_args(
}
free_kvlist:
+ rte_cryptodev_trace_pmd_parse_input_args(params->name,
+ params->socket_id, params->max_nb_queue_pairs);
+
rte_kvargs_free(kvlist);
return ret;
}
@@ -135,6 +139,8 @@ rte_cryptodev_pmd_create(const char *name,
/* initialise user call-back tail queue */
TAILQ_INIT(&(cryptodev->link_intr_cbs));
+ rte_cryptodev_trace_pmd_create(name, params->socket_id, cryptodev);
+
return cryptodev;
}
@@ -144,6 +150,8 @@ rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev)
int retval;
void *dev_priv = cryptodev->data->dev_private;
+ rte_cryptodev_trace_pmd_destroy(cryptodev);
+
CDEV_LOG_INFO("Closing crypto device %s", cryptodev->device->name);
/* free crypto device */
@@ -166,6 +174,9 @@ rte_cryptodev_pmd_probing_finish(struct rte_cryptodev *cryptodev)
{
if (cryptodev == NULL)
return;
+
+ rte_cryptodev_trace_pmd_probing_finish(cryptodev);
+
/*
* for secondary process, at that point we expect device
* to be already 'usable', so shared data and all function
@@ -231,6 +242,8 @@ cryptodev_fp_ops_set(struct rte_crypto_fp_ops *fp_ops,
void *
rte_cryptodev_session_event_mdata_get(struct rte_crypto_op *op)
{
+ rte_cryptodev_trace_session_event_mdata_get(op->type);
+
if (op->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC &&
op->sess_type == RTE_CRYPTO_OP_WITH_SESSION)
return rte_cryptodev_sym_session_get_user_data(op->sym->session);
diff --git a/lib/cryptodev/cryptodev_trace_points.c b/lib/cryptodev/cryptodev_trace_points.c
index c5bfe08b79..bca4deecc2 100644
--- a/lib/cryptodev/cryptodev_trace_points.c
+++ b/lib/cryptodev/cryptodev_trace_points.c
@@ -50,3 +50,168 @@ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_enqueue_burst,
RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_dequeue_burst,
lib.cryptodev.deq.burst)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_callback_register,
+ lib.cryptodev.callback.register)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_callback_unregister,
+ lib.cryptodev.callback.unregister)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_device_count_by_driver,
+ lib.cryptodev.device.count.by.driver)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_devices_get,
+ lib.cryptodev.devices.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_driver_id_get,
+ lib.cryptodev.driver.id.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_driver_name_get,
+ lib.cryptodev.driver.name.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_aead_algo_enum,
+ lib.cryptodev.get.aead.algo.enum)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_auth_algo_enum,
+ lib.cryptodev.get.auth.algo.enum)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_cipher_algo_enum,
+ lib.cryptodev.get.cipher.algo.enum)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_dev_id,
+ lib.cryptodev.get.dev.id)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_feature_name,
+ lib.cryptodev.get.feature.name)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_sec_ctx,
+ lib.cryptodev.get.sec.ctx)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_info_get,
+ lib.cryptodev.info.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_is_valid_dev,
+ lib.cryptodev.is.valid.dev)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_name_get,
+ lib.cryptodev.name.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_queue_pair_count,
+ lib.cryptodev.queue.pair.count)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_socket_id,
+ lib.cryptodev.socket.id)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_stats_get,
+ lib.cryptodev.stats.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_stats_reset,
+ lib.cryptodev.stats.reset)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_check_aead,
+ lib.cryptodev.sym.capability.check.aead)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_check_auth,
+ lib.cryptodev.sym.capability.check.auth)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_check_cipher,
+ lib.cryptodev.sym.capability.check.cipher)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_get,
+ lib.cryptodev.sym.capability.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_get_private_session_size,
+ lib.cryptodev.sym.get.private.session.size)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_capability_get,
+ lib.cryptodev.asym.capability.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_get_private_session_size,
+ lib.cryptodev.asym.get.private.session.size)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_get_xform_enum,
+ lib.cryptodev.asym.get.xform.enum)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_xform_capability_check_modlen,
+ lib.cryptodev.asym.xform.capability.check.modlen)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_cpu_crypto_process,
+ lib.cryptodev.sym.cpu.crypto.process)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_get_existing_header_session_size,
+ lib.cryptodev.sym.get.existing.header.session.size)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_get_user_data,
+ lib.cryptodev.sym.session.get.user.data)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_set_user_data,
+ lib.cryptodev.sym.session.set.user.data)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_qp_status,
+ lib.cryptodev.get.qp.status)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_configure_raw_dp_ctx,
+ lib.cryptodev.configure.raw.dp.ctx)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_raw_dp_ctx_size,
+ lib.cryptodev.get.raw.dp.ctx.size)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_add_deq_callback,
+ lib.cryptodev.add.deq.callback)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_add_enq_callback,
+ lib.cryptodev.add.enq.callback)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_remove_deq_callback,
+ lib.cryptodev.remove.deq.callback)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_remove_enq_callback,
+ lib.cryptodev.remove.enq.callback)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_get_user_data,
+ lib.cryptodev.asym.session.get.user.data)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_set_user_data,
+ lib.cryptodev.asym.session.set.user.data)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_session_event_mdata_set,
+ lib.cryptodev.session.event.mdata.set)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_allocate_driver,
+ lib.cryptodev.allocate.driver)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_allocate,
+ lib.cryptodev.pmd.allocate)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_callback_process,
+ lib.cryptodev.pmd.callback.process)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_create,
+ lib.cryptodev.pmd.create)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_create_dev_name,
+ lib.cryptodev.pmd.create.dev.name)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_destroy,
+ lib.cryptodev.pmd.destroy)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_get_dev,
+ lib.cryptodev.pmd.get.dev)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_get_named_dev,
+ lib.cryptodev.pmd.get.named.dev)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_parse_input_args,
+ lib.cryptodev.pmd.parse.input.args)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_probing_finish,
+ lib.cryptodev.pmd.probing.finish)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_release_device,
+ lib.cryptodev.pmd.release.device)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_session_event_mdata_get,
+ lib.cryptodev.session.event.mdata.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_op_pool_create,
+ lib.cryptodev.op.pool.create)
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 42f3221052..b712315674 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -216,6 +216,8 @@ rte_cryptodev_get_cipher_algo_enum(enum rte_crypto_cipher_algorithm *algo_enum,
{
unsigned int i;
+ rte_cryptodev_trace_get_cipher_algo_enum(algo_string);
+
for (i = 1; i < RTE_DIM(rte_crypto_cipher_algorithm_strings); i++) {
if (strcmp(algo_string, rte_crypto_cipher_algorithm_strings[i]) == 0) {
*algo_enum = (enum rte_crypto_cipher_algorithm) i;
@@ -233,6 +235,8 @@ rte_cryptodev_get_auth_algo_enum(enum rte_crypto_auth_algorithm *algo_enum,
{
unsigned int i;
+ rte_cryptodev_trace_get_auth_algo_enum(algo_string);
+
for (i = 1; i < RTE_DIM(rte_crypto_auth_algorithm_strings); i++) {
if (strcmp(algo_string, rte_crypto_auth_algorithm_strings[i]) == 0) {
*algo_enum = (enum rte_crypto_auth_algorithm) i;
@@ -250,6 +254,8 @@ rte_cryptodev_get_aead_algo_enum(enum rte_crypto_aead_algorithm *algo_enum,
{
unsigned int i;
+ rte_cryptodev_trace_get_aead_algo_enum(algo_string);
+
for (i = 1; i < RTE_DIM(rte_crypto_aead_algorithm_strings); i++) {
if (strcmp(algo_string, rte_crypto_aead_algorithm_strings[i]) == 0) {
*algo_enum = (enum rte_crypto_aead_algorithm) i;
@@ -267,6 +273,8 @@ rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum,
{
unsigned int i;
+ rte_cryptodev_trace_asym_get_xform_enum(xform_string);
+
for (i = 1; i < RTE_DIM(rte_crypto_asym_xform_strings); i++) {
if (strcmp(xform_string,
rte_crypto_asym_xform_strings[i]) == 0) {
@@ -299,6 +307,9 @@ rte_cryptodev_sym_capability_get(uint8_t dev_id,
rte_cryptodev_info_get(dev_id, &dev_info);
+ rte_cryptodev_trace_sym_capability_get(dev_id, dev_info.driver_name,
+ dev_info.driver_id, idx->type);
+
while ((capability = &dev_info.capabilities[i++])->op !=
RTE_CRYPTO_OP_TYPE_UNDEFINED) {
if (capability->op != RTE_CRYPTO_OP_TYPE_SYMMETRIC)
@@ -359,6 +370,9 @@ rte_cryptodev_asym_capability_get(uint8_t dev_id,
memset(&dev_info, 0, sizeof(struct rte_cryptodev_info));
rte_cryptodev_info_get(dev_id, &dev_info);
+ rte_cryptodev_trace_asym_capability_get(dev_info.driver_name,
+ dev_info.driver_id, idx->type);
+
while ((capability = &dev_info.capabilities[i++])->op !=
RTE_CRYPTO_OP_TYPE_UNDEFINED) {
if (capability->op != RTE_CRYPTO_OP_TYPE_ASYMMETRIC)
@@ -375,6 +389,9 @@ rte_cryptodev_sym_capability_check_cipher(
const struct rte_cryptodev_symmetric_capability *capability,
uint16_t key_size, uint16_t iv_size)
{
+ rte_cryptodev_trace_sym_capability_check_cipher(capability, key_size,
+ iv_size);
+
if (param_range_check(key_size, &capability->cipher.key_size) != 0)
return -1;
@@ -389,6 +406,9 @@ rte_cryptodev_sym_capability_check_auth(
const struct rte_cryptodev_symmetric_capability *capability,
uint16_t key_size, uint16_t digest_size, uint16_t iv_size)
{
+ rte_cryptodev_trace_sym_capability_check_auth(capability, key_size,
+ digest_size, iv_size);
+
if (param_range_check(key_size, &capability->auth.key_size) != 0)
return -1;
@@ -407,6 +427,9 @@ rte_cryptodev_sym_capability_check_aead(
uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
uint16_t iv_size)
{
+ rte_cryptodev_trace_sym_capability_check_aead(capability, key_size,
+ digest_size, aad_size, iv_size);
+
if (param_range_check(key_size, &capability->aead.key_size) != 0)
return -1;
@@ -437,6 +460,9 @@ rte_cryptodev_asym_xform_capability_check_modlen(
const struct rte_cryptodev_asymmetric_xform_capability *capability,
uint16_t modlen)
{
+ rte_cryptodev_trace_asym_xform_capability_check_modlen(capability,
+ modlen);
+
/* no need to check for limits, if min or max = 0 */
if (capability->modlen.min != 0) {
if (modlen < capability->modlen.min)
@@ -577,6 +603,8 @@ cryptodev_cb_init(struct rte_cryptodev *dev)
const char *
rte_cryptodev_get_feature_name(uint64_t flag)
{
+ rte_cryptodev_trace_get_feature_name(flag);
+
switch (flag) {
case RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO:
return "SYMMETRIC_CRYPTO";
@@ -638,6 +666,8 @@ rte_cryptodev_get_feature_name(uint64_t flag)
struct rte_cryptodev *
rte_cryptodev_pmd_get_dev(uint8_t dev_id)
{
+ rte_cryptodev_trace_pmd_get_dev(dev_id);
+
return &cryptodev_globals.devs[dev_id];
}
@@ -650,6 +680,8 @@ rte_cryptodev_pmd_get_named_dev(const char *name)
if (name == NULL)
return NULL;
+ rte_cryptodev_trace_pmd_get_named_dev(name);
+
for (i = 0; i < RTE_CRYPTO_MAX_DEVS; i++) {
dev = &cryptodev_globals.devs[i];
@@ -676,6 +708,8 @@ rte_cryptodev_is_valid_dev(uint8_t dev_id)
{
struct rte_cryptodev *dev = NULL;
+ rte_cryptodev_trace_is_valid_dev(dev_id);
+
if (!rte_cryptodev_is_valid_device_data(dev_id))
return 0;
@@ -695,6 +729,8 @@ rte_cryptodev_get_dev_id(const char *name)
if (name == NULL)
return -1;
+ rte_cryptodev_trace_get_dev_id(name);
+
for (i = 0; i < RTE_CRYPTO_MAX_DEVS; i++) {
if (!rte_cryptodev_is_valid_device_data(i))
continue;
@@ -725,6 +761,8 @@ rte_cryptodev_device_count_by_driver(uint8_t driver_id)
RTE_CRYPTODEV_ATTACHED)
dev_count++;
+ rte_cryptodev_trace_device_count_by_driver(driver_id, dev_count);
+
return dev_count;
}
@@ -751,12 +789,16 @@ rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices,
}
}
+ rte_cryptodev_trace_devices_get(driver_name, count);
+
return count;
}
void *
rte_cryptodev_get_sec_ctx(uint8_t dev_id)
{
+ rte_cryptodev_trace_get_sec_ctx(dev_id);
+
if (dev_id < RTE_CRYPTO_MAX_DEVS &&
(rte_crypto_devices[dev_id].feature_flags &
RTE_CRYPTODEV_FF_SECURITY))
@@ -775,6 +817,8 @@ rte_cryptodev_socket_id(uint8_t dev_id)
dev = rte_cryptodev_pmd_get_dev(dev_id);
+ rte_cryptodev_trace_socket_id(dev_id, dev->data->name,
+ dev->data->socket_id);
return dev->data->socket_id;
}
@@ -913,6 +957,7 @@ rte_cryptodev_pmd_allocate(const char *name, int socket_id)
cryptodev_globals.nb_devs++;
}
+ rte_cryptodev_trace_pmd_allocate(cryptodev);
return cryptodev;
}
@@ -925,6 +970,8 @@ rte_cryptodev_pmd_release_device(struct rte_cryptodev *cryptodev)
if (cryptodev == NULL)
return -EINVAL;
+ rte_cryptodev_trace_pmd_release_device(cryptodev);
+
dev_id = cryptodev->data->dev_id;
cryptodev_fp_ops_reset(rte_crypto_fp_ops + dev_id);
@@ -956,6 +1003,8 @@ rte_cryptodev_queue_pair_count(uint8_t dev_id)
}
dev = &rte_crypto_devices[dev_id];
+ rte_cryptodev_trace_queue_pair_count(dev);
+
return dev->data->nb_queue_pairs;
}
@@ -1178,6 +1227,8 @@ rte_cryptodev_get_qp_status(uint8_t dev_id, uint16_t queue_pair_id)
{
struct rte_cryptodev *dev;
+ rte_cryptodev_trace_get_qp_status(dev_id, queue_pair_id);
+
if (!rte_cryptodev_is_valid_dev(dev_id)) {
CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
return -EINVAL;
@@ -1331,6 +1382,7 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
rte_spinlock_unlock(&rte_cryptodev_callback_lock);
+ rte_cryptodev_trace_add_enq_callback(dev_id, qp_id, cb_fn);
return cb;
}
@@ -1356,6 +1408,8 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_id,
return -ENODEV;
}
+ rte_cryptodev_trace_remove_enq_callback(dev_id, qp_id, cb->fn);
+
dev = &rte_crypto_devices[dev_id];
if (qp_id >= dev->data->nb_queue_pairs) {
CDEV_LOG_ERR("Invalid queue_pair_id=%d", qp_id);
@@ -1466,6 +1520,8 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
rte_spinlock_unlock(&rte_cryptodev_callback_lock);
+ rte_cryptodev_trace_add_deq_callback(dev_id, qp_id, cb_fn);
+
return cb;
}
@@ -1491,6 +1547,8 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_id,
return -ENODEV;
}
+ rte_cryptodev_trace_remove_deq_callback(dev_id, qp_id, cb->fn);
+
dev = &rte_crypto_devices[dev_id];
if (qp_id >= dev->data->nb_queue_pairs) {
CDEV_LOG_ERR("Invalid queue_pair_id=%d", qp_id);
@@ -1559,6 +1617,8 @@ rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats)
RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_get, -ENOTSUP);
(*dev->dev_ops->stats_get)(dev, stats);
+
+ rte_cryptodev_trace_stats_get(dev_id, stats);
return 0;
}
@@ -1567,6 +1627,8 @@ rte_cryptodev_stats_reset(uint8_t dev_id)
{
struct rte_cryptodev *dev;
+ rte_cryptodev_trace_stats_reset(dev_id);
+
if (!rte_cryptodev_is_valid_dev(dev_id)) {
CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
return;
@@ -1597,6 +1659,9 @@ rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info)
dev_info->driver_name = dev->device->driver->name;
dev_info->device = dev->device;
+
+ rte_cryptodev_trace_info_get(dev_id);
+
}
int
@@ -1639,6 +1704,8 @@ rte_cryptodev_callback_register(uint8_t dev_id,
}
rte_spinlock_unlock(&rte_cryptodev_cb_lock);
+
+ rte_cryptodev_trace_callback_register(dev_id, event, cb_fn);
return (user_cb == NULL) ? -ENOMEM : 0;
}
@@ -1685,6 +1752,8 @@ rte_cryptodev_callback_unregister(uint8_t dev_id,
}
rte_spinlock_unlock(&rte_cryptodev_cb_lock);
+
+ rte_cryptodev_trace_callback_unregister(dev_id, event, cb_fn);
return ret;
}
@@ -1695,6 +1764,7 @@ rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
struct rte_cryptodev_callback *cb_lst;
struct rte_cryptodev_callback dev_cb;
+ rte_cryptodev_trace_pmd_callback_process(dev, event);
rte_spinlock_lock(&rte_cryptodev_cb_lock);
TAILQ_FOREACH(cb_lst, &(dev->link_intr_cbs), next) {
if (cb_lst->cb_fn == NULL || cb_lst->event != event)
@@ -2117,6 +2187,9 @@ rte_cryptodev_sym_get_private_session_size(uint8_t dev_id)
priv_sess_size = (*dev->dev_ops->sym_session_get_size)(dev);
+ rte_cryptodev_trace_sym_get_private_session_size(dev_id,
+ priv_sess_size);
+
return priv_sess_size;
}
@@ -2136,6 +2209,9 @@ rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
priv_sess_size = (*dev->dev_ops->asym_session_get_size)(dev);
+ rte_cryptodev_trace_asym_get_private_session_size(dev_id,
+ priv_sess_size);
+
return priv_sess_size;
}
@@ -2152,6 +2228,9 @@ rte_cryptodev_sym_session_set_user_data(
return -ENOMEM;
rte_memcpy(sess->sess_data + sess->nb_drivers, data, size);
+
+ rte_cryptodev_trace_sym_session_set_user_data(sess, data, size);
+
return 0;
}
@@ -2162,6 +2241,8 @@ rte_cryptodev_sym_session_get_user_data(
if (sess == NULL || sess->user_data_sz == 0)
return NULL;
+ rte_cryptodev_trace_sym_session_get_user_data(sess);
+
return (void *)(sess->sess_data + sess->nb_drivers);
}
@@ -2178,6 +2259,9 @@ rte_cryptodev_asym_session_set_user_data(void *session, void *data, uint16_t siz
rte_memcpy(sess->sess_private_data +
sess->max_priv_data_sz,
data, size);
+
+ rte_cryptodev_trace_asym_session_set_user_data(sess, data, size);
+
return 0;
}
@@ -2188,6 +2272,8 @@ rte_cryptodev_asym_session_get_user_data(void *session)
if (sess == NULL || sess->user_data_sz == 0)
return NULL;
+ rte_cryptodev_trace_asym_session_get_user_data(sess);
+
return (void *)(sess->sess_private_data +
sess->max_priv_data_sz);
}
@@ -2207,6 +2293,8 @@ rte_cryptodev_sym_cpu_crypto_process(uint8_t dev_id,
{
struct rte_cryptodev *dev;
+ rte_cryptodev_trace_sym_cpu_crypto_process(dev_id, sess);
+
if (!rte_cryptodev_is_valid_dev(dev_id)) {
sym_crypto_fill_status(vec, EINVAL);
return 0;
@@ -2230,6 +2318,8 @@ rte_cryptodev_get_raw_dp_ctx_size(uint8_t dev_id)
int32_t size = sizeof(struct rte_crypto_raw_dp_ctx);
int32_t priv_size;
+ rte_cryptodev_trace_get_raw_dp_ctx_size(dev_id);
+
if (!rte_cryptodev_is_valid_dev(dev_id))
return -EINVAL;
@@ -2256,6 +2346,8 @@ rte_cryptodev_configure_raw_dp_ctx(uint8_t dev_id, uint16_t qp_id,
{
struct rte_cryptodev *dev;
+ rte_cryptodev_trace_configure_raw_dp_ctx(dev_id, qp_id, sess_type);
+
if (!rte_cryptodev_get_qp_status(dev_id, qp_id))
return -EINVAL;
@@ -2280,6 +2372,9 @@ rte_cryptodev_session_event_mdata_set(uint8_t dev_id, void *sess,
if (sess == NULL || ev_mdata == NULL)
return -EINVAL;
+ rte_cryptodev_trace_session_event_mdata_set(dev_id, sess, op_type,
+ sess_type, ev_mdata, size);
+
if (!rte_cryptodev_is_valid_dev(dev_id))
goto skip_pmd_op;
@@ -2429,6 +2524,7 @@ rte_crypto_op_pool_create(const char *name, enum rte_crypto_op_type type,
priv->priv_size = priv_size;
priv->type = type;
+ rte_cryptodev_trace_op_pool_create(name, socket_id, type, nb_elts, mp);
return mp;
}
@@ -2441,6 +2537,8 @@ rte_cryptodev_pmd_create_dev_name(char *name, const char *dev_name_prefix)
if (name == NULL)
return -EINVAL;
+ rte_cryptodev_trace_pmd_create_dev_name(dev_name_prefix);
+
for (i = 0; i < RTE_CRYPTO_MAX_DEVS; i++) {
int ret = snprintf(name, RTE_CRYPTODEV_NAME_MAX_LEN,
"%s_%u", dev_name_prefix, i);
@@ -2467,6 +2565,8 @@ rte_cryptodev_driver_id_get(const char *name)
struct cryptodev_driver *driver;
const char *driver_name;
+ rte_cryptodev_trace_driver_id_get(name);
+
if (name == NULL) {
RTE_LOG(DEBUG, CRYPTODEV, "name pointer NULL");
return -1;
@@ -2494,6 +2594,8 @@ rte_cryptodev_name_get(uint8_t dev_id)
if (dev == NULL)
return NULL;
+ rte_cryptodev_trace_name_get(dev_id, dev->data->name);
+
return dev->data->name;
}
@@ -2503,8 +2605,11 @@ rte_cryptodev_driver_name_get(uint8_t driver_id)
struct cryptodev_driver *driver;
TAILQ_FOREACH(driver, &cryptodev_driver_list, next)
- if (driver->id == driver_id)
+ if (driver->id == driver_id) {
+ rte_cryptodev_trace_driver_name_get(driver_id,
+ driver->driver->name);
return driver->driver->name;
+ }
return NULL;
}
@@ -2517,6 +2622,8 @@ rte_cryptodev_allocate_driver(struct cryptodev_driver *crypto_drv,
TAILQ_INSERT_TAIL(&cryptodev_driver_list, crypto_drv, next);
+ rte_cryptodev_trace_allocate_driver(drv->name);
+
return nb_drivers++;
}
diff --git a/lib/cryptodev/rte_cryptodev_trace.h b/lib/cryptodev/rte_cryptodev_trace.h
index a3f6048e7d..84991c5b0a 100644
--- a/lib/cryptodev/rte_cryptodev_trace.h
+++ b/lib/cryptodev/rte_cryptodev_trace.h
@@ -18,6 +18,7 @@ extern "C" {
#include <rte_trace_point.h>
#include "rte_cryptodev.h"
+#include "cryptodev_pmd.h"
RTE_TRACE_POINT(
rte_cryptodev_trace_configure,
@@ -138,6 +139,428 @@ RTE_TRACE_POINT(
rte_trace_point_emit_ptr(sess);
)
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_callback_register,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id,
+ enum rte_cryptodev_event_type event, const void *cb_fn),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_int(event);
+ rte_trace_point_emit_ptr(cb_fn);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_callback_unregister,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id,
+ enum rte_cryptodev_event_type event, const void *cb_fn),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_int(event);
+ rte_trace_point_emit_ptr(cb_fn);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_device_count_by_driver,
+ RTE_TRACE_POINT_ARGS(uint8_t driver_id, uint8_t dev_count),
+ rte_trace_point_emit_u8(driver_id);
+ rte_trace_point_emit_u8(dev_count);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_devices_get,
+ RTE_TRACE_POINT_ARGS(const char *driver_name, uint8_t count),
+ rte_trace_point_emit_string(driver_name);
+ rte_trace_point_emit_u8(count);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_driver_id_get,
+ RTE_TRACE_POINT_ARGS(const char *name),
+ rte_trace_point_emit_string(name);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_driver_name_get,
+ RTE_TRACE_POINT_ARGS(uint8_t driver_id, const char *name),
+ rte_trace_point_emit_u8(driver_id);
+ rte_trace_point_emit_string(name);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_get_aead_algo_enum,
+ RTE_TRACE_POINT_ARGS(const char *algo_string),
+ rte_trace_point_emit_string(algo_string);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_get_auth_algo_enum,
+ RTE_TRACE_POINT_ARGS(const char *algo_string),
+ rte_trace_point_emit_string(algo_string);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_get_cipher_algo_enum,
+ RTE_TRACE_POINT_ARGS(const char *algo_string),
+ rte_trace_point_emit_string(algo_string);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_get_dev_id,
+ RTE_TRACE_POINT_ARGS(const char *name),
+ rte_trace_point_emit_string(name);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_get_feature_name,
+ RTE_TRACE_POINT_ARGS(uint64_t flag),
+ rte_trace_point_emit_u64(flag);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_get_sec_ctx,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+ rte_trace_point_emit_u8(dev_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_info_get,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+ rte_trace_point_emit_u8(dev_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_is_valid_dev,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+ rte_trace_point_emit_u8(dev_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_name_get,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *name),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_string(name);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_queue_pair_count,
+ RTE_TRACE_POINT_ARGS(const struct rte_cryptodev *dev),
+ rte_trace_point_emit_ptr(dev);
+ rte_trace_point_emit_string(dev->data->name);
+ rte_trace_point_emit_u8(dev->data->socket_id);
+ rte_trace_point_emit_u8(dev->data->dev_id);
+ rte_trace_point_emit_u16(dev->data->nb_queue_pairs);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_socket_id,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *name, int socket_id),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_string(name);
+ rte_trace_point_emit_int(socket_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_stats_get,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id,
+ const struct rte_cryptodev_stats *stats),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u64(stats->enqueued_count);
+ rte_trace_point_emit_u64(stats->dequeued_count);
+ rte_trace_point_emit_u64(stats->enqueue_err_count);
+ rte_trace_point_emit_u64(stats->dequeue_err_count);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_stats_reset,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+ rte_trace_point_emit_u8(dev_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_capability_check_aead,
+ RTE_TRACE_POINT_ARGS(
+ const struct rte_cryptodev_symmetric_capability *capability,
+ uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
+ uint16_t iv_size),
+ rte_trace_point_emit_ptr(capability);
+ rte_trace_point_emit_int(capability->xform_type);
+ rte_trace_point_emit_u16(key_size);
+ rte_trace_point_emit_u16(digest_size);
+ rte_trace_point_emit_u16(aad_size);
+ rte_trace_point_emit_u16(iv_size);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_capability_check_auth,
+ RTE_TRACE_POINT_ARGS(
+ const struct rte_cryptodev_symmetric_capability *capability,
+ uint16_t key_size, uint16_t digest_size, uint16_t iv_size),
+ rte_trace_point_emit_ptr(capability);
+ rte_trace_point_emit_int(capability->xform_type);
+ rte_trace_point_emit_u16(key_size);
+ rte_trace_point_emit_u16(digest_size);
+ rte_trace_point_emit_u16(iv_size);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_capability_check_cipher,
+ RTE_TRACE_POINT_ARGS(
+ const struct rte_cryptodev_symmetric_capability *capability,
+ uint16_t key_size, uint16_t iv_size),
+ rte_trace_point_emit_ptr(capability);
+ rte_trace_point_emit_int(capability->xform_type);
+ rte_trace_point_emit_u16(key_size);
+ rte_trace_point_emit_u16(iv_size);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_capability_get,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *driver_name,
+ uint8_t driver_id, int idx_type),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_string(driver_name);
+ rte_trace_point_emit_u8(driver_id);
+ rte_trace_point_emit_int(idx_type);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_get_private_session_size,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint32_t priv_sess_size),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u32(priv_sess_size);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_capability_get,
+ RTE_TRACE_POINT_ARGS(const char *driver_name, uint8_t driver_id,
+ int idx_type),
+ rte_trace_point_emit_string(driver_name);
+ rte_trace_point_emit_u8(driver_id);
+ rte_trace_point_emit_int(idx_type);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_get_private_session_size,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint32_t priv_sess_size),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u32(priv_sess_size);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_get_xform_enum,
+ RTE_TRACE_POINT_ARGS(const char *xform_string),
+ rte_trace_point_emit_string(xform_string);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_xform_capability_check_modlen,
+ RTE_TRACE_POINT_ARGS(const void *capability, uint16_t modlen),
+ rte_trace_point_emit_ptr(capability);
+ rte_trace_point_emit_u16(modlen);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_cpu_crypto_process,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, const void *sess),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_ptr(sess);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_get_existing_header_session_size,
+ RTE_TRACE_POINT_ARGS(struct rte_cryptodev_sym_session *sess),
+ rte_trace_point_emit_ptr(sess);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_session_get_user_data,
+ RTE_TRACE_POINT_ARGS(const void *sess),
+ rte_trace_point_emit_ptr(sess);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_session_set_user_data,
+ RTE_TRACE_POINT_ARGS(const void *sess, const void *data, uint16_t size),
+ rte_trace_point_emit_ptr(sess);
+ rte_trace_point_emit_ptr(data);
+ rte_trace_point_emit_u16(size);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_get_qp_status,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t queue_pair_id),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(queue_pair_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_configure_raw_dp_ctx,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, int sess_type),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(qp_id);
+ rte_trace_point_emit_int(sess_type);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_get_raw_dp_ctx_size,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+ rte_trace_point_emit_u8(dev_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_add_deq_callback,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void *cb_fn),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(qp_id);
+ rte_trace_point_emit_ptr(cb_fn);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_add_enq_callback,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void *cb_fn),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(qp_id);
+ rte_trace_point_emit_ptr(cb_fn);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_remove_deq_callback,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void *fn),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(qp_id);
+ rte_trace_point_emit_ptr(fn);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_remove_enq_callback,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void *fn),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(qp_id);
+ rte_trace_point_emit_ptr(fn);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_session_get_user_data,
+ RTE_TRACE_POINT_ARGS(const void *sess),
+ rte_trace_point_emit_ptr(sess);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_session_set_user_data,
+ RTE_TRACE_POINT_ARGS(const void *sess, const void *data, uint16_t size),
+ rte_trace_point_emit_ptr(sess);
+ rte_trace_point_emit_ptr(data);
+ rte_trace_point_emit_u16(size);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_session_event_mdata_set,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, const void *sess, int op_type,
+ int sess_type, const void *ev_mdata, uint16_t size),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_ptr(sess);
+ rte_trace_point_emit_int(op_type);
+ rte_trace_point_emit_int(sess_type);
+ rte_trace_point_emit_ptr(ev_mdata);
+ rte_trace_point_emit_u16(size);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_allocate_driver,
+ RTE_TRACE_POINT_ARGS(const char *name),
+ rte_trace_point_emit_string(name);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_pmd_allocate,
+ RTE_TRACE_POINT_ARGS(const struct rte_cryptodev *cryptodev),
+ rte_trace_point_emit_ptr(cryptodev);
+ rte_trace_point_emit_string(cryptodev->data->name);
+ rte_trace_point_emit_u8(cryptodev->data->socket_id);
+ rte_trace_point_emit_u8(cryptodev->data->dev_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_pmd_callback_process,
+ RTE_TRACE_POINT_ARGS(struct rte_cryptodev *dev,
+ enum rte_cryptodev_event_type event),
+ rte_trace_point_emit_ptr(dev);
+ rte_trace_point_emit_string(dev->data->name);
+ rte_trace_point_emit_u8(dev->data->socket_id);
+ rte_trace_point_emit_u8(dev->data->dev_id);
+ rte_trace_point_emit_int(event);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_pmd_create,
+ RTE_TRACE_POINT_ARGS(const char *name, int socket_id,
+ const void *cryptodev),
+ rte_trace_point_emit_string(name);
+ rte_trace_point_emit_int(socket_id);
+ rte_trace_point_emit_ptr(cryptodev);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_pmd_create_dev_name,
+ RTE_TRACE_POINT_ARGS(const char *dev_name_prefix),
+ rte_trace_point_emit_string(dev_name_prefix);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_pmd_destroy,
+ RTE_TRACE_POINT_ARGS(const struct rte_cryptodev *cryptodev),
+ rte_trace_point_emit_ptr(cryptodev);
+ rte_trace_point_emit_string(cryptodev->data->name);
+ rte_trace_point_emit_u8(cryptodev->data->socket_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_pmd_get_dev,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+ rte_trace_point_emit_u8(dev_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_pmd_get_named_dev,
+ RTE_TRACE_POINT_ARGS(const char *name),
+ rte_trace_point_emit_string(name);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_pmd_parse_input_args,
+ RTE_TRACE_POINT_ARGS(char *name, int socket_id,
+ uint32_t max_nb_queue_pairs),
+ rte_trace_point_emit_string(name);
+ rte_trace_point_emit_int(socket_id);
+ rte_trace_point_emit_u32(max_nb_queue_pairs);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_pmd_probing_finish,
+ RTE_TRACE_POINT_ARGS(const struct rte_cryptodev *cryptodev),
+ rte_trace_point_emit_ptr(cryptodev);
+ rte_trace_point_emit_string(cryptodev->data->name);
+ rte_trace_point_emit_u8(cryptodev->data->socket_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_pmd_release_device,
+ RTE_TRACE_POINT_ARGS(const struct rte_cryptodev *cryptodev),
+ rte_trace_point_emit_ptr(cryptodev);
+ rte_trace_point_emit_string(cryptodev->data->name);
+ rte_trace_point_emit_u8(cryptodev->data->socket_id);
+ rte_trace_point_emit_u8(cryptodev->data->dev_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_op_pool_create,
+ RTE_TRACE_POINT_ARGS(const char *name, int socket_id, int type,
+ uint32_t nb_elts, const void *mp),
+ rte_trace_point_emit_string(name);
+ rte_trace_point_emit_int(socket_id);
+ rte_trace_point_emit_int(type);
+ rte_trace_point_emit_u32(nb_elts);
+ rte_trace_point_emit_ptr(mp);
+)
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/cryptodev/rte_cryptodev_trace_fp.h b/lib/cryptodev/rte_cryptodev_trace_fp.h
index 9218997c14..03f4503d34 100644
--- a/lib/cryptodev/rte_cryptodev_trace_fp.h
+++ b/lib/cryptodev/rte_cryptodev_trace_fp.h
@@ -31,6 +31,12 @@ RTE_TRACE_POINT_FP(
rte_trace_point_emit_u16(nb_ops);
)
+RTE_TRACE_POINT_FP(
+ rte_cryptodev_trace_session_event_mdata_get,
+ RTE_TRACE_POINT_ARGS(uint8_t type),
+ rte_trace_point_emit_u8(type);
+)
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
index 5aee87c6f7..a788185229 100644
--- a/lib/cryptodev/version.map
+++ b/lib/cryptodev/version.map
@@ -109,6 +109,63 @@ EXPERIMENTAL {
#added in 22.07
rte_cryptodev_session_event_mdata_set;
rte_crypto_asym_ke_strings;
+
+ #added in 22.11
+ __rte_cryptodev_trace_add_deq_callback;
+ __rte_cryptodev_trace_add_enq_callback;
+ __rte_cryptodev_trace_allocate_driver;
+ __rte_cryptodev_trace_asym_capability_get;
+ __rte_cryptodev_trace_asym_get_private_session_size;
+ __rte_cryptodev_trace_asym_get_xform_enum;
+ __rte_cryptodev_trace_asym_session_get_user_data;
+ __rte_cryptodev_trace_asym_session_set_user_data;
+ __rte_cryptodev_trace_asym_xform_capability_check_modlen;
+ __rte_cryptodev_trace_callback_register;
+ __rte_cryptodev_trace_callback_unregister;
+ __rte_cryptodev_trace_configure_raw_dp_ctx;
+ __rte_cryptodev_trace_device_count_by_driver;
+ __rte_cryptodev_trace_devices_get;
+ __rte_cryptodev_trace_driver_id_get;
+ __rte_cryptodev_trace_driver_name_get;
+ __rte_cryptodev_trace_get_aead_algo_enum;
+ __rte_cryptodev_trace_get_auth_algo_enum;
+ __rte_cryptodev_trace_get_cipher_algo_enum;
+ __rte_cryptodev_trace_get_dev_id;
+ __rte_cryptodev_trace_get_feature_name;
+ __rte_cryptodev_trace_get_qp_status;
+ __rte_cryptodev_trace_get_raw_dp_ctx_size;
+ __rte_cryptodev_trace_get_sec_ctx;
+ __rte_cryptodev_trace_info_get;
+ __rte_cryptodev_trace_is_valid_dev;
+ __rte_cryptodev_trace_name_get;
+ __rte_cryptodev_trace_op_pool_create;
+ __rte_cryptodev_trace_pmd_allocate;
+ __rte_cryptodev_trace_pmd_callback_process;
+ __rte_cryptodev_trace_pmd_create;
+ __rte_cryptodev_trace_pmd_create_dev_name;
+ __rte_cryptodev_trace_pmd_destroy;
+ __rte_cryptodev_trace_pmd_get_dev;
+ __rte_cryptodev_trace_pmd_get_named_dev;
+ __rte_cryptodev_trace_pmd_parse_input_args;
+ __rte_cryptodev_trace_pmd_probing_finish;
+ __rte_cryptodev_trace_pmd_release_device;
+ __rte_cryptodev_trace_queue_pair_count;
+ __rte_cryptodev_trace_remove_deq_callback;
+ __rte_cryptodev_trace_remove_enq_callback;
+ __rte_cryptodev_trace_session_event_mdata_get;
+ __rte_cryptodev_trace_session_event_mdata_set;
+ __rte_cryptodev_trace_socket_id;
+ __rte_cryptodev_trace_stats_get;
+ __rte_cryptodev_trace_stats_reset;
+ __rte_cryptodev_trace_sym_capability_check_aead;
+ __rte_cryptodev_trace_sym_capability_check_auth;
+ __rte_cryptodev_trace_sym_capability_check_cipher;
+ __rte_cryptodev_trace_sym_capability_get;
+ __rte_cryptodev_trace_sym_cpu_crypto_process;
+ __rte_cryptodev_trace_sym_get_existing_header_session_size;
+ __rte_cryptodev_trace_sym_get_private_session_size;
+ __rte_cryptodev_trace_sym_session_get_user_data;
+ __rte_cryptodev_trace_sym_session_set_user_data;
};
INTERNAL {
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH] cryptodev: add trace points
2022-09-16 17:32 [PATCH] cryptodev: add trace points Amit Prakash Shukla
@ 2022-09-27 8:06 ` Akhil Goyal
2022-09-27 13:48 ` Amit Prakash Shukla
2022-09-28 4:08 ` Jerin Jacob
2022-09-29 12:35 ` [PATCH v2] " Amit Prakash Shukla
2 siblings, 1 reply; 8+ messages in thread
From: Akhil Goyal @ 2022-09-27 8:06 UTC (permalink / raw)
To: Amit Prakash Shukla, Fan Zhang, Ray Kinsella
Cc: dev, Jerin Jacob Kollanukkaran, Amit Prakash Shukla
> diff --git a/lib/cryptodev/rte_cryptodev_trace.h
> b/lib/cryptodev/rte_cryptodev_trace.h
> index a3f6048e7d..84991c5b0a 100644
> --- a/lib/cryptodev/rte_cryptodev_trace.h
> +++ b/lib/cryptodev/rte_cryptodev_trace.h
> @@ -18,6 +18,7 @@ extern "C" {
> #include <rte_trace_point.h>
>
> #include "rte_cryptodev.h"
> +#include "cryptodev_pmd.h"
We cannot include library internal header into external header.
We can either have a have a separate file for pmd specific APIs
And hide it from user or do not allow tracing for pmd APIs.
> diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
> index 5aee87c6f7..a788185229 100644
> --- a/lib/cryptodev/version.map
> +++ b/lib/cryptodev/version.map
> @@ -109,6 +109,63 @@ EXPERIMENTAL {
> #added in 22.07
> rte_cryptodev_session_event_mdata_set;
> rte_crypto_asym_ke_strings;
> +
> + #added in 22.11
> + __rte_cryptodev_trace_pmd_allocate;
> + __rte_cryptodev_trace_pmd_callback_process;
> + __rte_cryptodev_trace_pmd_create;
> + __rte_cryptodev_trace_pmd_create_dev_name;
> + __rte_cryptodev_trace_pmd_destroy;
> + __rte_cryptodev_trace_pmd_get_dev;
> + __rte_cryptodev_trace_pmd_get_named_dev;
> + __rte_cryptodev_trace_pmd_parse_input_args;
> + __rte_cryptodev_trace_pmd_probing_finish;
> + __rte_cryptodev_trace_pmd_release_device;
These can only be internal or just remove these.
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH] cryptodev: add trace points
2022-09-27 8:06 ` Akhil Goyal
@ 2022-09-27 13:48 ` Amit Prakash Shukla
0 siblings, 0 replies; 8+ messages in thread
From: Amit Prakash Shukla @ 2022-09-27 13:48 UTC (permalink / raw)
To: Akhil Goyal, Fan Zhang, Ray Kinsella; +Cc: dev, Jerin Jacob Kollanukkaran
Hi Akhil,
Thanks for your feedback. I will do the suggested changes in next version of the patch.
> -----Original Message-----
> From: Akhil Goyal <gakhil@marvell.com>
> Sent: Tuesday, September 27, 2022 1:37 PM
> To: Amit Prakash Shukla <amitprakashs@marvell.com>; Fan Zhang
> <roy.fan.zhang@intel.com>; Ray Kinsella <mdr@ashroe.eu>
> Cc: dev@dpdk.org; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Amit
> Prakash Shukla <amitprakashs@marvell.com>
> Subject: RE: [PATCH] cryptodev: add trace points
>
> > diff --git a/lib/cryptodev/rte_cryptodev_trace.h
> > b/lib/cryptodev/rte_cryptodev_trace.h
> > index a3f6048e7d..84991c5b0a 100644
> > --- a/lib/cryptodev/rte_cryptodev_trace.h
> > +++ b/lib/cryptodev/rte_cryptodev_trace.h
> > @@ -18,6 +18,7 @@ extern "C" {
> > #include <rte_trace_point.h>
> >
> > #include "rte_cryptodev.h"
> > +#include "cryptodev_pmd.h"
>
> We cannot include library internal header into external header.
> We can either have a have a separate file for pmd specific APIs And hide it
> from user or do not allow tracing for pmd APIs.
>
>
> > diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
> > index 5aee87c6f7..a788185229 100644
> > --- a/lib/cryptodev/version.map
> > +++ b/lib/cryptodev/version.map
> > @@ -109,6 +109,63 @@ EXPERIMENTAL {
> > #added in 22.07
> > rte_cryptodev_session_event_mdata_set;
> > rte_crypto_asym_ke_strings;
> > +
> > + #added in 22.11
>
>
> > + __rte_cryptodev_trace_pmd_allocate;
> > + __rte_cryptodev_trace_pmd_callback_process;
> > + __rte_cryptodev_trace_pmd_create;
> > + __rte_cryptodev_trace_pmd_create_dev_name;
> > + __rte_cryptodev_trace_pmd_destroy;
> > + __rte_cryptodev_trace_pmd_get_dev;
> > + __rte_cryptodev_trace_pmd_get_named_dev;
> > + __rte_cryptodev_trace_pmd_parse_input_args;
> > + __rte_cryptodev_trace_pmd_probing_finish;
> > + __rte_cryptodev_trace_pmd_release_device;
>
> These can only be internal or just remove these.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] cryptodev: add trace points
2022-09-16 17:32 [PATCH] cryptodev: add trace points Amit Prakash Shukla
2022-09-27 8:06 ` Akhil Goyal
@ 2022-09-28 4:08 ` Jerin Jacob
2022-09-28 17:30 ` [EXT] " Amit Prakash Shukla
2022-09-29 12:35 ` [PATCH v2] " Amit Prakash Shukla
2 siblings, 1 reply; 8+ messages in thread
From: Jerin Jacob @ 2022-09-28 4:08 UTC (permalink / raw)
To: Amit Prakash Shukla; +Cc: Akhil Goyal, Fan Zhang, Ray Kinsella, dev, jerinj
On Fri, Sep 16, 2022 at 11:05 PM Amit Prakash Shukla
<amitprakashs@marvell.com> wrote:
>
> Add trace points for cryptodev functions.
>
> Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
> ---
1) Please include the result of API operation in trace so that once
can know the API status
2) restrict trace additions to public API. i.e I think, no need to add
trace for PMD hooks
3) Please test with
https://patches.dpdk.org/project/dpdk/patch/20220804134430.6192-7-adwivedi@marvell.com/
patch by adding cryptodev symbols
to make sure not to missed any public cryptodev API.
> @@ -135,6 +139,8 @@ rte_cryptodev_pmd_create(const char *name,
> /* initialise user call-back tail queue */
> TAILQ_INIT(&(cryptodev->link_intr_cbs));
>
> + rte_cryptodev_trace_pmd_create(name, params->socket_id, cryptodev);
> +
> return cryptodev;
> }
>
> @@ -144,6 +150,8 @@ rte_cryptodev_pmd_destroy(struct rte_cryptodev *cryptodev)
> int retval;
> void *dev_priv = cryptodev->data->dev_private;
>
> + rte_cryptodev_trace_pmd_destroy(cryptodev);
> +
> CDEV_LOG_INFO("Closing crypto device %s", cryptodev->device->name);
>
> /* free crypto device */
> @@ -166,6 +174,9 @@ rte_cryptodev_pmd_probing_finish(struct rte_cryptodev *cryptodev)
> {
> if (cryptodev == NULL)
> return;
> +
> + rte_cryptodev_trace_pmd_probing_finish(cryptodev);
> +
> /*
> * for secondary process, at that point we expect device
> * to be already 'usable', so shared data and all function
> @@ -231,6 +242,8 @@ cryptodev_fp_ops_set(struct rte_crypto_fp_ops *fp_ops,
> void *
> rte_cryptodev_session_event_mdata_get(struct rte_crypto_op *op)
> {
> + rte_cryptodev_trace_session_event_mdata_get(op->type);
> +
> if (op->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC &&
> op->sess_type == RTE_CRYPTO_OP_WITH_SESSION)
> return rte_cryptodev_sym_session_get_user_data(op->sym->session);
> diff --git a/lib/cryptodev/cryptodev_trace_points.c b/lib/cryptodev/cryptodev_trace_points.c
> index c5bfe08b79..bca4deecc2 100644
> --- a/lib/cryptodev/cryptodev_trace_points.c
> +++ b/lib/cryptodev/cryptodev_trace_points.c
> @@ -50,3 +50,168 @@ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_enqueue_burst,
>
> RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_dequeue_burst,
> lib.cryptodev.deq.burst)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_callback_register,
> + lib.cryptodev.callback.register)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_callback_unregister,
> + lib.cryptodev.callback.unregister)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_device_count_by_driver,
> + lib.cryptodev.device.count.by.driver)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_devices_get,
> + lib.cryptodev.devices.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_driver_id_get,
> + lib.cryptodev.driver.id.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_driver_name_get,
> + lib.cryptodev.driver.name.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_aead_algo_enum,
> + lib.cryptodev.get.aead.algo.enum)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_auth_algo_enum,
> + lib.cryptodev.get.auth.algo.enum)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_cipher_algo_enum,
> + lib.cryptodev.get.cipher.algo.enum)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_dev_id,
> + lib.cryptodev.get.dev.id)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_feature_name,
> + lib.cryptodev.get.feature.name)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_sec_ctx,
> + lib.cryptodev.get.sec.ctx)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_info_get,
> + lib.cryptodev.info.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_is_valid_dev,
> + lib.cryptodev.is.valid.dev)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_name_get,
> + lib.cryptodev.name.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_queue_pair_count,
> + lib.cryptodev.queue.pair.count)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_socket_id,
> + lib.cryptodev.socket.id)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_stats_get,
> + lib.cryptodev.stats.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_stats_reset,
> + lib.cryptodev.stats.reset)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_check_aead,
> + lib.cryptodev.sym.capability.check.aead)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_check_auth,
> + lib.cryptodev.sym.capability.check.auth)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_check_cipher,
> + lib.cryptodev.sym.capability.check.cipher)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_get,
> + lib.cryptodev.sym.capability.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_get_private_session_size,
> + lib.cryptodev.sym.get.private.session.size)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_capability_get,
> + lib.cryptodev.asym.capability.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_get_private_session_size,
> + lib.cryptodev.asym.get.private.session.size)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_get_xform_enum,
> + lib.cryptodev.asym.get.xform.enum)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_xform_capability_check_modlen,
> + lib.cryptodev.asym.xform.capability.check.modlen)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_cpu_crypto_process,
> + lib.cryptodev.sym.cpu.crypto.process)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_get_existing_header_session_size,
> + lib.cryptodev.sym.get.existing.header.session.size)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_get_user_data,
> + lib.cryptodev.sym.session.get.user.data)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_set_user_data,
> + lib.cryptodev.sym.session.set.user.data)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_qp_status,
> + lib.cryptodev.get.qp.status)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_configure_raw_dp_ctx,
> + lib.cryptodev.configure.raw.dp.ctx)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_raw_dp_ctx_size,
> + lib.cryptodev.get.raw.dp.ctx.size)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_add_deq_callback,
> + lib.cryptodev.add.deq.callback)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_add_enq_callback,
> + lib.cryptodev.add.enq.callback)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_remove_deq_callback,
> + lib.cryptodev.remove.deq.callback)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_remove_enq_callback,
> + lib.cryptodev.remove.enq.callback)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_get_user_data,
> + lib.cryptodev.asym.session.get.user.data)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_set_user_data,
> + lib.cryptodev.asym.session.set.user.data)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_session_event_mdata_set,
> + lib.cryptodev.session.event.mdata.set)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_allocate_driver,
> + lib.cryptodev.allocate.driver)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_allocate,
> + lib.cryptodev.pmd.allocate)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_callback_process,
> + lib.cryptodev.pmd.callback.process)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_create,
> + lib.cryptodev.pmd.create)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_create_dev_name,
> + lib.cryptodev.pmd.create.dev.name)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_destroy,
> + lib.cryptodev.pmd.destroy)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_get_dev,
> + lib.cryptodev.pmd.get.dev)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_get_named_dev,
> + lib.cryptodev.pmd.get.named.dev)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_parse_input_args,
> + lib.cryptodev.pmd.parse.input.args)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_probing_finish,
> + lib.cryptodev.pmd.probing.finish)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_release_device,
> + lib.cryptodev.pmd.release.device)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_session_event_mdata_get,
> + lib.cryptodev.session.event.mdata.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_op_pool_create,
> + lib.cryptodev.op.pool.create)
> diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
> index 42f3221052..b712315674 100644
> --- a/lib/cryptodev/rte_cryptodev.c
> +++ b/lib/cryptodev/rte_cryptodev.c
> @@ -216,6 +216,8 @@ rte_cryptodev_get_cipher_algo_enum(enum rte_crypto_cipher_algorithm *algo_enum,
> {
> unsigned int i;
>
> + rte_cryptodev_trace_get_cipher_algo_enum(algo_string);
> +
> for (i = 1; i < RTE_DIM(rte_crypto_cipher_algorithm_strings); i++) {
> if (strcmp(algo_string, rte_crypto_cipher_algorithm_strings[i]) == 0) {
> *algo_enum = (enum rte_crypto_cipher_algorithm) i;
> @@ -233,6 +235,8 @@ rte_cryptodev_get_auth_algo_enum(enum rte_crypto_auth_algorithm *algo_enum,
> {
> unsigned int i;
>
> + rte_cryptodev_trace_get_auth_algo_enum(algo_string);
> +
> for (i = 1; i < RTE_DIM(rte_crypto_auth_algorithm_strings); i++) {
> if (strcmp(algo_string, rte_crypto_auth_algorithm_strings[i]) == 0) {
> *algo_enum = (enum rte_crypto_auth_algorithm) i;
> @@ -250,6 +254,8 @@ rte_cryptodev_get_aead_algo_enum(enum rte_crypto_aead_algorithm *algo_enum,
> {
> unsigned int i;
>
> + rte_cryptodev_trace_get_aead_algo_enum(algo_string);
> +
> for (i = 1; i < RTE_DIM(rte_crypto_aead_algorithm_strings); i++) {
> if (strcmp(algo_string, rte_crypto_aead_algorithm_strings[i]) == 0) {
> *algo_enum = (enum rte_crypto_aead_algorithm) i;
> @@ -267,6 +273,8 @@ rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum,
> {
> unsigned int i;
>
> + rte_cryptodev_trace_asym_get_xform_enum(xform_string);
> +
> for (i = 1; i < RTE_DIM(rte_crypto_asym_xform_strings); i++) {
> if (strcmp(xform_string,
> rte_crypto_asym_xform_strings[i]) == 0) {
> @@ -299,6 +307,9 @@ rte_cryptodev_sym_capability_get(uint8_t dev_id,
>
> rte_cryptodev_info_get(dev_id, &dev_info);
>
> + rte_cryptodev_trace_sym_capability_get(dev_id, dev_info.driver_name,
> + dev_info.driver_id, idx->type);
> +
> while ((capability = &dev_info.capabilities[i++])->op !=
> RTE_CRYPTO_OP_TYPE_UNDEFINED) {
> if (capability->op != RTE_CRYPTO_OP_TYPE_SYMMETRIC)
> @@ -359,6 +370,9 @@ rte_cryptodev_asym_capability_get(uint8_t dev_id,
> memset(&dev_info, 0, sizeof(struct rte_cryptodev_info));
> rte_cryptodev_info_get(dev_id, &dev_info);
>
> + rte_cryptodev_trace_asym_capability_get(dev_info.driver_name,
> + dev_info.driver_id, idx->type);
> +
> while ((capability = &dev_info.capabilities[i++])->op !=
> RTE_CRYPTO_OP_TYPE_UNDEFINED) {
> if (capability->op != RTE_CRYPTO_OP_TYPE_ASYMMETRIC)
> @@ -375,6 +389,9 @@ rte_cryptodev_sym_capability_check_cipher(
> const struct rte_cryptodev_symmetric_capability *capability,
> uint16_t key_size, uint16_t iv_size)
> {
> + rte_cryptodev_trace_sym_capability_check_cipher(capability, key_size,
> + iv_size);
> +
> if (param_range_check(key_size, &capability->cipher.key_size) != 0)
> return -1;
>
> @@ -389,6 +406,9 @@ rte_cryptodev_sym_capability_check_auth(
> const struct rte_cryptodev_symmetric_capability *capability,
> uint16_t key_size, uint16_t digest_size, uint16_t iv_size)
> {
> + rte_cryptodev_trace_sym_capability_check_auth(capability, key_size,
> + digest_size, iv_size);
> +
> if (param_range_check(key_size, &capability->auth.key_size) != 0)
> return -1;
>
> @@ -407,6 +427,9 @@ rte_cryptodev_sym_capability_check_aead(
> uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
> uint16_t iv_size)
> {
> + rte_cryptodev_trace_sym_capability_check_aead(capability, key_size,
> + digest_size, aad_size, iv_size);
> +
> if (param_range_check(key_size, &capability->aead.key_size) != 0)
> return -1;
>
> @@ -437,6 +460,9 @@ rte_cryptodev_asym_xform_capability_check_modlen(
> const struct rte_cryptodev_asymmetric_xform_capability *capability,
> uint16_t modlen)
> {
> + rte_cryptodev_trace_asym_xform_capability_check_modlen(capability,
> + modlen);
> +
> /* no need to check for limits, if min or max = 0 */
> if (capability->modlen.min != 0) {
> if (modlen < capability->modlen.min)
> @@ -577,6 +603,8 @@ cryptodev_cb_init(struct rte_cryptodev *dev)
> const char *
> rte_cryptodev_get_feature_name(uint64_t flag)
> {
> + rte_cryptodev_trace_get_feature_name(flag);
> +
> switch (flag) {
> case RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO:
> return "SYMMETRIC_CRYPTO";
> @@ -638,6 +666,8 @@ rte_cryptodev_get_feature_name(uint64_t flag)
> struct rte_cryptodev *
> rte_cryptodev_pmd_get_dev(uint8_t dev_id)
> {
> + rte_cryptodev_trace_pmd_get_dev(dev_id);
> +
> return &cryptodev_globals.devs[dev_id];
> }
>
> @@ -650,6 +680,8 @@ rte_cryptodev_pmd_get_named_dev(const char *name)
> if (name == NULL)
> return NULL;
>
> + rte_cryptodev_trace_pmd_get_named_dev(name);
> +
> for (i = 0; i < RTE_CRYPTO_MAX_DEVS; i++) {
> dev = &cryptodev_globals.devs[i];
>
> @@ -676,6 +708,8 @@ rte_cryptodev_is_valid_dev(uint8_t dev_id)
> {
> struct rte_cryptodev *dev = NULL;
>
> + rte_cryptodev_trace_is_valid_dev(dev_id);
> +
> if (!rte_cryptodev_is_valid_device_data(dev_id))
> return 0;
>
> @@ -695,6 +729,8 @@ rte_cryptodev_get_dev_id(const char *name)
> if (name == NULL)
> return -1;
>
> + rte_cryptodev_trace_get_dev_id(name);
> +
> for (i = 0; i < RTE_CRYPTO_MAX_DEVS; i++) {
> if (!rte_cryptodev_is_valid_device_data(i))
> continue;
> @@ -725,6 +761,8 @@ rte_cryptodev_device_count_by_driver(uint8_t driver_id)
> RTE_CRYPTODEV_ATTACHED)
> dev_count++;
>
> + rte_cryptodev_trace_device_count_by_driver(driver_id, dev_count);
> +
> return dev_count;
> }
>
> @@ -751,12 +789,16 @@ rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices,
> }
> }
>
> + rte_cryptodev_trace_devices_get(driver_name, count);
> +
> return count;
> }
>
> void *
> rte_cryptodev_get_sec_ctx(uint8_t dev_id)
> {
> + rte_cryptodev_trace_get_sec_ctx(dev_id);
> +
> if (dev_id < RTE_CRYPTO_MAX_DEVS &&
> (rte_crypto_devices[dev_id].feature_flags &
> RTE_CRYPTODEV_FF_SECURITY))
> @@ -775,6 +817,8 @@ rte_cryptodev_socket_id(uint8_t dev_id)
>
> dev = rte_cryptodev_pmd_get_dev(dev_id);
>
> + rte_cryptodev_trace_socket_id(dev_id, dev->data->name,
> + dev->data->socket_id);
> return dev->data->socket_id;
> }
>
> @@ -913,6 +957,7 @@ rte_cryptodev_pmd_allocate(const char *name, int socket_id)
> cryptodev_globals.nb_devs++;
> }
>
> + rte_cryptodev_trace_pmd_allocate(cryptodev);
> return cryptodev;
> }
>
> @@ -925,6 +970,8 @@ rte_cryptodev_pmd_release_device(struct rte_cryptodev *cryptodev)
> if (cryptodev == NULL)
> return -EINVAL;
>
> + rte_cryptodev_trace_pmd_release_device(cryptodev);
> +
> dev_id = cryptodev->data->dev_id;
>
> cryptodev_fp_ops_reset(rte_crypto_fp_ops + dev_id);
> @@ -956,6 +1003,8 @@ rte_cryptodev_queue_pair_count(uint8_t dev_id)
> }
>
> dev = &rte_crypto_devices[dev_id];
> + rte_cryptodev_trace_queue_pair_count(dev);
> +
> return dev->data->nb_queue_pairs;
> }
>
> @@ -1178,6 +1227,8 @@ rte_cryptodev_get_qp_status(uint8_t dev_id, uint16_t queue_pair_id)
> {
> struct rte_cryptodev *dev;
>
> + rte_cryptodev_trace_get_qp_status(dev_id, queue_pair_id);
> +
> if (!rte_cryptodev_is_valid_dev(dev_id)) {
> CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
> return -EINVAL;
> @@ -1331,6 +1382,7 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
>
> rte_spinlock_unlock(&rte_cryptodev_callback_lock);
>
> + rte_cryptodev_trace_add_enq_callback(dev_id, qp_id, cb_fn);
> return cb;
> }
>
> @@ -1356,6 +1408,8 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_id,
> return -ENODEV;
> }
>
> + rte_cryptodev_trace_remove_enq_callback(dev_id, qp_id, cb->fn);
> +
> dev = &rte_crypto_devices[dev_id];
> if (qp_id >= dev->data->nb_queue_pairs) {
> CDEV_LOG_ERR("Invalid queue_pair_id=%d", qp_id);
> @@ -1466,6 +1520,8 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
>
> rte_spinlock_unlock(&rte_cryptodev_callback_lock);
>
> + rte_cryptodev_trace_add_deq_callback(dev_id, qp_id, cb_fn);
> +
> return cb;
> }
>
> @@ -1491,6 +1547,8 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_id,
> return -ENODEV;
> }
>
> + rte_cryptodev_trace_remove_deq_callback(dev_id, qp_id, cb->fn);
> +
> dev = &rte_crypto_devices[dev_id];
> if (qp_id >= dev->data->nb_queue_pairs) {
> CDEV_LOG_ERR("Invalid queue_pair_id=%d", qp_id);
> @@ -1559,6 +1617,8 @@ rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats)
>
> RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_get, -ENOTSUP);
> (*dev->dev_ops->stats_get)(dev, stats);
> +
> + rte_cryptodev_trace_stats_get(dev_id, stats);
> return 0;
> }
>
> @@ -1567,6 +1627,8 @@ rte_cryptodev_stats_reset(uint8_t dev_id)
> {
> struct rte_cryptodev *dev;
>
> + rte_cryptodev_trace_stats_reset(dev_id);
> +
> if (!rte_cryptodev_is_valid_dev(dev_id)) {
> CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
> return;
> @@ -1597,6 +1659,9 @@ rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info)
>
> dev_info->driver_name = dev->device->driver->name;
> dev_info->device = dev->device;
> +
> + rte_cryptodev_trace_info_get(dev_id);
> +
> }
>
> int
> @@ -1639,6 +1704,8 @@ rte_cryptodev_callback_register(uint8_t dev_id,
> }
>
> rte_spinlock_unlock(&rte_cryptodev_cb_lock);
> +
> + rte_cryptodev_trace_callback_register(dev_id, event, cb_fn);
> return (user_cb == NULL) ? -ENOMEM : 0;
> }
>
> @@ -1685,6 +1752,8 @@ rte_cryptodev_callback_unregister(uint8_t dev_id,
> }
>
> rte_spinlock_unlock(&rte_cryptodev_cb_lock);
> +
> + rte_cryptodev_trace_callback_unregister(dev_id, event, cb_fn);
> return ret;
> }
>
> @@ -1695,6 +1764,7 @@ rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
> struct rte_cryptodev_callback *cb_lst;
> struct rte_cryptodev_callback dev_cb;
>
> + rte_cryptodev_trace_pmd_callback_process(dev, event);
> rte_spinlock_lock(&rte_cryptodev_cb_lock);
> TAILQ_FOREACH(cb_lst, &(dev->link_intr_cbs), next) {
> if (cb_lst->cb_fn == NULL || cb_lst->event != event)
> @@ -2117,6 +2187,9 @@ rte_cryptodev_sym_get_private_session_size(uint8_t dev_id)
>
> priv_sess_size = (*dev->dev_ops->sym_session_get_size)(dev);
>
> + rte_cryptodev_trace_sym_get_private_session_size(dev_id,
> + priv_sess_size);
> +
> return priv_sess_size;
> }
>
> @@ -2136,6 +2209,9 @@ rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
>
> priv_sess_size = (*dev->dev_ops->asym_session_get_size)(dev);
>
> + rte_cryptodev_trace_asym_get_private_session_size(dev_id,
> + priv_sess_size);
> +
> return priv_sess_size;
> }
>
> @@ -2152,6 +2228,9 @@ rte_cryptodev_sym_session_set_user_data(
> return -ENOMEM;
>
> rte_memcpy(sess->sess_data + sess->nb_drivers, data, size);
> +
> + rte_cryptodev_trace_sym_session_set_user_data(sess, data, size);
> +
> return 0;
> }
>
> @@ -2162,6 +2241,8 @@ rte_cryptodev_sym_session_get_user_data(
> if (sess == NULL || sess->user_data_sz == 0)
> return NULL;
>
> + rte_cryptodev_trace_sym_session_get_user_data(sess);
> +
> return (void *)(sess->sess_data + sess->nb_drivers);
> }
>
> @@ -2178,6 +2259,9 @@ rte_cryptodev_asym_session_set_user_data(void *session, void *data, uint16_t siz
> rte_memcpy(sess->sess_private_data +
> sess->max_priv_data_sz,
> data, size);
> +
> + rte_cryptodev_trace_asym_session_set_user_data(sess, data, size);
> +
> return 0;
> }
>
> @@ -2188,6 +2272,8 @@ rte_cryptodev_asym_session_get_user_data(void *session)
> if (sess == NULL || sess->user_data_sz == 0)
> return NULL;
>
> + rte_cryptodev_trace_asym_session_get_user_data(sess);
> +
> return (void *)(sess->sess_private_data +
> sess->max_priv_data_sz);
> }
> @@ -2207,6 +2293,8 @@ rte_cryptodev_sym_cpu_crypto_process(uint8_t dev_id,
> {
> struct rte_cryptodev *dev;
>
> + rte_cryptodev_trace_sym_cpu_crypto_process(dev_id, sess);
> +
> if (!rte_cryptodev_is_valid_dev(dev_id)) {
> sym_crypto_fill_status(vec, EINVAL);
> return 0;
> @@ -2230,6 +2318,8 @@ rte_cryptodev_get_raw_dp_ctx_size(uint8_t dev_id)
> int32_t size = sizeof(struct rte_crypto_raw_dp_ctx);
> int32_t priv_size;
>
> + rte_cryptodev_trace_get_raw_dp_ctx_size(dev_id);
> +
> if (!rte_cryptodev_is_valid_dev(dev_id))
> return -EINVAL;
>
> @@ -2256,6 +2346,8 @@ rte_cryptodev_configure_raw_dp_ctx(uint8_t dev_id, uint16_t qp_id,
> {
> struct rte_cryptodev *dev;
>
> + rte_cryptodev_trace_configure_raw_dp_ctx(dev_id, qp_id, sess_type);
> +
> if (!rte_cryptodev_get_qp_status(dev_id, qp_id))
> return -EINVAL;
>
> @@ -2280,6 +2372,9 @@ rte_cryptodev_session_event_mdata_set(uint8_t dev_id, void *sess,
> if (sess == NULL || ev_mdata == NULL)
> return -EINVAL;
>
> + rte_cryptodev_trace_session_event_mdata_set(dev_id, sess, op_type,
> + sess_type, ev_mdata, size);
> +
> if (!rte_cryptodev_is_valid_dev(dev_id))
> goto skip_pmd_op;
>
> @@ -2429,6 +2524,7 @@ rte_crypto_op_pool_create(const char *name, enum rte_crypto_op_type type,
> priv->priv_size = priv_size;
> priv->type = type;
>
> + rte_cryptodev_trace_op_pool_create(name, socket_id, type, nb_elts, mp);
> return mp;
> }
>
> @@ -2441,6 +2537,8 @@ rte_cryptodev_pmd_create_dev_name(char *name, const char *dev_name_prefix)
> if (name == NULL)
> return -EINVAL;
>
> + rte_cryptodev_trace_pmd_create_dev_name(dev_name_prefix);
> +
> for (i = 0; i < RTE_CRYPTO_MAX_DEVS; i++) {
> int ret = snprintf(name, RTE_CRYPTODEV_NAME_MAX_LEN,
> "%s_%u", dev_name_prefix, i);
> @@ -2467,6 +2565,8 @@ rte_cryptodev_driver_id_get(const char *name)
> struct cryptodev_driver *driver;
> const char *driver_name;
>
> + rte_cryptodev_trace_driver_id_get(name);
> +
> if (name == NULL) {
> RTE_LOG(DEBUG, CRYPTODEV, "name pointer NULL");
> return -1;
> @@ -2494,6 +2594,8 @@ rte_cryptodev_name_get(uint8_t dev_id)
> if (dev == NULL)
> return NULL;
>
> + rte_cryptodev_trace_name_get(dev_id, dev->data->name);
> +
> return dev->data->name;
> }
>
> @@ -2503,8 +2605,11 @@ rte_cryptodev_driver_name_get(uint8_t driver_id)
> struct cryptodev_driver *driver;
>
> TAILQ_FOREACH(driver, &cryptodev_driver_list, next)
> - if (driver->id == driver_id)
> + if (driver->id == driver_id) {
> + rte_cryptodev_trace_driver_name_get(driver_id,
> + driver->driver->name);
> return driver->driver->name;
> + }
> return NULL;
> }
>
> @@ -2517,6 +2622,8 @@ rte_cryptodev_allocate_driver(struct cryptodev_driver *crypto_drv,
>
> TAILQ_INSERT_TAIL(&cryptodev_driver_list, crypto_drv, next);
>
> + rte_cryptodev_trace_allocate_driver(drv->name);
> +
> return nb_drivers++;
> }
>
> diff --git a/lib/cryptodev/rte_cryptodev_trace.h b/lib/cryptodev/rte_cryptodev_trace.h
> index a3f6048e7d..84991c5b0a 100644
> --- a/lib/cryptodev/rte_cryptodev_trace.h
> +++ b/lib/cryptodev/rte_cryptodev_trace.h
> @@ -18,6 +18,7 @@ extern "C" {
> #include <rte_trace_point.h>
>
> #include "rte_cryptodev.h"
> +#include "cryptodev_pmd.h"
>
> RTE_TRACE_POINT(
> rte_cryptodev_trace_configure,
> @@ -138,6 +139,428 @@ RTE_TRACE_POINT(
> rte_trace_point_emit_ptr(sess);
> )
>
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_callback_register,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id,
> + enum rte_cryptodev_event_type event, const void *cb_fn),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_int(event);
> + rte_trace_point_emit_ptr(cb_fn);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_callback_unregister,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id,
> + enum rte_cryptodev_event_type event, const void *cb_fn),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_int(event);
> + rte_trace_point_emit_ptr(cb_fn);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_device_count_by_driver,
> + RTE_TRACE_POINT_ARGS(uint8_t driver_id, uint8_t dev_count),
> + rte_trace_point_emit_u8(driver_id);
> + rte_trace_point_emit_u8(dev_count);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_devices_get,
> + RTE_TRACE_POINT_ARGS(const char *driver_name, uint8_t count),
> + rte_trace_point_emit_string(driver_name);
> + rte_trace_point_emit_u8(count);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_driver_id_get,
> + RTE_TRACE_POINT_ARGS(const char *name),
> + rte_trace_point_emit_string(name);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_driver_name_get,
> + RTE_TRACE_POINT_ARGS(uint8_t driver_id, const char *name),
> + rte_trace_point_emit_u8(driver_id);
> + rte_trace_point_emit_string(name);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_get_aead_algo_enum,
> + RTE_TRACE_POINT_ARGS(const char *algo_string),
> + rte_trace_point_emit_string(algo_string);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_get_auth_algo_enum,
> + RTE_TRACE_POINT_ARGS(const char *algo_string),
> + rte_trace_point_emit_string(algo_string);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_get_cipher_algo_enum,
> + RTE_TRACE_POINT_ARGS(const char *algo_string),
> + rte_trace_point_emit_string(algo_string);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_get_dev_id,
> + RTE_TRACE_POINT_ARGS(const char *name),
> + rte_trace_point_emit_string(name);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_get_feature_name,
> + RTE_TRACE_POINT_ARGS(uint64_t flag),
> + rte_trace_point_emit_u64(flag);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_get_sec_ctx,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id),
> + rte_trace_point_emit_u8(dev_id);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_info_get,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id),
> + rte_trace_point_emit_u8(dev_id);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_is_valid_dev,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id),
> + rte_trace_point_emit_u8(dev_id);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_name_get,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *name),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_string(name);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_queue_pair_count,
> + RTE_TRACE_POINT_ARGS(const struct rte_cryptodev *dev),
> + rte_trace_point_emit_ptr(dev);
> + rte_trace_point_emit_string(dev->data->name);
> + rte_trace_point_emit_u8(dev->data->socket_id);
> + rte_trace_point_emit_u8(dev->data->dev_id);
> + rte_trace_point_emit_u16(dev->data->nb_queue_pairs);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_socket_id,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *name, int socket_id),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_string(name);
> + rte_trace_point_emit_int(socket_id);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_stats_get,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id,
> + const struct rte_cryptodev_stats *stats),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u64(stats->enqueued_count);
> + rte_trace_point_emit_u64(stats->dequeued_count);
> + rte_trace_point_emit_u64(stats->enqueue_err_count);
> + rte_trace_point_emit_u64(stats->dequeue_err_count);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_stats_reset,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id),
> + rte_trace_point_emit_u8(dev_id);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_capability_check_aead,
> + RTE_TRACE_POINT_ARGS(
> + const struct rte_cryptodev_symmetric_capability *capability,
> + uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
> + uint16_t iv_size),
> + rte_trace_point_emit_ptr(capability);
> + rte_trace_point_emit_int(capability->xform_type);
> + rte_trace_point_emit_u16(key_size);
> + rte_trace_point_emit_u16(digest_size);
> + rte_trace_point_emit_u16(aad_size);
> + rte_trace_point_emit_u16(iv_size);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_capability_check_auth,
> + RTE_TRACE_POINT_ARGS(
> + const struct rte_cryptodev_symmetric_capability *capability,
> + uint16_t key_size, uint16_t digest_size, uint16_t iv_size),
> + rte_trace_point_emit_ptr(capability);
> + rte_trace_point_emit_int(capability->xform_type);
> + rte_trace_point_emit_u16(key_size);
> + rte_trace_point_emit_u16(digest_size);
> + rte_trace_point_emit_u16(iv_size);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_capability_check_cipher,
> + RTE_TRACE_POINT_ARGS(
> + const struct rte_cryptodev_symmetric_capability *capability,
> + uint16_t key_size, uint16_t iv_size),
> + rte_trace_point_emit_ptr(capability);
> + rte_trace_point_emit_int(capability->xform_type);
> + rte_trace_point_emit_u16(key_size);
> + rte_trace_point_emit_u16(iv_size);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_capability_get,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *driver_name,
> + uint8_t driver_id, int idx_type),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_string(driver_name);
> + rte_trace_point_emit_u8(driver_id);
> + rte_trace_point_emit_int(idx_type);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_get_private_session_size,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint32_t priv_sess_size),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u32(priv_sess_size);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_asym_capability_get,
> + RTE_TRACE_POINT_ARGS(const char *driver_name, uint8_t driver_id,
> + int idx_type),
> + rte_trace_point_emit_string(driver_name);
> + rte_trace_point_emit_u8(driver_id);
> + rte_trace_point_emit_int(idx_type);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_asym_get_private_session_size,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint32_t priv_sess_size),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u32(priv_sess_size);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_asym_get_xform_enum,
> + RTE_TRACE_POINT_ARGS(const char *xform_string),
> + rte_trace_point_emit_string(xform_string);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_asym_xform_capability_check_modlen,
> + RTE_TRACE_POINT_ARGS(const void *capability, uint16_t modlen),
> + rte_trace_point_emit_ptr(capability);
> + rte_trace_point_emit_u16(modlen);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_cpu_crypto_process,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const void *sess),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_ptr(sess);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_get_existing_header_session_size,
> + RTE_TRACE_POINT_ARGS(struct rte_cryptodev_sym_session *sess),
> + rte_trace_point_emit_ptr(sess);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_session_get_user_data,
> + RTE_TRACE_POINT_ARGS(const void *sess),
> + rte_trace_point_emit_ptr(sess);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_session_set_user_data,
> + RTE_TRACE_POINT_ARGS(const void *sess, const void *data, uint16_t size),
> + rte_trace_point_emit_ptr(sess);
> + rte_trace_point_emit_ptr(data);
> + rte_trace_point_emit_u16(size);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_get_qp_status,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t queue_pair_id),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u16(queue_pair_id);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_configure_raw_dp_ctx,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, int sess_type),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u16(qp_id);
> + rte_trace_point_emit_int(sess_type);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_get_raw_dp_ctx_size,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id),
> + rte_trace_point_emit_u8(dev_id);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_add_deq_callback,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void *cb_fn),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u16(qp_id);
> + rte_trace_point_emit_ptr(cb_fn);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_add_enq_callback,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void *cb_fn),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u16(qp_id);
> + rte_trace_point_emit_ptr(cb_fn);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_remove_deq_callback,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void *fn),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u16(qp_id);
> + rte_trace_point_emit_ptr(fn);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_remove_enq_callback,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void *fn),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u16(qp_id);
> + rte_trace_point_emit_ptr(fn);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_asym_session_get_user_data,
> + RTE_TRACE_POINT_ARGS(const void *sess),
> + rte_trace_point_emit_ptr(sess);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_asym_session_set_user_data,
> + RTE_TRACE_POINT_ARGS(const void *sess, const void *data, uint16_t size),
> + rte_trace_point_emit_ptr(sess);
> + rte_trace_point_emit_ptr(data);
> + rte_trace_point_emit_u16(size);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_session_event_mdata_set,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const void *sess, int op_type,
> + int sess_type, const void *ev_mdata, uint16_t size),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_ptr(sess);
> + rte_trace_point_emit_int(op_type);
> + rte_trace_point_emit_int(sess_type);
> + rte_trace_point_emit_ptr(ev_mdata);
> + rte_trace_point_emit_u16(size);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_allocate_driver,
> + RTE_TRACE_POINT_ARGS(const char *name),
> + rte_trace_point_emit_string(name);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_pmd_allocate,
> + RTE_TRACE_POINT_ARGS(const struct rte_cryptodev *cryptodev),
> + rte_trace_point_emit_ptr(cryptodev);
> + rte_trace_point_emit_string(cryptodev->data->name);
> + rte_trace_point_emit_u8(cryptodev->data->socket_id);
> + rte_trace_point_emit_u8(cryptodev->data->dev_id);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_pmd_callback_process,
> + RTE_TRACE_POINT_ARGS(struct rte_cryptodev *dev,
> + enum rte_cryptodev_event_type event),
> + rte_trace_point_emit_ptr(dev);
> + rte_trace_point_emit_string(dev->data->name);
> + rte_trace_point_emit_u8(dev->data->socket_id);
> + rte_trace_point_emit_u8(dev->data->dev_id);
> + rte_trace_point_emit_int(event);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_pmd_create,
> + RTE_TRACE_POINT_ARGS(const char *name, int socket_id,
> + const void *cryptodev),
> + rte_trace_point_emit_string(name);
> + rte_trace_point_emit_int(socket_id);
> + rte_trace_point_emit_ptr(cryptodev);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_pmd_create_dev_name,
> + RTE_TRACE_POINT_ARGS(const char *dev_name_prefix),
> + rte_trace_point_emit_string(dev_name_prefix);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_pmd_destroy,
> + RTE_TRACE_POINT_ARGS(const struct rte_cryptodev *cryptodev),
> + rte_trace_point_emit_ptr(cryptodev);
> + rte_trace_point_emit_string(cryptodev->data->name);
> + rte_trace_point_emit_u8(cryptodev->data->socket_id);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_pmd_get_dev,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id),
> + rte_trace_point_emit_u8(dev_id);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_pmd_get_named_dev,
> + RTE_TRACE_POINT_ARGS(const char *name),
> + rte_trace_point_emit_string(name);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_pmd_parse_input_args,
> + RTE_TRACE_POINT_ARGS(char *name, int socket_id,
> + uint32_t max_nb_queue_pairs),
> + rte_trace_point_emit_string(name);
> + rte_trace_point_emit_int(socket_id);
> + rte_trace_point_emit_u32(max_nb_queue_pairs);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_pmd_probing_finish,
> + RTE_TRACE_POINT_ARGS(const struct rte_cryptodev *cryptodev),
> + rte_trace_point_emit_ptr(cryptodev);
> + rte_trace_point_emit_string(cryptodev->data->name);
> + rte_trace_point_emit_u8(cryptodev->data->socket_id);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_pmd_release_device,
> + RTE_TRACE_POINT_ARGS(const struct rte_cryptodev *cryptodev),
> + rte_trace_point_emit_ptr(cryptodev);
> + rte_trace_point_emit_string(cryptodev->data->name);
> + rte_trace_point_emit_u8(cryptodev->data->socket_id);
> + rte_trace_point_emit_u8(cryptodev->data->dev_id);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_op_pool_create,
> + RTE_TRACE_POINT_ARGS(const char *name, int socket_id, int type,
> + uint32_t nb_elts, const void *mp),
> + rte_trace_point_emit_string(name);
> + rte_trace_point_emit_int(socket_id);
> + rte_trace_point_emit_int(type);
> + rte_trace_point_emit_u32(nb_elts);
> + rte_trace_point_emit_ptr(mp);
> +)
> +
> #ifdef __cplusplus
> }
> #endif
> diff --git a/lib/cryptodev/rte_cryptodev_trace_fp.h b/lib/cryptodev/rte_cryptodev_trace_fp.h
> index 9218997c14..03f4503d34 100644
> --- a/lib/cryptodev/rte_cryptodev_trace_fp.h
> +++ b/lib/cryptodev/rte_cryptodev_trace_fp.h
> @@ -31,6 +31,12 @@ RTE_TRACE_POINT_FP(
> rte_trace_point_emit_u16(nb_ops);
> )
>
> +RTE_TRACE_POINT_FP(
> + rte_cryptodev_trace_session_event_mdata_get,
> + RTE_TRACE_POINT_ARGS(uint8_t type),
> + rte_trace_point_emit_u8(type);
> +)
> +
> #ifdef __cplusplus
> }
> #endif
> diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
> index 5aee87c6f7..a788185229 100644
> --- a/lib/cryptodev/version.map
> +++ b/lib/cryptodev/version.map
> @@ -109,6 +109,63 @@ EXPERIMENTAL {
> #added in 22.07
> rte_cryptodev_session_event_mdata_set;
> rte_crypto_asym_ke_strings;
> +
> + #added in 22.11
> + __rte_cryptodev_trace_add_deq_callback;
> + __rte_cryptodev_trace_add_enq_callback;
> + __rte_cryptodev_trace_allocate_driver;
> + __rte_cryptodev_trace_asym_capability_get;
> + __rte_cryptodev_trace_asym_get_private_session_size;
> + __rte_cryptodev_trace_asym_get_xform_enum;
> + __rte_cryptodev_trace_asym_session_get_user_data;
> + __rte_cryptodev_trace_asym_session_set_user_data;
> + __rte_cryptodev_trace_asym_xform_capability_check_modlen;
> + __rte_cryptodev_trace_callback_register;
> + __rte_cryptodev_trace_callback_unregister;
> + __rte_cryptodev_trace_configure_raw_dp_ctx;
> + __rte_cryptodev_trace_device_count_by_driver;
> + __rte_cryptodev_trace_devices_get;
> + __rte_cryptodev_trace_driver_id_get;
> + __rte_cryptodev_trace_driver_name_get;
> + __rte_cryptodev_trace_get_aead_algo_enum;
> + __rte_cryptodev_trace_get_auth_algo_enum;
> + __rte_cryptodev_trace_get_cipher_algo_enum;
> + __rte_cryptodev_trace_get_dev_id;
> + __rte_cryptodev_trace_get_feature_name;
> + __rte_cryptodev_trace_get_qp_status;
> + __rte_cryptodev_trace_get_raw_dp_ctx_size;
> + __rte_cryptodev_trace_get_sec_ctx;
> + __rte_cryptodev_trace_info_get;
> + __rte_cryptodev_trace_is_valid_dev;
> + __rte_cryptodev_trace_name_get;
> + __rte_cryptodev_trace_op_pool_create;
> + __rte_cryptodev_trace_pmd_allocate;
> + __rte_cryptodev_trace_pmd_callback_process;
> + __rte_cryptodev_trace_pmd_create;
> + __rte_cryptodev_trace_pmd_create_dev_name;
> + __rte_cryptodev_trace_pmd_destroy;
> + __rte_cryptodev_trace_pmd_get_dev;
> + __rte_cryptodev_trace_pmd_get_named_dev;
> + __rte_cryptodev_trace_pmd_parse_input_args;
> + __rte_cryptodev_trace_pmd_probing_finish;
> + __rte_cryptodev_trace_pmd_release_device;
> + __rte_cryptodev_trace_queue_pair_count;
> + __rte_cryptodev_trace_remove_deq_callback;
> + __rte_cryptodev_trace_remove_enq_callback;
> + __rte_cryptodev_trace_session_event_mdata_get;
> + __rte_cryptodev_trace_session_event_mdata_set;
> + __rte_cryptodev_trace_socket_id;
> + __rte_cryptodev_trace_stats_get;
> + __rte_cryptodev_trace_stats_reset;
> + __rte_cryptodev_trace_sym_capability_check_aead;
> + __rte_cryptodev_trace_sym_capability_check_auth;
> + __rte_cryptodev_trace_sym_capability_check_cipher;
> + __rte_cryptodev_trace_sym_capability_get;
> + __rte_cryptodev_trace_sym_cpu_crypto_process;
> + __rte_cryptodev_trace_sym_get_existing_header_session_size;
> + __rte_cryptodev_trace_sym_get_private_session_size;
> + __rte_cryptodev_trace_sym_session_get_user_data;
> + __rte_cryptodev_trace_sym_session_set_user_data;
> };
>
> INTERNAL {
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [EXT] Re: [PATCH] cryptodev: add trace points
2022-09-28 4:08 ` Jerin Jacob
@ 2022-09-28 17:30 ` Amit Prakash Shukla
0 siblings, 0 replies; 8+ messages in thread
From: Amit Prakash Shukla @ 2022-09-28 17:30 UTC (permalink / raw)
To: Jerin Jacob
Cc: Akhil Goyal, Fan Zhang, Ray Kinsella, dev, Jerin Jacob Kollanukkaran
Hi Jerin,
Thanks for the feedback. I will do the suggested changes in next version of the patch.
> -----Original Message-----
> From: Jerin Jacob <jerinjacobk@gmail.com>
> Sent: Wednesday, September 28, 2022 9:38 AM
> To: Amit Prakash Shukla <amitprakashs@marvell.com>
> Cc: Akhil Goyal <gakhil@marvell.com>; Fan Zhang
> <roy.fan.zhang@intel.com>; Ray Kinsella <mdr@ashroe.eu>; dev@dpdk.org;
> Jerin Jacob Kollanukkaran <jerinj@marvell.com>
> Subject: [EXT] Re: [PATCH] cryptodev: add trace points
>
> External Email
>
> ----------------------------------------------------------------------
> On Fri, Sep 16, 2022 at 11:05 PM Amit Prakash Shukla
> <amitprakashs@marvell.com> wrote:
> >
> > Add trace points for cryptodev functions.
> >
> > Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
> > ---
>
> 1) Please include the result of API operation in trace so that once can know
> the API status
> 2) restrict trace additions to public API. i.e I think, no need to add trace for
> PMD hooks
> 3) Please test with
> https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__patches.dpdk.org_project_dpdk_patch_20220804134430.6192-2D7-
> 2Dadwivedi-
> 40marvell.com_&d=DwIBaQ&c=nKjWec2b6R0mOyPaz7xtfQ&r=ALGdXl3fZgF
> GR69VnJLdSnADun7zLaXG1p5Rs7pXihE&m=La6KTYnho7a2OyakYv8EYufGmc9
> 4buR5F88gTXM3TE1wkbcHadzRTCGSpG6WnUoU&s=UwXGLOV1QKlABQz31v
> BV7KC6lRzayDRh1lftzCCG2jc&e=
> patch by adding cryptodev symbols
> to make sure not to missed any public cryptodev API.
>
>
> > @@ -135,6 +139,8 @@ rte_cryptodev_pmd_create(const char *name,
> > /* initialise user call-back tail queue */
> > TAILQ_INIT(&(cryptodev->link_intr_cbs));
> >
> > + rte_cryptodev_trace_pmd_create(name, params->socket_id,
> > + cryptodev);
> > +
> > return cryptodev;
> > }
> >
> > @@ -144,6 +150,8 @@ rte_cryptodev_pmd_destroy(struct rte_cryptodev
> *cryptodev)
> > int retval;
> > void *dev_priv = cryptodev->data->dev_private;
> >
> > + rte_cryptodev_trace_pmd_destroy(cryptodev);
> > +
> > CDEV_LOG_INFO("Closing crypto device %s",
> > cryptodev->device->name);
> >
> > /* free crypto device */
> > @@ -166,6 +174,9 @@ rte_cryptodev_pmd_probing_finish(struct
> > rte_cryptodev *cryptodev) {
> > if (cryptodev == NULL)
> > return;
> > +
> > + rte_cryptodev_trace_pmd_probing_finish(cryptodev);
> > +
> > /*
> > * for secondary process, at that point we expect device
> > * to be already 'usable', so shared data and all function @@
> > -231,6 +242,8 @@ cryptodev_fp_ops_set(struct rte_crypto_fp_ops
> > *fp_ops, void * rte_cryptodev_session_event_mdata_get(struct
> > rte_crypto_op *op) {
> > + rte_cryptodev_trace_session_event_mdata_get(op->type);
> > +
> > if (op->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC &&
> > op->sess_type == RTE_CRYPTO_OP_WITH_SESSION)
> > return
> > rte_cryptodev_sym_session_get_user_data(op->sym->session);
> > diff --git a/lib/cryptodev/cryptodev_trace_points.c
> > b/lib/cryptodev/cryptodev_trace_points.c
> > index c5bfe08b79..bca4deecc2 100644
> > --- a/lib/cryptodev/cryptodev_trace_points.c
> > +++ b/lib/cryptodev/cryptodev_trace_points.c
> > @@ -50,3 +50,168 @@
> > RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_enqueue_burst,
> >
> > RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_dequeue_burst,
> > lib.cryptodev.deq.burst)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_callback_register,
> > + lib.cryptodev.callback.register)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_callback_unregister,
> > + lib.cryptodev.callback.unregister)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_device_count_by_driv
> er,
> > + lib.cryptodev.device.count.by.driver)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_devices_get,
> > + lib.cryptodev.devices.get)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_driver_id_get,
> > + lib.cryptodev.driver.id.get)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_driver_name_get,
> > + lib.cryptodev.driver.name.get)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_aead_algo_enum,
> > + lib.cryptodev.get.aead.algo.enum)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_auth_algo_enum,
> > + lib.cryptodev.get.auth.algo.enum)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_cipher_algo_enu
> m,
> > + lib.cryptodev.get.cipher.algo.enum)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_dev_id,
> > + lib.cryptodev.get.dev.id)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_feature_name,
> > + lib.cryptodev.get.feature.name)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_sec_ctx,
> > + lib.cryptodev.get.sec.ctx)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_info_get,
> > + lib.cryptodev.info.get)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_is_valid_dev,
> > + lib.cryptodev.is.valid.dev)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_name_get,
> > + lib.cryptodev.name.get)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_queue_pair_count,
> > + lib.cryptodev.queue.pair.count)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_socket_id,
> > + lib.cryptodev.socket.id)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_stats_get,
> > + lib.cryptodev.stats.get)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_stats_reset,
> > + lib.cryptodev.stats.reset)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_check
> _aead,
> > + lib.cryptodev.sym.capability.check.aead)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_check
> _auth,
> > + lib.cryptodev.sym.capability.check.auth)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_check
> _cipher,
> > + lib.cryptodev.sym.capability.check.cipher)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_get,
> > + lib.cryptodev.sym.capability.get)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_get_private_sess
> ion_size,
> > + lib.cryptodev.sym.get.private.session.size)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_capability_get,
> > + lib.cryptodev.asym.capability.get)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_get_private_ses
> sion_size,
> > + lib.cryptodev.asym.get.private.session.size)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_get_xform_enu
> m,
> > + lib.cryptodev.asym.get.xform.enum)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_xform_capabilit
> y_check_modlen,
> > + lib.cryptodev.asym.xform.capability.check.modlen)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_cpu_crypto_proc
> ess,
> > + lib.cryptodev.sym.cpu.crypto.process)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_get_existing_hea
> der_session_size,
> > + lib.cryptodev.sym.get.existing.header.session.size)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_get_use
> r_data,
> > + lib.cryptodev.sym.session.get.user.data)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_set_user
> _data,
> > + lib.cryptodev.sym.session.set.user.data)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_qp_status,
> > + lib.cryptodev.get.qp.status)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_configure_raw_dp_ctx
> ,
> > + lib.cryptodev.configure.raw.dp.ctx)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_raw_dp_ctx_size,
> > + lib.cryptodev.get.raw.dp.ctx.size)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_add_deq_callback,
> > + lib.cryptodev.add.deq.callback)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_add_enq_callback,
> > + lib.cryptodev.add.enq.callback)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_remove_deq_callback,
> > + lib.cryptodev.remove.deq.callback)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_remove_enq_callback,
> > + lib.cryptodev.remove.enq.callback)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_get_us
> er_data,
> > + lib.cryptodev.asym.session.get.user.data)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_set_us
> er_data,
> > + lib.cryptodev.asym.session.set.user.data)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_session_event_mdata
> _set,
> > + lib.cryptodev.session.event.mdata.set)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_allocate_driver,
> > + lib.cryptodev.allocate.driver)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_allocate,
> > + lib.cryptodev.pmd.allocate)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_callback_process
> ,
> > + lib.cryptodev.pmd.callback.process)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_create,
> > + lib.cryptodev.pmd.create)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_create_dev_na
> me,
> > + lib.cryptodev.pmd.create.dev.name)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_destroy,
> > + lib.cryptodev.pmd.destroy)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_get_dev,
> > + lib.cryptodev.pmd.get.dev)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_get_named_dev
> ,
> > + lib.cryptodev.pmd.get.named.dev)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_parse_input_arg
> s,
> > + lib.cryptodev.pmd.parse.input.args)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_probing_finish,
> > + lib.cryptodev.pmd.probing.finish)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_pmd_release_device,
> > + lib.cryptodev.pmd.release.device)
> > +
> >
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_session_event_mdata
> _get,
> > + lib.cryptodev.session.event.mdata.get)
> > +
> > +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_op_pool_create,
> > + lib.cryptodev.op.pool.create)
> > diff --git a/lib/cryptodev/rte_cryptodev.c
> > b/lib/cryptodev/rte_cryptodev.c index 42f3221052..b712315674 100644
> > --- a/lib/cryptodev/rte_cryptodev.c
> > +++ b/lib/cryptodev/rte_cryptodev.c
> > @@ -216,6 +216,8 @@ rte_cryptodev_get_cipher_algo_enum(enum
> > rte_crypto_cipher_algorithm *algo_enum, {
> > unsigned int i;
> >
> > + rte_cryptodev_trace_get_cipher_algo_enum(algo_string);
> > +
> > for (i = 1; i < RTE_DIM(rte_crypto_cipher_algorithm_strings); i++) {
> > if (strcmp(algo_string, rte_crypto_cipher_algorithm_strings[i]) ==
> 0) {
> > *algo_enum = (enum
> > rte_crypto_cipher_algorithm) i; @@ -233,6 +235,8 @@
> > rte_cryptodev_get_auth_algo_enum(enum rte_crypto_auth_algorithm
> *algo_enum, {
> > unsigned int i;
> >
> > + rte_cryptodev_trace_get_auth_algo_enum(algo_string);
> > +
> > for (i = 1; i < RTE_DIM(rte_crypto_auth_algorithm_strings); i++) {
> > if (strcmp(algo_string, rte_crypto_auth_algorithm_strings[i]) == 0)
> {
> > *algo_enum = (enum rte_crypto_auth_algorithm)
> > i; @@ -250,6 +254,8 @@ rte_cryptodev_get_aead_algo_enum(enum
> > rte_crypto_aead_algorithm *algo_enum, {
> > unsigned int i;
> >
> > + rte_cryptodev_trace_get_aead_algo_enum(algo_string);
> > +
> > for (i = 1; i < RTE_DIM(rte_crypto_aead_algorithm_strings); i++) {
> > if (strcmp(algo_string, rte_crypto_aead_algorithm_strings[i]) == 0)
> {
> > *algo_enum = (enum rte_crypto_aead_algorithm)
> > i; @@ -267,6 +273,8 @@ rte_cryptodev_asym_get_xform_enum(enum
> > rte_crypto_asym_xform_type *xform_enum, {
> > unsigned int i;
> >
> > + rte_cryptodev_trace_asym_get_xform_enum(xform_string);
> > +
> > for (i = 1; i < RTE_DIM(rte_crypto_asym_xform_strings); i++) {
> > if (strcmp(xform_string,
> > rte_crypto_asym_xform_strings[i]) == 0) { @@
> > -299,6 +307,9 @@ rte_cryptodev_sym_capability_get(uint8_t dev_id,
> >
> > rte_cryptodev_info_get(dev_id, &dev_info);
> >
> > + rte_cryptodev_trace_sym_capability_get(dev_id,
> dev_info.driver_name,
> > + dev_info.driver_id, idx->type);
> > +
> > while ((capability = &dev_info.capabilities[i++])->op !=
> > RTE_CRYPTO_OP_TYPE_UNDEFINED) {
> > if (capability->op != RTE_CRYPTO_OP_TYPE_SYMMETRIC) @@
> > -359,6 +370,9 @@ rte_cryptodev_asym_capability_get(uint8_t dev_id,
> > memset(&dev_info, 0, sizeof(struct rte_cryptodev_info));
> > rte_cryptodev_info_get(dev_id, &dev_info);
> >
> > + rte_cryptodev_trace_asym_capability_get(dev_info.driver_name,
> > + dev_info.driver_id, idx->type);
> > +
> > while ((capability = &dev_info.capabilities[i++])->op !=
> > RTE_CRYPTO_OP_TYPE_UNDEFINED) {
> > if (capability->op != RTE_CRYPTO_OP_TYPE_ASYMMETRIC)
> > @@ -375,6 +389,9 @@ rte_cryptodev_sym_capability_check_cipher(
> > const struct rte_cryptodev_symmetric_capability *capability,
> > uint16_t key_size, uint16_t iv_size) {
> > + rte_cryptodev_trace_sym_capability_check_cipher(capability,
> key_size,
> > + iv_size);
> > +
> > if (param_range_check(key_size, &capability->cipher.key_size) != 0)
> > return -1;
> >
> > @@ -389,6 +406,9 @@ rte_cryptodev_sym_capability_check_auth(
> > const struct rte_cryptodev_symmetric_capability *capability,
> > uint16_t key_size, uint16_t digest_size, uint16_t
> > iv_size) {
> > + rte_cryptodev_trace_sym_capability_check_auth(capability, key_size,
> > + digest_size, iv_size);
> > +
> > if (param_range_check(key_size, &capability->auth.key_size) != 0)
> > return -1;
> >
> > @@ -407,6 +427,9 @@ rte_cryptodev_sym_capability_check_aead(
> > uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
> > uint16_t iv_size)
> > {
> > + rte_cryptodev_trace_sym_capability_check_aead(capability,
> key_size,
> > + digest_size, aad_size, iv_size);
> > +
> > if (param_range_check(key_size, &capability->aead.key_size) != 0)
> > return -1;
> >
> > @@ -437,6 +460,9 @@
> rte_cryptodev_asym_xform_capability_check_modlen(
> > const struct rte_cryptodev_asymmetric_xform_capability *capability,
> > uint16_t modlen)
> > {
> > +
> rte_cryptodev_trace_asym_xform_capability_check_modlen(capability,
> > + modlen);
> > +
> > /* no need to check for limits, if min or max = 0 */
> > if (capability->modlen.min != 0) {
> > if (modlen < capability->modlen.min) @@ -577,6 +603,8
> > @@ cryptodev_cb_init(struct rte_cryptodev *dev) const char *
> > rte_cryptodev_get_feature_name(uint64_t flag) {
> > + rte_cryptodev_trace_get_feature_name(flag);
> > +
> > switch (flag) {
> > case RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO:
> > return "SYMMETRIC_CRYPTO"; @@ -638,6 +666,8 @@
> > rte_cryptodev_get_feature_name(uint64_t flag) struct rte_cryptodev *
> > rte_cryptodev_pmd_get_dev(uint8_t dev_id) {
> > + rte_cryptodev_trace_pmd_get_dev(dev_id);
> > +
> > return &cryptodev_globals.devs[dev_id]; }
> >
> > @@ -650,6 +680,8 @@ rte_cryptodev_pmd_get_named_dev(const char
> *name)
> > if (name == NULL)
> > return NULL;
> >
> > + rte_cryptodev_trace_pmd_get_named_dev(name);
> > +
> > for (i = 0; i < RTE_CRYPTO_MAX_DEVS; i++) {
> > dev = &cryptodev_globals.devs[i];
> >
> > @@ -676,6 +708,8 @@ rte_cryptodev_is_valid_dev(uint8_t dev_id) {
> > struct rte_cryptodev *dev = NULL;
> >
> > + rte_cryptodev_trace_is_valid_dev(dev_id);
> > +
> > if (!rte_cryptodev_is_valid_device_data(dev_id))
> > return 0;
> >
> > @@ -695,6 +729,8 @@ rte_cryptodev_get_dev_id(const char *name)
> > if (name == NULL)
> > return -1;
> >
> > + rte_cryptodev_trace_get_dev_id(name);
> > +
> > for (i = 0; i < RTE_CRYPTO_MAX_DEVS; i++) {
> > if (!rte_cryptodev_is_valid_device_data(i))
> > continue;
> > @@ -725,6 +761,8 @@ rte_cryptodev_device_count_by_driver(uint8_t
> driver_id)
> > RTE_CRYPTODEV_ATTACHED)
> > dev_count++;
> >
> > + rte_cryptodev_trace_device_count_by_driver(driver_id,
> > + dev_count);
> > +
> > return dev_count;
> > }
> >
> > @@ -751,12 +789,16 @@ rte_cryptodev_devices_get(const char
> *driver_name, uint8_t *devices,
> > }
> > }
> >
> > + rte_cryptodev_trace_devices_get(driver_name, count);
> > +
> > return count;
> > }
> >
> > void *
> > rte_cryptodev_get_sec_ctx(uint8_t dev_id) {
> > + rte_cryptodev_trace_get_sec_ctx(dev_id);
> > +
> > if (dev_id < RTE_CRYPTO_MAX_DEVS &&
> > (rte_crypto_devices[dev_id].feature_flags &
> > RTE_CRYPTODEV_FF_SECURITY)) @@ -775,6 +817,8
> > @@ rte_cryptodev_socket_id(uint8_t dev_id)
> >
> > dev = rte_cryptodev_pmd_get_dev(dev_id);
> >
> > + rte_cryptodev_trace_socket_id(dev_id, dev->data->name,
> > + dev->data->socket_id);
> > return dev->data->socket_id;
> > }
> >
> > @@ -913,6 +957,7 @@ rte_cryptodev_pmd_allocate(const char *name, int
> socket_id)
> > cryptodev_globals.nb_devs++;
> > }
> >
> > + rte_cryptodev_trace_pmd_allocate(cryptodev);
> > return cryptodev;
> > }
> >
> > @@ -925,6 +970,8 @@ rte_cryptodev_pmd_release_device(struct
> rte_cryptodev *cryptodev)
> > if (cryptodev == NULL)
> > return -EINVAL;
> >
> > + rte_cryptodev_trace_pmd_release_device(cryptodev);
> > +
> > dev_id = cryptodev->data->dev_id;
> >
> > cryptodev_fp_ops_reset(rte_crypto_fp_ops + dev_id); @@ -956,6
> > +1003,8 @@ rte_cryptodev_queue_pair_count(uint8_t dev_id)
> > }
> >
> > dev = &rte_crypto_devices[dev_id];
> > + rte_cryptodev_trace_queue_pair_count(dev);
> > +
> > return dev->data->nb_queue_pairs; }
> >
> > @@ -1178,6 +1227,8 @@ rte_cryptodev_get_qp_status(uint8_t dev_id,
> > uint16_t queue_pair_id) {
> > struct rte_cryptodev *dev;
> >
> > + rte_cryptodev_trace_get_qp_status(dev_id, queue_pair_id);
> > +
> > if (!rte_cryptodev_is_valid_dev(dev_id)) {
> > CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
> > return -EINVAL;
> > @@ -1331,6 +1382,7 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
> >
> > rte_spinlock_unlock(&rte_cryptodev_callback_lock);
> >
> > + rte_cryptodev_trace_add_enq_callback(dev_id, qp_id, cb_fn);
> > return cb;
> > }
> >
> > @@ -1356,6 +1408,8 @@ rte_cryptodev_remove_enq_callback(uint8_t
> dev_id,
> > return -ENODEV;
> > }
> >
> > + rte_cryptodev_trace_remove_enq_callback(dev_id, qp_id,
> > + cb->fn);
> > +
> > dev = &rte_crypto_devices[dev_id];
> > if (qp_id >= dev->data->nb_queue_pairs) {
> > CDEV_LOG_ERR("Invalid queue_pair_id=%d", qp_id); @@
> > -1466,6 +1520,8 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
> >
> > rte_spinlock_unlock(&rte_cryptodev_callback_lock);
> >
> > + rte_cryptodev_trace_add_deq_callback(dev_id, qp_id, cb_fn);
> > +
> > return cb;
> > }
> >
> > @@ -1491,6 +1547,8 @@ rte_cryptodev_remove_deq_callback(uint8_t
> dev_id,
> > return -ENODEV;
> > }
> >
> > + rte_cryptodev_trace_remove_deq_callback(dev_id, qp_id,
> > + cb->fn);
> > +
> > dev = &rte_crypto_devices[dev_id];
> > if (qp_id >= dev->data->nb_queue_pairs) {
> > CDEV_LOG_ERR("Invalid queue_pair_id=%d", qp_id); @@
> > -1559,6 +1617,8 @@ rte_cryptodev_stats_get(uint8_t dev_id, struct
> > rte_cryptodev_stats *stats)
> >
> > RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_get, -ENOTSUP);
> > (*dev->dev_ops->stats_get)(dev, stats);
> > +
> > + rte_cryptodev_trace_stats_get(dev_id, stats);
> > return 0;
> > }
> >
> > @@ -1567,6 +1627,8 @@ rte_cryptodev_stats_reset(uint8_t dev_id) {
> > struct rte_cryptodev *dev;
> >
> > + rte_cryptodev_trace_stats_reset(dev_id);
> > +
> > if (!rte_cryptodev_is_valid_dev(dev_id)) {
> > CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
> > return;
> > @@ -1597,6 +1659,9 @@ rte_cryptodev_info_get(uint8_t dev_id, struct
> > rte_cryptodev_info *dev_info)
> >
> > dev_info->driver_name = dev->device->driver->name;
> > dev_info->device = dev->device;
> > +
> > + rte_cryptodev_trace_info_get(dev_id);
> > +
> > }
> >
> > int
> > @@ -1639,6 +1704,8 @@ rte_cryptodev_callback_register(uint8_t dev_id,
> > }
> >
> > rte_spinlock_unlock(&rte_cryptodev_cb_lock);
> > +
> > + rte_cryptodev_trace_callback_register(dev_id, event, cb_fn);
> > return (user_cb == NULL) ? -ENOMEM : 0; }
> >
> > @@ -1685,6 +1752,8 @@ rte_cryptodev_callback_unregister(uint8_t
> dev_id,
> > }
> >
> > rte_spinlock_unlock(&rte_cryptodev_cb_lock);
> > +
> > + rte_cryptodev_trace_callback_unregister(dev_id, event, cb_fn);
> > return ret;
> > }
> >
> > @@ -1695,6 +1764,7 @@ rte_cryptodev_pmd_callback_process(struct
> rte_cryptodev *dev,
> > struct rte_cryptodev_callback *cb_lst;
> > struct rte_cryptodev_callback dev_cb;
> >
> > + rte_cryptodev_trace_pmd_callback_process(dev, event);
> > rte_spinlock_lock(&rte_cryptodev_cb_lock);
> > TAILQ_FOREACH(cb_lst, &(dev->link_intr_cbs), next) {
> > if (cb_lst->cb_fn == NULL || cb_lst->event != event)
> > @@ -2117,6 +2187,9 @@
> > rte_cryptodev_sym_get_private_session_size(uint8_t dev_id)
> >
> > priv_sess_size = (*dev->dev_ops->sym_session_get_size)(dev);
> >
> > + rte_cryptodev_trace_sym_get_private_session_size(dev_id,
> > + priv_sess_size);
> > +
> > return priv_sess_size;
> > }
> >
> > @@ -2136,6 +2209,9 @@
> > rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
> >
> > priv_sess_size = (*dev->dev_ops->asym_session_get_size)(dev);
> >
> > + rte_cryptodev_trace_asym_get_private_session_size(dev_id,
> > + priv_sess_size);
> > +
> > return priv_sess_size;
> > }
> >
> > @@ -2152,6 +2228,9 @@ rte_cryptodev_sym_session_set_user_data(
> > return -ENOMEM;
> >
> > rte_memcpy(sess->sess_data + sess->nb_drivers, data, size);
> > +
> > + rte_cryptodev_trace_sym_session_set_user_data(sess, data,
> > + size);
> > +
> > return 0;
> > }
> >
> > @@ -2162,6 +2241,8 @@ rte_cryptodev_sym_session_get_user_data(
> > if (sess == NULL || sess->user_data_sz == 0)
> > return NULL;
> >
> > + rte_cryptodev_trace_sym_session_get_user_data(sess);
> > +
> > return (void *)(sess->sess_data + sess->nb_drivers); }
> >
> > @@ -2178,6 +2259,9 @@
> rte_cryptodev_asym_session_set_user_data(void *session, void *data,
> uint16_t siz
> > rte_memcpy(sess->sess_private_data +
> > sess->max_priv_data_sz,
> > data, size);
> > +
> > + rte_cryptodev_trace_asym_session_set_user_data(sess, data,
> > + size);
> > +
> > return 0;
> > }
> >
> > @@ -2188,6 +2272,8 @@
> rte_cryptodev_asym_session_get_user_data(void *session)
> > if (sess == NULL || sess->user_data_sz == 0)
> > return NULL;
> >
> > + rte_cryptodev_trace_asym_session_get_user_data(sess);
> > +
> > return (void *)(sess->sess_private_data +
> > sess->max_priv_data_sz); } @@ -2207,6 +2293,8
> > @@ rte_cryptodev_sym_cpu_crypto_process(uint8_t dev_id, {
> > struct rte_cryptodev *dev;
> >
> > + rte_cryptodev_trace_sym_cpu_crypto_process(dev_id, sess);
> > +
> > if (!rte_cryptodev_is_valid_dev(dev_id)) {
> > sym_crypto_fill_status(vec, EINVAL);
> > return 0;
> > @@ -2230,6 +2318,8 @@ rte_cryptodev_get_raw_dp_ctx_size(uint8_t
> dev_id)
> > int32_t size = sizeof(struct rte_crypto_raw_dp_ctx);
> > int32_t priv_size;
> >
> > + rte_cryptodev_trace_get_raw_dp_ctx_size(dev_id);
> > +
> > if (!rte_cryptodev_is_valid_dev(dev_id))
> > return -EINVAL;
> >
> > @@ -2256,6 +2346,8 @@ rte_cryptodev_configure_raw_dp_ctx(uint8_t
> > dev_id, uint16_t qp_id, {
> > struct rte_cryptodev *dev;
> >
> > + rte_cryptodev_trace_configure_raw_dp_ctx(dev_id, qp_id,
> > + sess_type);
> > +
> > if (!rte_cryptodev_get_qp_status(dev_id, qp_id))
> > return -EINVAL;
> >
> > @@ -2280,6 +2372,9 @@
> rte_cryptodev_session_event_mdata_set(uint8_t dev_id, void *sess,
> > if (sess == NULL || ev_mdata == NULL)
> > return -EINVAL;
> >
> > + rte_cryptodev_trace_session_event_mdata_set(dev_id, sess,
> op_type,
> > + sess_type, ev_mdata, size);
> > +
> > if (!rte_cryptodev_is_valid_dev(dev_id))
> > goto skip_pmd_op;
> >
> > @@ -2429,6 +2524,7 @@ rte_crypto_op_pool_create(const char *name,
> enum rte_crypto_op_type type,
> > priv->priv_size = priv_size;
> > priv->type = type;
> >
> > + rte_cryptodev_trace_op_pool_create(name, socket_id, type,
> > + nb_elts, mp);
> > return mp;
> > }
> >
> > @@ -2441,6 +2537,8 @@ rte_cryptodev_pmd_create_dev_name(char
> *name, const char *dev_name_prefix)
> > if (name == NULL)
> > return -EINVAL;
> >
> > + rte_cryptodev_trace_pmd_create_dev_name(dev_name_prefix);
> > +
> > for (i = 0; i < RTE_CRYPTO_MAX_DEVS; i++) {
> > int ret = snprintf(name, RTE_CRYPTODEV_NAME_MAX_LEN,
> > "%s_%u", dev_name_prefix, i); @@
> > -2467,6 +2565,8 @@ rte_cryptodev_driver_id_get(const char *name)
> > struct cryptodev_driver *driver;
> > const char *driver_name;
> >
> > + rte_cryptodev_trace_driver_id_get(name);
> > +
> > if (name == NULL) {
> > RTE_LOG(DEBUG, CRYPTODEV, "name pointer NULL");
> > return -1;
> > @@ -2494,6 +2594,8 @@ rte_cryptodev_name_get(uint8_t dev_id)
> > if (dev == NULL)
> > return NULL;
> >
> > + rte_cryptodev_trace_name_get(dev_id, dev->data->name);
> > +
> > return dev->data->name;
> > }
> >
> > @@ -2503,8 +2605,11 @@ rte_cryptodev_driver_name_get(uint8_t
> driver_id)
> > struct cryptodev_driver *driver;
> >
> > TAILQ_FOREACH(driver, &cryptodev_driver_list, next)
> > - if (driver->id == driver_id)
> > + if (driver->id == driver_id) {
> > + rte_cryptodev_trace_driver_name_get(driver_id,
> > + driver->driver->name);
> > return driver->driver->name;
> > + }
> > return NULL;
> > }
> >
> > @@ -2517,6 +2622,8 @@ rte_cryptodev_allocate_driver(struct
> > cryptodev_driver *crypto_drv,
> >
> > TAILQ_INSERT_TAIL(&cryptodev_driver_list, crypto_drv, next);
> >
> > + rte_cryptodev_trace_allocate_driver(drv->name);
> > +
> > return nb_drivers++;
> > }
> >
> > diff --git a/lib/cryptodev/rte_cryptodev_trace.h
> > b/lib/cryptodev/rte_cryptodev_trace.h
> > index a3f6048e7d..84991c5b0a 100644
> > --- a/lib/cryptodev/rte_cryptodev_trace.h
> > +++ b/lib/cryptodev/rte_cryptodev_trace.h
> > @@ -18,6 +18,7 @@ extern "C" {
> > #include <rte_trace_point.h>
> >
> > #include "rte_cryptodev.h"
> > +#include "cryptodev_pmd.h"
> >
> > RTE_TRACE_POINT(
> > rte_cryptodev_trace_configure, @@ -138,6 +139,428 @@
> > RTE_TRACE_POINT(
> > rte_trace_point_emit_ptr(sess);
> > )
> >
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_callback_register,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id,
> > + enum rte_cryptodev_event_type event, const void *cb_fn),
> > + rte_trace_point_emit_u8(dev_id);
> > + rte_trace_point_emit_int(event);
> > + rte_trace_point_emit_ptr(cb_fn);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_callback_unregister,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id,
> > + enum rte_cryptodev_event_type event, const void *cb_fn),
> > + rte_trace_point_emit_u8(dev_id);
> > + rte_trace_point_emit_int(event);
> > + rte_trace_point_emit_ptr(cb_fn);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_device_count_by_driver,
> > + RTE_TRACE_POINT_ARGS(uint8_t driver_id, uint8_t dev_count),
> > + rte_trace_point_emit_u8(driver_id);
> > + rte_trace_point_emit_u8(dev_count);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_devices_get,
> > + RTE_TRACE_POINT_ARGS(const char *driver_name, uint8_t count),
> > + rte_trace_point_emit_string(driver_name);
> > + rte_trace_point_emit_u8(count);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_driver_id_get,
> > + RTE_TRACE_POINT_ARGS(const char *name),
> > + rte_trace_point_emit_string(name);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_driver_name_get,
> > + RTE_TRACE_POINT_ARGS(uint8_t driver_id, const char *name),
> > + rte_trace_point_emit_u8(driver_id);
> > + rte_trace_point_emit_string(name);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_get_aead_algo_enum,
> > + RTE_TRACE_POINT_ARGS(const char *algo_string),
> > + rte_trace_point_emit_string(algo_string);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_get_auth_algo_enum,
> > + RTE_TRACE_POINT_ARGS(const char *algo_string),
> > + rte_trace_point_emit_string(algo_string);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_get_cipher_algo_enum,
> > + RTE_TRACE_POINT_ARGS(const char *algo_string),
> > + rte_trace_point_emit_string(algo_string);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_get_dev_id,
> > + RTE_TRACE_POINT_ARGS(const char *name),
> > + rte_trace_point_emit_string(name);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_get_feature_name,
> > + RTE_TRACE_POINT_ARGS(uint64_t flag),
> > + rte_trace_point_emit_u64(flag);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_get_sec_ctx,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id),
> > + rte_trace_point_emit_u8(dev_id);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_info_get,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id),
> > + rte_trace_point_emit_u8(dev_id);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_is_valid_dev,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id),
> > + rte_trace_point_emit_u8(dev_id);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_name_get,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *name),
> > + rte_trace_point_emit_u8(dev_id);
> > + rte_trace_point_emit_string(name);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_queue_pair_count,
> > + RTE_TRACE_POINT_ARGS(const struct rte_cryptodev *dev),
> > + rte_trace_point_emit_ptr(dev);
> > + rte_trace_point_emit_string(dev->data->name);
> > + rte_trace_point_emit_u8(dev->data->socket_id);
> > + rte_trace_point_emit_u8(dev->data->dev_id);
> > + rte_trace_point_emit_u16(dev->data->nb_queue_pairs);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_socket_id,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *name, int
> socket_id),
> > + rte_trace_point_emit_u8(dev_id);
> > + rte_trace_point_emit_string(name);
> > + rte_trace_point_emit_int(socket_id);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_stats_get,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id,
> > + const struct rte_cryptodev_stats *stats),
> > + rte_trace_point_emit_u8(dev_id);
> > + rte_trace_point_emit_u64(stats->enqueued_count);
> > + rte_trace_point_emit_u64(stats->dequeued_count);
> > + rte_trace_point_emit_u64(stats->enqueue_err_count);
> > + rte_trace_point_emit_u64(stats->dequeue_err_count);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_stats_reset,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id),
> > + rte_trace_point_emit_u8(dev_id);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_sym_capability_check_aead,
> > + RTE_TRACE_POINT_ARGS(
> > + const struct rte_cryptodev_symmetric_capability *capability,
> > + uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
> > + uint16_t iv_size),
> > + rte_trace_point_emit_ptr(capability);
> > + rte_trace_point_emit_int(capability->xform_type);
> > + rte_trace_point_emit_u16(key_size);
> > + rte_trace_point_emit_u16(digest_size);
> > + rte_trace_point_emit_u16(aad_size);
> > + rte_trace_point_emit_u16(iv_size);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_sym_capability_check_auth,
> > + RTE_TRACE_POINT_ARGS(
> > + const struct rte_cryptodev_symmetric_capability *capability,
> > + uint16_t key_size, uint16_t digest_size, uint16_t iv_size),
> > + rte_trace_point_emit_ptr(capability);
> > + rte_trace_point_emit_int(capability->xform_type);
> > + rte_trace_point_emit_u16(key_size);
> > + rte_trace_point_emit_u16(digest_size);
> > + rte_trace_point_emit_u16(iv_size);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_sym_capability_check_cipher,
> > + RTE_TRACE_POINT_ARGS(
> > + const struct rte_cryptodev_symmetric_capability *capability,
> > + uint16_t key_size, uint16_t iv_size),
> > + rte_trace_point_emit_ptr(capability);
> > + rte_trace_point_emit_int(capability->xform_type);
> > + rte_trace_point_emit_u16(key_size);
> > + rte_trace_point_emit_u16(iv_size);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_sym_capability_get,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *driver_name,
> > + uint8_t driver_id, int idx_type),
> > + rte_trace_point_emit_u8(dev_id);
> > + rte_trace_point_emit_string(driver_name);
> > + rte_trace_point_emit_u8(driver_id);
> > + rte_trace_point_emit_int(idx_type);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_sym_get_private_session_size,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint32_t priv_sess_size),
> > + rte_trace_point_emit_u8(dev_id);
> > + rte_trace_point_emit_u32(priv_sess_size);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_asym_capability_get,
> > + RTE_TRACE_POINT_ARGS(const char *driver_name, uint8_t driver_id,
> > + int idx_type),
> > + rte_trace_point_emit_string(driver_name);
> > + rte_trace_point_emit_u8(driver_id);
> > + rte_trace_point_emit_int(idx_type);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_asym_get_private_session_size,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint32_t priv_sess_size),
> > + rte_trace_point_emit_u8(dev_id);
> > + rte_trace_point_emit_u32(priv_sess_size);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_asym_get_xform_enum,
> > + RTE_TRACE_POINT_ARGS(const char *xform_string),
> > + rte_trace_point_emit_string(xform_string);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_asym_xform_capability_check_modlen,
> > + RTE_TRACE_POINT_ARGS(const void *capability, uint16_t modlen),
> > + rte_trace_point_emit_ptr(capability);
> > + rte_trace_point_emit_u16(modlen);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_sym_cpu_crypto_process,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const void *sess),
> > + rte_trace_point_emit_u8(dev_id);
> > + rte_trace_point_emit_ptr(sess);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_sym_get_existing_header_session_size,
> > + RTE_TRACE_POINT_ARGS(struct rte_cryptodev_sym_session *sess),
> > + rte_trace_point_emit_ptr(sess);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_sym_session_get_user_data,
> > + RTE_TRACE_POINT_ARGS(const void *sess),
> > + rte_trace_point_emit_ptr(sess);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_sym_session_set_user_data,
> > + RTE_TRACE_POINT_ARGS(const void *sess, const void *data, uint16_t
> size),
> > + rte_trace_point_emit_ptr(sess);
> > + rte_trace_point_emit_ptr(data);
> > + rte_trace_point_emit_u16(size);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_get_qp_status,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t queue_pair_id),
> > + rte_trace_point_emit_u8(dev_id);
> > + rte_trace_point_emit_u16(queue_pair_id);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_configure_raw_dp_ctx,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, int
> sess_type),
> > + rte_trace_point_emit_u8(dev_id);
> > + rte_trace_point_emit_u16(qp_id);
> > + rte_trace_point_emit_int(sess_type);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_get_raw_dp_ctx_size,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id),
> > + rte_trace_point_emit_u8(dev_id);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_add_deq_callback,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void
> *cb_fn),
> > + rte_trace_point_emit_u8(dev_id);
> > + rte_trace_point_emit_u16(qp_id);
> > + rte_trace_point_emit_ptr(cb_fn);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_add_enq_callback,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void
> *cb_fn),
> > + rte_trace_point_emit_u8(dev_id);
> > + rte_trace_point_emit_u16(qp_id);
> > + rte_trace_point_emit_ptr(cb_fn);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_remove_deq_callback,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void
> *fn),
> > + rte_trace_point_emit_u8(dev_id);
> > + rte_trace_point_emit_u16(qp_id);
> > + rte_trace_point_emit_ptr(fn);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_remove_enq_callback,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void
> *fn),
> > + rte_trace_point_emit_u8(dev_id);
> > + rte_trace_point_emit_u16(qp_id);
> > + rte_trace_point_emit_ptr(fn);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_asym_session_get_user_data,
> > + RTE_TRACE_POINT_ARGS(const void *sess),
> > + rte_trace_point_emit_ptr(sess);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_asym_session_set_user_data,
> > + RTE_TRACE_POINT_ARGS(const void *sess, const void *data, uint16_t
> size),
> > + rte_trace_point_emit_ptr(sess);
> > + rte_trace_point_emit_ptr(data);
> > + rte_trace_point_emit_u16(size);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_session_event_mdata_set,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const void *sess, int
> op_type,
> > + int sess_type, const void *ev_mdata, uint16_t size),
> > + rte_trace_point_emit_u8(dev_id);
> > + rte_trace_point_emit_ptr(sess);
> > + rte_trace_point_emit_int(op_type);
> > + rte_trace_point_emit_int(sess_type);
> > + rte_trace_point_emit_ptr(ev_mdata);
> > + rte_trace_point_emit_u16(size);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_allocate_driver,
> > + RTE_TRACE_POINT_ARGS(const char *name),
> > + rte_trace_point_emit_string(name);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_pmd_allocate,
> > + RTE_TRACE_POINT_ARGS(const struct rte_cryptodev *cryptodev),
> > + rte_trace_point_emit_ptr(cryptodev);
> > + rte_trace_point_emit_string(cryptodev->data->name);
> > + rte_trace_point_emit_u8(cryptodev->data->socket_id);
> > + rte_trace_point_emit_u8(cryptodev->data->dev_id);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_pmd_callback_process,
> > + RTE_TRACE_POINT_ARGS(struct rte_cryptodev *dev,
> > + enum rte_cryptodev_event_type event),
> > + rte_trace_point_emit_ptr(dev);
> > + rte_trace_point_emit_string(dev->data->name);
> > + rte_trace_point_emit_u8(dev->data->socket_id);
> > + rte_trace_point_emit_u8(dev->data->dev_id);
> > + rte_trace_point_emit_int(event);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_pmd_create,
> > + RTE_TRACE_POINT_ARGS(const char *name, int socket_id,
> > + const void *cryptodev),
> > + rte_trace_point_emit_string(name);
> > + rte_trace_point_emit_int(socket_id);
> > + rte_trace_point_emit_ptr(cryptodev);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_pmd_create_dev_name,
> > + RTE_TRACE_POINT_ARGS(const char *dev_name_prefix),
> > + rte_trace_point_emit_string(dev_name_prefix);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_pmd_destroy,
> > + RTE_TRACE_POINT_ARGS(const struct rte_cryptodev *cryptodev),
> > + rte_trace_point_emit_ptr(cryptodev);
> > + rte_trace_point_emit_string(cryptodev->data->name);
> > + rte_trace_point_emit_u8(cryptodev->data->socket_id);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_pmd_get_dev,
> > + RTE_TRACE_POINT_ARGS(uint8_t dev_id),
> > + rte_trace_point_emit_u8(dev_id);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_pmd_get_named_dev,
> > + RTE_TRACE_POINT_ARGS(const char *name),
> > + rte_trace_point_emit_string(name);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_pmd_parse_input_args,
> > + RTE_TRACE_POINT_ARGS(char *name, int socket_id,
> > + uint32_t max_nb_queue_pairs),
> > + rte_trace_point_emit_string(name);
> > + rte_trace_point_emit_int(socket_id);
> > + rte_trace_point_emit_u32(max_nb_queue_pairs);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_pmd_probing_finish,
> > + RTE_TRACE_POINT_ARGS(const struct rte_cryptodev *cryptodev),
> > + rte_trace_point_emit_ptr(cryptodev);
> > + rte_trace_point_emit_string(cryptodev->data->name);
> > + rte_trace_point_emit_u8(cryptodev->data->socket_id);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_pmd_release_device,
> > + RTE_TRACE_POINT_ARGS(const struct rte_cryptodev *cryptodev),
> > + rte_trace_point_emit_ptr(cryptodev);
> > + rte_trace_point_emit_string(cryptodev->data->name);
> > + rte_trace_point_emit_u8(cryptodev->data->socket_id);
> > + rte_trace_point_emit_u8(cryptodev->data->dev_id);
> > +)
> > +
> > +RTE_TRACE_POINT(
> > + rte_cryptodev_trace_op_pool_create,
> > + RTE_TRACE_POINT_ARGS(const char *name, int socket_id, int type,
> > + uint32_t nb_elts, const void *mp),
> > + rte_trace_point_emit_string(name);
> > + rte_trace_point_emit_int(socket_id);
> > + rte_trace_point_emit_int(type);
> > + rte_trace_point_emit_u32(nb_elts);
> > + rte_trace_point_emit_ptr(mp);
> > +)
> > +
> > #ifdef __cplusplus
> > }
> > #endif
> > diff --git a/lib/cryptodev/rte_cryptodev_trace_fp.h
> > b/lib/cryptodev/rte_cryptodev_trace_fp.h
> > index 9218997c14..03f4503d34 100644
> > --- a/lib/cryptodev/rte_cryptodev_trace_fp.h
> > +++ b/lib/cryptodev/rte_cryptodev_trace_fp.h
> > @@ -31,6 +31,12 @@ RTE_TRACE_POINT_FP(
> > rte_trace_point_emit_u16(nb_ops);
> > )
> >
> > +RTE_TRACE_POINT_FP(
> > + rte_cryptodev_trace_session_event_mdata_get,
> > + RTE_TRACE_POINT_ARGS(uint8_t type),
> > + rte_trace_point_emit_u8(type);
> > +)
> > +
> > #ifdef __cplusplus
> > }
> > #endif
> > diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
> > index 5aee87c6f7..a788185229 100644
> > --- a/lib/cryptodev/version.map
> > +++ b/lib/cryptodev/version.map
> > @@ -109,6 +109,63 @@ EXPERIMENTAL {
> > #added in 22.07
> > rte_cryptodev_session_event_mdata_set;
> > rte_crypto_asym_ke_strings;
> > +
> > + #added in 22.11
> > + __rte_cryptodev_trace_add_deq_callback;
> > + __rte_cryptodev_trace_add_enq_callback;
> > + __rte_cryptodev_trace_allocate_driver;
> > + __rte_cryptodev_trace_asym_capability_get;
> > + __rte_cryptodev_trace_asym_get_private_session_size;
> > + __rte_cryptodev_trace_asym_get_xform_enum;
> > + __rte_cryptodev_trace_asym_session_get_user_data;
> > + __rte_cryptodev_trace_asym_session_set_user_data;
> > + __rte_cryptodev_trace_asym_xform_capability_check_modlen;
> > + __rte_cryptodev_trace_callback_register;
> > + __rte_cryptodev_trace_callback_unregister;
> > + __rte_cryptodev_trace_configure_raw_dp_ctx;
> > + __rte_cryptodev_trace_device_count_by_driver;
> > + __rte_cryptodev_trace_devices_get;
> > + __rte_cryptodev_trace_driver_id_get;
> > + __rte_cryptodev_trace_driver_name_get;
> > + __rte_cryptodev_trace_get_aead_algo_enum;
> > + __rte_cryptodev_trace_get_auth_algo_enum;
> > + __rte_cryptodev_trace_get_cipher_algo_enum;
> > + __rte_cryptodev_trace_get_dev_id;
> > + __rte_cryptodev_trace_get_feature_name;
> > + __rte_cryptodev_trace_get_qp_status;
> > + __rte_cryptodev_trace_get_raw_dp_ctx_size;
> > + __rte_cryptodev_trace_get_sec_ctx;
> > + __rte_cryptodev_trace_info_get;
> > + __rte_cryptodev_trace_is_valid_dev;
> > + __rte_cryptodev_trace_name_get;
> > + __rte_cryptodev_trace_op_pool_create;
> > + __rte_cryptodev_trace_pmd_allocate;
> > + __rte_cryptodev_trace_pmd_callback_process;
> > + __rte_cryptodev_trace_pmd_create;
> > + __rte_cryptodev_trace_pmd_create_dev_name;
> > + __rte_cryptodev_trace_pmd_destroy;
> > + __rte_cryptodev_trace_pmd_get_dev;
> > + __rte_cryptodev_trace_pmd_get_named_dev;
> > + __rte_cryptodev_trace_pmd_parse_input_args;
> > + __rte_cryptodev_trace_pmd_probing_finish;
> > + __rte_cryptodev_trace_pmd_release_device;
> > + __rte_cryptodev_trace_queue_pair_count;
> > + __rte_cryptodev_trace_remove_deq_callback;
> > + __rte_cryptodev_trace_remove_enq_callback;
> > + __rte_cryptodev_trace_session_event_mdata_get;
> > + __rte_cryptodev_trace_session_event_mdata_set;
> > + __rte_cryptodev_trace_socket_id;
> > + __rte_cryptodev_trace_stats_get;
> > + __rte_cryptodev_trace_stats_reset;
> > + __rte_cryptodev_trace_sym_capability_check_aead;
> > + __rte_cryptodev_trace_sym_capability_check_auth;
> > + __rte_cryptodev_trace_sym_capability_check_cipher;
> > + __rte_cryptodev_trace_sym_capability_get;
> > + __rte_cryptodev_trace_sym_cpu_crypto_process;
> > + __rte_cryptodev_trace_sym_get_existing_header_session_size;
> > + __rte_cryptodev_trace_sym_get_private_session_size;
> > + __rte_cryptodev_trace_sym_session_get_user_data;
> > + __rte_cryptodev_trace_sym_session_set_user_data;
> > };
> >
> > INTERNAL {
> > --
> > 2.25.1
> >
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2] cryptodev: add trace points
2022-09-16 17:32 [PATCH] cryptodev: add trace points Amit Prakash Shukla
2022-09-27 8:06 ` Akhil Goyal
2022-09-28 4:08 ` Jerin Jacob
@ 2022-09-29 12:35 ` Amit Prakash Shukla
2022-09-30 7:34 ` Jerin Jacob
2 siblings, 1 reply; 8+ messages in thread
From: Amit Prakash Shukla @ 2022-09-29 12:35 UTC (permalink / raw)
To: Akhil Goyal, Fan Zhang, Ray Kinsella
Cc: dev, jerinj, roy.fan.zhang, Amit Prakash Shukla
Add trace points for cryptodev functions.
Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
---
v2:
- Removed trace changes for non-public API
- Code changes to include API result in trace
lib/cryptodev/cryptodev_trace_points.c | 138 +++++++++
lib/cryptodev/rte_cryptodev.c | 319 +++++++++++++++-----
lib/cryptodev/rte_cryptodev_trace.h | 384 +++++++++++++++++++++++++
lib/cryptodev/version.map | 48 ++++
4 files changed, 818 insertions(+), 71 deletions(-)
diff --git a/lib/cryptodev/cryptodev_trace_points.c b/lib/cryptodev/cryptodev_trace_points.c
index c5bfe08b79..9f0ed904ea 100644
--- a/lib/cryptodev/cryptodev_trace_points.c
+++ b/lib/cryptodev/cryptodev_trace_points.c
@@ -50,3 +50,141 @@ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_enqueue_burst,
RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_dequeue_burst,
lib.cryptodev.deq.burst)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_callback_register,
+ lib.cryptodev.callback.register)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_callback_unregister,
+ lib.cryptodev.callback.unregister)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_device_count_by_driver,
+ lib.cryptodev.device.count.by.driver)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_devices_get,
+ lib.cryptodev.devices.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_driver_id_get,
+ lib.cryptodev.driver.id.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_driver_name_get,
+ lib.cryptodev.driver.name.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_aead_algo_enum,
+ lib.cryptodev.get.aead.algo.enum)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_auth_algo_enum,
+ lib.cryptodev.get.auth.algo.enum)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_cipher_algo_enum,
+ lib.cryptodev.get.cipher.algo.enum)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_dev_id,
+ lib.cryptodev.get.dev.id)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_feature_name,
+ lib.cryptodev.get.feature.name)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_sec_ctx,
+ lib.cryptodev.get.sec.ctx)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_info_get,
+ lib.cryptodev.info.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_is_valid_dev,
+ lib.cryptodev.is.valid.dev)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_name_get,
+ lib.cryptodev.name.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_queue_pair_count,
+ lib.cryptodev.queue.pair.count)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_socket_id,
+ lib.cryptodev.socket.id)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_stats_get,
+ lib.cryptodev.stats.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_stats_reset,
+ lib.cryptodev.stats.reset)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_check_aead,
+ lib.cryptodev.sym.capability.check.aead)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_check_auth,
+ lib.cryptodev.sym.capability.check.auth)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_check_cipher,
+ lib.cryptodev.sym.capability.check.cipher)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_get,
+ lib.cryptodev.sym.capability.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_get_private_session_size,
+ lib.cryptodev.sym.get.private.session.size)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_capability_get,
+ lib.cryptodev.asym.capability.get)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_get_private_session_size,
+ lib.cryptodev.asym.get.private.session.size)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_get_xform_enum,
+ lib.cryptodev.asym.get.xform.enum)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_xform_capability_check_modlen,
+ lib.cryptodev.asym.xform.capability.check.modlen)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_xform_capability_check_optype,
+ lib.cryptodev.asym.xform.capability.check.optype)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_cpu_crypto_process,
+ lib.cryptodev.sym.cpu.crypto.process)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_get_existing_header_session_size,
+ lib.cryptodev.sym.get.existing.header.session.size)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_get_user_data,
+ lib.cryptodev.sym.session.get.user.data)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_set_user_data,
+ lib.cryptodev.sym.session.set.user.data)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_qp_status,
+ lib.cryptodev.get.qp.status)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_configure_raw_dp_ctx,
+ lib.cryptodev.configure.raw.dp.ctx)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_raw_dp_ctx_size,
+ lib.cryptodev.get.raw.dp.ctx.size)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_add_deq_callback,
+ lib.cryptodev.add.deq.callback)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_add_enq_callback,
+ lib.cryptodev.add.enq.callback)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_remove_deq_callback,
+ lib.cryptodev.remove.deq.callback)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_remove_enq_callback,
+ lib.cryptodev.remove.enq.callback)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_get_user_data,
+ lib.cryptodev.asym.session.get.user.data)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_set_user_data,
+ lib.cryptodev.asym.session.set.user.data)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_session_event_mdata_set,
+ lib.cryptodev.session.event.mdata.set)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_allocate_driver,
+ lib.cryptodev.allocate.driver)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_op_pool_create,
+ lib.cryptodev.op.pool.create)
+
+RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_count,
+ lib.cryptodev.count)
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 5e25e607fa..7c0fb59e29 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -224,16 +224,19 @@ rte_cryptodev_get_cipher_algo_enum(enum rte_crypto_cipher_algorithm *algo_enum,
const char *algo_string)
{
unsigned int i;
+ int ret = -1; /* Invalid string */
for (i = 1; i < RTE_DIM(rte_crypto_cipher_algorithm_strings); i++) {
if (strcmp(algo_string, rte_crypto_cipher_algorithm_strings[i]) == 0) {
*algo_enum = (enum rte_crypto_cipher_algorithm) i;
- return 0;
+ ret = 0;
+ break;
}
}
- /* Invalid string */
- return -1;
+ rte_cryptodev_trace_get_cipher_algo_enum(algo_string, *algo_enum, ret);
+
+ return ret;
}
int
@@ -241,16 +244,19 @@ rte_cryptodev_get_auth_algo_enum(enum rte_crypto_auth_algorithm *algo_enum,
const char *algo_string)
{
unsigned int i;
+ int ret = -1; /* Invalid string */
for (i = 1; i < RTE_DIM(rte_crypto_auth_algorithm_strings); i++) {
if (strcmp(algo_string, rte_crypto_auth_algorithm_strings[i]) == 0) {
*algo_enum = (enum rte_crypto_auth_algorithm) i;
- return 0;
+ ret = 0;
+ break;
}
}
- /* Invalid string */
- return -1;
+ rte_cryptodev_trace_get_auth_algo_enum(algo_string, *algo_enum, ret);
+
+ return ret;
}
int
@@ -258,16 +264,19 @@ rte_cryptodev_get_aead_algo_enum(enum rte_crypto_aead_algorithm *algo_enum,
const char *algo_string)
{
unsigned int i;
+ int ret = -1; /* Invalid string */
for (i = 1; i < RTE_DIM(rte_crypto_aead_algorithm_strings); i++) {
if (strcmp(algo_string, rte_crypto_aead_algorithm_strings[i]) == 0) {
*algo_enum = (enum rte_crypto_aead_algorithm) i;
- return 0;
+ ret = 0;
+ break;
}
}
- /* Invalid string */
- return -1;
+ rte_cryptodev_trace_get_aead_algo_enum(algo_string, *algo_enum, ret);
+
+ return ret;
}
int
@@ -275,17 +284,20 @@ rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum,
const char *xform_string)
{
unsigned int i;
+ int ret = -1; /* Invalid string */
for (i = 1; i < RTE_DIM(rte_crypto_asym_xform_strings); i++) {
if (strcmp(xform_string,
rte_crypto_asym_xform_strings[i]) == 0) {
*xform_enum = (enum rte_crypto_asym_xform_type) i;
- return 0;
+ ret = 0;
+ break;
}
}
- /* Invalid string */
- return -1;
+ rte_cryptodev_trace_asym_get_xform_enum(xform_string, *xform_enum, ret);
+
+ return ret;
}
/**
@@ -303,6 +315,7 @@ rte_cryptodev_sym_capability_get(uint8_t dev_id,
const struct rte_cryptodev_sym_capability_idx *idx)
{
const struct rte_cryptodev_capabilities *capability;
+ const struct rte_cryptodev_symmetric_capability *sym_capability = NULL;
struct rte_cryptodev_info dev_info;
int i = 0;
@@ -317,19 +330,28 @@ rte_cryptodev_sym_capability_get(uint8_t dev_id,
continue;
if (idx->type == RTE_CRYPTO_SYM_XFORM_AUTH &&
- capability->sym.auth.algo == idx->algo.auth)
- return &capability->sym;
+ capability->sym.auth.algo == idx->algo.auth) {
+ sym_capability = &capability->sym;
+ break;
+ }
if (idx->type == RTE_CRYPTO_SYM_XFORM_CIPHER &&
- capability->sym.cipher.algo == idx->algo.cipher)
- return &capability->sym;
+ capability->sym.cipher.algo == idx->algo.cipher) {
+ sym_capability = &capability->sym;
+ break;
+ }
if (idx->type == RTE_CRYPTO_SYM_XFORM_AEAD &&
- capability->sym.aead.algo == idx->algo.aead)
- return &capability->sym;
+ capability->sym.aead.algo == idx->algo.aead) {
+ sym_capability = &capability->sym;
+ break;
+ }
}
- return NULL;
+ rte_cryptodev_trace_sym_capability_get(dev_id, dev_info.driver_name,
+ dev_info.driver_id, idx->type, sym_capability);
+
+ return sym_capability;
}
static int
@@ -362,6 +384,7 @@ rte_cryptodev_asym_capability_get(uint8_t dev_id,
const struct rte_cryptodev_asym_capability_idx *idx)
{
const struct rte_cryptodev_capabilities *capability;
+ const struct rte_cryptodev_asymmetric_xform_capability *asym_cap = NULL;
struct rte_cryptodev_info dev_info;
unsigned int i = 0;
@@ -373,10 +396,16 @@ rte_cryptodev_asym_capability_get(uint8_t dev_id,
if (capability->op != RTE_CRYPTO_OP_TYPE_ASYMMETRIC)
continue;
- if (capability->asym.xform_capa.xform_type == idx->type)
- return &capability->asym.xform_capa;
+ if (capability->asym.xform_capa.xform_type == idx->type) {
+ asym_cap = &capability->asym.xform_capa;
+ break;
+ }
}
- return NULL;
+
+ rte_cryptodev_trace_asym_capability_get(dev_info.driver_name,
+ dev_info.driver_id, idx->type, asym_cap);
+
+ return asym_cap;
};
int
@@ -384,13 +413,21 @@ rte_cryptodev_sym_capability_check_cipher(
const struct rte_cryptodev_symmetric_capability *capability,
uint16_t key_size, uint16_t iv_size)
{
- if (param_range_check(key_size, &capability->cipher.key_size) != 0)
- return -1;
+ int ret = 0; /* success */
+
+ if (param_range_check(key_size, &capability->cipher.key_size) != 0) {
+ ret = -1;
+ goto done;
+ }
if (param_range_check(iv_size, &capability->cipher.iv_size) != 0)
- return -1;
+ ret = -1;
- return 0;
+done:
+ rte_cryptodev_trace_sym_capability_check_cipher(capability, key_size,
+ iv_size, ret);
+
+ return ret;
}
int
@@ -398,16 +435,27 @@ rte_cryptodev_sym_capability_check_auth(
const struct rte_cryptodev_symmetric_capability *capability,
uint16_t key_size, uint16_t digest_size, uint16_t iv_size)
{
- if (param_range_check(key_size, &capability->auth.key_size) != 0)
- return -1;
+ int ret = 0; /* success */
- if (param_range_check(digest_size, &capability->auth.digest_size) != 0)
- return -1;
+ if (param_range_check(key_size, &capability->auth.key_size) != 0) {
+ ret = -1;
+ goto done;
+ }
+
+ if (param_range_check(digest_size,
+ &capability->auth.digest_size) != 0) {
+ ret = -1;
+ goto done;
+ }
if (param_range_check(iv_size, &capability->auth.iv_size) != 0)
- return -1;
+ ret = -1;
- return 0;
+done:
+ rte_cryptodev_trace_sym_capability_check_auth(capability, key_size,
+ digest_size, iv_size, ret);
+
+ return ret;
}
int
@@ -416,29 +464,48 @@ rte_cryptodev_sym_capability_check_aead(
uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
uint16_t iv_size)
{
- if (param_range_check(key_size, &capability->aead.key_size) != 0)
- return -1;
+ int ret = 0; /* success */
- if (param_range_check(digest_size, &capability->aead.digest_size) != 0)
- return -1;
+ if (param_range_check(key_size, &capability->aead.key_size) != 0) {
+ ret = -1;
+ goto done;
+ }
- if (param_range_check(aad_size, &capability->aead.aad_size) != 0)
- return -1;
+ if (param_range_check(digest_size,
+ &capability->aead.digest_size) != 0) {
+ ret = -1;
+ goto done;
+ }
+
+ if (param_range_check(aad_size, &capability->aead.aad_size) != 0) {
+ ret = -1;
+ goto done;
+ }
if (param_range_check(iv_size, &capability->aead.iv_size) != 0)
- return -1;
+ ret = -1;
- return 0;
+done:
+ rte_cryptodev_trace_sym_capability_check_aead(capability, key_size,
+ digest_size, aad_size, iv_size, ret);
+
+ return ret;
}
+
int
rte_cryptodev_asym_xform_capability_check_optype(
const struct rte_cryptodev_asymmetric_xform_capability *capability,
enum rte_crypto_asym_op_type op_type)
{
+ int ret = 0;
+
if (capability->op_types & (1 << op_type))
- return 1;
+ ret = 1;
- return 0;
+ rte_cryptodev_trace_asym_xform_capability_check_optype(
+ capability->op_types, op_type, ret);
+
+ return ret;
}
int
@@ -446,24 +513,34 @@ rte_cryptodev_asym_xform_capability_check_modlen(
const struct rte_cryptodev_asymmetric_xform_capability *capability,
uint16_t modlen)
{
+ int ret = 0; /* success */
+
/* no need to check for limits, if min or max = 0 */
if (capability->modlen.min != 0) {
- if (modlen < capability->modlen.min)
- return -1;
+ if (modlen < capability->modlen.min) {
+ ret = -1;
+ goto done;
+ }
}
if (capability->modlen.max != 0) {
- if (modlen > capability->modlen.max)
- return -1;
+ if (modlen > capability->modlen.max) {
+ ret = -1;
+ goto done;
+ }
}
/* in any case, check if given modlen is module increment */
if (capability->modlen.increment != 0) {
if (modlen % (capability->modlen.increment))
- return -1;
+ ret = -1;
}
- return 0;
+done:
+ rte_cryptodev_trace_asym_xform_capability_check_modlen(capability,
+ modlen, ret);
+
+ return ret;
}
/* spinlock for crypto device enq callbacks */
@@ -586,6 +663,8 @@ cryptodev_cb_init(struct rte_cryptodev *dev)
const char *
rte_cryptodev_get_feature_name(uint64_t flag)
{
+ rte_cryptodev_trace_get_feature_name(flag);
+
switch (flag) {
case RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO:
return "SYMMETRIC_CRYPTO";
@@ -684,22 +763,28 @@ unsigned int
rte_cryptodev_is_valid_dev(uint8_t dev_id)
{
struct rte_cryptodev *dev = NULL;
+ unsigned int ret = 1;
- if (!rte_cryptodev_is_valid_device_data(dev_id))
- return 0;
+ if (!rte_cryptodev_is_valid_device_data(dev_id)) {
+ ret = 0;
+ goto done;
+ }
dev = rte_cryptodev_pmd_get_dev(dev_id);
if (dev->attached != RTE_CRYPTODEV_ATTACHED)
- return 0;
- else
- return 1;
-}
+ ret = 0;
+done:
+ rte_cryptodev_trace_is_valid_dev(dev_id, ret);
+
+ return ret;
+}
int
rte_cryptodev_get_dev_id(const char *name)
{
unsigned i;
+ int ret = -1;
if (name == NULL)
return -1;
@@ -710,16 +795,22 @@ rte_cryptodev_get_dev_id(const char *name)
if ((strcmp(cryptodev_globals.devs[i].data->name, name)
== 0) &&
(cryptodev_globals.devs[i].attached ==
- RTE_CRYPTODEV_ATTACHED))
- return i;
+ RTE_CRYPTODEV_ATTACHED)) {
+ ret = (int)i;
+ break;
+ }
}
- return -1;
+ rte_cryptodev_trace_get_dev_id(name, ret);
+
+ return ret;
}
uint8_t
rte_cryptodev_count(void)
{
+ rte_cryptodev_trace_count(cryptodev_globals.nb_devs);
+
return cryptodev_globals.nb_devs;
}
@@ -734,6 +825,8 @@ rte_cryptodev_device_count_by_driver(uint8_t driver_id)
RTE_CRYPTODEV_ATTACHED)
dev_count++;
+ rte_cryptodev_trace_device_count_by_driver(driver_id, dev_count);
+
return dev_count;
}
@@ -760,18 +853,24 @@ rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices,
}
}
+ rte_cryptodev_trace_devices_get(driver_name, count);
+
return count;
}
void *
rte_cryptodev_get_sec_ctx(uint8_t dev_id)
{
+ void *sec_ctx = NULL;
+
if (dev_id < RTE_CRYPTO_MAX_DEVS &&
(rte_crypto_devices[dev_id].feature_flags &
RTE_CRYPTODEV_FF_SECURITY))
- return rte_crypto_devices[dev_id].security_ctx;
+ sec_ctx = rte_crypto_devices[dev_id].security_ctx;
- return NULL;
+ rte_cryptodev_trace_get_sec_ctx(dev_id, sec_ctx);
+
+ return sec_ctx;
}
int
@@ -784,6 +883,8 @@ rte_cryptodev_socket_id(uint8_t dev_id)
dev = rte_cryptodev_pmd_get_dev(dev_id);
+ rte_cryptodev_trace_socket_id(dev_id, dev->data->name,
+ dev->data->socket_id);
return dev->data->socket_id;
}
@@ -965,6 +1066,10 @@ rte_cryptodev_queue_pair_count(uint8_t dev_id)
}
dev = &rte_crypto_devices[dev_id];
+ rte_cryptodev_trace_queue_pair_count(dev, dev->data->name,
+ dev->data->socket_id, dev->data->dev_id,
+ dev->data->nb_queue_pairs);
+
return dev->data->nb_queue_pairs;
}
@@ -1191,29 +1296,36 @@ int
rte_cryptodev_get_qp_status(uint8_t dev_id, uint16_t queue_pair_id)
{
struct rte_cryptodev *dev;
+ int ret = 0;
if (!rte_cryptodev_is_valid_dev(dev_id)) {
CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
- return -EINVAL;
+ ret = -EINVAL;
+ goto done;
}
dev = &rte_crypto_devices[dev_id];
if (queue_pair_id >= dev->data->nb_queue_pairs) {
CDEV_LOG_ERR("Invalid queue_pair_id=%d", queue_pair_id);
- return -EINVAL;
+ ret = -EINVAL;
+ goto done;
}
void **qps = dev->data->queue_pairs;
if (qps[queue_pair_id]) {
CDEV_LOG_DEBUG("qp %d on dev %d is initialised",
queue_pair_id, dev_id);
- return 1;
+ ret = 1;
+ goto done;
}
CDEV_LOG_DEBUG("qp %d on dev %d is not initialised",
queue_pair_id, dev_id);
- return 0;
+done:
+ rte_cryptodev_trace_get_qp_status(dev_id, queue_pair_id, ret);
+
+ return ret;
}
int
@@ -1346,6 +1458,7 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
rte_spinlock_unlock(&rte_cryptodev_callback_lock);
+ rte_cryptodev_trace_add_enq_callback(dev_id, qp_id, cb_fn);
return cb;
}
@@ -1371,6 +1484,8 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_id,
return -ENODEV;
}
+ rte_cryptodev_trace_remove_enq_callback(dev_id, qp_id, cb->fn);
+
dev = &rte_crypto_devices[dev_id];
if (qp_id >= dev->data->nb_queue_pairs) {
CDEV_LOG_ERR("Invalid queue_pair_id=%d", qp_id);
@@ -1481,6 +1596,8 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
rte_spinlock_unlock(&rte_cryptodev_callback_lock);
+ rte_cryptodev_trace_add_deq_callback(dev_id, qp_id, cb_fn);
+
return cb;
}
@@ -1506,6 +1623,8 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_id,
return -ENODEV;
}
+ rte_cryptodev_trace_remove_deq_callback(dev_id, qp_id, cb->fn);
+
dev = &rte_crypto_devices[dev_id];
if (qp_id >= dev->data->nb_queue_pairs) {
CDEV_LOG_ERR("Invalid queue_pair_id=%d", qp_id);
@@ -1575,6 +1694,8 @@ rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats)
if (*dev->dev_ops->stats_get == NULL)
return -ENOTSUP;
(*dev->dev_ops->stats_get)(dev, stats);
+
+ rte_cryptodev_trace_stats_get(dev_id, stats);
return 0;
}
@@ -1583,6 +1704,8 @@ rte_cryptodev_stats_reset(uint8_t dev_id)
{
struct rte_cryptodev *dev;
+ rte_cryptodev_trace_stats_reset(dev_id);
+
if (!rte_cryptodev_is_valid_dev(dev_id)) {
CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
return;
@@ -1615,6 +1738,9 @@ rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info)
dev_info->driver_name = dev->device->driver->name;
dev_info->device = dev->device;
+
+ rte_cryptodev_trace_info_get(dev_id, dev_info->driver_name);
+
}
int
@@ -1657,6 +1783,8 @@ rte_cryptodev_callback_register(uint8_t dev_id,
}
rte_spinlock_unlock(&rte_cryptodev_cb_lock);
+
+ rte_cryptodev_trace_callback_register(dev_id, event, cb_fn);
return (user_cb == NULL) ? -ENOMEM : 0;
}
@@ -1703,6 +1831,8 @@ rte_cryptodev_callback_unregister(uint8_t dev_id,
}
rte_spinlock_unlock(&rte_cryptodev_cb_lock);
+
+ rte_cryptodev_trace_callback_unregister(dev_id, event, cb_fn);
return ret;
}
@@ -2139,6 +2269,9 @@ rte_cryptodev_sym_get_private_session_size(uint8_t dev_id)
priv_sess_size = (*dev->dev_ops->sym_session_get_size)(dev);
+ rte_cryptodev_trace_sym_get_private_session_size(dev_id,
+ priv_sess_size);
+
return priv_sess_size;
}
@@ -2158,6 +2291,9 @@ rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
priv_sess_size = (*dev->dev_ops->asym_session_get_size)(dev);
+ rte_cryptodev_trace_asym_get_private_session_size(dev_id,
+ priv_sess_size);
+
return priv_sess_size;
}
@@ -2174,6 +2310,9 @@ rte_cryptodev_sym_session_set_user_data(
return -ENOMEM;
rte_memcpy(sess->sess_data + sess->nb_drivers, data, size);
+
+ rte_cryptodev_trace_sym_session_set_user_data(sess, data, size);
+
return 0;
}
@@ -2181,10 +2320,16 @@ void *
rte_cryptodev_sym_session_get_user_data(
struct rte_cryptodev_sym_session *sess)
{
+ void *data = NULL;
+
if (sess == NULL || sess->user_data_sz == 0)
return NULL;
- return (void *)(sess->sess_data + sess->nb_drivers);
+ data = (void *)(sess->sess_data + sess->nb_drivers);
+
+ rte_cryptodev_trace_sym_session_get_user_data(sess, data);
+
+ return data;
}
int
@@ -2200,6 +2345,9 @@ rte_cryptodev_asym_session_set_user_data(void *session, void *data, uint16_t siz
rte_memcpy(sess->sess_private_data +
sess->max_priv_data_sz,
data, size);
+
+ rte_cryptodev_trace_asym_session_set_user_data(sess, data, size);
+
return 0;
}
@@ -2207,11 +2355,16 @@ void *
rte_cryptodev_asym_session_get_user_data(void *session)
{
struct rte_cryptodev_asym_session *sess = session;
+ void *data = NULL;
+
if (sess == NULL || sess->user_data_sz == 0)
return NULL;
- return (void *)(sess->sess_private_data +
- sess->max_priv_data_sz);
+ data = (void *)(sess->sess_private_data + sess->max_priv_data_sz);
+
+ rte_cryptodev_trace_asym_session_get_user_data(sess, data);
+
+ return data;
}
static inline void
@@ -2242,6 +2395,8 @@ rte_cryptodev_sym_cpu_crypto_process(uint8_t dev_id,
return 0;
}
+ rte_cryptodev_trace_sym_cpu_crypto_process(dev_id, sess);
+
return dev->dev_ops->sym_cpu_process(dev, sess, ofs, vec);
}
@@ -2266,6 +2421,8 @@ rte_cryptodev_get_raw_dp_ctx_size(uint8_t dev_id)
if (priv_size < 0)
return -ENOTSUP;
+ rte_cryptodev_trace_get_raw_dp_ctx_size(dev_id);
+
return RTE_ALIGN_CEIL((size + priv_size), 8);
}
@@ -2286,6 +2443,8 @@ rte_cryptodev_configure_raw_dp_ctx(uint8_t dev_id, uint16_t qp_id,
|| dev->dev_ops->sym_configure_raw_dp_ctx == NULL)
return -ENOTSUP;
+ rte_cryptodev_trace_configure_raw_dp_ctx(dev_id, qp_id, sess_type);
+
return (*dev->dev_ops->sym_configure_raw_dp_ctx)(dev, qp_id, ctx,
sess_type, session_ctx, is_update);
}
@@ -2309,6 +2468,9 @@ rte_cryptodev_session_event_mdata_set(uint8_t dev_id, void *sess,
if (dev->dev_ops->session_ev_mdata_set == NULL)
goto skip_pmd_op;
+ rte_cryptodev_trace_session_event_mdata_set(dev_id, sess, op_type,
+ sess_type, ev_mdata, size);
+
return (*dev->dev_ops->session_ev_mdata_set)(dev, sess, op_type,
sess_type, ev_mdata);
@@ -2451,6 +2613,7 @@ rte_crypto_op_pool_create(const char *name, enum rte_crypto_op_type type,
priv->priv_size = priv_size;
priv->type = type;
+ rte_cryptodev_trace_op_pool_create(name, socket_id, type, nb_elts, mp);
return mp;
}
@@ -2488,6 +2651,7 @@ rte_cryptodev_driver_id_get(const char *name)
{
struct cryptodev_driver *driver;
const char *driver_name;
+ int driver_id = -1;
if (name == NULL) {
RTE_LOG(DEBUG, CRYPTODEV, "name pointer NULL");
@@ -2496,10 +2660,15 @@ rte_cryptodev_driver_id_get(const char *name)
TAILQ_FOREACH(driver, &cryptodev_driver_list, next) {
driver_name = driver->driver->name;
- if (strncmp(driver_name, name, strlen(driver_name) + 1) == 0)
- return driver->id;
+ if (strncmp(driver_name, name, strlen(driver_name) + 1) == 0) {
+ driver_id = driver->id;
+ break;
+ }
}
- return -1;
+
+ rte_cryptodev_trace_driver_id_get(name, driver_id);
+
+ return driver_id;
}
const char *
@@ -2516,6 +2685,8 @@ rte_cryptodev_name_get(uint8_t dev_id)
if (dev == NULL)
return NULL;
+ rte_cryptodev_trace_name_get(dev_id, dev->data->name);
+
return dev->data->name;
}
@@ -2524,9 +2695,13 @@ rte_cryptodev_driver_name_get(uint8_t driver_id)
{
struct cryptodev_driver *driver;
- TAILQ_FOREACH(driver, &cryptodev_driver_list, next)
- if (driver->id == driver_id)
+ TAILQ_FOREACH(driver, &cryptodev_driver_list, next) {
+ if (driver->id == driver_id) {
+ rte_cryptodev_trace_driver_name_get(driver_id,
+ driver->driver->name);
return driver->driver->name;
+ }
+ }
return NULL;
}
@@ -2539,6 +2714,8 @@ rte_cryptodev_allocate_driver(struct cryptodev_driver *crypto_drv,
TAILQ_INSERT_TAIL(&cryptodev_driver_list, crypto_drv, next);
+ rte_cryptodev_trace_allocate_driver(drv->name);
+
return nb_drivers++;
}
diff --git a/lib/cryptodev/rte_cryptodev_trace.h b/lib/cryptodev/rte_cryptodev_trace.h
index a3f6048e7d..3d9b00145e 100644
--- a/lib/cryptodev/rte_cryptodev_trace.h
+++ b/lib/cryptodev/rte_cryptodev_trace.h
@@ -138,6 +138,390 @@ RTE_TRACE_POINT(
rte_trace_point_emit_ptr(sess);
)
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_callback_register,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id,
+ enum rte_cryptodev_event_type event, const void *cb_fn),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_int(event);
+ rte_trace_point_emit_ptr(cb_fn);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_callback_unregister,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id,
+ enum rte_cryptodev_event_type event, const void *cb_fn),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_int(event);
+ rte_trace_point_emit_ptr(cb_fn);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_device_count_by_driver,
+ RTE_TRACE_POINT_ARGS(uint8_t driver_id, uint8_t dev_count),
+ rte_trace_point_emit_u8(driver_id);
+ rte_trace_point_emit_u8(dev_count);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_devices_get,
+ RTE_TRACE_POINT_ARGS(const char *driver_name, uint8_t count),
+ rte_trace_point_emit_string(driver_name);
+ rte_trace_point_emit_u8(count);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_driver_id_get,
+ RTE_TRACE_POINT_ARGS(const char *name, int driver_id),
+ rte_trace_point_emit_string(name);
+ rte_trace_point_emit_int(driver_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_driver_name_get,
+ RTE_TRACE_POINT_ARGS(uint8_t driver_id, const char *name),
+ rte_trace_point_emit_u8(driver_id);
+ rte_trace_point_emit_string(name);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_get_aead_algo_enum,
+ RTE_TRACE_POINT_ARGS(const char *algo_string,
+ enum rte_crypto_aead_algorithm algo_enum, int ret),
+ rte_trace_point_emit_string(algo_string);
+ rte_trace_point_emit_int(algo_enum);
+ rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_get_auth_algo_enum,
+ RTE_TRACE_POINT_ARGS(const char *algo_string,
+ enum rte_crypto_auth_algorithm algo_enum, int ret),
+ rte_trace_point_emit_string(algo_string);
+ rte_trace_point_emit_int(algo_enum);
+ rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_get_cipher_algo_enum,
+ RTE_TRACE_POINT_ARGS(const char *algo_string,
+ enum rte_crypto_cipher_algorithm algo_enum, int ret),
+ rte_trace_point_emit_string(algo_string);
+ rte_trace_point_emit_int(algo_enum);
+ rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_get_dev_id,
+ RTE_TRACE_POINT_ARGS(const char *name, int ret),
+ rte_trace_point_emit_string(name);
+ rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_get_feature_name,
+ RTE_TRACE_POINT_ARGS(uint64_t flag),
+ rte_trace_point_emit_u64(flag);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_get_sec_ctx,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, const void *sec_ctx),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_ptr(sec_ctx);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_info_get,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *driver_name),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_string(driver_name);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_is_valid_dev,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, unsigned int ret),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u32(ret);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_name_get,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *name),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_string(name);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_queue_pair_count,
+ RTE_TRACE_POINT_ARGS(const void *dev, const char *name,
+ uint8_t socket_id, uint8_t dev_id, uint16_t nb_queue_pairs),
+ rte_trace_point_emit_ptr(dev);
+ rte_trace_point_emit_string(name);
+ rte_trace_point_emit_u8(socket_id);
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(nb_queue_pairs);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_socket_id,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *name, int socket_id),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_string(name);
+ rte_trace_point_emit_int(socket_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_stats_get,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id,
+ const struct rte_cryptodev_stats *stats),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u64(stats->enqueued_count);
+ rte_trace_point_emit_u64(stats->dequeued_count);
+ rte_trace_point_emit_u64(stats->enqueue_err_count);
+ rte_trace_point_emit_u64(stats->dequeue_err_count);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_stats_reset,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+ rte_trace_point_emit_u8(dev_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_capability_check_aead,
+ RTE_TRACE_POINT_ARGS(
+ const struct rte_cryptodev_symmetric_capability *capability,
+ uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
+ uint16_t iv_size, int ret),
+ rte_trace_point_emit_ptr(capability);
+ rte_trace_point_emit_int(capability->xform_type);
+ rte_trace_point_emit_u16(key_size);
+ rte_trace_point_emit_u16(digest_size);
+ rte_trace_point_emit_u16(aad_size);
+ rte_trace_point_emit_u16(iv_size);
+ rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_capability_check_auth,
+ RTE_TRACE_POINT_ARGS(
+ const struct rte_cryptodev_symmetric_capability *capability,
+ uint16_t key_size, uint16_t digest_size, uint16_t iv_size,
+ int ret),
+ rte_trace_point_emit_ptr(capability);
+ rte_trace_point_emit_int(capability->xform_type);
+ rte_trace_point_emit_u16(key_size);
+ rte_trace_point_emit_u16(digest_size);
+ rte_trace_point_emit_u16(iv_size);
+ rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_capability_check_cipher,
+ RTE_TRACE_POINT_ARGS(
+ const struct rte_cryptodev_symmetric_capability *capability,
+ uint16_t key_size, uint16_t iv_size, int ret),
+ rte_trace_point_emit_ptr(capability);
+ rte_trace_point_emit_int(capability->xform_type);
+ rte_trace_point_emit_u16(key_size);
+ rte_trace_point_emit_u16(iv_size);
+ rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_capability_get,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *driver_name,
+ uint8_t driver_id, int idx_type, const void *sym_capability),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_string(driver_name);
+ rte_trace_point_emit_u8(driver_id);
+ rte_trace_point_emit_int(idx_type);
+ rte_trace_point_emit_ptr(sym_capability);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_get_private_session_size,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint32_t priv_sess_size),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u32(priv_sess_size);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_capability_get,
+ RTE_TRACE_POINT_ARGS(const char *driver_name, uint8_t driver_id,
+ int idx_type, const void *asym_cap),
+ rte_trace_point_emit_string(driver_name);
+ rte_trace_point_emit_u8(driver_id);
+ rte_trace_point_emit_int(idx_type);
+ rte_trace_point_emit_ptr(asym_cap);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_get_private_session_size,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint32_t priv_sess_size),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u32(priv_sess_size);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_get_xform_enum,
+ RTE_TRACE_POINT_ARGS(const char *xform_string,
+ enum rte_crypto_asym_xform_type xform_enum, int ret),
+ rte_trace_point_emit_string(xform_string);
+ rte_trace_point_emit_int(xform_enum);
+ rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_xform_capability_check_modlen,
+ RTE_TRACE_POINT_ARGS(const void *capability, uint16_t modlen, int ret),
+ rte_trace_point_emit_ptr(capability);
+ rte_trace_point_emit_u16(modlen);
+ rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_cpu_crypto_process,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, const void *sess),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_ptr(sess);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_get_existing_header_session_size,
+ RTE_TRACE_POINT_ARGS(struct rte_cryptodev_sym_session *sess),
+ rte_trace_point_emit_ptr(sess);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_session_get_user_data,
+ RTE_TRACE_POINT_ARGS(const void *sess, const void *data),
+ rte_trace_point_emit_ptr(sess);
+ rte_trace_point_emit_ptr(data);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_sym_session_set_user_data,
+ RTE_TRACE_POINT_ARGS(const void *sess, const void *data, uint16_t size),
+ rte_trace_point_emit_ptr(sess);
+ rte_trace_point_emit_ptr(data);
+ rte_trace_point_emit_u16(size);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_get_qp_status,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t queue_pair_id, int ret),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(queue_pair_id);
+ rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_configure_raw_dp_ctx,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, int sess_type),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(qp_id);
+ rte_trace_point_emit_int(sess_type);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_get_raw_dp_ctx_size,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id),
+ rte_trace_point_emit_u8(dev_id);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_add_deq_callback,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void *cb_fn),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(qp_id);
+ rte_trace_point_emit_ptr(cb_fn);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_add_enq_callback,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void *cb_fn),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(qp_id);
+ rte_trace_point_emit_ptr(cb_fn);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_remove_deq_callback,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void *fn),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(qp_id);
+ rte_trace_point_emit_ptr(fn);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_remove_enq_callback,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void *fn),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_u16(qp_id);
+ rte_trace_point_emit_ptr(fn);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_session_get_user_data,
+ RTE_TRACE_POINT_ARGS(const void *sess, const void *data),
+ rte_trace_point_emit_ptr(sess);
+ rte_trace_point_emit_ptr(data);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_session_set_user_data,
+ RTE_TRACE_POINT_ARGS(const void *sess, const void *data, uint16_t size),
+ rte_trace_point_emit_ptr(sess);
+ rte_trace_point_emit_ptr(data);
+ rte_trace_point_emit_u16(size);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_session_event_mdata_set,
+ RTE_TRACE_POINT_ARGS(uint8_t dev_id, const void *sess, int op_type,
+ int sess_type, const void *ev_mdata, uint16_t size),
+ rte_trace_point_emit_u8(dev_id);
+ rte_trace_point_emit_ptr(sess);
+ rte_trace_point_emit_int(op_type);
+ rte_trace_point_emit_int(sess_type);
+ rte_trace_point_emit_ptr(ev_mdata);
+ rte_trace_point_emit_u16(size);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_allocate_driver,
+ RTE_TRACE_POINT_ARGS(const char *name),
+ rte_trace_point_emit_string(name);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_op_pool_create,
+ RTE_TRACE_POINT_ARGS(const char *name, int socket_id, int type,
+ uint32_t nb_elts, const void *mp),
+ rte_trace_point_emit_string(name);
+ rte_trace_point_emit_int(socket_id);
+ rte_trace_point_emit_int(type);
+ rte_trace_point_emit_u32(nb_elts);
+ rte_trace_point_emit_ptr(mp);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_asym_xform_capability_check_optype,
+ RTE_TRACE_POINT_ARGS(uint32_t op_types,
+ enum rte_crypto_asym_op_type op_type, int ret),
+ rte_trace_point_emit_u32(op_types);
+ rte_trace_point_emit_int(op_type);
+ rte_trace_point_emit_int(ret);
+)
+
+RTE_TRACE_POINT(
+ rte_cryptodev_trace_count,
+ RTE_TRACE_POINT_ARGS(uint8_t nb_devs),
+ rte_trace_point_emit_u8(nb_devs);
+)
+
#ifdef __cplusplus
}
#endif
diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
index 5aee87c6f7..6d9b3e01a6 100644
--- a/lib/cryptodev/version.map
+++ b/lib/cryptodev/version.map
@@ -109,6 +109,54 @@ EXPERIMENTAL {
#added in 22.07
rte_cryptodev_session_event_mdata_set;
rte_crypto_asym_ke_strings;
+
+ #added in 22.11
+ __rte_cryptodev_trace_add_deq_callback;
+ __rte_cryptodev_trace_add_enq_callback;
+ __rte_cryptodev_trace_allocate_driver;
+ __rte_cryptodev_trace_asym_capability_get;
+ __rte_cryptodev_trace_asym_get_private_session_size;
+ __rte_cryptodev_trace_asym_get_xform_enum;
+ __rte_cryptodev_trace_asym_session_get_user_data;
+ __rte_cryptodev_trace_asym_session_set_user_data;
+ __rte_cryptodev_trace_asym_xform_capability_check_modlen;
+ __rte_cryptodev_trace_asym_xform_capability_check_optype;
+ __rte_cryptodev_trace_callback_register;
+ __rte_cryptodev_trace_callback_unregister;
+ __rte_cryptodev_trace_configure_raw_dp_ctx;
+ __rte_cryptodev_trace_device_count_by_driver;
+ __rte_cryptodev_trace_devices_get;
+ __rte_cryptodev_trace_driver_id_get;
+ __rte_cryptodev_trace_driver_name_get;
+ __rte_cryptodev_trace_get_aead_algo_enum;
+ __rte_cryptodev_trace_get_auth_algo_enum;
+ __rte_cryptodev_trace_get_cipher_algo_enum;
+ __rte_cryptodev_trace_get_dev_id;
+ __rte_cryptodev_trace_get_feature_name;
+ __rte_cryptodev_trace_get_qp_status;
+ __rte_cryptodev_trace_get_raw_dp_ctx_size;
+ __rte_cryptodev_trace_get_sec_ctx;
+ __rte_cryptodev_trace_info_get;
+ __rte_cryptodev_trace_is_valid_dev;
+ __rte_cryptodev_trace_name_get;
+ __rte_cryptodev_trace_op_pool_create;
+ __rte_cryptodev_trace_queue_pair_count;
+ __rte_cryptodev_trace_remove_deq_callback;
+ __rte_cryptodev_trace_remove_enq_callback;
+ __rte_cryptodev_trace_session_event_mdata_set;
+ __rte_cryptodev_trace_socket_id;
+ __rte_cryptodev_trace_stats_get;
+ __rte_cryptodev_trace_stats_reset;
+ __rte_cryptodev_trace_sym_capability_check_aead;
+ __rte_cryptodev_trace_sym_capability_check_auth;
+ __rte_cryptodev_trace_sym_capability_check_cipher;
+ __rte_cryptodev_trace_sym_capability_get;
+ __rte_cryptodev_trace_sym_cpu_crypto_process;
+ __rte_cryptodev_trace_sym_get_existing_header_session_size;
+ __rte_cryptodev_trace_sym_get_private_session_size;
+ __rte_cryptodev_trace_sym_session_get_user_data;
+ __rte_cryptodev_trace_sym_session_set_user_data;
+ __rte_cryptodev_trace_count;
};
INTERNAL {
--
2.25.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2] cryptodev: add trace points
2022-09-29 12:35 ` [PATCH v2] " Amit Prakash Shukla
@ 2022-09-30 7:34 ` Jerin Jacob
2022-09-30 18:22 ` [EXT] " Akhil Goyal
0 siblings, 1 reply; 8+ messages in thread
From: Jerin Jacob @ 2022-09-30 7:34 UTC (permalink / raw)
To: Amit Prakash Shukla
Cc: Akhil Goyal, Fan Zhang, Ray Kinsella, dev, jerinj, roy.fan.zhang
On Thu, Sep 29, 2022 at 6:08 PM Amit Prakash Shukla
<amitprakashs@marvell.com> wrote:
>
> Add trace points for cryptodev functions.
>
> Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
Looks good from tracing PoV.
Reviewed-by: Jerin Jacob <jerinj@marvell.com>
> ---
> v2:
> - Removed trace changes for non-public API
> - Code changes to include API result in trace
>
> lib/cryptodev/cryptodev_trace_points.c | 138 +++++++++
> lib/cryptodev/rte_cryptodev.c | 319 +++++++++++++++-----
> lib/cryptodev/rte_cryptodev_trace.h | 384 +++++++++++++++++++++++++
> lib/cryptodev/version.map | 48 ++++
> 4 files changed, 818 insertions(+), 71 deletions(-)
>
> diff --git a/lib/cryptodev/cryptodev_trace_points.c b/lib/cryptodev/cryptodev_trace_points.c
> index c5bfe08b79..9f0ed904ea 100644
> --- a/lib/cryptodev/cryptodev_trace_points.c
> +++ b/lib/cryptodev/cryptodev_trace_points.c
> @@ -50,3 +50,141 @@ RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_enqueue_burst,
>
> RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_dequeue_burst,
> lib.cryptodev.deq.burst)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_callback_register,
> + lib.cryptodev.callback.register)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_callback_unregister,
> + lib.cryptodev.callback.unregister)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_device_count_by_driver,
> + lib.cryptodev.device.count.by.driver)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_devices_get,
> + lib.cryptodev.devices.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_driver_id_get,
> + lib.cryptodev.driver.id.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_driver_name_get,
> + lib.cryptodev.driver.name.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_aead_algo_enum,
> + lib.cryptodev.get.aead.algo.enum)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_auth_algo_enum,
> + lib.cryptodev.get.auth.algo.enum)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_cipher_algo_enum,
> + lib.cryptodev.get.cipher.algo.enum)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_dev_id,
> + lib.cryptodev.get.dev.id)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_feature_name,
> + lib.cryptodev.get.feature.name)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_sec_ctx,
> + lib.cryptodev.get.sec.ctx)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_info_get,
> + lib.cryptodev.info.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_is_valid_dev,
> + lib.cryptodev.is.valid.dev)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_name_get,
> + lib.cryptodev.name.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_queue_pair_count,
> + lib.cryptodev.queue.pair.count)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_socket_id,
> + lib.cryptodev.socket.id)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_stats_get,
> + lib.cryptodev.stats.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_stats_reset,
> + lib.cryptodev.stats.reset)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_check_aead,
> + lib.cryptodev.sym.capability.check.aead)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_check_auth,
> + lib.cryptodev.sym.capability.check.auth)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_check_cipher,
> + lib.cryptodev.sym.capability.check.cipher)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_capability_get,
> + lib.cryptodev.sym.capability.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_get_private_session_size,
> + lib.cryptodev.sym.get.private.session.size)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_capability_get,
> + lib.cryptodev.asym.capability.get)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_get_private_session_size,
> + lib.cryptodev.asym.get.private.session.size)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_get_xform_enum,
> + lib.cryptodev.asym.get.xform.enum)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_xform_capability_check_modlen,
> + lib.cryptodev.asym.xform.capability.check.modlen)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_xform_capability_check_optype,
> + lib.cryptodev.asym.xform.capability.check.optype)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_cpu_crypto_process,
> + lib.cryptodev.sym.cpu.crypto.process)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_get_existing_header_session_size,
> + lib.cryptodev.sym.get.existing.header.session.size)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_get_user_data,
> + lib.cryptodev.sym.session.get.user.data)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_sym_session_set_user_data,
> + lib.cryptodev.sym.session.set.user.data)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_qp_status,
> + lib.cryptodev.get.qp.status)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_configure_raw_dp_ctx,
> + lib.cryptodev.configure.raw.dp.ctx)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_get_raw_dp_ctx_size,
> + lib.cryptodev.get.raw.dp.ctx.size)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_add_deq_callback,
> + lib.cryptodev.add.deq.callback)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_add_enq_callback,
> + lib.cryptodev.add.enq.callback)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_remove_deq_callback,
> + lib.cryptodev.remove.deq.callback)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_remove_enq_callback,
> + lib.cryptodev.remove.enq.callback)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_get_user_data,
> + lib.cryptodev.asym.session.get.user.data)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_asym_session_set_user_data,
> + lib.cryptodev.asym.session.set.user.data)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_session_event_mdata_set,
> + lib.cryptodev.session.event.mdata.set)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_allocate_driver,
> + lib.cryptodev.allocate.driver)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_op_pool_create,
> + lib.cryptodev.op.pool.create)
> +
> +RTE_TRACE_POINT_REGISTER(rte_cryptodev_trace_count,
> + lib.cryptodev.count)
> diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
> index 5e25e607fa..7c0fb59e29 100644
> --- a/lib/cryptodev/rte_cryptodev.c
> +++ b/lib/cryptodev/rte_cryptodev.c
> @@ -224,16 +224,19 @@ rte_cryptodev_get_cipher_algo_enum(enum rte_crypto_cipher_algorithm *algo_enum,
> const char *algo_string)
> {
> unsigned int i;
> + int ret = -1; /* Invalid string */
>
> for (i = 1; i < RTE_DIM(rte_crypto_cipher_algorithm_strings); i++) {
> if (strcmp(algo_string, rte_crypto_cipher_algorithm_strings[i]) == 0) {
> *algo_enum = (enum rte_crypto_cipher_algorithm) i;
> - return 0;
> + ret = 0;
> + break;
> }
> }
>
> - /* Invalid string */
> - return -1;
> + rte_cryptodev_trace_get_cipher_algo_enum(algo_string, *algo_enum, ret);
> +
> + return ret;
> }
>
> int
> @@ -241,16 +244,19 @@ rte_cryptodev_get_auth_algo_enum(enum rte_crypto_auth_algorithm *algo_enum,
> const char *algo_string)
> {
> unsigned int i;
> + int ret = -1; /* Invalid string */
>
> for (i = 1; i < RTE_DIM(rte_crypto_auth_algorithm_strings); i++) {
> if (strcmp(algo_string, rte_crypto_auth_algorithm_strings[i]) == 0) {
> *algo_enum = (enum rte_crypto_auth_algorithm) i;
> - return 0;
> + ret = 0;
> + break;
> }
> }
>
> - /* Invalid string */
> - return -1;
> + rte_cryptodev_trace_get_auth_algo_enum(algo_string, *algo_enum, ret);
> +
> + return ret;
> }
>
> int
> @@ -258,16 +264,19 @@ rte_cryptodev_get_aead_algo_enum(enum rte_crypto_aead_algorithm *algo_enum,
> const char *algo_string)
> {
> unsigned int i;
> + int ret = -1; /* Invalid string */
>
> for (i = 1; i < RTE_DIM(rte_crypto_aead_algorithm_strings); i++) {
> if (strcmp(algo_string, rte_crypto_aead_algorithm_strings[i]) == 0) {
> *algo_enum = (enum rte_crypto_aead_algorithm) i;
> - return 0;
> + ret = 0;
> + break;
> }
> }
>
> - /* Invalid string */
> - return -1;
> + rte_cryptodev_trace_get_aead_algo_enum(algo_string, *algo_enum, ret);
> +
> + return ret;
> }
>
> int
> @@ -275,17 +284,20 @@ rte_cryptodev_asym_get_xform_enum(enum rte_crypto_asym_xform_type *xform_enum,
> const char *xform_string)
> {
> unsigned int i;
> + int ret = -1; /* Invalid string */
>
> for (i = 1; i < RTE_DIM(rte_crypto_asym_xform_strings); i++) {
> if (strcmp(xform_string,
> rte_crypto_asym_xform_strings[i]) == 0) {
> *xform_enum = (enum rte_crypto_asym_xform_type) i;
> - return 0;
> + ret = 0;
> + break;
> }
> }
>
> - /* Invalid string */
> - return -1;
> + rte_cryptodev_trace_asym_get_xform_enum(xform_string, *xform_enum, ret);
> +
> + return ret;
> }
>
> /**
> @@ -303,6 +315,7 @@ rte_cryptodev_sym_capability_get(uint8_t dev_id,
> const struct rte_cryptodev_sym_capability_idx *idx)
> {
> const struct rte_cryptodev_capabilities *capability;
> + const struct rte_cryptodev_symmetric_capability *sym_capability = NULL;
> struct rte_cryptodev_info dev_info;
> int i = 0;
>
> @@ -317,19 +330,28 @@ rte_cryptodev_sym_capability_get(uint8_t dev_id,
> continue;
>
> if (idx->type == RTE_CRYPTO_SYM_XFORM_AUTH &&
> - capability->sym.auth.algo == idx->algo.auth)
> - return &capability->sym;
> + capability->sym.auth.algo == idx->algo.auth) {
> + sym_capability = &capability->sym;
> + break;
> + }
>
> if (idx->type == RTE_CRYPTO_SYM_XFORM_CIPHER &&
> - capability->sym.cipher.algo == idx->algo.cipher)
> - return &capability->sym;
> + capability->sym.cipher.algo == idx->algo.cipher) {
> + sym_capability = &capability->sym;
> + break;
> + }
>
> if (idx->type == RTE_CRYPTO_SYM_XFORM_AEAD &&
> - capability->sym.aead.algo == idx->algo.aead)
> - return &capability->sym;
> + capability->sym.aead.algo == idx->algo.aead) {
> + sym_capability = &capability->sym;
> + break;
> + }
> }
>
> - return NULL;
> + rte_cryptodev_trace_sym_capability_get(dev_id, dev_info.driver_name,
> + dev_info.driver_id, idx->type, sym_capability);
> +
> + return sym_capability;
> }
>
> static int
> @@ -362,6 +384,7 @@ rte_cryptodev_asym_capability_get(uint8_t dev_id,
> const struct rte_cryptodev_asym_capability_idx *idx)
> {
> const struct rte_cryptodev_capabilities *capability;
> + const struct rte_cryptodev_asymmetric_xform_capability *asym_cap = NULL;
> struct rte_cryptodev_info dev_info;
> unsigned int i = 0;
>
> @@ -373,10 +396,16 @@ rte_cryptodev_asym_capability_get(uint8_t dev_id,
> if (capability->op != RTE_CRYPTO_OP_TYPE_ASYMMETRIC)
> continue;
>
> - if (capability->asym.xform_capa.xform_type == idx->type)
> - return &capability->asym.xform_capa;
> + if (capability->asym.xform_capa.xform_type == idx->type) {
> + asym_cap = &capability->asym.xform_capa;
> + break;
> + }
> }
> - return NULL;
> +
> + rte_cryptodev_trace_asym_capability_get(dev_info.driver_name,
> + dev_info.driver_id, idx->type, asym_cap);
> +
> + return asym_cap;
> };
>
> int
> @@ -384,13 +413,21 @@ rte_cryptodev_sym_capability_check_cipher(
> const struct rte_cryptodev_symmetric_capability *capability,
> uint16_t key_size, uint16_t iv_size)
> {
> - if (param_range_check(key_size, &capability->cipher.key_size) != 0)
> - return -1;
> + int ret = 0; /* success */
> +
> + if (param_range_check(key_size, &capability->cipher.key_size) != 0) {
> + ret = -1;
> + goto done;
> + }
>
> if (param_range_check(iv_size, &capability->cipher.iv_size) != 0)
> - return -1;
> + ret = -1;
>
> - return 0;
> +done:
> + rte_cryptodev_trace_sym_capability_check_cipher(capability, key_size,
> + iv_size, ret);
> +
> + return ret;
> }
>
> int
> @@ -398,16 +435,27 @@ rte_cryptodev_sym_capability_check_auth(
> const struct rte_cryptodev_symmetric_capability *capability,
> uint16_t key_size, uint16_t digest_size, uint16_t iv_size)
> {
> - if (param_range_check(key_size, &capability->auth.key_size) != 0)
> - return -1;
> + int ret = 0; /* success */
>
> - if (param_range_check(digest_size, &capability->auth.digest_size) != 0)
> - return -1;
> + if (param_range_check(key_size, &capability->auth.key_size) != 0) {
> + ret = -1;
> + goto done;
> + }
> +
> + if (param_range_check(digest_size,
> + &capability->auth.digest_size) != 0) {
> + ret = -1;
> + goto done;
> + }
>
> if (param_range_check(iv_size, &capability->auth.iv_size) != 0)
> - return -1;
> + ret = -1;
>
> - return 0;
> +done:
> + rte_cryptodev_trace_sym_capability_check_auth(capability, key_size,
> + digest_size, iv_size, ret);
> +
> + return ret;
> }
>
> int
> @@ -416,29 +464,48 @@ rte_cryptodev_sym_capability_check_aead(
> uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
> uint16_t iv_size)
> {
> - if (param_range_check(key_size, &capability->aead.key_size) != 0)
> - return -1;
> + int ret = 0; /* success */
>
> - if (param_range_check(digest_size, &capability->aead.digest_size) != 0)
> - return -1;
> + if (param_range_check(key_size, &capability->aead.key_size) != 0) {
> + ret = -1;
> + goto done;
> + }
>
> - if (param_range_check(aad_size, &capability->aead.aad_size) != 0)
> - return -1;
> + if (param_range_check(digest_size,
> + &capability->aead.digest_size) != 0) {
> + ret = -1;
> + goto done;
> + }
> +
> + if (param_range_check(aad_size, &capability->aead.aad_size) != 0) {
> + ret = -1;
> + goto done;
> + }
>
> if (param_range_check(iv_size, &capability->aead.iv_size) != 0)
> - return -1;
> + ret = -1;
>
> - return 0;
> +done:
> + rte_cryptodev_trace_sym_capability_check_aead(capability, key_size,
> + digest_size, aad_size, iv_size, ret);
> +
> + return ret;
> }
> +
> int
> rte_cryptodev_asym_xform_capability_check_optype(
> const struct rte_cryptodev_asymmetric_xform_capability *capability,
> enum rte_crypto_asym_op_type op_type)
> {
> + int ret = 0;
> +
> if (capability->op_types & (1 << op_type))
> - return 1;
> + ret = 1;
>
> - return 0;
> + rte_cryptodev_trace_asym_xform_capability_check_optype(
> + capability->op_types, op_type, ret);
> +
> + return ret;
> }
>
> int
> @@ -446,24 +513,34 @@ rte_cryptodev_asym_xform_capability_check_modlen(
> const struct rte_cryptodev_asymmetric_xform_capability *capability,
> uint16_t modlen)
> {
> + int ret = 0; /* success */
> +
> /* no need to check for limits, if min or max = 0 */
> if (capability->modlen.min != 0) {
> - if (modlen < capability->modlen.min)
> - return -1;
> + if (modlen < capability->modlen.min) {
> + ret = -1;
> + goto done;
> + }
> }
>
> if (capability->modlen.max != 0) {
> - if (modlen > capability->modlen.max)
> - return -1;
> + if (modlen > capability->modlen.max) {
> + ret = -1;
> + goto done;
> + }
> }
>
> /* in any case, check if given modlen is module increment */
> if (capability->modlen.increment != 0) {
> if (modlen % (capability->modlen.increment))
> - return -1;
> + ret = -1;
> }
>
> - return 0;
> +done:
> + rte_cryptodev_trace_asym_xform_capability_check_modlen(capability,
> + modlen, ret);
> +
> + return ret;
> }
>
> /* spinlock for crypto device enq callbacks */
> @@ -586,6 +663,8 @@ cryptodev_cb_init(struct rte_cryptodev *dev)
> const char *
> rte_cryptodev_get_feature_name(uint64_t flag)
> {
> + rte_cryptodev_trace_get_feature_name(flag);
> +
> switch (flag) {
> case RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO:
> return "SYMMETRIC_CRYPTO";
> @@ -684,22 +763,28 @@ unsigned int
> rte_cryptodev_is_valid_dev(uint8_t dev_id)
> {
> struct rte_cryptodev *dev = NULL;
> + unsigned int ret = 1;
>
> - if (!rte_cryptodev_is_valid_device_data(dev_id))
> - return 0;
> + if (!rte_cryptodev_is_valid_device_data(dev_id)) {
> + ret = 0;
> + goto done;
> + }
>
> dev = rte_cryptodev_pmd_get_dev(dev_id);
> if (dev->attached != RTE_CRYPTODEV_ATTACHED)
> - return 0;
> - else
> - return 1;
> -}
> + ret = 0;
>
> +done:
> + rte_cryptodev_trace_is_valid_dev(dev_id, ret);
> +
> + return ret;
> +}
>
> int
> rte_cryptodev_get_dev_id(const char *name)
> {
> unsigned i;
> + int ret = -1;
>
> if (name == NULL)
> return -1;
> @@ -710,16 +795,22 @@ rte_cryptodev_get_dev_id(const char *name)
> if ((strcmp(cryptodev_globals.devs[i].data->name, name)
> == 0) &&
> (cryptodev_globals.devs[i].attached ==
> - RTE_CRYPTODEV_ATTACHED))
> - return i;
> + RTE_CRYPTODEV_ATTACHED)) {
> + ret = (int)i;
> + break;
> + }
> }
>
> - return -1;
> + rte_cryptodev_trace_get_dev_id(name, ret);
> +
> + return ret;
> }
>
> uint8_t
> rte_cryptodev_count(void)
> {
> + rte_cryptodev_trace_count(cryptodev_globals.nb_devs);
> +
> return cryptodev_globals.nb_devs;
> }
>
> @@ -734,6 +825,8 @@ rte_cryptodev_device_count_by_driver(uint8_t driver_id)
> RTE_CRYPTODEV_ATTACHED)
> dev_count++;
>
> + rte_cryptodev_trace_device_count_by_driver(driver_id, dev_count);
> +
> return dev_count;
> }
>
> @@ -760,18 +853,24 @@ rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices,
> }
> }
>
> + rte_cryptodev_trace_devices_get(driver_name, count);
> +
> return count;
> }
>
> void *
> rte_cryptodev_get_sec_ctx(uint8_t dev_id)
> {
> + void *sec_ctx = NULL;
> +
> if (dev_id < RTE_CRYPTO_MAX_DEVS &&
> (rte_crypto_devices[dev_id].feature_flags &
> RTE_CRYPTODEV_FF_SECURITY))
> - return rte_crypto_devices[dev_id].security_ctx;
> + sec_ctx = rte_crypto_devices[dev_id].security_ctx;
>
> - return NULL;
> + rte_cryptodev_trace_get_sec_ctx(dev_id, sec_ctx);
> +
> + return sec_ctx;
> }
>
> int
> @@ -784,6 +883,8 @@ rte_cryptodev_socket_id(uint8_t dev_id)
>
> dev = rte_cryptodev_pmd_get_dev(dev_id);
>
> + rte_cryptodev_trace_socket_id(dev_id, dev->data->name,
> + dev->data->socket_id);
> return dev->data->socket_id;
> }
>
> @@ -965,6 +1066,10 @@ rte_cryptodev_queue_pair_count(uint8_t dev_id)
> }
>
> dev = &rte_crypto_devices[dev_id];
> + rte_cryptodev_trace_queue_pair_count(dev, dev->data->name,
> + dev->data->socket_id, dev->data->dev_id,
> + dev->data->nb_queue_pairs);
> +
> return dev->data->nb_queue_pairs;
> }
>
> @@ -1191,29 +1296,36 @@ int
> rte_cryptodev_get_qp_status(uint8_t dev_id, uint16_t queue_pair_id)
> {
> struct rte_cryptodev *dev;
> + int ret = 0;
>
> if (!rte_cryptodev_is_valid_dev(dev_id)) {
> CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
> - return -EINVAL;
> + ret = -EINVAL;
> + goto done;
> }
>
> dev = &rte_crypto_devices[dev_id];
> if (queue_pair_id >= dev->data->nb_queue_pairs) {
> CDEV_LOG_ERR("Invalid queue_pair_id=%d", queue_pair_id);
> - return -EINVAL;
> + ret = -EINVAL;
> + goto done;
> }
> void **qps = dev->data->queue_pairs;
>
> if (qps[queue_pair_id]) {
> CDEV_LOG_DEBUG("qp %d on dev %d is initialised",
> queue_pair_id, dev_id);
> - return 1;
> + ret = 1;
> + goto done;
> }
>
> CDEV_LOG_DEBUG("qp %d on dev %d is not initialised",
> queue_pair_id, dev_id);
>
> - return 0;
> +done:
> + rte_cryptodev_trace_get_qp_status(dev_id, queue_pair_id, ret);
> +
> + return ret;
> }
>
> int
> @@ -1346,6 +1458,7 @@ rte_cryptodev_add_enq_callback(uint8_t dev_id,
>
> rte_spinlock_unlock(&rte_cryptodev_callback_lock);
>
> + rte_cryptodev_trace_add_enq_callback(dev_id, qp_id, cb_fn);
> return cb;
> }
>
> @@ -1371,6 +1484,8 @@ rte_cryptodev_remove_enq_callback(uint8_t dev_id,
> return -ENODEV;
> }
>
> + rte_cryptodev_trace_remove_enq_callback(dev_id, qp_id, cb->fn);
> +
> dev = &rte_crypto_devices[dev_id];
> if (qp_id >= dev->data->nb_queue_pairs) {
> CDEV_LOG_ERR("Invalid queue_pair_id=%d", qp_id);
> @@ -1481,6 +1596,8 @@ rte_cryptodev_add_deq_callback(uint8_t dev_id,
>
> rte_spinlock_unlock(&rte_cryptodev_callback_lock);
>
> + rte_cryptodev_trace_add_deq_callback(dev_id, qp_id, cb_fn);
> +
> return cb;
> }
>
> @@ -1506,6 +1623,8 @@ rte_cryptodev_remove_deq_callback(uint8_t dev_id,
> return -ENODEV;
> }
>
> + rte_cryptodev_trace_remove_deq_callback(dev_id, qp_id, cb->fn);
> +
> dev = &rte_crypto_devices[dev_id];
> if (qp_id >= dev->data->nb_queue_pairs) {
> CDEV_LOG_ERR("Invalid queue_pair_id=%d", qp_id);
> @@ -1575,6 +1694,8 @@ rte_cryptodev_stats_get(uint8_t dev_id, struct rte_cryptodev_stats *stats)
> if (*dev->dev_ops->stats_get == NULL)
> return -ENOTSUP;
> (*dev->dev_ops->stats_get)(dev, stats);
> +
> + rte_cryptodev_trace_stats_get(dev_id, stats);
> return 0;
> }
>
> @@ -1583,6 +1704,8 @@ rte_cryptodev_stats_reset(uint8_t dev_id)
> {
> struct rte_cryptodev *dev;
>
> + rte_cryptodev_trace_stats_reset(dev_id);
> +
> if (!rte_cryptodev_is_valid_dev(dev_id)) {
> CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
> return;
> @@ -1615,6 +1738,9 @@ rte_cryptodev_info_get(uint8_t dev_id, struct rte_cryptodev_info *dev_info)
>
> dev_info->driver_name = dev->device->driver->name;
> dev_info->device = dev->device;
> +
> + rte_cryptodev_trace_info_get(dev_id, dev_info->driver_name);
> +
> }
>
> int
> @@ -1657,6 +1783,8 @@ rte_cryptodev_callback_register(uint8_t dev_id,
> }
>
> rte_spinlock_unlock(&rte_cryptodev_cb_lock);
> +
> + rte_cryptodev_trace_callback_register(dev_id, event, cb_fn);
> return (user_cb == NULL) ? -ENOMEM : 0;
> }
>
> @@ -1703,6 +1831,8 @@ rte_cryptodev_callback_unregister(uint8_t dev_id,
> }
>
> rte_spinlock_unlock(&rte_cryptodev_cb_lock);
> +
> + rte_cryptodev_trace_callback_unregister(dev_id, event, cb_fn);
> return ret;
> }
>
> @@ -2139,6 +2269,9 @@ rte_cryptodev_sym_get_private_session_size(uint8_t dev_id)
>
> priv_sess_size = (*dev->dev_ops->sym_session_get_size)(dev);
>
> + rte_cryptodev_trace_sym_get_private_session_size(dev_id,
> + priv_sess_size);
> +
> return priv_sess_size;
> }
>
> @@ -2158,6 +2291,9 @@ rte_cryptodev_asym_get_private_session_size(uint8_t dev_id)
>
> priv_sess_size = (*dev->dev_ops->asym_session_get_size)(dev);
>
> + rte_cryptodev_trace_asym_get_private_session_size(dev_id,
> + priv_sess_size);
> +
> return priv_sess_size;
> }
>
> @@ -2174,6 +2310,9 @@ rte_cryptodev_sym_session_set_user_data(
> return -ENOMEM;
>
> rte_memcpy(sess->sess_data + sess->nb_drivers, data, size);
> +
> + rte_cryptodev_trace_sym_session_set_user_data(sess, data, size);
> +
> return 0;
> }
>
> @@ -2181,10 +2320,16 @@ void *
> rte_cryptodev_sym_session_get_user_data(
> struct rte_cryptodev_sym_session *sess)
> {
> + void *data = NULL;
> +
> if (sess == NULL || sess->user_data_sz == 0)
> return NULL;
>
> - return (void *)(sess->sess_data + sess->nb_drivers);
> + data = (void *)(sess->sess_data + sess->nb_drivers);
> +
> + rte_cryptodev_trace_sym_session_get_user_data(sess, data);
> +
> + return data;
> }
>
> int
> @@ -2200,6 +2345,9 @@ rte_cryptodev_asym_session_set_user_data(void *session, void *data, uint16_t siz
> rte_memcpy(sess->sess_private_data +
> sess->max_priv_data_sz,
> data, size);
> +
> + rte_cryptodev_trace_asym_session_set_user_data(sess, data, size);
> +
> return 0;
> }
>
> @@ -2207,11 +2355,16 @@ void *
> rte_cryptodev_asym_session_get_user_data(void *session)
> {
> struct rte_cryptodev_asym_session *sess = session;
> + void *data = NULL;
> +
> if (sess == NULL || sess->user_data_sz == 0)
> return NULL;
>
> - return (void *)(sess->sess_private_data +
> - sess->max_priv_data_sz);
> + data = (void *)(sess->sess_private_data + sess->max_priv_data_sz);
> +
> + rte_cryptodev_trace_asym_session_get_user_data(sess, data);
> +
> + return data;
> }
>
> static inline void
> @@ -2242,6 +2395,8 @@ rte_cryptodev_sym_cpu_crypto_process(uint8_t dev_id,
> return 0;
> }
>
> + rte_cryptodev_trace_sym_cpu_crypto_process(dev_id, sess);
> +
> return dev->dev_ops->sym_cpu_process(dev, sess, ofs, vec);
> }
>
> @@ -2266,6 +2421,8 @@ rte_cryptodev_get_raw_dp_ctx_size(uint8_t dev_id)
> if (priv_size < 0)
> return -ENOTSUP;
>
> + rte_cryptodev_trace_get_raw_dp_ctx_size(dev_id);
> +
> return RTE_ALIGN_CEIL((size + priv_size), 8);
> }
>
> @@ -2286,6 +2443,8 @@ rte_cryptodev_configure_raw_dp_ctx(uint8_t dev_id, uint16_t qp_id,
> || dev->dev_ops->sym_configure_raw_dp_ctx == NULL)
> return -ENOTSUP;
>
> + rte_cryptodev_trace_configure_raw_dp_ctx(dev_id, qp_id, sess_type);
> +
> return (*dev->dev_ops->sym_configure_raw_dp_ctx)(dev, qp_id, ctx,
> sess_type, session_ctx, is_update);
> }
> @@ -2309,6 +2468,9 @@ rte_cryptodev_session_event_mdata_set(uint8_t dev_id, void *sess,
> if (dev->dev_ops->session_ev_mdata_set == NULL)
> goto skip_pmd_op;
>
> + rte_cryptodev_trace_session_event_mdata_set(dev_id, sess, op_type,
> + sess_type, ev_mdata, size);
> +
> return (*dev->dev_ops->session_ev_mdata_set)(dev, sess, op_type,
> sess_type, ev_mdata);
>
> @@ -2451,6 +2613,7 @@ rte_crypto_op_pool_create(const char *name, enum rte_crypto_op_type type,
> priv->priv_size = priv_size;
> priv->type = type;
>
> + rte_cryptodev_trace_op_pool_create(name, socket_id, type, nb_elts, mp);
> return mp;
> }
>
> @@ -2488,6 +2651,7 @@ rte_cryptodev_driver_id_get(const char *name)
> {
> struct cryptodev_driver *driver;
> const char *driver_name;
> + int driver_id = -1;
>
> if (name == NULL) {
> RTE_LOG(DEBUG, CRYPTODEV, "name pointer NULL");
> @@ -2496,10 +2660,15 @@ rte_cryptodev_driver_id_get(const char *name)
>
> TAILQ_FOREACH(driver, &cryptodev_driver_list, next) {
> driver_name = driver->driver->name;
> - if (strncmp(driver_name, name, strlen(driver_name) + 1) == 0)
> - return driver->id;
> + if (strncmp(driver_name, name, strlen(driver_name) + 1) == 0) {
> + driver_id = driver->id;
> + break;
> + }
> }
> - return -1;
> +
> + rte_cryptodev_trace_driver_id_get(name, driver_id);
> +
> + return driver_id;
> }
>
> const char *
> @@ -2516,6 +2685,8 @@ rte_cryptodev_name_get(uint8_t dev_id)
> if (dev == NULL)
> return NULL;
>
> + rte_cryptodev_trace_name_get(dev_id, dev->data->name);
> +
> return dev->data->name;
> }
>
> @@ -2524,9 +2695,13 @@ rte_cryptodev_driver_name_get(uint8_t driver_id)
> {
> struct cryptodev_driver *driver;
>
> - TAILQ_FOREACH(driver, &cryptodev_driver_list, next)
> - if (driver->id == driver_id)
> + TAILQ_FOREACH(driver, &cryptodev_driver_list, next) {
> + if (driver->id == driver_id) {
> + rte_cryptodev_trace_driver_name_get(driver_id,
> + driver->driver->name);
> return driver->driver->name;
> + }
> + }
> return NULL;
> }
>
> @@ -2539,6 +2714,8 @@ rte_cryptodev_allocate_driver(struct cryptodev_driver *crypto_drv,
>
> TAILQ_INSERT_TAIL(&cryptodev_driver_list, crypto_drv, next);
>
> + rte_cryptodev_trace_allocate_driver(drv->name);
> +
> return nb_drivers++;
> }
>
> diff --git a/lib/cryptodev/rte_cryptodev_trace.h b/lib/cryptodev/rte_cryptodev_trace.h
> index a3f6048e7d..3d9b00145e 100644
> --- a/lib/cryptodev/rte_cryptodev_trace.h
> +++ b/lib/cryptodev/rte_cryptodev_trace.h
> @@ -138,6 +138,390 @@ RTE_TRACE_POINT(
> rte_trace_point_emit_ptr(sess);
> )
>
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_callback_register,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id,
> + enum rte_cryptodev_event_type event, const void *cb_fn),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_int(event);
> + rte_trace_point_emit_ptr(cb_fn);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_callback_unregister,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id,
> + enum rte_cryptodev_event_type event, const void *cb_fn),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_int(event);
> + rte_trace_point_emit_ptr(cb_fn);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_device_count_by_driver,
> + RTE_TRACE_POINT_ARGS(uint8_t driver_id, uint8_t dev_count),
> + rte_trace_point_emit_u8(driver_id);
> + rte_trace_point_emit_u8(dev_count);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_devices_get,
> + RTE_TRACE_POINT_ARGS(const char *driver_name, uint8_t count),
> + rte_trace_point_emit_string(driver_name);
> + rte_trace_point_emit_u8(count);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_driver_id_get,
> + RTE_TRACE_POINT_ARGS(const char *name, int driver_id),
> + rte_trace_point_emit_string(name);
> + rte_trace_point_emit_int(driver_id);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_driver_name_get,
> + RTE_TRACE_POINT_ARGS(uint8_t driver_id, const char *name),
> + rte_trace_point_emit_u8(driver_id);
> + rte_trace_point_emit_string(name);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_get_aead_algo_enum,
> + RTE_TRACE_POINT_ARGS(const char *algo_string,
> + enum rte_crypto_aead_algorithm algo_enum, int ret),
> + rte_trace_point_emit_string(algo_string);
> + rte_trace_point_emit_int(algo_enum);
> + rte_trace_point_emit_int(ret);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_get_auth_algo_enum,
> + RTE_TRACE_POINT_ARGS(const char *algo_string,
> + enum rte_crypto_auth_algorithm algo_enum, int ret),
> + rte_trace_point_emit_string(algo_string);
> + rte_trace_point_emit_int(algo_enum);
> + rte_trace_point_emit_int(ret);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_get_cipher_algo_enum,
> + RTE_TRACE_POINT_ARGS(const char *algo_string,
> + enum rte_crypto_cipher_algorithm algo_enum, int ret),
> + rte_trace_point_emit_string(algo_string);
> + rte_trace_point_emit_int(algo_enum);
> + rte_trace_point_emit_int(ret);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_get_dev_id,
> + RTE_TRACE_POINT_ARGS(const char *name, int ret),
> + rte_trace_point_emit_string(name);
> + rte_trace_point_emit_int(ret);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_get_feature_name,
> + RTE_TRACE_POINT_ARGS(uint64_t flag),
> + rte_trace_point_emit_u64(flag);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_get_sec_ctx,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const void *sec_ctx),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_ptr(sec_ctx);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_info_get,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *driver_name),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_string(driver_name);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_is_valid_dev,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, unsigned int ret),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u32(ret);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_name_get,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *name),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_string(name);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_queue_pair_count,
> + RTE_TRACE_POINT_ARGS(const void *dev, const char *name,
> + uint8_t socket_id, uint8_t dev_id, uint16_t nb_queue_pairs),
> + rte_trace_point_emit_ptr(dev);
> + rte_trace_point_emit_string(name);
> + rte_trace_point_emit_u8(socket_id);
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u16(nb_queue_pairs);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_socket_id,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *name, int socket_id),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_string(name);
> + rte_trace_point_emit_int(socket_id);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_stats_get,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id,
> + const struct rte_cryptodev_stats *stats),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u64(stats->enqueued_count);
> + rte_trace_point_emit_u64(stats->dequeued_count);
> + rte_trace_point_emit_u64(stats->enqueue_err_count);
> + rte_trace_point_emit_u64(stats->dequeue_err_count);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_stats_reset,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id),
> + rte_trace_point_emit_u8(dev_id);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_capability_check_aead,
> + RTE_TRACE_POINT_ARGS(
> + const struct rte_cryptodev_symmetric_capability *capability,
> + uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
> + uint16_t iv_size, int ret),
> + rte_trace_point_emit_ptr(capability);
> + rte_trace_point_emit_int(capability->xform_type);
> + rte_trace_point_emit_u16(key_size);
> + rte_trace_point_emit_u16(digest_size);
> + rte_trace_point_emit_u16(aad_size);
> + rte_trace_point_emit_u16(iv_size);
> + rte_trace_point_emit_int(ret);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_capability_check_auth,
> + RTE_TRACE_POINT_ARGS(
> + const struct rte_cryptodev_symmetric_capability *capability,
> + uint16_t key_size, uint16_t digest_size, uint16_t iv_size,
> + int ret),
> + rte_trace_point_emit_ptr(capability);
> + rte_trace_point_emit_int(capability->xform_type);
> + rte_trace_point_emit_u16(key_size);
> + rte_trace_point_emit_u16(digest_size);
> + rte_trace_point_emit_u16(iv_size);
> + rte_trace_point_emit_int(ret);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_capability_check_cipher,
> + RTE_TRACE_POINT_ARGS(
> + const struct rte_cryptodev_symmetric_capability *capability,
> + uint16_t key_size, uint16_t iv_size, int ret),
> + rte_trace_point_emit_ptr(capability);
> + rte_trace_point_emit_int(capability->xform_type);
> + rte_trace_point_emit_u16(key_size);
> + rte_trace_point_emit_u16(iv_size);
> + rte_trace_point_emit_int(ret);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_capability_get,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const char *driver_name,
> + uint8_t driver_id, int idx_type, const void *sym_capability),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_string(driver_name);
> + rte_trace_point_emit_u8(driver_id);
> + rte_trace_point_emit_int(idx_type);
> + rte_trace_point_emit_ptr(sym_capability);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_get_private_session_size,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint32_t priv_sess_size),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u32(priv_sess_size);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_asym_capability_get,
> + RTE_TRACE_POINT_ARGS(const char *driver_name, uint8_t driver_id,
> + int idx_type, const void *asym_cap),
> + rte_trace_point_emit_string(driver_name);
> + rte_trace_point_emit_u8(driver_id);
> + rte_trace_point_emit_int(idx_type);
> + rte_trace_point_emit_ptr(asym_cap);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_asym_get_private_session_size,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint32_t priv_sess_size),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u32(priv_sess_size);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_asym_get_xform_enum,
> + RTE_TRACE_POINT_ARGS(const char *xform_string,
> + enum rte_crypto_asym_xform_type xform_enum, int ret),
> + rte_trace_point_emit_string(xform_string);
> + rte_trace_point_emit_int(xform_enum);
> + rte_trace_point_emit_int(ret);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_asym_xform_capability_check_modlen,
> + RTE_TRACE_POINT_ARGS(const void *capability, uint16_t modlen, int ret),
> + rte_trace_point_emit_ptr(capability);
> + rte_trace_point_emit_u16(modlen);
> + rte_trace_point_emit_int(ret);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_cpu_crypto_process,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const void *sess),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_ptr(sess);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_get_existing_header_session_size,
> + RTE_TRACE_POINT_ARGS(struct rte_cryptodev_sym_session *sess),
> + rte_trace_point_emit_ptr(sess);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_session_get_user_data,
> + RTE_TRACE_POINT_ARGS(const void *sess, const void *data),
> + rte_trace_point_emit_ptr(sess);
> + rte_trace_point_emit_ptr(data);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_sym_session_set_user_data,
> + RTE_TRACE_POINT_ARGS(const void *sess, const void *data, uint16_t size),
> + rte_trace_point_emit_ptr(sess);
> + rte_trace_point_emit_ptr(data);
> + rte_trace_point_emit_u16(size);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_get_qp_status,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t queue_pair_id, int ret),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u16(queue_pair_id);
> + rte_trace_point_emit_int(ret);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_configure_raw_dp_ctx,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, int sess_type),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u16(qp_id);
> + rte_trace_point_emit_int(sess_type);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_get_raw_dp_ctx_size,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id),
> + rte_trace_point_emit_u8(dev_id);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_add_deq_callback,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void *cb_fn),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u16(qp_id);
> + rte_trace_point_emit_ptr(cb_fn);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_add_enq_callback,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void *cb_fn),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u16(qp_id);
> + rte_trace_point_emit_ptr(cb_fn);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_remove_deq_callback,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void *fn),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u16(qp_id);
> + rte_trace_point_emit_ptr(fn);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_remove_enq_callback,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, uint16_t qp_id, const void *fn),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_u16(qp_id);
> + rte_trace_point_emit_ptr(fn);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_asym_session_get_user_data,
> + RTE_TRACE_POINT_ARGS(const void *sess, const void *data),
> + rte_trace_point_emit_ptr(sess);
> + rte_trace_point_emit_ptr(data);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_asym_session_set_user_data,
> + RTE_TRACE_POINT_ARGS(const void *sess, const void *data, uint16_t size),
> + rte_trace_point_emit_ptr(sess);
> + rte_trace_point_emit_ptr(data);
> + rte_trace_point_emit_u16(size);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_session_event_mdata_set,
> + RTE_TRACE_POINT_ARGS(uint8_t dev_id, const void *sess, int op_type,
> + int sess_type, const void *ev_mdata, uint16_t size),
> + rte_trace_point_emit_u8(dev_id);
> + rte_trace_point_emit_ptr(sess);
> + rte_trace_point_emit_int(op_type);
> + rte_trace_point_emit_int(sess_type);
> + rte_trace_point_emit_ptr(ev_mdata);
> + rte_trace_point_emit_u16(size);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_allocate_driver,
> + RTE_TRACE_POINT_ARGS(const char *name),
> + rte_trace_point_emit_string(name);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_op_pool_create,
> + RTE_TRACE_POINT_ARGS(const char *name, int socket_id, int type,
> + uint32_t nb_elts, const void *mp),
> + rte_trace_point_emit_string(name);
> + rte_trace_point_emit_int(socket_id);
> + rte_trace_point_emit_int(type);
> + rte_trace_point_emit_u32(nb_elts);
> + rte_trace_point_emit_ptr(mp);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_asym_xform_capability_check_optype,
> + RTE_TRACE_POINT_ARGS(uint32_t op_types,
> + enum rte_crypto_asym_op_type op_type, int ret),
> + rte_trace_point_emit_u32(op_types);
> + rte_trace_point_emit_int(op_type);
> + rte_trace_point_emit_int(ret);
> +)
> +
> +RTE_TRACE_POINT(
> + rte_cryptodev_trace_count,
> + RTE_TRACE_POINT_ARGS(uint8_t nb_devs),
> + rte_trace_point_emit_u8(nb_devs);
> +)
> +
> #ifdef __cplusplus
> }
> #endif
> diff --git a/lib/cryptodev/version.map b/lib/cryptodev/version.map
> index 5aee87c6f7..6d9b3e01a6 100644
> --- a/lib/cryptodev/version.map
> +++ b/lib/cryptodev/version.map
> @@ -109,6 +109,54 @@ EXPERIMENTAL {
> #added in 22.07
> rte_cryptodev_session_event_mdata_set;
> rte_crypto_asym_ke_strings;
> +
> + #added in 22.11
> + __rte_cryptodev_trace_add_deq_callback;
> + __rte_cryptodev_trace_add_enq_callback;
> + __rte_cryptodev_trace_allocate_driver;
> + __rte_cryptodev_trace_asym_capability_get;
> + __rte_cryptodev_trace_asym_get_private_session_size;
> + __rte_cryptodev_trace_asym_get_xform_enum;
> + __rte_cryptodev_trace_asym_session_get_user_data;
> + __rte_cryptodev_trace_asym_session_set_user_data;
> + __rte_cryptodev_trace_asym_xform_capability_check_modlen;
> + __rte_cryptodev_trace_asym_xform_capability_check_optype;
> + __rte_cryptodev_trace_callback_register;
> + __rte_cryptodev_trace_callback_unregister;
> + __rte_cryptodev_trace_configure_raw_dp_ctx;
> + __rte_cryptodev_trace_device_count_by_driver;
> + __rte_cryptodev_trace_devices_get;
> + __rte_cryptodev_trace_driver_id_get;
> + __rte_cryptodev_trace_driver_name_get;
> + __rte_cryptodev_trace_get_aead_algo_enum;
> + __rte_cryptodev_trace_get_auth_algo_enum;
> + __rte_cryptodev_trace_get_cipher_algo_enum;
> + __rte_cryptodev_trace_get_dev_id;
> + __rte_cryptodev_trace_get_feature_name;
> + __rte_cryptodev_trace_get_qp_status;
> + __rte_cryptodev_trace_get_raw_dp_ctx_size;
> + __rte_cryptodev_trace_get_sec_ctx;
> + __rte_cryptodev_trace_info_get;
> + __rte_cryptodev_trace_is_valid_dev;
> + __rte_cryptodev_trace_name_get;
> + __rte_cryptodev_trace_op_pool_create;
> + __rte_cryptodev_trace_queue_pair_count;
> + __rte_cryptodev_trace_remove_deq_callback;
> + __rte_cryptodev_trace_remove_enq_callback;
> + __rte_cryptodev_trace_session_event_mdata_set;
> + __rte_cryptodev_trace_socket_id;
> + __rte_cryptodev_trace_stats_get;
> + __rte_cryptodev_trace_stats_reset;
> + __rte_cryptodev_trace_sym_capability_check_aead;
> + __rte_cryptodev_trace_sym_capability_check_auth;
> + __rte_cryptodev_trace_sym_capability_check_cipher;
> + __rte_cryptodev_trace_sym_capability_get;
> + __rte_cryptodev_trace_sym_cpu_crypto_process;
> + __rte_cryptodev_trace_sym_get_existing_header_session_size;
> + __rte_cryptodev_trace_sym_get_private_session_size;
> + __rte_cryptodev_trace_sym_session_get_user_data;
> + __rte_cryptodev_trace_sym_session_set_user_data;
> + __rte_cryptodev_trace_count;
> };
>
> INTERNAL {
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [EXT] Re: [PATCH v2] cryptodev: add trace points
2022-09-30 7:34 ` Jerin Jacob
@ 2022-09-30 18:22 ` Akhil Goyal
0 siblings, 0 replies; 8+ messages in thread
From: Akhil Goyal @ 2022-09-30 18:22 UTC (permalink / raw)
To: Jerin Jacob, Amit Prakash Shukla
Cc: Fan Zhang, Ray Kinsella, dev, Jerin Jacob Kollanukkaran, roy.fan.zhang
> On Thu, Sep 29, 2022 at 6:08 PM Amit Prakash Shukla
> <amitprakashs@marvell.com> wrote:
> >
> > Add trace points for cryptodev functions.
> >
> > Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
>
> Looks good from tracing PoV.
>
> Reviewed-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Applied to dpdk-next-crypto
Thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-09-30 18:24 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-16 17:32 [PATCH] cryptodev: add trace points Amit Prakash Shukla
2022-09-27 8:06 ` Akhil Goyal
2022-09-27 13:48 ` Amit Prakash Shukla
2022-09-28 4:08 ` Jerin Jacob
2022-09-28 17:30 ` [EXT] " Amit Prakash Shukla
2022-09-29 12:35 ` [PATCH v2] " Amit Prakash Shukla
2022-09-30 7:34 ` Jerin Jacob
2022-09-30 18:22 ` [EXT] " Akhil Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).