eventdev: support telemetry with xstats info
PATCH 1/1 eventdev: support telemetry with xstats info
The telemetry library is connected with eventdev xstats and port link info. The following new telemetry commands are added:
/eventdev/dev_list
/eventdev/port_list,DevID
/eventdev/queue_list,DevID
/eventdev/dev_xstats,DevID
/eventdev/port_xstats,DevID,PortID
/eventdev/queue_xstats,DevID,PortID
/eventdev/queue_links,DevID,PortID
queue_links command displays a list of queues linked with a specified eventdev port and a service priority associated with each link.
---
Depends-on: patch-76075 ("lib/telemetry: fix passing full params string to command")
--- lib/librte_eventdev/meson.build | 1 + lib/librte_eventdev/rte_eventdev.c | 304 +++++++++++++++++++++++++++++ 2 files changed, 305 insertions(+)
lib/librte_eventdev/meson.build +1 -0
@@ -27,3 +27,4 @@ headers = files('rte_eventdev.h', 'rte_event_crypto_adapter.h', 'rte_event_eth_tx_adapter.h') deps += ['ring', 'ethdev', 'hash', 'mempool', 'mbuf', 'timer', 'cryptodev'] +deps += ['telemetry']
lib/librte_eventdev/rte_eventdev.c +304 -0
313 lines not on this page · raw message
Signature · 1 line
2.17.1
Hi Mike,
See comment inline.
Asides from that comment, overall the change looks good from a Telemetry usage point of view, in my opinion.
Thanks,
Ciara
Quoted 32 lines
-----Original Message-----
From: Chen, Mike Ximing <[email protected]>
Sent: Wednesday 9 September 2020 21:55
To: Jerin Jacob <[email protected]>
Cc: [email protected]; Eads, Gage <[email protected]>; Vedantham, Sundar <[email protected]>; Power, Ciara <[email protected]>; Richardson, Bruce <[email protected]>; Chen, Mike Ximing <[email protected]>
Subject: [PATCH] eventdev: support telemetry with xstats infoThe telemetry library is connected with eventdev xstats and port link info. The following new telemetry commands are added:
/eventdev/dev_list
/eventdev/port_list,DevID
/eventdev/queue_list,DevID
/eventdev/dev_xstats,DevID
/eventdev/port_xstats,DevID,PortID
/eventdev/queue_xstats,DevID,PortID
/eventdev/queue_links,DevID,PortID
queue_linkscommand displays a list of queues linked with a specified eventdev port and a service priority associated with each link.Signed-off-by Mike Ximing Chen <[email protected]>---
Depends-on: patch-76075 ("lib/telemetry: fix passing full params string to command")
---lib/librte_eventdev/meson.build| 1 +lib/librte_eventdev/rte_eventdev.c| 304 +++++++++++++++++++++++++++++2 files changed, 305 insertions(+)
<snip>
Quoted 29 lines
lib/librte_eventdev/rte_eventdev.c +29
-0+ +static int +handle_queue_links(const char *cmd __rte_unused, +const char *params, +struct rte_tel_data *d) +{ +int i, ret, port_id =0 ; +char *end_param; +uint8_t dev_id; +uint8_t queues[RTE_EVENT_MAX_QUEUES_PER_DEV ]; +uint8_t priorities[RTE_EVENT_MAX_QUEUES_PER_DEV ]; +const char *p_param; + +if (params ==NULL ||strlen (params) ==0 || !isdigit (*params)) +return -1 ; + +/* Get dev ID from parameter string */ + dev_id =strtoul (params, &end_param,10 ); +RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET (dev_id, -EINVAL ); + + p_param =strtok (end_param,"," ); +if (p_param ==NULL ||strlen (p_param) ==0 || !isdigit (*p_param)) +return -1 ; + + port_id =strtoul (p_param, &end_param,10 ); + p_param =strtok (NULL ,"\0" ); +if (*p_param !='\0' ) + RTE_EDEV_LOG_DEBUG( + "Extra parameters passed to eventdev telemetry
Quoted 1 line
command, ignoring");
The code above to parse the parameters doesn't look right to me - I think in the case of valid parameters being passed (e.g. "0,2"), there would be a seg fault at this condition check on p_param.
This applies to the other handler functions here that follow similar steps also.
Quoted 15 lines
lib/librte_eventdev/rte_eventdev.c +15
-0+ + ret =rte_event_port_links_get (dev_id, port_id, queues, priorities); +if (ret <0 ) +return -1 ; + +rte_tel_data_start_dict (d); +for (i =0 ; i < ret; i++) { +char qid_name[32 ]; + +snprintf (qid_name,31 ,"qid_%u" , queues[i]); +rte_tel_data_add_dict_u64 (d, qid_name, priorities[i]); + } + +return 0 ; +}
<snip>
Hi Ciara,
Thanks for identifying the issue. For some reasons, the problem did not show up in my previous tests with telemetry and eventdev. I will fix the bug as we discussed and upload a v2 patch.
Best Regards,
Mike
-----Original Message-----
From: Power, Ciara <[email protected]>
Sent: Thursday, September 17, 2020 5:05 AM
To: Chen, Mike Ximing <[email protected]>; Jerin Jacob <[email protected]>
Cc: [email protected]; Eads, Gage <[email protected]>; Vedantham, Sundar <[email protected]>; Richardson, Bruce <[email protected]>
Subject: RE: [PATCH] eventdev: support telemetry with xstats info
Hi Mike,
See comment inline.
Asides from that comment, overall the change looks good from a Telemetry usage point of view, in my opinion.
Thanks,
Ciara
Quoted 33 lines
-----Original Message-----
From: Chen, Mike Ximing <[email protected]>
Sent: Wednesday 9 September 2020 21:55
To: Jerin Jacob <[email protected]>
Cc: [email protected]; Eads, Gage <[email protected]>; Vedantham, Sundar <[email protected]>; Power, Ciara <[email protected]>; Richardson, Bruce <[email protected]>; Chen, Mike Ximing <[email protected]>
Subject: [PATCH] eventdev: support telemetry with xstats infoThe telemetry library is connected with eventdev xstats and port link info. The following new telemetry commands are added:
/eventdev/dev_list
/eventdev/port_list,DevID
/eventdev/queue_list,DevID
/eventdev/dev_xstats,DevID
/eventdev/port_xstats,DevID,PortID
/eventdev/queue_xstats,DevID,PortID
/eventdev/queue_links,DevID,PortID
queue_linkscommand displays a list of queues linked with a specified eventdev port and a service priority associated with each link.Signed-off-by Mike Ximing Chen <[email protected]>---
Depends-on: patch-76075 ("lib/telemetry: fix passing full params string to
command")
---lib/librte_eventdev/meson.build| 1 +lib/librte_eventdev/rte_eventdev.c| 304 +++++++++++++++++++++++++++++2 files changed, 305 insertions(+)
<snip>
Quoted 29 lines
lib/librte_eventdev/rte_eventdev.c +29
-0+ +static int +handle_queue_links(const char *cmd __rte_unused, +const char *params, +struct rte_tel_data *d) +{ +int i, ret, port_id =0 ; +char *end_param; +uint8_t dev_id; +uint8_t queues[RTE_EVENT_MAX_QUEUES_PER_DEV ]; +uint8_t priorities[RTE_EVENT_MAX_QUEUES_PER_DEV ]; +const char *p_param; + +if (params ==NULL ||strlen (params) ==0 || !isdigit (*params)) +return -1 ; + +/* Get dev ID from parameter string */ + dev_id =strtoul (params, &end_param,10 ); +RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET (dev_id, -EINVAL ); + + p_param =strtok (end_param,"," ); +if (p_param ==NULL ||strlen (p_param) ==0 || !isdigit (*p_param)) +return -1 ; + + port_id =strtoul (p_param, &end_param,10 ); + p_param =strtok (NULL ,"\0" ); +if (*p_param !='\0' ) + RTE_EDEV_LOG_DEBUG( + "Extra parameters passed to eventdev telemetry
Quoted 1 line
command, ignoring");
The code above to parse the parameters doesn't look right to me - I think in the case of valid parameters being passed (e.g. "0,2"), there would be a seg fault at this condition check on p_param. This applies to the other handler functions here that follow similar steps also.
Quoted 15 lines
lib/librte_eventdev/rte_eventdev.c +15
-0+ + ret =rte_event_port_links_get (dev_id, port_id, queues, priorities); +if (ret <0 ) +return -1 ; + +rte_tel_data_start_dict (d); +for (i =0 ; i < ret; i++) { +char qid_name[32 ]; + +snprintf (qid_name,31 ,"qid_%u" , queues[i]); +rte_tel_data_add_dict_u64 (d, qid_name, priorities[i]); + } + +return 0 ; +}
<snip>
PATCH v3 1/1 eventdev: support telemetry with xstats info
In reply to Chen, Mike XimingThe telemetry library is connected with eventdev xstats and port link info. The following new telemetry commands are added:
/eventdev/dev_list
/eventdev/port_list,DevID
/eventdev/queue_list,DevID
/eventdev/dev_xstats,DevID
/eventdev/port_xstats,DevID,PortID
/eventdev/queue_xstats,DevID,PortID
/eventdev/queue_links,DevID,PortID
queue_links command displays a list of queues linked with a specified eventdev port and a service priority associated with each link.
---
Depends-on: patch-76075 ("lib/telemetry: fix passing full params string to command")
---
v2:
* Fixed an issue with p_param in handles.
v3:
* No code change.
* Add --in-reply-to v1 patch.
--- lib/librte_eventdev/meson.build | 1 + lib/librte_eventdev/rte_eventdev.c | 304 +++++++++++++++++++++++++++++ 2 files changed, 305 insertions(+)
lib/librte_eventdev/meson.build +1 -0
@@ -27,3 +27,4 @@ headers = files('rte_eventdev.h', 'rte_event_crypto_adapter.h', 'rte_event_eth_tx_adapter.h') deps += ['ring', 'ethdev', 'hash', 'mempool', 'mbuf', 'timer', 'cryptodev'] +deps += ['telemetry']
lib/librte_eventdev/rte_eventdev.c +304 -0
313 lines not on this page · raw message
Signature · 1 line
2.17.1
Quoted 39 lines
-----Original Message-----
From: Chen, Mike Ximing <[email protected]>
Sent: Friday 18 September 2020 18:39
To: Jerin Jacob <[email protected]>
Cc: [email protected]; Eads, Gage <[email protected]>; Vedantham, Sundar <[email protected]>; Power, Ciara <[email protected]>; Richardson, Bruce <[email protected]>
Subject: [PATCH v3] eventdev: support telemetry with xstats infoThe telemetry library is connected with eventdev xstats and port link info. The following new telemetry commands are added:
/eventdev/dev_list
/eventdev/port_list,DevID
/eventdev/queue_list,DevID
/eventdev/dev_xstats,DevID
/eventdev/port_xstats,DevID,PortID
/eventdev/queue_xstats,DevID,PortID
/eventdev/queue_links,DevID,PortID
queue_linkscommand displays a list of queues linked with a specified eventdev port and a service priority associated with each link.Signed-off-by Mike Ximing Chen <[email protected]>---
Depends-on: patch-76075 ("lib/telemetry: fix passing full params string to command")
---
v2:
* Fixed an issue withp_paramin handles.v3:
* No code change.
* Add --in-reply-to v1 patch.
---lib/librte_eventdev/meson.build| 1 +lib/librte_eventdev/rte_eventdev.c| 304 +++++++++++++++++++++++++++++2 files changed, 305 insertions(+)
<snip>
Quoted 28 lines
lib/librte_eventdev/rte_eventdev.c +28
-0+static int +handle_queue_links(const char *cmd __rte_unused, +const char *params, +struct rte_tel_data *d) +{ +int i, ret, port_id =0 ; +char *end_param; +uint8_t dev_id; +uint8_t queues[RTE_EVENT_MAX_QUEUES_PER_DEV ]; +uint8_t priorities[RTE_EVENT_MAX_QUEUES_PER_DEV ]; +const char *p_param; + +if (params ==NULL ||strlen (params) ==0 || !isdigit (*params)) +return -1 ; + +/* Get dev ID from parameter string */ + dev_id =strtoul (params, &end_param,10 ); +RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET (dev_id, -EINVAL ); + + p_param =strtok (end_param,"," ); +if (p_param ==NULL ||strlen (p_param) ==0 || !isdigit (*p_param)) +return -1 ; + + port_id =strtoul (p_param, &end_param,10 ); + p_param =strtok (NULL ,"\0" ); +if (p_param !=NULL ) + RTE_EDEV_LOG_DEBUG( + "Extra parameters passed to eventdev telemetry
Quoted 2 lines
command, ignoring");
+
<snip>
This fix avoids the seg fault I previously mentioned, looks fine to me.
Quoted 22 lines
-----Original Message-----
From: Chen, Mike Ximing <[email protected]>
Sent: Friday, September 18, 2020 12:39 PM
To: Jerin Jacob <[email protected]>
Cc: [email protected]; Eads, Gage <[email protected]>; Vedantham, Sundar <[email protected]>; Power, Ciara <[email protected]>; Richardson, Bruce <[email protected]>
Subject: [PATCH v3] eventdev: support telemetry with xstats infoThe telemetry library is connected with eventdev xstats and port link info. The following new telemetry commands are added:
/eventdev/dev_list
/eventdev/port_list,DevID
/eventdev/queue_list,DevID
/eventdev/dev_xstats,DevID
/eventdev/port_xstats,DevID,PortID
/eventdev/queue_xstats,DevID,PortID
/eventdev/queue_links,DevID,PortID
Quoted 4 lines
queue_linkscommand displays a list of queues linked with a specified eventdev port and a service priority associated with each link.Signed-off-by Mike Ximing Chen <[email protected]>
Thanks,
Gage
Jerin Jacob
AppliedQuoted 23 lines · Gage
Quoted 23 lines
-----Original Message-----
From: Chen, Mike Ximing <[email protected]>
Sent: Friday, September 18, 2020 12:39 PM
To: Jerin Jacob <[email protected]>
Cc: [email protected]; Eads, Gage <[email protected]>; Vedantham, Sundar <[email protected]>; Power, Ciara <[email protected]>; Richardson, Bruce <[email protected]>
Subject: [PATCH v3] eventdev: support telemetry with xstats infoThe telemetry library is connected with eventdev xstats and port link info. The following new telemetry commands are added:
/eventdev/dev_list
/eventdev/port_list,DevID
/eventdev/queue_list,DevID
/eventdev/dev_xstats,DevID
/eventdev/port_xstats,DevID,PortID
/eventdev/queue_xstats,DevID,PortID
/eventdev/queue_links,DevID,PortID
Quoted 6 lines
Quoted 4 lines
queue_linkscommand displays a list of queues linked with a specified eventdev port and a service priority associated with each link.Signed-off-by Mike Ximing Chen <[email protected]>Reviewed-by Gage Eads <[email protected]>
Applied to dpdk-next-eventdev/for-main. Thanks.
Quoted 3 lines
Thanks,
Gage