[dpdk-dev] [EXT] [PATCH] cryptodev: add telemetry callbacks
Gowrishankar Muthukrishnan
gmuthukrishn at marvell.com
Wed Sep 29 07:14:38 CEST 2021
> An example usage can be seen below:
>
> Connecting to /var/run/dpdk/rte/dpdk_telemetry.v2
> {"version": "DPDK 21.11.0-rc0", "pid": 1135019, "max_output_len": 16384}
> --> /
> {"/": ["/", "/cryptodev/list", "/cryptodev/stats", ...]}
> --> /cryptodev/list
> {"/cryptodev/list": {"0000:1a:01.0_qat_sym": 0, "0000:1a:01.0_qat_asym": \
> 1}}
Will this be better if we list keys by port ID, as port ID is used as param in appropriate endpoints ?
Just a suggestion.
> --> /cryptodev/stats,0
> {"/cryptodev/stats": {"enqueued_count": 0, "dequeued_count": 0, \
> "enqueue_err_count": 0, "dequeue_err_count": 0}}
>
> Signed-off-by: Rebecca Troy <rebecca.troy at intel.com>
> ---
> lib/cryptodev/rte_cryptodev.c | 62 +++++++++++++++++++++++++++++++++++
> 1 file changed, 62 insertions(+)
>
> diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index
> 447aa9d519..1e3ab633cc 100644
> --- a/lib/cryptodev/rte_cryptodev.c
> +++ b/lib/cryptodev/rte_cryptodev.c
> @@ -36,6 +36,7 @@
> #include <rte_errno.h>
> #include <rte_spinlock.h>
> #include <rte_string_fns.h>
> +#include <rte_telemetry.h>
>
> #include "rte_crypto.h"
> #include "rte_cryptodev.h"
> @@ -2427,3 +2428,64 @@ rte_cryptodev_allocate_driver(struct
> cryptodev_driver *crypto_drv,
>
> return nb_drivers++;
> }
> +
> +static int
> +cryptodev_handle_dev_list(const char *cmd __rte_unused,
> + const char *params __rte_unused,
> + struct rte_tel_data *d)
> +{
> + int dev_id;
> +
> + if (rte_cryptodev_count() < 1)
> + return -1;
> +
> + rte_tel_data_start_dict(d);
> + for (dev_id = 0; dev_id < RTE_CRYPTO_MAX_DEVS; dev_id++)
> + if (rte_cryptodev_pmd_is_valid_dev(dev_id))
This is broken now. Correct function is rte_cryptodev_is_valid_dev() .
Thanks,
Gowrishankar
More information about the dev
mailing list