* [PATCH] eventdev: add device info telemetry command
@ 2024-11-06 16:07 Bruce Richardson
2024-11-06 16:31 ` [PATCH v2 0/2] small improvements for eventdev telemetry Bruce Richardson
0 siblings, 1 reply; 4+ messages in thread
From: Bruce Richardson @ 2024-11-06 16:07 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, Jerin Jacob
The eventdev telemetry support did not have a command for showing basic
info about each eventdev device, such as the name and driver in use. Add
this callback to allow telemetry user to determine which eventdev device
is which.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/eventdev/rte_eventdev.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index ca295c87c4..23631ff3f6 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -1725,6 +1725,41 @@ handle_dev_list(const char *cmd __rte_unused,
return 0;
}
+static int
+handle_dev_info(const char *cmd __rte_unused,
+ const char *params,
+ struct rte_tel_data *d)
+{
+ uint8_t dev_id;
+ struct rte_eventdev *dev;
+ char *end_param;
+
+ if (params == NULL || strlen(params) == 0 || !isdigit(*params))
+ return -1;
+
+ dev_id = strtoul(params, &end_param, 10);
+ if (*end_param != '\0')
+ RTE_EDEV_LOG_DEBUG(
+ "Extra parameters passed to eventdev telemetry command, ignoring");
+
+ RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
+ dev = &rte_eventdevs[dev_id];
+
+ rte_tel_data_start_dict(d);
+ rte_tel_data_add_dict_int(d, "dev_id", dev_id);
+ rte_tel_data_add_dict_string(d, "dev_name", dev->dev->name);
+ rte_tel_data_add_dict_string(d, "dev_driver", dev->dev->driver->name);
+ rte_tel_data_add_dict_string(d, "state",
+ dev->data->dev_started ? "started" : "stopped");
+ rte_tel_data_add_dict_int(d, "socket_id", dev->data->socket_id);
+ rte_tel_data_add_dict_int(d, "nb_queues", dev->data->nb_queues);
+ rte_tel_data_add_dict_int(d, "nb_ports", dev->data->nb_ports);
+ rte_tel_data_add_dict_uint_hex(d, "capabilities", dev->data->event_dev_cap,
+ sizeof(dev->data->event_dev_cap) * CHAR_BIT);
+
+ return 0;
+}
+
static int
handle_port_list(const char *cmd __rte_unused,
const char *params,
@@ -2030,6 +2065,8 @@ RTE_INIT(eventdev_init_telemetry)
{
rte_telemetry_register_cmd("/eventdev/dev_list", handle_dev_list,
"Returns list of available eventdevs. Takes no parameters");
+ rte_telemetry_register_cmd("/eventdev/dev_info", handle_dev_info,
+ "Returns basic info about an eventdev. Parameter: DevID");
rte_telemetry_register_cmd("/eventdev/port_list", handle_port_list,
"Returns list of available ports. Parameter: DevID");
rte_telemetry_register_cmd("/eventdev/queue_list", handle_queue_list,
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 0/2] small improvements for eventdev telemetry
2024-11-06 16:07 [PATCH] eventdev: add device info telemetry command Bruce Richardson
@ 2024-11-06 16:31 ` Bruce Richardson
2024-11-06 16:31 ` [PATCH v2 1/2] eventdev: add device info telemetry command Bruce Richardson
2024-11-06 16:31 ` [PATCH v2 2/2] eventdev: add standard aliases for telemetry commands Bruce Richardson
0 siblings, 2 replies; 4+ messages in thread
From: Bruce Richardson @ 2024-11-06 16:31 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson
Two small improvements for eventdev telemetry:
* add a device info command to show the name, driver and other minor
details for each device.
* add aliases for "dev_list" and "dev_info" to just "list" and "info"
for consistency with other commands.
V2: expand from single patch to a 2-patch set.
Bruce Richardson (2):
eventdev: add device info telemetry command
eventdev: add standard aliases for telemetry commands
lib/eventdev/rte_eventdev.c | 46 +++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 1/2] eventdev: add device info telemetry command
2024-11-06 16:31 ` [PATCH v2 0/2] small improvements for eventdev telemetry Bruce Richardson
@ 2024-11-06 16:31 ` Bruce Richardson
2024-11-06 16:31 ` [PATCH v2 2/2] eventdev: add standard aliases for telemetry commands Bruce Richardson
1 sibling, 0 replies; 4+ messages in thread
From: Bruce Richardson @ 2024-11-06 16:31 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, Jerin Jacob
The eventdev telemetry support did not have a command for showing basic
info about each eventdev device, such as the name and driver in use. Add
this callback to allow telemetry user to determine which eventdev device
is which.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/eventdev/rte_eventdev.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index ca295c87c4..23631ff3f6 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -1725,6 +1725,41 @@ handle_dev_list(const char *cmd __rte_unused,
return 0;
}
+static int
+handle_dev_info(const char *cmd __rte_unused,
+ const char *params,
+ struct rte_tel_data *d)
+{
+ uint8_t dev_id;
+ struct rte_eventdev *dev;
+ char *end_param;
+
+ if (params == NULL || strlen(params) == 0 || !isdigit(*params))
+ return -1;
+
+ dev_id = strtoul(params, &end_param, 10);
+ if (*end_param != '\0')
+ RTE_EDEV_LOG_DEBUG(
+ "Extra parameters passed to eventdev telemetry command, ignoring");
+
+ RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
+ dev = &rte_eventdevs[dev_id];
+
+ rte_tel_data_start_dict(d);
+ rte_tel_data_add_dict_int(d, "dev_id", dev_id);
+ rte_tel_data_add_dict_string(d, "dev_name", dev->dev->name);
+ rte_tel_data_add_dict_string(d, "dev_driver", dev->dev->driver->name);
+ rte_tel_data_add_dict_string(d, "state",
+ dev->data->dev_started ? "started" : "stopped");
+ rte_tel_data_add_dict_int(d, "socket_id", dev->data->socket_id);
+ rte_tel_data_add_dict_int(d, "nb_queues", dev->data->nb_queues);
+ rte_tel_data_add_dict_int(d, "nb_ports", dev->data->nb_ports);
+ rte_tel_data_add_dict_uint_hex(d, "capabilities", dev->data->event_dev_cap,
+ sizeof(dev->data->event_dev_cap) * CHAR_BIT);
+
+ return 0;
+}
+
static int
handle_port_list(const char *cmd __rte_unused,
const char *params,
@@ -2030,6 +2065,8 @@ RTE_INIT(eventdev_init_telemetry)
{
rte_telemetry_register_cmd("/eventdev/dev_list", handle_dev_list,
"Returns list of available eventdevs. Takes no parameters");
+ rte_telemetry_register_cmd("/eventdev/dev_info", handle_dev_info,
+ "Returns basic info about an eventdev. Parameter: DevID");
rte_telemetry_register_cmd("/eventdev/port_list", handle_port_list,
"Returns list of available ports. Parameter: DevID");
rte_telemetry_register_cmd("/eventdev/queue_list", handle_queue_list,
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2 2/2] eventdev: add standard aliases for telemetry commands
2024-11-06 16:31 ` [PATCH v2 0/2] small improvements for eventdev telemetry Bruce Richardson
2024-11-06 16:31 ` [PATCH v2 1/2] eventdev: add device info telemetry command Bruce Richardson
@ 2024-11-06 16:31 ` Bruce Richardson
1 sibling, 0 replies; 4+ messages in thread
From: Bruce Richardson @ 2024-11-06 16:31 UTC (permalink / raw)
To: dev; +Cc: Bruce Richardson, Jerin Jacob
Most other device classes in DPDK which offer telemetry provide a list
of the devices of that class via "/<class>/list", e.g. /ethdev/list,
/ring/list, /mempool/list. However, eventdev provided that list via
"dev_list" command. For consistency, add "list" as an alias for
"dev_list" - after all the "dev" is part of the initial "/eventdev"
prefix part, so should not need repeating.
Similarly for the "dev_info" command, provide an alias as just "info".
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/eventdev/rte_eventdev.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 23631ff3f6..d3f1ea092f 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -2067,6 +2067,15 @@ RTE_INIT(eventdev_init_telemetry)
"Returns list of available eventdevs. Takes no parameters");
rte_telemetry_register_cmd("/eventdev/dev_info", handle_dev_info,
"Returns basic info about an eventdev. Parameter: DevID");
+
+ /* alias "dev_list" and "dev_info" as just "list" and "info" to match
+ * other categories, such as ethdev, ring, mempool etc.
+ */
+ rte_telemetry_register_cmd("/eventdev/list", handle_dev_list,
+ "Returns list of available eventdevs. Takes no parameters");
+ rte_telemetry_register_cmd("/eventdev/info", handle_dev_info,
+ "Returns basic info about an eventdev. Parameter: DevID");
+
rte_telemetry_register_cmd("/eventdev/port_list", handle_port_list,
"Returns list of available ports. Parameter: DevID");
rte_telemetry_register_cmd("/eventdev/queue_list", handle_queue_list,
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-06 16:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-06 16:07 [PATCH] eventdev: add device info telemetry command Bruce Richardson
2024-11-06 16:31 ` [PATCH v2 0/2] small improvements for eventdev telemetry Bruce Richardson
2024-11-06 16:31 ` [PATCH v2 1/2] eventdev: add device info telemetry command Bruce Richardson
2024-11-06 16:31 ` [PATCH v2 2/2] eventdev: add standard aliases for telemetry commands Bruce Richardson
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).