* [dpdk-dev] [PATCH v1] eventdev/rx-adapter: add telemetry callbacks @ 2021-10-07 12:57 Ganapati Kundapura 2021-10-07 13:46 ` [dpdk-dev] [PATCH v2] " Ganapati Kundapura 2021-10-11 16:14 ` [dpdk-dev] [PATCH v1] eventdev/rx-adapter: " Jerin Jacob 0 siblings, 2 replies; 19+ messages in thread From: Ganapati Kundapura @ 2021-10-07 12:57 UTC (permalink / raw) To: jerinjacobk, dev; +Cc: jay.jayatheerthan Added telemetry callbacks to get Rx adapter stats, reset stats and to get rx queue config information. Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com> diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 9ac976c..fa7191c 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -23,6 +23,7 @@ #include "eventdev_pmd.h" #include "rte_eventdev_trace.h" #include "rte_event_eth_rx_adapter.h" +#include <rte_telemetry.h> #define BATCH_SIZE 32 #define BLOCK_CNT_THRESHOLD 10 @@ -2852,6 +2853,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, struct rte_event_eth_rx_adapter_stats *stats) { struct rte_event_eth_rx_adapter *rx_adapter; + struct rte_eth_event_enqueue_buffer *buf; struct rte_event_eth_rx_adapter_stats dev_stats_sum = { 0 }; struct rte_event_eth_rx_adapter_stats dev_stats; struct rte_eventdev *dev; @@ -2887,8 +2889,11 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, if (rx_adapter->service_inited) *stats = rx_adapter->stats; + buf = &rx_adapter->event_enqueue_buffer; stats->rx_packets += dev_stats_sum.rx_packets; stats->rx_enq_count += dev_stats_sum.rx_enq_count; + stats->rx_event_buf_count = buf->count; + stats->rx_event_buf_size = buf->events_size; return 0; } @@ -3052,3 +3057,146 @@ rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, return 0; } + +#define RXA_ADD_DICT(stats, s) rte_tel_data_add_dict_u64(d, #s, stats.s) + +static int +handle_rxa_stats(const char *cmd __rte_unused, + const char *params, + struct rte_tel_data *d) +{ + uint8_t rx_adapter_id; + struct rte_event_eth_rx_adapter_stats rx_adptr_stats; + + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) + return -1; + + /* Get Rx adapter ID from parameter string */ + rx_adapter_id = atoi(params); + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); + + /* Get Rx adapter stats */ + if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, + &rx_adptr_stats)) { + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); + return -1; + } + + rte_tel_data_start_dict(d); + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); + RXA_ADD_DICT(rx_adptr_stats, rx_packets); + RXA_ADD_DICT(rx_adptr_stats, rx_poll_count); + RXA_ADD_DICT(rx_adptr_stats, rx_dropped); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_retry); + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_count); + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_size); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_count); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_start_ts); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_block_cycles); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_end_ts); + RXA_ADD_DICT(rx_adptr_stats, rx_intr_packets); + + return 0; +} + +static int +handle_rxa_stats_reset(const char *cmd __rte_unused, + const char *params, + struct rte_tel_data *d __rte_unused) +{ + uint8_t rx_adapter_id; + + if (params == NULL || strlen(params) == 0 || ~isdigit(*params)) + return -1; + + /* Get Rx adapter ID from parameter string */ + rx_adapter_id = atoi(params); + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); + + /* Reset Rx adapter stats */ + if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); + return -1; + } + + return 0; +} + +static int +handle_rxa_get_queue_conf(const char *cmd __rte_unused, + const char *params, + struct rte_tel_data *d) +{ + uint8_t rx_adapter_id; + uint16_t rx_queue_id; + int eth_dev_id; + char *token, *l_params; + struct rte_event_eth_rx_adapter_queue_conf queue_conf; + + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) + return -1; + + /* Get Rx adapter ID from parameter string */ + l_params = strdup(params); + token = strtok(l_params, ","); + rx_adapter_id = strtoul(token, NULL, 10); + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); + + token = strtok(NULL, ","); + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) + return -1; + + /* Get device ID from parameter string */ + eth_dev_id = strtoul(token, NULL, 10); + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, -EINVAL); + + token = strtok(NULL, ","); + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) + return -1; + + /* Get Rx queue ID from parameter string */ + rx_queue_id = strtoul(token, NULL, 10); + if (rx_queue_id >= rte_eth_devices[eth_dev_id].data->nb_rx_queues) { + RTE_EDEV_LOG_ERR("Invalid rx queue_id %u", rx_queue_id); + return -EINVAL; + } + + token = strtok(NULL, "\0"); + if (token != NULL) + RTE_EDEV_LOG_ERR("Extra parameters passed to eventdev" + " telemetry command, igrnoring"); + + if (rte_event_eth_rx_adapter_queue_conf_get(rx_adapter_id, eth_dev_id, + rx_queue_id, &queue_conf)) { + RTE_EDEV_LOG_ERR("Failed to get Rx adapter queue config"); + return -1; + } + + rte_tel_data_start_dict(d); + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); + rte_tel_data_add_dict_u64(d, "eth_dev_id", eth_dev_id); + rte_tel_data_add_dict_u64(d, "rx_queue_id", rx_queue_id); + RXA_ADD_DICT(queue_conf, rx_queue_flags); + RXA_ADD_DICT(queue_conf, servicing_weight); + RXA_ADD_DICT(queue_conf.ev, queue_id); + RXA_ADD_DICT(queue_conf.ev, sched_type); + RXA_ADD_DICT(queue_conf.ev, priority); + RXA_ADD_DICT(queue_conf.ev, flow_id); + + return 0; +} + +RTE_INIT(rxa_init_telemetry) +{ + rte_telemetry_register_cmd("/eventdev/rxa_stats", + handle_rxa_stats, + "Returns Rx adapter stats. Parameter: rx_adapter_id"); + + rte_telemetry_register_cmd("/eventdev/rxa_stats_reset", + handle_rxa_stats_reset, + "Reset Rx adapter stats. Parameter: rx_adapter_id"); + + rte_telemetry_register_cmd("/eventdev/rxa_queue_conf", + handle_rxa_get_queue_conf, + "Returns Rx queue config. Parameter: rxa_id, DevID, que_id"); +} diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_event_eth_rx_adapter.h index 70ca427..acabed4 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.h +++ b/lib/eventdev/rte_event_eth_rx_adapter.h @@ -216,6 +216,10 @@ struct rte_event_eth_rx_adapter_stats { /**< Eventdev enqueue count */ uint64_t rx_enq_retry; /**< Eventdev enqueue retry count */ + uint64_t rx_event_buf_count; + /**< Rx event buffered count */ + uint64_t rx_event_buf_size; + /**< Rx event buffer size */ uint64_t rx_dropped; /**< Received packet dropped count */ uint64_t rx_enq_start_ts; -- 2.6.4 ^ permalink raw reply [flat|nested] 19+ messages in thread
* [dpdk-dev] [PATCH v2] eventdev/rx-adapter: add telemetry callbacks 2021-10-07 12:57 [dpdk-dev] [PATCH v1] eventdev/rx-adapter: add telemetry callbacks Ganapati Kundapura @ 2021-10-07 13:46 ` Ganapati Kundapura 2021-10-07 16:02 ` [dpdk-dev] [EXT] " Gowrishankar Muthukrishnan 2021-10-12 10:25 ` [dpdk-dev] [PATCH v3] eventdev/rx_adapter: " Ganapati Kundapura 2021-10-11 16:14 ` [dpdk-dev] [PATCH v1] eventdev/rx-adapter: " Jerin Jacob 1 sibling, 2 replies; 19+ messages in thread From: Ganapati Kundapura @ 2021-10-07 13:46 UTC (permalink / raw) To: jerinjacobk, dev; +Cc: jay.jayatheerthan Added telemetry callbacks to get Rx adapter stats, reset stats and to get rx queue config information. Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com> --- v2: Fixed checkpatch warning --- diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 9ac976c..c2fb54a 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -23,6 +23,7 @@ #include "eventdev_pmd.h" #include "rte_eventdev_trace.h" #include "rte_event_eth_rx_adapter.h" +#include <rte_telemetry.h> #define BATCH_SIZE 32 #define BLOCK_CNT_THRESHOLD 10 @@ -2852,6 +2853,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, struct rte_event_eth_rx_adapter_stats *stats) { struct rte_event_eth_rx_adapter *rx_adapter; + struct rte_eth_event_enqueue_buffer *buf; struct rte_event_eth_rx_adapter_stats dev_stats_sum = { 0 }; struct rte_event_eth_rx_adapter_stats dev_stats; struct rte_eventdev *dev; @@ -2887,8 +2889,11 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, if (rx_adapter->service_inited) *stats = rx_adapter->stats; + buf = &rx_adapter->event_enqueue_buffer; stats->rx_packets += dev_stats_sum.rx_packets; stats->rx_enq_count += dev_stats_sum.rx_enq_count; + stats->rx_event_buf_count = buf->count; + stats->rx_event_buf_size = buf->events_size; return 0; } @@ -3052,3 +3057,146 @@ rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, return 0; } + +#define RXA_ADD_DICT(stats, s) rte_tel_data_add_dict_u64(d, #s, stats.s) + +static int +handle_rxa_stats(const char *cmd __rte_unused, + const char *params, + struct rte_tel_data *d) +{ + uint8_t rx_adapter_id; + struct rte_event_eth_rx_adapter_stats rx_adptr_stats; + + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) + return -1; + + /* Get Rx adapter ID from parameter string */ + rx_adapter_id = atoi(params); + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); + + /* Get Rx adapter stats */ + if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, + &rx_adptr_stats)) { + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); + return -1; + } + + rte_tel_data_start_dict(d); + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); + RXA_ADD_DICT(rx_adptr_stats, rx_packets); + RXA_ADD_DICT(rx_adptr_stats, rx_poll_count); + RXA_ADD_DICT(rx_adptr_stats, rx_dropped); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_retry); + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_count); + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_size); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_count); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_start_ts); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_block_cycles); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_end_ts); + RXA_ADD_DICT(rx_adptr_stats, rx_intr_packets); + + return 0; +} + +static int +handle_rxa_stats_reset(const char *cmd __rte_unused, + const char *params, + struct rte_tel_data *d __rte_unused) +{ + uint8_t rx_adapter_id; + + if (params == NULL || strlen(params) == 0 || ~isdigit(*params)) + return -1; + + /* Get Rx adapter ID from parameter string */ + rx_adapter_id = atoi(params); + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); + + /* Reset Rx adapter stats */ + if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); + return -1; + } + + return 0; +} + +static int +handle_rxa_get_queue_conf(const char *cmd __rte_unused, + const char *params, + struct rte_tel_data *d) +{ + uint8_t rx_adapter_id; + uint16_t rx_queue_id; + int eth_dev_id; + char *token, *l_params; + struct rte_event_eth_rx_adapter_queue_conf queue_conf; + + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) + return -1; + + /* Get Rx adapter ID from parameter string */ + l_params = strdup(params); + token = strtok(l_params, ","); + rx_adapter_id = strtoul(token, NULL, 10); + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); + + token = strtok(NULL, ","); + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) + return -1; + + /* Get device ID from parameter string */ + eth_dev_id = strtoul(token, NULL, 10); + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, -EINVAL); + + token = strtok(NULL, ","); + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) + return -1; + + /* Get Rx queue ID from parameter string */ + rx_queue_id = strtoul(token, NULL, 10); + if (rx_queue_id >= rte_eth_devices[eth_dev_id].data->nb_rx_queues) { + RTE_EDEV_LOG_ERR("Invalid rx queue_id %u", rx_queue_id); + return -EINVAL; + } + + token = strtok(NULL, "\0"); + if (token != NULL) + RTE_EDEV_LOG_ERR("Extra parameters passed to eventdev" + " telemetry command, igrnoring"); + + if (rte_event_eth_rx_adapter_queue_conf_get(rx_adapter_id, eth_dev_id, + rx_queue_id, &queue_conf)) { + RTE_EDEV_LOG_ERR("Failed to get Rx adapter queue config"); + return -1; + } + + rte_tel_data_start_dict(d); + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); + rte_tel_data_add_dict_u64(d, "eth_dev_id", eth_dev_id); + rte_tel_data_add_dict_u64(d, "rx_queue_id", rx_queue_id); + RXA_ADD_DICT(queue_conf, rx_queue_flags); + RXA_ADD_DICT(queue_conf, servicing_weight); + RXA_ADD_DICT(queue_conf.ev, queue_id); + RXA_ADD_DICT(queue_conf.ev, sched_type); + RXA_ADD_DICT(queue_conf.ev, priority); + RXA_ADD_DICT(queue_conf.ev, flow_id); + + return 0; +} + +RTE_INIT(rxa_init_telemetry) +{ + rte_telemetry_register_cmd("/eventdev/rxa_stats", + handle_rxa_stats, + "Returns Rx adapter stats. Parameter: rx_adapter_id"); + + rte_telemetry_register_cmd("/eventdev/rxa_stats_reset", + handle_rxa_stats_reset, + "Reset Rx adapter stats. Parameter: rx_adapter_id"); + + rte_telemetry_register_cmd("/eventdev/rxa_queue_conf", + handle_rxa_get_queue_conf, + "Returns Rx queue config. Parameter: rxa_id, DevID, queue_id"); +} diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_event_eth_rx_adapter.h index 70ca427..acabed4 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.h +++ b/lib/eventdev/rte_event_eth_rx_adapter.h @@ -216,6 +216,10 @@ struct rte_event_eth_rx_adapter_stats { /**< Eventdev enqueue count */ uint64_t rx_enq_retry; /**< Eventdev enqueue retry count */ + uint64_t rx_event_buf_count; + /**< Rx event buffered count */ + uint64_t rx_event_buf_size; + /**< Rx event buffer size */ uint64_t rx_dropped; /**< Received packet dropped count */ uint64_t rx_enq_start_ts; -- 2.6.4 ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [dpdk-dev] [EXT] [PATCH v2] eventdev/rx-adapter: add telemetry callbacks 2021-10-07 13:46 ` [dpdk-dev] [PATCH v2] " Ganapati Kundapura @ 2021-10-07 16:02 ` Gowrishankar Muthukrishnan 2021-10-12 10:25 ` [dpdk-dev] [PATCH v3] eventdev/rx_adapter: " Ganapati Kundapura 1 sibling, 0 replies; 19+ messages in thread From: Gowrishankar Muthukrishnan @ 2021-10-07 16:02 UTC (permalink / raw) To: Ganapati Kundapura, jerinjacobk, dev; +Cc: jay.jayatheerthan Just few minor corrections as below. > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c > b/lib/eventdev/rte_event_eth_rx_adapter.c > index 9ac976c..c2fb54a 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > @@ -23,6 +23,7 @@ > #include "eventdev_pmd.h" > #include "rte_eventdev_trace.h" > #include "rte_event_eth_rx_adapter.h" > +#include <rte_telemetry.h> This change can follow other <> includes before this folder include. > > #define BATCH_SIZE 32 > #define BLOCK_CNT_THRESHOLD 10 > @@ -2852,6 +2853,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, > struct rte_event_eth_rx_adapter_stats *stats) { > struct rte_event_eth_rx_adapter *rx_adapter; > + struct rte_eth_event_enqueue_buffer *buf; > struct rte_event_eth_rx_adapter_stats dev_stats_sum = { 0 }; > struct rte_event_eth_rx_adapter_stats dev_stats; > struct rte_eventdev *dev; > @@ -2887,8 +2889,11 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, > if (rx_adapter->service_inited) > *stats = rx_adapter->stats; > > + buf = &rx_adapter->event_enqueue_buffer; > stats->rx_packets += dev_stats_sum.rx_packets; > stats->rx_enq_count += dev_stats_sum.rx_enq_count; > + stats->rx_event_buf_count = buf->count; > + stats->rx_event_buf_size = buf->events_size; > > return 0; > } > @@ -3052,3 +3057,146 @@ > rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, > > return 0; > } > + > +#define RXA_ADD_DICT(stats, s) rte_tel_data_add_dict_u64(d, #s, > +stats.s) > + > +static int > +handle_rxa_stats(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *d) > +{ > + uint8_t rx_adapter_id; > + struct rte_event_eth_rx_adapter_stats rx_adptr_stats; > + > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > + return -1; > + > + /* Get Rx adapter ID from parameter string */ > + rx_adapter_id = atoi(params); > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, > -EINVAL); > + > + /* Get Rx adapter stats */ > + if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, > + &rx_adptr_stats)) { > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); > + return -1; > + } > + > + rte_tel_data_start_dict(d); > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > + RXA_ADD_DICT(rx_adptr_stats, rx_packets); > + RXA_ADD_DICT(rx_adptr_stats, rx_poll_count); > + RXA_ADD_DICT(rx_adptr_stats, rx_dropped); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_retry); > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_count); > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_size); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_count); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_start_ts); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_block_cycles); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_end_ts); > + RXA_ADD_DICT(rx_adptr_stats, rx_intr_packets); > + > + return 0; > +} > + > +static int > +handle_rxa_stats_reset(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *d __rte_unused) { > + uint8_t rx_adapter_id; > + > + if (params == NULL || strlen(params) == 0 || ~isdigit(*params)) > + return -1; > + > + /* Get Rx adapter ID from parameter string */ > + rx_adapter_id = atoi(params); > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, > -EINVAL); > + > + /* Reset Rx adapter stats */ > + if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { > + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); > + return -1; > + } > + > + return 0; > +} > + > +static int > +handle_rxa_get_queue_conf(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *d) > +{ > + uint8_t rx_adapter_id; > + uint16_t rx_queue_id; > + int eth_dev_id; > + char *token, *l_params; > + struct rte_event_eth_rx_adapter_queue_conf queue_conf; > + > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > + return -1; > + > + /* Get Rx adapter ID from parameter string */ > + l_params = strdup(params); > + token = strtok(l_params, ","); > + rx_adapter_id = strtoul(token, NULL, 10); > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, > -EINVAL); > + > + token = strtok(NULL, ","); > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > + return -1; > + > + /* Get device ID from parameter string */ > + eth_dev_id = strtoul(token, NULL, 10); > + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, -EINVAL); > + > + token = strtok(NULL, ","); > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > + return -1; > + > + /* Get Rx queue ID from parameter string */ > + rx_queue_id = strtoul(token, NULL, 10); > + if (rx_queue_id >= rte_eth_devices[eth_dev_id].data->nb_rx_queues) { > + RTE_EDEV_LOG_ERR("Invalid rx queue_id %u", rx_queue_id); > + return -EINVAL; > + } > + > + token = strtok(NULL, "\0"); > + if (token != NULL) > + RTE_EDEV_LOG_ERR("Extra parameters passed to eventdev" > + " telemetry command, igrnoring"); > + > + if (rte_event_eth_rx_adapter_queue_conf_get(rx_adapter_id, > eth_dev_id, > + rx_queue_id, &queue_conf)) > { > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter queue config"); > + return -1; > + } > + > + rte_tel_data_start_dict(d); > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > + rte_tel_data_add_dict_u64(d, "eth_dev_id", eth_dev_id); > + rte_tel_data_add_dict_u64(d, "rx_queue_id", rx_queue_id); > + RXA_ADD_DICT(queue_conf, rx_queue_flags); > + RXA_ADD_DICT(queue_conf, servicing_weight); > + RXA_ADD_DICT(queue_conf.ev, queue_id); > + RXA_ADD_DICT(queue_conf.ev, sched_type); > + RXA_ADD_DICT(queue_conf.ev, priority); > + RXA_ADD_DICT(queue_conf.ev, flow_id); > + > + return 0; > +} > + > +RTE_INIT(rxa_init_telemetry) > +{ > + rte_telemetry_register_cmd("/eventdev/rxa_stats", > + handle_rxa_stats, > + "Returns Rx adapter stats. Parameter: rx_adapter_id"); > + > + rte_telemetry_register_cmd("/eventdev/rxa_stats_reset", > + handle_rxa_stats_reset, > + "Reset Rx adapter stats. Parameter: rx_adapter_id"); > + > + rte_telemetry_register_cmd("/eventdev/rxa_queue_conf", > + handle_rxa_get_queue_conf, > + "Returns Rx queue config. Parameter: rxa_id, DevID, Either rxa_id or rx_adapter_id as a description in all end points. Also, DevID -> dev_id. Thanks, Gowrishankar > queue_id"); } > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h > b/lib/eventdev/rte_event_eth_rx_adapter.h > index 70ca427..acabed4 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > @@ -216,6 +216,10 @@ struct rte_event_eth_rx_adapter_stats { > /**< Eventdev enqueue count */ > uint64_t rx_enq_retry; > /**< Eventdev enqueue retry count */ > + uint64_t rx_event_buf_count; > + /**< Rx event buffered count */ > + uint64_t rx_event_buf_size; > + /**< Rx event buffer size */ > uint64_t rx_dropped; > /**< Received packet dropped count */ > uint64_t rx_enq_start_ts; > -- > 2.6.4 ^ permalink raw reply [flat|nested] 19+ messages in thread
* [dpdk-dev] [PATCH v3] eventdev/rx_adapter: add telemetry callbacks 2021-10-07 13:46 ` [dpdk-dev] [PATCH v2] " Ganapati Kundapura 2021-10-07 16:02 ` [dpdk-dev] [EXT] " Gowrishankar Muthukrishnan @ 2021-10-12 10:25 ` Ganapati Kundapura 2021-10-12 13:09 ` Jayatheerthan, Jay 2021-10-13 7:57 ` [dpdk-dev] [PATCH v4] " Ganapati Kundapura 1 sibling, 2 replies; 19+ messages in thread From: Ganapati Kundapura @ 2021-10-12 10:25 UTC (permalink / raw) To: jerinjacobk, dev; +Cc: jay.jayatheerthan Added telemetry callbacks to get Rx adapter stats, reset stats and to get Rx queue config information. Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com> --- v3: * Updated release notes * Addressed review comments v2: * Fixed checkpatch warning --- diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index dfc2cbd..9955e52 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -130,6 +130,10 @@ New Features * Added tests to validate packets hard expiry. * Added tests to verify tunnel header verification in IPsec inbound. +* **Updated rte_event_eth_rx_adapter_stats structure + * Added 'uint64_t rx_event_buf_count' + * Added 'uint64_t rx_event_buf_size' + Removed Items ------------- diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 9ac976c..7e3bf62 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -18,6 +18,7 @@ #include <rte_thash.h> #include <rte_interrupts.h> #include <rte_mbuf_dyn.h> +#include <rte_telemetry.h> #include "rte_eventdev.h" #include "eventdev_pmd.h" @@ -2852,6 +2853,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, struct rte_event_eth_rx_adapter_stats *stats) { struct rte_event_eth_rx_adapter *rx_adapter; + struct rte_eth_event_enqueue_buffer *buf; struct rte_event_eth_rx_adapter_stats dev_stats_sum = { 0 }; struct rte_event_eth_rx_adapter_stats dev_stats; struct rte_eventdev *dev; @@ -2887,8 +2889,11 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, if (rx_adapter->service_inited) *stats = rx_adapter->stats; + buf = &rx_adapter->event_enqueue_buffer; stats->rx_packets += dev_stats_sum.rx_packets; stats->rx_enq_count += dev_stats_sum.rx_enq_count; + stats->rx_event_buf_count = buf->count; + stats->rx_event_buf_size = buf->events_size; return 0; } @@ -3052,3 +3057,146 @@ rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, return 0; } + +#define RXA_ADD_DICT(stats, s) rte_tel_data_add_dict_u64(d, #s, stats.s) + +static int +handle_rxa_stats(const char *cmd __rte_unused, + const char *params, + struct rte_tel_data *d) +{ + uint8_t rx_adapter_id; + struct rte_event_eth_rx_adapter_stats rx_adptr_stats; + + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) + return -1; + + /* Get Rx adapter ID from parameter string */ + rx_adapter_id = atoi(params); + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); + + /* Get Rx adapter stats */ + if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, + &rx_adptr_stats)) { + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); + return -1; + } + + rte_tel_data_start_dict(d); + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); + RXA_ADD_DICT(rx_adptr_stats, rx_packets); + RXA_ADD_DICT(rx_adptr_stats, rx_poll_count); + RXA_ADD_DICT(rx_adptr_stats, rx_dropped); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_retry); + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_count); + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_size); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_count); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_start_ts); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_block_cycles); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_end_ts); + RXA_ADD_DICT(rx_adptr_stats, rx_intr_packets); + + return 0; +} + +static int +handle_rxa_stats_reset(const char *cmd __rte_unused, + const char *params, + struct rte_tel_data *d __rte_unused) +{ + uint8_t rx_adapter_id; + + if (params == NULL || strlen(params) == 0 || ~isdigit(*params)) + return -1; + + /* Get Rx adapter ID from parameter string */ + rx_adapter_id = atoi(params); + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); + + /* Reset Rx adapter stats */ + if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); + return -1; + } + + return 0; +} + +static int +handle_rxa_get_queue_conf(const char *cmd __rte_unused, + const char *params, + struct rte_tel_data *d) +{ + uint8_t rx_adapter_id; + uint16_t rx_queue_id; + int eth_dev_id; + char *token, *l_params; + struct rte_event_eth_rx_adapter_queue_conf queue_conf; + + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) + return -1; + + /* Get Rx adapter ID from parameter string */ + l_params = strdup(params); + token = strtok(l_params, ","); + rx_adapter_id = strtoul(token, NULL, 10); + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); + + token = strtok(NULL, ","); + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) + return -1; + + /* Get device ID from parameter string */ + eth_dev_id = strtoul(token, NULL, 10); + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, -EINVAL); + + token = strtok(NULL, ","); + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) + return -1; + + /* Get Rx queue ID from parameter string */ + rx_queue_id = strtoul(token, NULL, 10); + if (rx_queue_id >= rte_eth_devices[eth_dev_id].data->nb_rx_queues) { + RTE_EDEV_LOG_ERR("Invalid rx queue_id %u", rx_queue_id); + return -EINVAL; + } + + token = strtok(NULL, "\0"); + if (token != NULL) + RTE_EDEV_LOG_ERR("Extra parameters passed to eventdev" + " telemetry command, igrnoring"); + + if (rte_event_eth_rx_adapter_queue_conf_get(rx_adapter_id, eth_dev_id, + rx_queue_id, &queue_conf)) { + RTE_EDEV_LOG_ERR("Failed to get Rx adapter queue config"); + return -1; + } + + rte_tel_data_start_dict(d); + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); + rte_tel_data_add_dict_u64(d, "eth_dev_id", eth_dev_id); + rte_tel_data_add_dict_u64(d, "rx_queue_id", rx_queue_id); + RXA_ADD_DICT(queue_conf, rx_queue_flags); + RXA_ADD_DICT(queue_conf, servicing_weight); + RXA_ADD_DICT(queue_conf.ev, queue_id); + RXA_ADD_DICT(queue_conf.ev, sched_type); + RXA_ADD_DICT(queue_conf.ev, priority); + RXA_ADD_DICT(queue_conf.ev, flow_id); + + return 0; +} + +RTE_INIT(rxa_init_telemetry) +{ + rte_telemetry_register_cmd("/eventdev/rxa_stats", + handle_rxa_stats, + "Returns Rx adapter stats. Parameter: rxa_id"); + + rte_telemetry_register_cmd("/eventdev/rxa_stats_reset", + handle_rxa_stats_reset, + "Reset Rx adapter stats. Parameter: rxa_id"); + + rte_telemetry_register_cmd("/eventdev/rxa_queue_conf", + handle_rxa_get_queue_conf, + "Returns Rx queue config. Parameter: rxa_id, dev_id, queue_id"); +} diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_event_eth_rx_adapter.h index 70ca427..c4257e7 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.h +++ b/lib/eventdev/rte_event_eth_rx_adapter.h @@ -232,6 +232,10 @@ struct rte_event_eth_rx_adapter_stats { */ uint64_t rx_intr_packets; /**< Received packet count for interrupt mode Rx queues */ + uint64_t rx_event_buf_count; + /**< Rx event buffered count */ + uint64_t rx_event_buf_size; + /**< Rx event buffer size */ }; /** -- 2.6.4 ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [dpdk-dev] [PATCH v3] eventdev/rx_adapter: add telemetry callbacks 2021-10-12 10:25 ` [dpdk-dev] [PATCH v3] eventdev/rx_adapter: " Ganapati Kundapura @ 2021-10-12 13:09 ` Jayatheerthan, Jay 2021-10-12 14:05 ` Naga Harish K, S V 2021-10-13 7:57 ` [dpdk-dev] [PATCH v4] " Ganapati Kundapura 1 sibling, 1 reply; 19+ messages in thread From: Jayatheerthan, Jay @ 2021-10-12 13:09 UTC (permalink / raw) To: Kundapura, Ganapati, jerinjacobk, dev Cc: Kinsella, Ray, Thomas Monjalon, David Marchand Acked by: Jay Jayatheerthan <jay.jayatheerthan@intel.com> + @Ray Kinsella @Thomas Monjalon @David Marchand > -----Original Message----- > From: Kundapura, Ganapati <ganapati.kundapura@intel.com> > Sent: Tuesday, October 12, 2021 3:55 PM > To: jerinjacobk@gmail.com; dev@dpdk.org > Cc: Jayatheerthan, Jay <jay.jayatheerthan@intel.com> > Subject: [PATCH v3] eventdev/rx_adapter: add telemetry callbacks > > Added telemetry callbacks to get Rx adapter stats, reset stats and > to get Rx queue config information. > > Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com> > --- > v3: > * Updated release notes > * Addressed review comments > > v2: > * Fixed checkpatch warning > --- > > diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst > index dfc2cbd..9955e52 100644 > --- a/doc/guides/rel_notes/release_21_11.rst > +++ b/doc/guides/rel_notes/release_21_11.rst > @@ -130,6 +130,10 @@ New Features > * Added tests to validate packets hard expiry. > * Added tests to verify tunnel header verification in IPsec inbound. > > +* **Updated rte_event_eth_rx_adapter_stats structure > + * Added 'uint64_t rx_event_buf_count' > + * Added 'uint64_t rx_event_buf_size' > + > > Removed Items > ------------- > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c > index 9ac976c..7e3bf62 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > @@ -18,6 +18,7 @@ > #include <rte_thash.h> > #include <rte_interrupts.h> > #include <rte_mbuf_dyn.h> > +#include <rte_telemetry.h> > > #include "rte_eventdev.h" > #include "eventdev_pmd.h" > @@ -2852,6 +2853,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, > struct rte_event_eth_rx_adapter_stats *stats) > { > struct rte_event_eth_rx_adapter *rx_adapter; > + struct rte_eth_event_enqueue_buffer *buf; > struct rte_event_eth_rx_adapter_stats dev_stats_sum = { 0 }; > struct rte_event_eth_rx_adapter_stats dev_stats; > struct rte_eventdev *dev; > @@ -2887,8 +2889,11 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, > if (rx_adapter->service_inited) > *stats = rx_adapter->stats; > > + buf = &rx_adapter->event_enqueue_buffer; > stats->rx_packets += dev_stats_sum.rx_packets; > stats->rx_enq_count += dev_stats_sum.rx_enq_count; > + stats->rx_event_buf_count = buf->count; > + stats->rx_event_buf_size = buf->events_size; > > return 0; > } > @@ -3052,3 +3057,146 @@ rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, > > return 0; > } > + > +#define RXA_ADD_DICT(stats, s) rte_tel_data_add_dict_u64(d, #s, stats.s) > + > +static int > +handle_rxa_stats(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *d) > +{ > + uint8_t rx_adapter_id; > + struct rte_event_eth_rx_adapter_stats rx_adptr_stats; > + > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > + return -1; > + > + /* Get Rx adapter ID from parameter string */ > + rx_adapter_id = atoi(params); > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); > + > + /* Get Rx adapter stats */ > + if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, > + &rx_adptr_stats)) { > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); > + return -1; > + } > + > + rte_tel_data_start_dict(d); > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > + RXA_ADD_DICT(rx_adptr_stats, rx_packets); > + RXA_ADD_DICT(rx_adptr_stats, rx_poll_count); > + RXA_ADD_DICT(rx_adptr_stats, rx_dropped); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_retry); > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_count); > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_size); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_count); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_start_ts); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_block_cycles); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_end_ts); > + RXA_ADD_DICT(rx_adptr_stats, rx_intr_packets); > + > + return 0; > +} > + > +static int > +handle_rxa_stats_reset(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *d __rte_unused) > +{ > + uint8_t rx_adapter_id; > + > + if (params == NULL || strlen(params) == 0 || ~isdigit(*params)) > + return -1; > + > + /* Get Rx adapter ID from parameter string */ > + rx_adapter_id = atoi(params); > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); > + > + /* Reset Rx adapter stats */ > + if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { > + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); > + return -1; > + } > + > + return 0; > +} > + > +static int > +handle_rxa_get_queue_conf(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *d) > +{ > + uint8_t rx_adapter_id; > + uint16_t rx_queue_id; > + int eth_dev_id; > + char *token, *l_params; > + struct rte_event_eth_rx_adapter_queue_conf queue_conf; > + > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > + return -1; > + > + /* Get Rx adapter ID from parameter string */ > + l_params = strdup(params); > + token = strtok(l_params, ","); > + rx_adapter_id = strtoul(token, NULL, 10); > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); > + > + token = strtok(NULL, ","); > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > + return -1; > + > + /* Get device ID from parameter string */ > + eth_dev_id = strtoul(token, NULL, 10); > + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, -EINVAL); > + > + token = strtok(NULL, ","); > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > + return -1; > + > + /* Get Rx queue ID from parameter string */ > + rx_queue_id = strtoul(token, NULL, 10); > + if (rx_queue_id >= rte_eth_devices[eth_dev_id].data->nb_rx_queues) { > + RTE_EDEV_LOG_ERR("Invalid rx queue_id %u", rx_queue_id); > + return -EINVAL; > + } > + > + token = strtok(NULL, "\0"); > + if (token != NULL) > + RTE_EDEV_LOG_ERR("Extra parameters passed to eventdev" > + " telemetry command, igrnoring"); > + > + if (rte_event_eth_rx_adapter_queue_conf_get(rx_adapter_id, eth_dev_id, > + rx_queue_id, &queue_conf)) { > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter queue config"); > + return -1; > + } > + > + rte_tel_data_start_dict(d); > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > + rte_tel_data_add_dict_u64(d, "eth_dev_id", eth_dev_id); > + rte_tel_data_add_dict_u64(d, "rx_queue_id", rx_queue_id); > + RXA_ADD_DICT(queue_conf, rx_queue_flags); > + RXA_ADD_DICT(queue_conf, servicing_weight); > + RXA_ADD_DICT(queue_conf.ev, queue_id); > + RXA_ADD_DICT(queue_conf.ev, sched_type); > + RXA_ADD_DICT(queue_conf.ev, priority); > + RXA_ADD_DICT(queue_conf.ev, flow_id); > + > + return 0; > +} > + > +RTE_INIT(rxa_init_telemetry) > +{ > + rte_telemetry_register_cmd("/eventdev/rxa_stats", > + handle_rxa_stats, > + "Returns Rx adapter stats. Parameter: rxa_id"); > + > + rte_telemetry_register_cmd("/eventdev/rxa_stats_reset", > + handle_rxa_stats_reset, > + "Reset Rx adapter stats. Parameter: rxa_id"); > + > + rte_telemetry_register_cmd("/eventdev/rxa_queue_conf", > + handle_rxa_get_queue_conf, > + "Returns Rx queue config. Parameter: rxa_id, dev_id, queue_id"); > +} > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_event_eth_rx_adapter.h > index 70ca427..c4257e7 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > @@ -232,6 +232,10 @@ struct rte_event_eth_rx_adapter_stats { > */ > uint64_t rx_intr_packets; > /**< Received packet count for interrupt mode Rx queues */ > + uint64_t rx_event_buf_count; > + /**< Rx event buffered count */ > + uint64_t rx_event_buf_size; > + /**< Rx event buffer size */ > }; > > /** > -- > 2.6.4 ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [dpdk-dev] [PATCH v3] eventdev/rx_adapter: add telemetry callbacks 2021-10-12 13:09 ` Jayatheerthan, Jay @ 2021-10-12 14:05 ` Naga Harish K, S V 2021-10-12 16:13 ` Kundapura, Ganapati 0 siblings, 1 reply; 19+ messages in thread From: Naga Harish K, S V @ 2021-10-12 14:05 UTC (permalink / raw) To: Jayatheerthan, Jay, Kundapura, Ganapati, jerinjacobk, dev Cc: Kinsella, Ray, Thomas Monjalon, David Marchand > -----Original Message----- > From: dev <dev-bounces@dpdk.org> On Behalf Of Jayatheerthan, Jay > Sent: Tuesday, October 12, 2021 6:39 PM > To: Kundapura, Ganapati <Ganapati.Kundapura@intel.com>; > jerinjacobk@gmail.com; dev@dpdk.org > Cc: Kinsella, Ray <ray.kinsella@intel.com>; Thomas Monjalon > <thomas@monjalon.net>; David Marchand <david.marchand@redhat.com> > Subject: Re: [dpdk-dev] [PATCH v3] eventdev/rx_adapter: add telemetry > callbacks > > Acked by: Jay Jayatheerthan <jay.jayatheerthan@intel.com> > > + @Ray Kinsella @Thomas Monjalon @David Marchand > > > -----Original Message----- > > From: Kundapura, Ganapati <ganapati.kundapura@intel.com> > > Sent: Tuesday, October 12, 2021 3:55 PM > > To: jerinjacobk@gmail.com; dev@dpdk.org > > Cc: Jayatheerthan, Jay <jay.jayatheerthan@intel.com> > > Subject: [PATCH v3] eventdev/rx_adapter: add telemetry callbacks > > > > Added telemetry callbacks to get Rx adapter stats, reset stats and to > > get Rx queue config information. > > > > Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com> > > --- > > v3: > > * Updated release notes > > * Addressed review comments > > > > v2: > > * Fixed checkpatch warning > > --- > > > > diff --git a/doc/guides/rel_notes/release_21_11.rst > > b/doc/guides/rel_notes/release_21_11.rst > > index dfc2cbd..9955e52 100644 > > --- a/doc/guides/rel_notes/release_21_11.rst > > +++ b/doc/guides/rel_notes/release_21_11.rst > > @@ -130,6 +130,10 @@ New Features > > * Added tests to validate packets hard expiry. > > * Added tests to verify tunnel header verification in IPsec inbound. > > > > +* **Updated rte_event_eth_rx_adapter_stats structure > > + * Added 'uint64_t rx_event_buf_count' > > + * Added 'uint64_t rx_event_buf_size' > > + > > > > Removed Items > > ------------- > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c > > b/lib/eventdev/rte_event_eth_rx_adapter.c > > index 9ac976c..7e3bf62 100644 > > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > > @@ -18,6 +18,7 @@ > > #include <rte_thash.h> > > #include <rte_interrupts.h> > > #include <rte_mbuf_dyn.h> > > +#include <rte_telemetry.h> > > > > #include "rte_eventdev.h" > > #include "eventdev_pmd.h" > > @@ -2852,6 +2853,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, > > struct rte_event_eth_rx_adapter_stats *stats) { > > struct rte_event_eth_rx_adapter *rx_adapter; > > + struct rte_eth_event_enqueue_buffer *buf; > > struct rte_event_eth_rx_adapter_stats dev_stats_sum = { 0 }; > > struct rte_event_eth_rx_adapter_stats dev_stats; > > struct rte_eventdev *dev; > > @@ -2887,8 +2889,11 @@ rte_event_eth_rx_adapter_stats_get(uint8_t > id, > > if (rx_adapter->service_inited) > > *stats = rx_adapter->stats; > > > > + buf = &rx_adapter->event_enqueue_buffer; > > stats->rx_packets += dev_stats_sum.rx_packets; > > stats->rx_enq_count += dev_stats_sum.rx_enq_count; > > + stats->rx_event_buf_count = buf->count; When per Rx queue event buffer is used, there is a possibility of segfault here Because of null pointer deference. > > + stats->rx_event_buf_size = buf->events_size; > > > > return 0; > > } > > @@ -3052,3 +3057,146 @@ > > rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, > > > > return 0; > > } > > + > > +#define RXA_ADD_DICT(stats, s) rte_tel_data_add_dict_u64(d, #s, > > +stats.s) > > + > > +static int > > +handle_rxa_stats(const char *cmd __rte_unused, > > + const char *params, > > + struct rte_tel_data *d) > > +{ > > + uint8_t rx_adapter_id; > > + struct rte_event_eth_rx_adapter_stats rx_adptr_stats; > > + > > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > > + return -1; > > + > > + /* Get Rx adapter ID from parameter string */ > > + rx_adapter_id = atoi(params); > > + > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > _id, > > +-EINVAL); > > + > > + /* Get Rx adapter stats */ > > + if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, > > + &rx_adptr_stats)) { > > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); > > + return -1; > > + } > > + > > + rte_tel_data_start_dict(d); > > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > > + RXA_ADD_DICT(rx_adptr_stats, rx_packets); > > + RXA_ADD_DICT(rx_adptr_stats, rx_poll_count); > > + RXA_ADD_DICT(rx_adptr_stats, rx_dropped); > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_retry); > > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_count); > > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_size); > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_count); > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_start_ts); > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_block_cycles); > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_end_ts); > > + RXA_ADD_DICT(rx_adptr_stats, rx_intr_packets); > > + > > + return 0; > > +} > > + > > +static int > > +handle_rxa_stats_reset(const char *cmd __rte_unused, > > + const char *params, > > + struct rte_tel_data *d __rte_unused) { > > + uint8_t rx_adapter_id; > > + > > + if (params == NULL || strlen(params) == 0 || ~isdigit(*params)) > > + return -1; > > + > > + /* Get Rx adapter ID from parameter string */ > > + rx_adapter_id = atoi(params); > > + > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > _id, > > +-EINVAL); > > + > > + /* Reset Rx adapter stats */ > > + if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { > > + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); > > + return -1; > > + } > > + > > + return 0; > > +} > > + > > +static int > > +handle_rxa_get_queue_conf(const char *cmd __rte_unused, > > + const char *params, > > + struct rte_tel_data *d) > > +{ > > + uint8_t rx_adapter_id; > > + uint16_t rx_queue_id; > > + int eth_dev_id; > > + char *token, *l_params; > > + struct rte_event_eth_rx_adapter_queue_conf queue_conf; > > + > > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > > + return -1; > > + > > + /* Get Rx adapter ID from parameter string */ > > + l_params = strdup(params); > > + token = strtok(l_params, ","); > > + rx_adapter_id = strtoul(token, NULL, 10); > > + > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > _id, > > +-EINVAL); > > + > > + token = strtok(NULL, ","); > > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > > + return -1; > > + > > + /* Get device ID from parameter string */ > > + eth_dev_id = strtoul(token, NULL, 10); > > + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, -EINVAL); > > + > > + token = strtok(NULL, ","); > > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > > + return -1; > > + > > + /* Get Rx queue ID from parameter string */ > > + rx_queue_id = strtoul(token, NULL, 10); > > + if (rx_queue_id >= rte_eth_devices[eth_dev_id].data- > >nb_rx_queues) { > > + RTE_EDEV_LOG_ERR("Invalid rx queue_id %u", > rx_queue_id); > > + return -EINVAL; > > + } > > + > > + token = strtok(NULL, "\0"); > > + if (token != NULL) > > + RTE_EDEV_LOG_ERR("Extra parameters passed to eventdev" > > + " telemetry command, igrnoring"); > > + > > + if (rte_event_eth_rx_adapter_queue_conf_get(rx_adapter_id, > eth_dev_id, > > + rx_queue_id, > &queue_conf)) { > > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter queue > config"); > > + return -1; > > + } > > + > > + rte_tel_data_start_dict(d); > > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > > + rte_tel_data_add_dict_u64(d, "eth_dev_id", eth_dev_id); > > + rte_tel_data_add_dict_u64(d, "rx_queue_id", rx_queue_id); > > + RXA_ADD_DICT(queue_conf, rx_queue_flags); > > + RXA_ADD_DICT(queue_conf, servicing_weight); > > + RXA_ADD_DICT(queue_conf.ev, queue_id); > > + RXA_ADD_DICT(queue_conf.ev, sched_type); > > + RXA_ADD_DICT(queue_conf.ev, priority); > > + RXA_ADD_DICT(queue_conf.ev, flow_id); > > + > > + return 0; > > +} > > + > > +RTE_INIT(rxa_init_telemetry) > > +{ > > + rte_telemetry_register_cmd("/eventdev/rxa_stats", > > + handle_rxa_stats, > > + "Returns Rx adapter stats. Parameter: rxa_id"); > > + > > + rte_telemetry_register_cmd("/eventdev/rxa_stats_reset", > > + handle_rxa_stats_reset, > > + "Reset Rx adapter stats. Parameter: rxa_id"); > > + > > + rte_telemetry_register_cmd("/eventdev/rxa_queue_conf", > > + handle_rxa_get_queue_conf, > > + "Returns Rx queue config. Parameter: rxa_id, dev_id, > queue_id"); } > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h > > b/lib/eventdev/rte_event_eth_rx_adapter.h > > index 70ca427..c4257e7 100644 > > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > > @@ -232,6 +232,10 @@ struct rte_event_eth_rx_adapter_stats { > > */ > > uint64_t rx_intr_packets; > > /**< Received packet count for interrupt mode Rx queues */ > > + uint64_t rx_event_buf_count; > > + /**< Rx event buffered count */ > > + uint64_t rx_event_buf_size; > > + /**< Rx event buffer size */ > > }; > > > > /** > > -- > > 2.6.4 ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [dpdk-dev] [PATCH v3] eventdev/rx_adapter: add telemetry callbacks 2021-10-12 14:05 ` Naga Harish K, S V @ 2021-10-12 16:13 ` Kundapura, Ganapati 2021-10-13 6:48 ` Naga Harish K, S V 0 siblings, 1 reply; 19+ messages in thread From: Kundapura, Ganapati @ 2021-10-12 16:13 UTC (permalink / raw) To: Naga Harish K, S V, Jayatheerthan, Jay, jerinjacobk, dev Cc: Kinsella, Ray, Thomas Monjalon, David Marchand Hi Harish, > -----Original Message----- > From: Naga Harish K, S V <s.v.naga.harish.k@intel.com> > Sent: 12 October 2021 19:36 > To: Jayatheerthan, Jay <jay.jayatheerthan@intel.com>; Kundapura, Ganapati > <ganapati.kundapura@intel.com>; jerinjacobk@gmail.com; dev@dpdk.org > Cc: Kinsella, Ray <ray.kinsella@intel.com>; Thomas Monjalon > <thomas@monjalon.net>; David Marchand <david.marchand@redhat.com> > Subject: RE: [PATCH v3] eventdev/rx_adapter: add telemetry callbacks > > > > > -----Original Message----- > > From: dev <dev-bounces@dpdk.org> On Behalf Of Jayatheerthan, Jay > > Sent: Tuesday, October 12, 2021 6:39 PM > > To: Kundapura, Ganapati <Ganapati.Kundapura@intel.com>; > > jerinjacobk@gmail.com; dev@dpdk.org > > Cc: Kinsella, Ray <ray.kinsella@intel.com>; Thomas Monjalon > > <thomas@monjalon.net>; David Marchand <david.marchand@redhat.com> > > Subject: Re: [dpdk-dev] [PATCH v3] eventdev/rx_adapter: add telemetry > > callbacks > > > > Acked by: Jay Jayatheerthan <jay.jayatheerthan@intel.com> > > > > + @Ray Kinsella @Thomas Monjalon @David Marchand > > > > > -----Original Message----- > > > From: Kundapura, Ganapati <ganapati.kundapura@intel.com> > > > Sent: Tuesday, October 12, 2021 3:55 PM > > > To: jerinjacobk@gmail.com; dev@dpdk.org > > > Cc: Jayatheerthan, Jay <jay.jayatheerthan@intel.com> > > > Subject: [PATCH v3] eventdev/rx_adapter: add telemetry callbacks > > > > > > Added telemetry callbacks to get Rx adapter stats, reset stats and > > > to get Rx queue config information. > > > > > > Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com> > > > --- > > > v3: > > > * Updated release notes > > > * Addressed review comments > > > > > > v2: > > > * Fixed checkpatch warning > > > --- > > > > > > diff --git a/doc/guides/rel_notes/release_21_11.rst > > > b/doc/guides/rel_notes/release_21_11.rst > > > index dfc2cbd..9955e52 100644 > > > --- a/doc/guides/rel_notes/release_21_11.rst > > > +++ b/doc/guides/rel_notes/release_21_11.rst > > > @@ -130,6 +130,10 @@ New Features > > > * Added tests to validate packets hard expiry. > > > * Added tests to verify tunnel header verification in IPsec inbound. > > > > > > +* **Updated rte_event_eth_rx_adapter_stats structure > > > + * Added 'uint64_t rx_event_buf_count' > > > + * Added 'uint64_t rx_event_buf_size' > > > + > > > > > > Removed Items > > > ------------- > > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c > > > b/lib/eventdev/rte_event_eth_rx_adapter.c > > > index 9ac976c..7e3bf62 100644 > > > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > > > @@ -18,6 +18,7 @@ > > > #include <rte_thash.h> > > > #include <rte_interrupts.h> > > > #include <rte_mbuf_dyn.h> > > > +#include <rte_telemetry.h> > > > > > > #include "rte_eventdev.h" > > > #include "eventdev_pmd.h" > > > @@ -2852,6 +2853,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, > > > struct rte_event_eth_rx_adapter_stats *stats) { > > > struct rte_event_eth_rx_adapter *rx_adapter; > > > + struct rte_eth_event_enqueue_buffer *buf; > > > struct rte_event_eth_rx_adapter_stats dev_stats_sum = { 0 }; > > > struct rte_event_eth_rx_adapter_stats dev_stats; > > > struct rte_eventdev *dev; > > > @@ -2887,8 +2889,11 @@ rte_event_eth_rx_adapter_stats_get(uint8_t > > id, > > > if (rx_adapter->service_inited) > > > *stats = rx_adapter->stats; > > > > > > + buf = &rx_adapter->event_enqueue_buffer; > > > stats->rx_packets += dev_stats_sum.rx_packets; > > > stats->rx_enq_count += dev_stats_sum.rx_enq_count; > > > + stats->rx_event_buf_count = buf->count; > > When per Rx queue event buffer is used, there is a possibility of segfault here > Because of null pointer deference. > Queue_id is not passed to rte_event_eth_rx_adapter_stats_get() and there's no way to retrieve the queue id to return the queue's event buffer size and count. We may need to loop through all the queue's in the adapter which requires changes in rte_event_eth_rx_adapter_stats structure to hold event buffer size and count for all the queues. Alternatively stats_get() can return event buffer size and count only if use_queue_event_buf = false i.e only for adapter wide event buffer. Do we need event buffer size and count in Rx adapter stats? > > > + stats->rx_event_buf_size = buf->events_size; > > > > > > return 0; > > > } > > > @@ -3052,3 +3057,146 @@ > > > rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, > > > > > > return 0; > > > } > > > + > > > +#define RXA_ADD_DICT(stats, s) rte_tel_data_add_dict_u64(d, #s, > > > +stats.s) > > > + > > > +static int > > > +handle_rxa_stats(const char *cmd __rte_unused, > > > + const char *params, > > > + struct rte_tel_data *d) > > > +{ > > > + uint8_t rx_adapter_id; > > > + struct rte_event_eth_rx_adapter_stats rx_adptr_stats; > > > + > > > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > > > + return -1; > > > + > > > + /* Get Rx adapter ID from parameter string */ > > > + rx_adapter_id = atoi(params); > > > + > > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > > _id, > > > +-EINVAL); > > > + > > > + /* Get Rx adapter stats */ > > > + if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, > > > + &rx_adptr_stats)) { > > > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); > > > + return -1; > > > + } > > > + > > > + rte_tel_data_start_dict(d); > > > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > > > + RXA_ADD_DICT(rx_adptr_stats, rx_packets); > > > + RXA_ADD_DICT(rx_adptr_stats, rx_poll_count); > > > + RXA_ADD_DICT(rx_adptr_stats, rx_dropped); > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_retry); > > > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_count); > > > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_size); > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_count); > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_start_ts); > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_block_cycles); > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_end_ts); > > > + RXA_ADD_DICT(rx_adptr_stats, rx_intr_packets); > > > + > > > + return 0; > > > +} > > > + > > > +static int > > > +handle_rxa_stats_reset(const char *cmd __rte_unused, > > > + const char *params, > > > + struct rte_tel_data *d __rte_unused) { > > > + uint8_t rx_adapter_id; > > > + > > > + if (params == NULL || strlen(params) == 0 || ~isdigit(*params)) > > > + return -1; > > > + > > > + /* Get Rx adapter ID from parameter string */ > > > + rx_adapter_id = atoi(params); > > > + > > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > > _id, > > > +-EINVAL); > > > + > > > + /* Reset Rx adapter stats */ > > > + if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { > > > + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); > > > + return -1; > > > + } > > > + > > > + return 0; > > > +} > > > + > > > +static int > > > +handle_rxa_get_queue_conf(const char *cmd __rte_unused, > > > + const char *params, > > > + struct rte_tel_data *d) > > > +{ > > > + uint8_t rx_adapter_id; > > > + uint16_t rx_queue_id; > > > + int eth_dev_id; > > > + char *token, *l_params; > > > + struct rte_event_eth_rx_adapter_queue_conf queue_conf; > > > + > > > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > > > + return -1; > > > + > > > + /* Get Rx adapter ID from parameter string */ > > > + l_params = strdup(params); > > > + token = strtok(l_params, ","); > > > + rx_adapter_id = strtoul(token, NULL, 10); > > > + > > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > > _id, > > > +-EINVAL); > > > + > > > + token = strtok(NULL, ","); > > > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > > > + return -1; > > > + > > > + /* Get device ID from parameter string */ > > > + eth_dev_id = strtoul(token, NULL, 10); > > > + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, -EINVAL); > > > + > > > + token = strtok(NULL, ","); > > > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > > > + return -1; > > > + > > > + /* Get Rx queue ID from parameter string */ > > > + rx_queue_id = strtoul(token, NULL, 10); > > > + if (rx_queue_id >= rte_eth_devices[eth_dev_id].data- > > >nb_rx_queues) { > > > + RTE_EDEV_LOG_ERR("Invalid rx queue_id %u", > > rx_queue_id); > > > + return -EINVAL; > > > + } > > > + > > > + token = strtok(NULL, "\0"); > > > + if (token != NULL) > > > + RTE_EDEV_LOG_ERR("Extra parameters passed to eventdev" > > > + " telemetry command, igrnoring"); > > > + > > > + if (rte_event_eth_rx_adapter_queue_conf_get(rx_adapter_id, > > eth_dev_id, > > > + rx_queue_id, > > &queue_conf)) { > > > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter queue > > config"); > > > + return -1; > > > + } > > > + > > > + rte_tel_data_start_dict(d); > > > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > > > + rte_tel_data_add_dict_u64(d, "eth_dev_id", eth_dev_id); > > > + rte_tel_data_add_dict_u64(d, "rx_queue_id", rx_queue_id); > > > + RXA_ADD_DICT(queue_conf, rx_queue_flags); > > > + RXA_ADD_DICT(queue_conf, servicing_weight); > > > + RXA_ADD_DICT(queue_conf.ev, queue_id); > > > + RXA_ADD_DICT(queue_conf.ev, sched_type); > > > + RXA_ADD_DICT(queue_conf.ev, priority); > > > + RXA_ADD_DICT(queue_conf.ev, flow_id); > > > + > > > + return 0; > > > +} > > > + > > > +RTE_INIT(rxa_init_telemetry) > > > +{ > > > + rte_telemetry_register_cmd("/eventdev/rxa_stats", > > > + handle_rxa_stats, > > > + "Returns Rx adapter stats. Parameter: rxa_id"); > > > + > > > + rte_telemetry_register_cmd("/eventdev/rxa_stats_reset", > > > + handle_rxa_stats_reset, > > > + "Reset Rx adapter stats. Parameter: rxa_id"); > > > + > > > + rte_telemetry_register_cmd("/eventdev/rxa_queue_conf", > > > + handle_rxa_get_queue_conf, > > > + "Returns Rx queue config. Parameter: rxa_id, dev_id, > > queue_id"); } > > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h > > > b/lib/eventdev/rte_event_eth_rx_adapter.h > > > index 70ca427..c4257e7 100644 > > > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > > > @@ -232,6 +232,10 @@ struct rte_event_eth_rx_adapter_stats { > > > */ > > > uint64_t rx_intr_packets; > > > /**< Received packet count for interrupt mode Rx queues */ > > > + uint64_t rx_event_buf_count; > > > + /**< Rx event buffered count */ > > > + uint64_t rx_event_buf_size; > > > + /**< Rx event buffer size */ > > > }; > > > > > > /** > > > -- > > > 2.6.4 ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [dpdk-dev] [PATCH v3] eventdev/rx_adapter: add telemetry callbacks 2021-10-12 16:13 ` Kundapura, Ganapati @ 2021-10-13 6:48 ` Naga Harish K, S V 2021-10-13 8:15 ` Kundapura, Ganapati 0 siblings, 1 reply; 19+ messages in thread From: Naga Harish K, S V @ 2021-10-13 6:48 UTC (permalink / raw) To: Kundapura, Ganapati, Jayatheerthan, Jay, jerinjacobk, dev Cc: Kinsella, Ray, Thomas Monjalon, David Marchand > -----Original Message----- > From: Kundapura, Ganapati <ganapati.kundapura@intel.com> > Sent: Tuesday, October 12, 2021 9:44 PM > To: Naga Harish K, S V <s.v.naga.harish.k@intel.com>; Jayatheerthan, Jay > <jay.jayatheerthan@intel.com>; jerinjacobk@gmail.com; dev@dpdk.org > Cc: Kinsella, Ray <ray.kinsella@intel.com>; Thomas Monjalon > <thomas@monjalon.net>; David Marchand <david.marchand@redhat.com> > Subject: RE: [PATCH v3] eventdev/rx_adapter: add telemetry callbacks > > Hi Harish, > > > -----Original Message----- > > From: Naga Harish K, S V <s.v.naga.harish.k@intel.com> > > Sent: 12 October 2021 19:36 > > To: Jayatheerthan, Jay <jay.jayatheerthan@intel.com>; Kundapura, > > Ganapati <ganapati.kundapura@intel.com>; jerinjacobk@gmail.com; > > dev@dpdk.org > > Cc: Kinsella, Ray <ray.kinsella@intel.com>; Thomas Monjalon > > <thomas@monjalon.net>; David Marchand > <david.marchand@redhat.com> > > Subject: RE: [PATCH v3] eventdev/rx_adapter: add telemetry callbacks > > > > > > > > > -----Original Message----- > > > From: dev <dev-bounces@dpdk.org> On Behalf Of Jayatheerthan, Jay > > > Sent: Tuesday, October 12, 2021 6:39 PM > > > To: Kundapura, Ganapati <Ganapati.Kundapura@intel.com>; > > > jerinjacobk@gmail.com; dev@dpdk.org > > > Cc: Kinsella, Ray <ray.kinsella@intel.com>; Thomas Monjalon > > > <thomas@monjalon.net>; David Marchand > <david.marchand@redhat.com> > > > Subject: Re: [dpdk-dev] [PATCH v3] eventdev/rx_adapter: add > > > telemetry callbacks > > > > > > Acked by: Jay Jayatheerthan <jay.jayatheerthan@intel.com> > > > > > > + @Ray Kinsella @Thomas Monjalon @David Marchand > > > > > > > -----Original Message----- > > > > From: Kundapura, Ganapati <ganapati.kundapura@intel.com> > > > > Sent: Tuesday, October 12, 2021 3:55 PM > > > > To: jerinjacobk@gmail.com; dev@dpdk.org > > > > Cc: Jayatheerthan, Jay <jay.jayatheerthan@intel.com> > > > > Subject: [PATCH v3] eventdev/rx_adapter: add telemetry callbacks > > > > > > > > Added telemetry callbacks to get Rx adapter stats, reset stats and > > > > to get Rx queue config information. > > > > > > > > Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com> > > > > --- > > > > v3: > > > > * Updated release notes > > > > * Addressed review comments > > > > > > > > v2: > > > > * Fixed checkpatch warning > > > > --- > > > > > > > > diff --git a/doc/guides/rel_notes/release_21_11.rst > > > > b/doc/guides/rel_notes/release_21_11.rst > > > > index dfc2cbd..9955e52 100644 > > > > --- a/doc/guides/rel_notes/release_21_11.rst > > > > +++ b/doc/guides/rel_notes/release_21_11.rst > > > > @@ -130,6 +130,10 @@ New Features > > > > * Added tests to validate packets hard expiry. > > > > * Added tests to verify tunnel header verification in IPsec inbound. > > > > > > > > +* **Updated rte_event_eth_rx_adapter_stats structure > > > > + * Added 'uint64_t rx_event_buf_count' > > > > + * Added 'uint64_t rx_event_buf_size' > > > > + > > > > > > > > Removed Items > > > > ------------- > > > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c > > > > b/lib/eventdev/rte_event_eth_rx_adapter.c > > > > index 9ac976c..7e3bf62 100644 > > > > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > > > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > > > > @@ -18,6 +18,7 @@ > > > > #include <rte_thash.h> > > > > #include <rte_interrupts.h> > > > > #include <rte_mbuf_dyn.h> > > > > +#include <rte_telemetry.h> > > > > > > > > #include "rte_eventdev.h" > > > > #include "eventdev_pmd.h" > > > > @@ -2852,6 +2853,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t > id, > > > > struct rte_event_eth_rx_adapter_stats *stats) { > > > > struct rte_event_eth_rx_adapter *rx_adapter; > > > > + struct rte_eth_event_enqueue_buffer *buf; > > > > struct rte_event_eth_rx_adapter_stats dev_stats_sum = { 0 }; > > > > struct rte_event_eth_rx_adapter_stats dev_stats; > > > > struct rte_eventdev *dev; > > > > @@ -2887,8 +2889,11 @@ > rte_event_eth_rx_adapter_stats_get(uint8_t > > > id, > > > > if (rx_adapter->service_inited) > > > > *stats = rx_adapter->stats; > > > > > > > > + buf = &rx_adapter->event_enqueue_buffer; > > > > stats->rx_packets += dev_stats_sum.rx_packets; > > > > stats->rx_enq_count += dev_stats_sum.rx_enq_count; > > > > + stats->rx_event_buf_count = buf->count; > > > > When per Rx queue event buffer is used, there is a possibility of > > segfault here Because of null pointer deference. > > > Queue_id is not passed to rte_event_eth_rx_adapter_stats_get() and > there's no way to retrieve the queue id to return the queue's event buffer > size and count. We may need to loop through all the queue's in the adapter > which requires changes in rte_event_eth_rx_adapter_stats structure to hold > event buffer size and count for all the queues. > > Alternatively stats_get() can return event buffer size and count only if > use_queue_event_buf = false i.e only for adapter wide event buffer. > This approach looks ok. When use_queue_event_buf = true, buffer size and count Can be returned as zero. > Do we need event buffer size and count in Rx adapter stats? > > > > > + stats->rx_event_buf_size = buf->events_size; > > > > > > > > return 0; > > > > } > > > > @@ -3052,3 +3057,146 @@ > > > > rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, > > > > > > > > return 0; > > > > } > > > > + > > > > +#define RXA_ADD_DICT(stats, s) rte_tel_data_add_dict_u64(d, #s, > > > > +stats.s) > > > > + > > > > +static int > > > > +handle_rxa_stats(const char *cmd __rte_unused, > > > > + const char *params, > > > > + struct rte_tel_data *d) > > > > +{ > > > > + uint8_t rx_adapter_id; > > > > + struct rte_event_eth_rx_adapter_stats rx_adptr_stats; > > > > + > > > > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > > > > + return -1; > > > > + > > > > + /* Get Rx adapter ID from parameter string */ > > > > + rx_adapter_id = atoi(params); > > > > + > > > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > > > _id, > > > > +-EINVAL); > > > > + > > > > + /* Get Rx adapter stats */ > > > > + if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, > > > > + &rx_adptr_stats)) { > > > > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); > > > > + return -1; > > > > + } > > > > + > > > > + rte_tel_data_start_dict(d); > > > > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_packets); > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_poll_count); > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_dropped); > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_retry); > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_count); > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_size); > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_count); > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_start_ts); > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_block_cycles); > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_end_ts); > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_intr_packets); > > > > + > > > > + return 0; > > > > +} > > > > + > > > > +static int > > > > +handle_rxa_stats_reset(const char *cmd __rte_unused, > > > > + const char *params, > > > > + struct rte_tel_data *d __rte_unused) { > > > > + uint8_t rx_adapter_id; > > > > + > > > > + if (params == NULL || strlen(params) == 0 || ~isdigit(*params)) > > > > + return -1; > > > > + > > > > + /* Get Rx adapter ID from parameter string */ > > > > + rx_adapter_id = atoi(params); > > > > + > > > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > > > _id, > > > > +-EINVAL); > > > > + > > > > + /* Reset Rx adapter stats */ > > > > + if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { > > > > + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); > > > > + return -1; > > > > + } > > > > + > > > > + return 0; > > > > +} > > > > + > > > > +static int > > > > +handle_rxa_get_queue_conf(const char *cmd __rte_unused, > > > > + const char *params, > > > > + struct rte_tel_data *d) > > > > +{ > > > > + uint8_t rx_adapter_id; > > > > + uint16_t rx_queue_id; > > > > + int eth_dev_id; > > > > + char *token, *l_params; > > > > + struct rte_event_eth_rx_adapter_queue_conf queue_conf; > > > > + > > > > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > > > > + return -1; > > > > + > > > > + /* Get Rx adapter ID from parameter string */ > > > > + l_params = strdup(params); > > > > + token = strtok(l_params, ","); > > > > + rx_adapter_id = strtoul(token, NULL, 10); > > > > + > > > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > > > _id, > > > > +-EINVAL); > > > > + > > > > + token = strtok(NULL, ","); > > > > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > > > > + return -1; > > > > + > > > > + /* Get device ID from parameter string */ > > > > + eth_dev_id = strtoul(token, NULL, 10); > > > > + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, -EINVAL); > > > > + > > > > + token = strtok(NULL, ","); > > > > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > > > > + return -1; > > > > + > > > > + /* Get Rx queue ID from parameter string */ > > > > + rx_queue_id = strtoul(token, NULL, 10); > > > > + if (rx_queue_id >= rte_eth_devices[eth_dev_id].data- > > > >nb_rx_queues) { > > > > + RTE_EDEV_LOG_ERR("Invalid rx queue_id %u", > > > rx_queue_id); > > > > + return -EINVAL; > > > > + } > > > > + > > > > + token = strtok(NULL, "\0"); > > > > + if (token != NULL) > > > > + RTE_EDEV_LOG_ERR("Extra parameters passed to eventdev" > > > > + " telemetry command, igrnoring"); > > > > + > > > > + if (rte_event_eth_rx_adapter_queue_conf_get(rx_adapter_id, > > > eth_dev_id, > > > > + rx_queue_id, > > > &queue_conf)) { > > > > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter queue > > > config"); > > > > + return -1; > > > > + } > > > > + > > > > + rte_tel_data_start_dict(d); > > > > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > > > > + rte_tel_data_add_dict_u64(d, "eth_dev_id", eth_dev_id); > > > > + rte_tel_data_add_dict_u64(d, "rx_queue_id", rx_queue_id); > > > > + RXA_ADD_DICT(queue_conf, rx_queue_flags); > > > > + RXA_ADD_DICT(queue_conf, servicing_weight); > > > > + RXA_ADD_DICT(queue_conf.ev, queue_id); > > > > + RXA_ADD_DICT(queue_conf.ev, sched_type); > > > > + RXA_ADD_DICT(queue_conf.ev, priority); > > > > + RXA_ADD_DICT(queue_conf.ev, flow_id); > > > > + > > > > + return 0; > > > > +} > > > > + > > > > +RTE_INIT(rxa_init_telemetry) > > > > +{ > > > > + rte_telemetry_register_cmd("/eventdev/rxa_stats", > > > > + handle_rxa_stats, > > > > + "Returns Rx adapter stats. Parameter: rxa_id"); > > > > + > > > > + rte_telemetry_register_cmd("/eventdev/rxa_stats_reset", > > > > + handle_rxa_stats_reset, > > > > + "Reset Rx adapter stats. Parameter: rxa_id"); > > > > + > > > > + rte_telemetry_register_cmd("/eventdev/rxa_queue_conf", > > > > + handle_rxa_get_queue_conf, > > > > + "Returns Rx queue config. Parameter: rxa_id, dev_id, > > > queue_id"); } > > > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h > > > > b/lib/eventdev/rte_event_eth_rx_adapter.h > > > > index 70ca427..c4257e7 100644 > > > > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > > > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > > > > @@ -232,6 +232,10 @@ struct rte_event_eth_rx_adapter_stats { > > > > */ > > > > uint64_t rx_intr_packets; > > > > /**< Received packet count for interrupt mode Rx queues */ > > > > + uint64_t rx_event_buf_count; > > > > + /**< Rx event buffered count */ > > > > + uint64_t rx_event_buf_size; > > > > + /**< Rx event buffer size */ > > > > }; > > > > > > > > /** > > > > -- > > > > 2.6.4 ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [dpdk-dev] [PATCH v3] eventdev/rx_adapter: add telemetry callbacks 2021-10-13 6:48 ` Naga Harish K, S V @ 2021-10-13 8:15 ` Kundapura, Ganapati 0 siblings, 0 replies; 19+ messages in thread From: Kundapura, Ganapati @ 2021-10-13 8:15 UTC (permalink / raw) To: Naga Harish K, S V, Jayatheerthan, Jay, jerinjacobk, dev Cc: Kinsella, Ray, Thomas Monjalon, David Marchand Hi Harish, > -----Original Message----- > From: Naga Harish K, S V <s.v.naga.harish.k@intel.com> > Sent: 13 October 2021 12:18 > To: Kundapura, Ganapati <ganapati.kundapura@intel.com>; Jayatheerthan, Jay > <jay.jayatheerthan@intel.com>; jerinjacobk@gmail.com; dev@dpdk.org > Cc: Kinsella, Ray <ray.kinsella@intel.com>; Thomas Monjalon > <thomas@monjalon.net>; David Marchand <david.marchand@redhat.com> > Subject: RE: [PATCH v3] eventdev/rx_adapter: add telemetry callbacks > > > > > -----Original Message----- > > From: Kundapura, Ganapati <ganapati.kundapura@intel.com> > > Sent: Tuesday, October 12, 2021 9:44 PM > > To: Naga Harish K, S V <s.v.naga.harish.k@intel.com>; Jayatheerthan, > > Jay <jay.jayatheerthan@intel.com>; jerinjacobk@gmail.com; dev@dpdk.org > > Cc: Kinsella, Ray <ray.kinsella@intel.com>; Thomas Monjalon > > <thomas@monjalon.net>; David Marchand <david.marchand@redhat.com> > > Subject: RE: [PATCH v3] eventdev/rx_adapter: add telemetry callbacks > > > > Hi Harish, > > > > > -----Original Message----- > > > From: Naga Harish K, S V <s.v.naga.harish.k@intel.com> > > > Sent: 12 October 2021 19:36 > > > To: Jayatheerthan, Jay <jay.jayatheerthan@intel.com>; Kundapura, > > > Ganapati <ganapati.kundapura@intel.com>; jerinjacobk@gmail.com; > > > dev@dpdk.org > > > Cc: Kinsella, Ray <ray.kinsella@intel.com>; Thomas Monjalon > > > <thomas@monjalon.net>; David Marchand > > <david.marchand@redhat.com> > > > Subject: RE: [PATCH v3] eventdev/rx_adapter: add telemetry callbacks > > > > > > > > > > > > > -----Original Message----- > > > > From: dev <dev-bounces@dpdk.org> On Behalf Of Jayatheerthan, Jay > > > > Sent: Tuesday, October 12, 2021 6:39 PM > > > > To: Kundapura, Ganapati <Ganapati.Kundapura@intel.com>; > > > > jerinjacobk@gmail.com; dev@dpdk.org > > > > Cc: Kinsella, Ray <ray.kinsella@intel.com>; Thomas Monjalon > > > > <thomas@monjalon.net>; David Marchand > > <david.marchand@redhat.com> > > > > Subject: Re: [dpdk-dev] [PATCH v3] eventdev/rx_adapter: add > > > > telemetry callbacks > > > > > > > > Acked by: Jay Jayatheerthan <jay.jayatheerthan@intel.com> > > > > > > > > + @Ray Kinsella @Thomas Monjalon @David Marchand > > > > > > > > > -----Original Message----- > > > > > From: Kundapura, Ganapati <ganapati.kundapura@intel.com> > > > > > Sent: Tuesday, October 12, 2021 3:55 PM > > > > > To: jerinjacobk@gmail.com; dev@dpdk.org > > > > > Cc: Jayatheerthan, Jay <jay.jayatheerthan@intel.com> > > > > > Subject: [PATCH v3] eventdev/rx_adapter: add telemetry callbacks > > > > > > > > > > Added telemetry callbacks to get Rx adapter stats, reset stats > > > > > and to get Rx queue config information. > > > > > > > > > > Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com> > > > > > --- > > > > > v3: > > > > > * Updated release notes > > > > > * Addressed review comments > > > > > > > > > > v2: > > > > > * Fixed checkpatch warning > > > > > --- > > > > > > > > > > diff --git a/doc/guides/rel_notes/release_21_11.rst > > > > > b/doc/guides/rel_notes/release_21_11.rst > > > > > index dfc2cbd..9955e52 100644 > > > > > --- a/doc/guides/rel_notes/release_21_11.rst > > > > > +++ b/doc/guides/rel_notes/release_21_11.rst > > > > > @@ -130,6 +130,10 @@ New Features > > > > > * Added tests to validate packets hard expiry. > > > > > * Added tests to verify tunnel header verification in IPsec inbound. > > > > > > > > > > +* **Updated rte_event_eth_rx_adapter_stats structure > > > > > + * Added 'uint64_t rx_event_buf_count' > > > > > + * Added 'uint64_t rx_event_buf_size' > > > > > + > > > > > > > > > > Removed Items > > > > > ------------- > > > > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c > > > > > b/lib/eventdev/rte_event_eth_rx_adapter.c > > > > > index 9ac976c..7e3bf62 100644 > > > > > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > > > > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > > > > > @@ -18,6 +18,7 @@ > > > > > #include <rte_thash.h> > > > > > #include <rte_interrupts.h> > > > > > #include <rte_mbuf_dyn.h> > > > > > +#include <rte_telemetry.h> > > > > > > > > > > #include "rte_eventdev.h" > > > > > #include "eventdev_pmd.h" > > > > > @@ -2852,6 +2853,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t > > id, > > > > > struct rte_event_eth_rx_adapter_stats *stats) { > > > > > struct rte_event_eth_rx_adapter *rx_adapter; > > > > > + struct rte_eth_event_enqueue_buffer *buf; > > > > > struct rte_event_eth_rx_adapter_stats dev_stats_sum = { 0 }; > > > > > struct rte_event_eth_rx_adapter_stats dev_stats; > > > > > struct rte_eventdev *dev; > > > > > @@ -2887,8 +2889,11 @@ > > rte_event_eth_rx_adapter_stats_get(uint8_t > > > > id, > > > > > if (rx_adapter->service_inited) > > > > > *stats = rx_adapter->stats; > > > > > > > > > > + buf = &rx_adapter->event_enqueue_buffer; > > > > > stats->rx_packets += dev_stats_sum.rx_packets; > > > > > stats->rx_enq_count += dev_stats_sum.rx_enq_count; > > > > > + stats->rx_event_buf_count = buf->count; > > > > > > When per Rx queue event buffer is used, there is a possibility of > > > segfault here Because of null pointer deference. > > > > > Queue_id is not passed to rte_event_eth_rx_adapter_stats_get() and > > there's no way to retrieve the queue id to return the queue's event > > buffer size and count. We may need to loop through all the queue's in > > the adapter which requires changes in rte_event_eth_rx_adapter_stats > > structure to hold event buffer size and count for all the queues. > > > > Alternatively stats_get() can return event buffer size and count only > > if use_queue_event_buf = false i.e only for adapter wide event buffer. > > > > This approach looks ok. When use_queue_event_buf = true, buffer size and > count Can be returned as zero. > Posted new patch with the suggested changes. > > Do we need event buffer size and count in Rx adapter stats? > > > > > > > + stats->rx_event_buf_size = buf->events_size; > > > > > > > > > > return 0; > > > > > } > > > > > @@ -3052,3 +3057,146 @@ > > > > > rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, > > > > > > > > > > return 0; > > > > > } > > > > > + > > > > > +#define RXA_ADD_DICT(stats, s) rte_tel_data_add_dict_u64(d, #s, > > > > > +stats.s) > > > > > + > > > > > +static int > > > > > +handle_rxa_stats(const char *cmd __rte_unused, > > > > > + const char *params, > > > > > + struct rte_tel_data *d) > > > > > +{ > > > > > + uint8_t rx_adapter_id; > > > > > + struct rte_event_eth_rx_adapter_stats rx_adptr_stats; > > > > > + > > > > > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > > > > > + return -1; > > > > > + > > > > > + /* Get Rx adapter ID from parameter string */ > > > > > + rx_adapter_id = atoi(params); > > > > > + > > > > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > > > > _id, > > > > > +-EINVAL); > > > > > + > > > > > + /* Get Rx adapter stats */ > > > > > + if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, > > > > > + &rx_adptr_stats)) { > > > > > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter > stats\n"); > > > > > + return -1; > > > > > + } > > > > > + > > > > > + rte_tel_data_start_dict(d); > > > > > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_packets); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_poll_count); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_dropped); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_retry); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_count); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_size); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_count); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_start_ts); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_block_cycles); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_end_ts); > > > > > + RXA_ADD_DICT(rx_adptr_stats, rx_intr_packets); > > > > > + > > > > > + return 0; > > > > > +} > > > > > + > > > > > +static int > > > > > +handle_rxa_stats_reset(const char *cmd __rte_unused, > > > > > + const char *params, > > > > > + struct rte_tel_data *d __rte_unused) { > > > > > + uint8_t rx_adapter_id; > > > > > + > > > > > + if (params == NULL || strlen(params) == 0 || ~isdigit(*params)) > > > > > + return -1; > > > > > + > > > > > + /* Get Rx adapter ID from parameter string */ > > > > > + rx_adapter_id = atoi(params); > > > > > + > > > > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > > > > _id, > > > > > +-EINVAL); > > > > > + > > > > > + /* Reset Rx adapter stats */ > > > > > + if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { > > > > > + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter > stats\n"); > > > > > + return -1; > > > > > + } > > > > > + > > > > > + return 0; > > > > > +} > > > > > + > > > > > +static int > > > > > +handle_rxa_get_queue_conf(const char *cmd __rte_unused, > > > > > + const char *params, > > > > > + struct rte_tel_data *d) > > > > > +{ > > > > > + uint8_t rx_adapter_id; > > > > > + uint16_t rx_queue_id; > > > > > + int eth_dev_id; > > > > > + char *token, *l_params; > > > > > + struct rte_event_eth_rx_adapter_queue_conf queue_conf; > > > > > + > > > > > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > > > > > + return -1; > > > > > + > > > > > + /* Get Rx adapter ID from parameter string */ > > > > > + l_params = strdup(params); > > > > > + token = strtok(l_params, ","); > > > > > + rx_adapter_id = strtoul(token, NULL, 10); > > > > > + > > > > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > > > > _id, > > > > > +-EINVAL); > > > > > + > > > > > + token = strtok(NULL, ","); > > > > > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > > > > > + return -1; > > > > > + > > > > > + /* Get device ID from parameter string */ > > > > > + eth_dev_id = strtoul(token, NULL, 10); > > > > > + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, - > EINVAL); > > > > > + > > > > > + token = strtok(NULL, ","); > > > > > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > > > > > + return -1; > > > > > + > > > > > + /* Get Rx queue ID from parameter string */ > > > > > + rx_queue_id = strtoul(token, NULL, 10); > > > > > + if (rx_queue_id >= rte_eth_devices[eth_dev_id].data- > > > > >nb_rx_queues) { > > > > > + RTE_EDEV_LOG_ERR("Invalid rx queue_id %u", > > > > rx_queue_id); > > > > > + return -EINVAL; > > > > > + } > > > > > + > > > > > + token = strtok(NULL, "\0"); > > > > > + if (token != NULL) > > > > > + RTE_EDEV_LOG_ERR("Extra parameters passed to > eventdev" > > > > > + " telemetry command, igrnoring"); > > > > > + > > > > > + if (rte_event_eth_rx_adapter_queue_conf_get(rx_adapter_id, > > > > eth_dev_id, > > > > > + rx_queue_id, > > > > &queue_conf)) { > > > > > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter queue > > > > config"); > > > > > + return -1; > > > > > + } > > > > > + > > > > > + rte_tel_data_start_dict(d); > > > > > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > > > > > + rte_tel_data_add_dict_u64(d, "eth_dev_id", eth_dev_id); > > > > > + rte_tel_data_add_dict_u64(d, "rx_queue_id", rx_queue_id); > > > > > + RXA_ADD_DICT(queue_conf, rx_queue_flags); > > > > > + RXA_ADD_DICT(queue_conf, servicing_weight); > > > > > + RXA_ADD_DICT(queue_conf.ev, queue_id); > > > > > + RXA_ADD_DICT(queue_conf.ev, sched_type); > > > > > + RXA_ADD_DICT(queue_conf.ev, priority); > > > > > + RXA_ADD_DICT(queue_conf.ev, flow_id); > > > > > + > > > > > + return 0; > > > > > +} > > > > > + > > > > > +RTE_INIT(rxa_init_telemetry) > > > > > +{ > > > > > + rte_telemetry_register_cmd("/eventdev/rxa_stats", > > > > > + handle_rxa_stats, > > > > > + "Returns Rx adapter stats. Parameter: rxa_id"); > > > > > + > > > > > + rte_telemetry_register_cmd("/eventdev/rxa_stats_reset", > > > > > + handle_rxa_stats_reset, > > > > > + "Reset Rx adapter stats. Parameter: rxa_id"); > > > > > + > > > > > + rte_telemetry_register_cmd("/eventdev/rxa_queue_conf", > > > > > + handle_rxa_get_queue_conf, > > > > > + "Returns Rx queue config. Parameter: rxa_id, dev_id, > > > > queue_id"); } > > > > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h > > > > > b/lib/eventdev/rte_event_eth_rx_adapter.h > > > > > index 70ca427..c4257e7 100644 > > > > > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > > > > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > > > > > @@ -232,6 +232,10 @@ struct rte_event_eth_rx_adapter_stats { > > > > > */ > > > > > uint64_t rx_intr_packets; > > > > > /**< Received packet count for interrupt mode Rx queues */ > > > > > + uint64_t rx_event_buf_count; > > > > > + /**< Rx event buffered count */ > > > > > + uint64_t rx_event_buf_size; > > > > > + /**< Rx event buffer size */ > > > > > }; > > > > > > > > > > /** > > > > > -- > > > > > 2.6.4 ^ permalink raw reply [flat|nested] 19+ messages in thread
* [dpdk-dev] [PATCH v4] eventdev/rx_adapter: add telemetry callbacks 2021-10-12 10:25 ` [dpdk-dev] [PATCH v3] eventdev/rx_adapter: " Ganapati Kundapura 2021-10-12 13:09 ` Jayatheerthan, Jay @ 2021-10-13 7:57 ` Ganapati Kundapura 2021-10-13 12:09 ` Naga Harish K, S V 1 sibling, 1 reply; 19+ messages in thread From: Ganapati Kundapura @ 2021-10-13 7:57 UTC (permalink / raw) To: jerinjacobk, dev; +Cc: jay.jayatheerthan Added telemetry callbacks to get Rx adapter stats, reset stats and to get Rx queue config information. Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com> Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com> --- v4: * Addressed segfault when per Rx queue event buffer is used. v3: * Updated release notes. * Addressed review comments. v2: * Fixed checkpatch warning. --- diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst index dfc2cbd..9955e52 100644 --- a/doc/guides/rel_notes/release_21_11.rst +++ b/doc/guides/rel_notes/release_21_11.rst @@ -130,6 +130,10 @@ New Features * Added tests to validate packets hard expiry. * Added tests to verify tunnel header verification in IPsec inbound. +* **Updated rte_event_eth_rx_adapter_stats structure + * Added 'uint64_t rx_event_buf_count' + * Added 'uint64_t rx_event_buf_size' + Removed Items ------------- diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index 9ac976c..bd68b8e 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -18,6 +18,7 @@ #include <rte_thash.h> #include <rte_interrupts.h> #include <rte_mbuf_dyn.h> +#include <rte_telemetry.h> #include "rte_eventdev.h" #include "eventdev_pmd.h" @@ -2852,6 +2853,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, struct rte_event_eth_rx_adapter_stats *stats) { struct rte_event_eth_rx_adapter *rx_adapter; + struct rte_eth_event_enqueue_buffer *buf; struct rte_event_eth_rx_adapter_stats dev_stats_sum = { 0 }; struct rte_event_eth_rx_adapter_stats dev_stats; struct rte_eventdev *dev; @@ -2890,6 +2892,15 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, stats->rx_packets += dev_stats_sum.rx_packets; stats->rx_enq_count += dev_stats_sum.rx_enq_count; + if (!rx_adapter->use_queue_event_buf) { + buf = &rx_adapter->event_enqueue_buffer; + stats->rx_event_buf_count = buf->count; + stats->rx_event_buf_size = buf->events_size; + } else { + stats->rx_event_buf_count = 0; + stats->rx_event_buf_size = 0; + } + return 0; } @@ -3052,3 +3063,146 @@ rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, return 0; } + +#define RXA_ADD_DICT(stats, s) rte_tel_data_add_dict_u64(d, #s, stats.s) + +static int +handle_rxa_stats(const char *cmd __rte_unused, + const char *params, + struct rte_tel_data *d) +{ + uint8_t rx_adapter_id; + struct rte_event_eth_rx_adapter_stats rx_adptr_stats; + + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) + return -1; + + /* Get Rx adapter ID from parameter string */ + rx_adapter_id = atoi(params); + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); + + /* Get Rx adapter stats */ + if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, + &rx_adptr_stats)) { + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); + return -1; + } + + rte_tel_data_start_dict(d); + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); + RXA_ADD_DICT(rx_adptr_stats, rx_packets); + RXA_ADD_DICT(rx_adptr_stats, rx_poll_count); + RXA_ADD_DICT(rx_adptr_stats, rx_dropped); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_retry); + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_count); + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_size); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_count); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_start_ts); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_block_cycles); + RXA_ADD_DICT(rx_adptr_stats, rx_enq_end_ts); + RXA_ADD_DICT(rx_adptr_stats, rx_intr_packets); + + return 0; +} + +static int +handle_rxa_stats_reset(const char *cmd __rte_unused, + const char *params, + struct rte_tel_data *d __rte_unused) +{ + uint8_t rx_adapter_id; + + if (params == NULL || strlen(params) == 0 || ~isdigit(*params)) + return -1; + + /* Get Rx adapter ID from parameter string */ + rx_adapter_id = atoi(params); + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); + + /* Reset Rx adapter stats */ + if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); + return -1; + } + + return 0; +} + +static int +handle_rxa_get_queue_conf(const char *cmd __rte_unused, + const char *params, + struct rte_tel_data *d) +{ + uint8_t rx_adapter_id; + uint16_t rx_queue_id; + int eth_dev_id; + char *token, *l_params; + struct rte_event_eth_rx_adapter_queue_conf queue_conf; + + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) + return -1; + + /* Get Rx adapter ID from parameter string */ + l_params = strdup(params); + token = strtok(l_params, ","); + rx_adapter_id = strtoul(token, NULL, 10); + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); + + token = strtok(NULL, ","); + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) + return -1; + + /* Get device ID from parameter string */ + eth_dev_id = strtoul(token, NULL, 10); + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, -EINVAL); + + token = strtok(NULL, ","); + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) + return -1; + + /* Get Rx queue ID from parameter string */ + rx_queue_id = strtoul(token, NULL, 10); + if (rx_queue_id >= rte_eth_devices[eth_dev_id].data->nb_rx_queues) { + RTE_EDEV_LOG_ERR("Invalid rx queue_id %u", rx_queue_id); + return -EINVAL; + } + + token = strtok(NULL, "\0"); + if (token != NULL) + RTE_EDEV_LOG_ERR("Extra parameters passed to eventdev" + " telemetry command, igrnoring"); + + if (rte_event_eth_rx_adapter_queue_conf_get(rx_adapter_id, eth_dev_id, + rx_queue_id, &queue_conf)) { + RTE_EDEV_LOG_ERR("Failed to get Rx adapter queue config"); + return -1; + } + + rte_tel_data_start_dict(d); + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); + rte_tel_data_add_dict_u64(d, "eth_dev_id", eth_dev_id); + rte_tel_data_add_dict_u64(d, "rx_queue_id", rx_queue_id); + RXA_ADD_DICT(queue_conf, rx_queue_flags); + RXA_ADD_DICT(queue_conf, servicing_weight); + RXA_ADD_DICT(queue_conf.ev, queue_id); + RXA_ADD_DICT(queue_conf.ev, sched_type); + RXA_ADD_DICT(queue_conf.ev, priority); + RXA_ADD_DICT(queue_conf.ev, flow_id); + + return 0; +} + +RTE_INIT(rxa_init_telemetry) +{ + rte_telemetry_register_cmd("/eventdev/rxa_stats", + handle_rxa_stats, + "Returns Rx adapter stats. Parameter: rxa_id"); + + rte_telemetry_register_cmd("/eventdev/rxa_stats_reset", + handle_rxa_stats_reset, + "Reset Rx adapter stats. Parameter: rxa_id"); + + rte_telemetry_register_cmd("/eventdev/rxa_queue_conf", + handle_rxa_get_queue_conf, + "Returns Rx queue config. Parameter: rxa_id, dev_id, queue_id"); +} diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_event_eth_rx_adapter.h index 70ca427..c4257e7 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.h +++ b/lib/eventdev/rte_event_eth_rx_adapter.h @@ -232,6 +232,10 @@ struct rte_event_eth_rx_adapter_stats { */ uint64_t rx_intr_packets; /**< Received packet count for interrupt mode Rx queues */ + uint64_t rx_event_buf_count; + /**< Rx event buffered count */ + uint64_t rx_event_buf_size; + /**< Rx event buffer size */ }; /** -- 2.6.4 ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [dpdk-dev] [PATCH v4] eventdev/rx_adapter: add telemetry callbacks 2021-10-13 7:57 ` [dpdk-dev] [PATCH v4] " Ganapati Kundapura @ 2021-10-13 12:09 ` Naga Harish K, S V 2021-10-14 8:25 ` Jerin Jacob 0 siblings, 1 reply; 19+ messages in thread From: Naga Harish K, S V @ 2021-10-13 12:09 UTC (permalink / raw) To: Kundapura, Ganapati, jerinjacobk, dev; +Cc: Jayatheerthan, Jay Acked-by: Naga Harish K S V <s.v.naga.harish.k@intel.com> > -----Original Message----- > From: dev <dev-bounces@dpdk.org> On Behalf Of Ganapati Kundapura > Sent: Wednesday, October 13, 2021 1:27 PM > To: jerinjacobk@gmail.com; dev@dpdk.org > Cc: Jayatheerthan, Jay <jay.jayatheerthan@intel.com> > Subject: [dpdk-dev] [PATCH v4] eventdev/rx_adapter: add telemetry > callbacks > > Added telemetry callbacks to get Rx adapter stats, reset stats and to get Rx > queue config information. > > Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com> > > Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com> > --- > v4: > * Addressed segfault when per Rx queue event buffer is used. > > v3: > * Updated release notes. > * Addressed review comments. > > v2: > * Fixed checkpatch warning. > --- > > diff --git a/doc/guides/rel_notes/release_21_11.rst > b/doc/guides/rel_notes/release_21_11.rst > index dfc2cbd..9955e52 100644 > --- a/doc/guides/rel_notes/release_21_11.rst > +++ b/doc/guides/rel_notes/release_21_11.rst > @@ -130,6 +130,10 @@ New Features > * Added tests to validate packets hard expiry. > * Added tests to verify tunnel header verification in IPsec inbound. > > +* **Updated rte_event_eth_rx_adapter_stats structure > + * Added 'uint64_t rx_event_buf_count' > + * Added 'uint64_t rx_event_buf_size' > + > > Removed Items > ------------- > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c > b/lib/eventdev/rte_event_eth_rx_adapter.c > index 9ac976c..bd68b8e 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > @@ -18,6 +18,7 @@ > #include <rte_thash.h> > #include <rte_interrupts.h> > #include <rte_mbuf_dyn.h> > +#include <rte_telemetry.h> > > #include "rte_eventdev.h" > #include "eventdev_pmd.h" > @@ -2852,6 +2853,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, > struct rte_event_eth_rx_adapter_stats *stats) { > struct rte_event_eth_rx_adapter *rx_adapter; > + struct rte_eth_event_enqueue_buffer *buf; > struct rte_event_eth_rx_adapter_stats dev_stats_sum = { 0 }; > struct rte_event_eth_rx_adapter_stats dev_stats; > struct rte_eventdev *dev; > @@ -2890,6 +2892,15 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, > stats->rx_packets += dev_stats_sum.rx_packets; > stats->rx_enq_count += dev_stats_sum.rx_enq_count; > > + if (!rx_adapter->use_queue_event_buf) { > + buf = &rx_adapter->event_enqueue_buffer; > + stats->rx_event_buf_count = buf->count; > + stats->rx_event_buf_size = buf->events_size; > + } else { > + stats->rx_event_buf_count = 0; > + stats->rx_event_buf_size = 0; > + } > + > return 0; > } > > @@ -3052,3 +3063,146 @@ > rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, > > return 0; > } > + > +#define RXA_ADD_DICT(stats, s) rte_tel_data_add_dict_u64(d, #s, > +stats.s) > + > +static int > +handle_rxa_stats(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *d) > +{ > + uint8_t rx_adapter_id; > + struct rte_event_eth_rx_adapter_stats rx_adptr_stats; > + > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > + return -1; > + > + /* Get Rx adapter ID from parameter string */ > + rx_adapter_id = atoi(params); > + > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > _id, -EINVAL); > + > + /* Get Rx adapter stats */ > + if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, > + &rx_adptr_stats)) { > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); > + return -1; > + } > + > + rte_tel_data_start_dict(d); > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > + RXA_ADD_DICT(rx_adptr_stats, rx_packets); > + RXA_ADD_DICT(rx_adptr_stats, rx_poll_count); > + RXA_ADD_DICT(rx_adptr_stats, rx_dropped); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_retry); > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_count); > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_size); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_count); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_start_ts); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_block_cycles); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_end_ts); > + RXA_ADD_DICT(rx_adptr_stats, rx_intr_packets); > + > + return 0; > +} > + > +static int > +handle_rxa_stats_reset(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *d __rte_unused) { > + uint8_t rx_adapter_id; > + > + if (params == NULL || strlen(params) == 0 || ~isdigit(*params)) > + return -1; > + > + /* Get Rx adapter ID from parameter string */ > + rx_adapter_id = atoi(params); > + > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > _id, -EINVAL); > + > + /* Reset Rx adapter stats */ > + if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { > + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); > + return -1; > + } > + > + return 0; > +} > + > +static int > +handle_rxa_get_queue_conf(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *d) > +{ > + uint8_t rx_adapter_id; > + uint16_t rx_queue_id; > + int eth_dev_id; > + char *token, *l_params; > + struct rte_event_eth_rx_adapter_queue_conf queue_conf; > + > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > + return -1; > + > + /* Get Rx adapter ID from parameter string */ > + l_params = strdup(params); > + token = strtok(l_params, ","); > + rx_adapter_id = strtoul(token, NULL, 10); > + > RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter > _id, -EINVAL); > + > + token = strtok(NULL, ","); > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > + return -1; > + > + /* Get device ID from parameter string */ > + eth_dev_id = strtoul(token, NULL, 10); > + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, -EINVAL); > + > + token = strtok(NULL, ","); > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > + return -1; > + > + /* Get Rx queue ID from parameter string */ > + rx_queue_id = strtoul(token, NULL, 10); > + if (rx_queue_id >= rte_eth_devices[eth_dev_id].data- > >nb_rx_queues) { > + RTE_EDEV_LOG_ERR("Invalid rx queue_id %u", > rx_queue_id); > + return -EINVAL; > + } > + > + token = strtok(NULL, "\0"); > + if (token != NULL) > + RTE_EDEV_LOG_ERR("Extra parameters passed to eventdev" > + " telemetry command, igrnoring"); > + > + if (rte_event_eth_rx_adapter_queue_conf_get(rx_adapter_id, > eth_dev_id, > + rx_queue_id, > &queue_conf)) { > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter queue > config"); > + return -1; > + } > + > + rte_tel_data_start_dict(d); > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > + rte_tel_data_add_dict_u64(d, "eth_dev_id", eth_dev_id); > + rte_tel_data_add_dict_u64(d, "rx_queue_id", rx_queue_id); > + RXA_ADD_DICT(queue_conf, rx_queue_flags); > + RXA_ADD_DICT(queue_conf, servicing_weight); > + RXA_ADD_DICT(queue_conf.ev, queue_id); > + RXA_ADD_DICT(queue_conf.ev, sched_type); > + RXA_ADD_DICT(queue_conf.ev, priority); > + RXA_ADD_DICT(queue_conf.ev, flow_id); > + > + return 0; > +} > + > +RTE_INIT(rxa_init_telemetry) > +{ > + rte_telemetry_register_cmd("/eventdev/rxa_stats", > + handle_rxa_stats, > + "Returns Rx adapter stats. Parameter: rxa_id"); > + > + rte_telemetry_register_cmd("/eventdev/rxa_stats_reset", > + handle_rxa_stats_reset, > + "Reset Rx adapter stats. Parameter: rxa_id"); > + > + rte_telemetry_register_cmd("/eventdev/rxa_queue_conf", > + handle_rxa_get_queue_conf, > + "Returns Rx queue config. Parameter: rxa_id, dev_id, > queue_id"); } > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h > b/lib/eventdev/rte_event_eth_rx_adapter.h > index 70ca427..c4257e7 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > @@ -232,6 +232,10 @@ struct rte_event_eth_rx_adapter_stats { > */ > uint64_t rx_intr_packets; > /**< Received packet count for interrupt mode Rx queues */ > + uint64_t rx_event_buf_count; > + /**< Rx event buffered count */ > + uint64_t rx_event_buf_size; > + /**< Rx event buffer size */ > }; > > /** > -- > 2.6.4 ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [dpdk-dev] [PATCH v4] eventdev/rx_adapter: add telemetry callbacks 2021-10-13 12:09 ` Naga Harish K, S V @ 2021-10-14 8:25 ` Jerin Jacob 0 siblings, 0 replies; 19+ messages in thread From: Jerin Jacob @ 2021-10-14 8:25 UTC (permalink / raw) To: Naga Harish K, S V; +Cc: Kundapura, Ganapati, dev, Jayatheerthan, Jay On Wed, Oct 13, 2021 at 5:39 PM Naga Harish K, S V <s.v.naga.harish.k@intel.com> wrote: > > Acked-by: Naga Harish K S V <s.v.naga.harish.k@intel.com> > > > -----Original Message----- > > From: dev <dev-bounces@dpdk.org> On Behalf Of Ganapati Kundapura > > Sent: Wednesday, October 13, 2021 1:27 PM > > To: jerinjacobk@gmail.com; dev@dpdk.org > > Cc: Jayatheerthan, Jay <jay.jayatheerthan@intel.com> > > Subject: [dpdk-dev] [PATCH v4] eventdev/rx_adapter: add telemetry > > callbacks > > > > Added telemetry callbacks to get Rx adapter stats, reset stats and to get Rx > > queue config information. > > > > Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com> > > > > Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com> > > --- > > v4: > > * Addressed segfault when per Rx queue event buffer is used. > > > > v3: > > * Updated release notes. > > * Addressed review comments. > > > > v2: > > * Fixed checkpatch warning. > > --- > > > > diff --git a/doc/guides/rel_notes/release_21_11.rst > > b/doc/guides/rel_notes/release_21_11.rst > > index dfc2cbd..9955e52 100644 > > --- a/doc/guides/rel_notes/release_21_11.rst > > +++ b/doc/guides/rel_notes/release_21_11.rst > > @@ -130,6 +130,10 @@ New Features > > * Added tests to validate packets hard expiry. > > * Added tests to verify tunnel header verification in IPsec inbound. > > > > +* **Updated rte_event_eth_rx_adapter_stats structure > > + * Added 'uint64_t rx_event_buf_count' > > + * Added 'uint64_t rx_event_buf_size' > > + We need to add this to ABI changed. Updated the patch to add ABI changes as below * eventdev: New variables ``rx_event_buf_count`` and ``rx_event_buf_size`` were added in structure ``rte_event_eth_rx_adapter_stats`` to get additional status. And Updatde git log as log below: eventdev/rx_adapter: support telemetry Added telemetry callbacks to get Rx adapter stats, reset stats and to get Rx queue config information. Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com> Acked-by: Jay Jayatheerthan <jay.jayatheerthan@intel.com> Acked-by: Naga Harish K S V <s.v.naga.harish.k@intel.com> Acked-by: Jerin Jacob <jerinj@marvell.com> Applied to dpdk-next-net-eventdev/for-main. Thanks ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [dpdk-dev] [PATCH v1] eventdev/rx-adapter: add telemetry callbacks 2021-10-07 12:57 [dpdk-dev] [PATCH v1] eventdev/rx-adapter: add telemetry callbacks Ganapati Kundapura 2021-10-07 13:46 ` [dpdk-dev] [PATCH v2] " Ganapati Kundapura @ 2021-10-11 16:14 ` Jerin Jacob 2021-10-12 8:35 ` Kundapura, Ganapati 1 sibling, 1 reply; 19+ messages in thread From: Jerin Jacob @ 2021-10-11 16:14 UTC (permalink / raw) To: Ganapati Kundapura; +Cc: dpdk-dev, Jayatheerthan, Jay On Thu, Oct 7, 2021 at 6:27 PM Ganapati Kundapura <ganapati.kundapura@intel.com> wrote: > > Added telemetry callbacks to get Rx adapter stats, reset stats and > to get rx queue config information. rx -> Rx Change the subject to eventdev/rx_adapter > > Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com> > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c > index 9ac976c..fa7191c 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > @@ -23,6 +23,7 @@ > #include "eventdev_pmd.h" > #include "rte_eventdev_trace.h" > #include "rte_event_eth_rx_adapter.h" > +#include <rte_telemetry.h> Move this to the above block where all <...h> header files are grouped. > > #define BATCH_SIZE 32 > #define BLOCK_CNT_THRESHOLD 10 > @@ -2852,6 +2853,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, > struct rte_event_eth_rx_adapter_stats *stats) > { > struct rte_event_eth_rx_adapter *rx_adapter; > + struct rte_eth_event_enqueue_buffer *buf; > struct rte_event_eth_rx_adapter_stats dev_stats_sum = { 0 }; > struct rte_event_eth_rx_adapter_stats dev_stats; > struct rte_eventdev *dev; > @@ -2887,8 +2889,11 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, > if (rx_adapter->service_inited) > *stats = rx_adapter->stats; > > + buf = &rx_adapter->event_enqueue_buffer; > stats->rx_packets += dev_stats_sum.rx_packets; > stats->rx_enq_count += dev_stats_sum.rx_enq_count; > + stats->rx_event_buf_count = buf->count; > + stats->rx_event_buf_size = buf->events_size; > > return 0; > } > @@ -3052,3 +3057,146 @@ rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, > > return 0; > } > + > +#define RXA_ADD_DICT(stats, s) rte_tel_data_add_dict_u64(d, #s, stats.s) > + > +static int > +handle_rxa_stats(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *d) > +{ > + uint8_t rx_adapter_id; > + struct rte_event_eth_rx_adapter_stats rx_adptr_stats; > + > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > + return -1; > + > + /* Get Rx adapter ID from parameter string */ > + rx_adapter_id = atoi(params); > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); > + > + /* Get Rx adapter stats */ > + if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, > + &rx_adptr_stats)) { > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); > + return -1; > + } > + > + rte_tel_data_start_dict(d); > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > + RXA_ADD_DICT(rx_adptr_stats, rx_packets); > + RXA_ADD_DICT(rx_adptr_stats, rx_poll_count); > + RXA_ADD_DICT(rx_adptr_stats, rx_dropped); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_retry); > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_count); > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_size); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_count); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_start_ts); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_block_cycles); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_end_ts); > + RXA_ADD_DICT(rx_adptr_stats, rx_intr_packets); > + > + return 0; > +} > + > +static int > +handle_rxa_stats_reset(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *d __rte_unused) > +{ > + uint8_t rx_adapter_id; > + > + if (params == NULL || strlen(params) == 0 || ~isdigit(*params)) > + return -1; > + > + /* Get Rx adapter ID from parameter string */ > + rx_adapter_id = atoi(params); > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); > + > + /* Reset Rx adapter stats */ > + if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { > + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); > + return -1; > + } > + > + return 0; > +} > + > +static int > +handle_rxa_get_queue_conf(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *d) > +{ > + uint8_t rx_adapter_id; > + uint16_t rx_queue_id; > + int eth_dev_id; > + char *token, *l_params; > + struct rte_event_eth_rx_adapter_queue_conf queue_conf; > + > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > + return -1; > + > + /* Get Rx adapter ID from parameter string */ > + l_params = strdup(params); > + token = strtok(l_params, ","); > + rx_adapter_id = strtoul(token, NULL, 10); > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, -EINVAL); > + > + token = strtok(NULL, ","); > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > + return -1; > + > + /* Get device ID from parameter string */ > + eth_dev_id = strtoul(token, NULL, 10); > + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, -EINVAL); > + > + token = strtok(NULL, ","); > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > + return -1; > + > + /* Get Rx queue ID from parameter string */ > + rx_queue_id = strtoul(token, NULL, 10); > + if (rx_queue_id >= rte_eth_devices[eth_dev_id].data->nb_rx_queues) { > + RTE_EDEV_LOG_ERR("Invalid rx queue_id %u", rx_queue_id); > + return -EINVAL; > + } > + > + token = strtok(NULL, "\0"); > + if (token != NULL) > + RTE_EDEV_LOG_ERR("Extra parameters passed to eventdev" > + " telemetry command, igrnoring"); > + > + if (rte_event_eth_rx_adapter_queue_conf_get(rx_adapter_id, eth_dev_id, > + rx_queue_id, &queue_conf)) { > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter queue config"); > + return -1; > + } > + > + rte_tel_data_start_dict(d); > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > + rte_tel_data_add_dict_u64(d, "eth_dev_id", eth_dev_id); > + rte_tel_data_add_dict_u64(d, "rx_queue_id", rx_queue_id); > + RXA_ADD_DICT(queue_conf, rx_queue_flags); > + RXA_ADD_DICT(queue_conf, servicing_weight); > + RXA_ADD_DICT(queue_conf.ev, queue_id); > + RXA_ADD_DICT(queue_conf.ev, sched_type); > + RXA_ADD_DICT(queue_conf.ev, priority); > + RXA_ADD_DICT(queue_conf.ev, flow_id); > + > + return 0; > +} > + > +RTE_INIT(rxa_init_telemetry) > +{ > + rte_telemetry_register_cmd("/eventdev/rxa_stats", > + handle_rxa_stats, > + "Returns Rx adapter stats. Parameter: rx_adapter_id"); > + > + rte_telemetry_register_cmd("/eventdev/rxa_stats_reset", > + handle_rxa_stats_reset, > + "Reset Rx adapter stats. Parameter: rx_adapter_id"); > + > + rte_telemetry_register_cmd("/eventdev/rxa_queue_conf", > + handle_rxa_get_queue_conf, > + "Returns Rx queue config. Parameter: rxa_id, DevID, que_id"); > +} > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h b/lib/eventdev/rte_event_eth_rx_adapter.h > index 70ca427..acabed4 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > @@ -216,6 +216,10 @@ struct rte_event_eth_rx_adapter_stats { > /**< Eventdev enqueue count */ > uint64_t rx_enq_retry; > /**< Eventdev enqueue retry count */ > + uint64_t rx_event_buf_count; > + /**< Rx event buffered count */ > + uint64_t rx_event_buf_size; Isn't ABI breakage? CI did not warn this. Isn't this a public structure? > + /**< Rx event buffer size */ > uint64_t rx_dropped; > /**< Received packet dropped count */ > uint64_t rx_enq_start_ts; > -- > 2.6.4 > ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [dpdk-dev] [PATCH v1] eventdev/rx-adapter: add telemetry callbacks 2021-10-11 16:14 ` [dpdk-dev] [PATCH v1] eventdev/rx-adapter: " Jerin Jacob @ 2021-10-12 8:35 ` Kundapura, Ganapati 2021-10-12 8:47 ` Jerin Jacob 0 siblings, 1 reply; 19+ messages in thread From: Kundapura, Ganapati @ 2021-10-12 8:35 UTC (permalink / raw) To: Jerin Jacob; +Cc: dpdk-dev, Jayatheerthan, Jay Hi Jerin, > -----Original Message----- > From: Jerin Jacob <jerinjacobk@gmail.com> > Sent: 11 October 2021 21:44 > To: Kundapura, Ganapati <ganapati.kundapura@intel.com> > Cc: dpdk-dev <dev@dpdk.org>; Jayatheerthan, Jay > <jay.jayatheerthan@intel.com> > Subject: Re: [PATCH v1] eventdev/rx-adapter: add telemetry callbacks > > On Thu, Oct 7, 2021 at 6:27 PM Ganapati Kundapura > <ganapati.kundapura@intel.com> wrote: > > > > Added telemetry callbacks to get Rx adapter stats, reset stats and to > > get rx queue config information. > > rx -> Rx > > Change the subject to eventdev/rx_adapter > > > > > Signed-off-by: Ganapati Kundapura <ganapati.kundapura@intel.com> > > > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c > > b/lib/eventdev/rte_event_eth_rx_adapter.c > > index 9ac976c..fa7191c 100644 > > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > > @@ -23,6 +23,7 @@ > > #include "eventdev_pmd.h" > > #include "rte_eventdev_trace.h" > > #include "rte_event_eth_rx_adapter.h" > > +#include <rte_telemetry.h> > > Move this to the above block where all <...h> header files are grouped. OK > > > > > > #define BATCH_SIZE 32 > > #define BLOCK_CNT_THRESHOLD 10 > > @@ -2852,6 +2853,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, > > struct rte_event_eth_rx_adapter_stats > > *stats) { > > struct rte_event_eth_rx_adapter *rx_adapter; > > + struct rte_eth_event_enqueue_buffer *buf; > > struct rte_event_eth_rx_adapter_stats dev_stats_sum = { 0 }; > > struct rte_event_eth_rx_adapter_stats dev_stats; > > struct rte_eventdev *dev; > > @@ -2887,8 +2889,11 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, > > if (rx_adapter->service_inited) > > *stats = rx_adapter->stats; > > > > + buf = &rx_adapter->event_enqueue_buffer; > > stats->rx_packets += dev_stats_sum.rx_packets; > > stats->rx_enq_count += dev_stats_sum.rx_enq_count; > > + stats->rx_event_buf_count = buf->count; > > + stats->rx_event_buf_size = buf->events_size; > > > > return 0; > > } > > @@ -3052,3 +3057,146 @@ > > rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, > > > > return 0; > > } > > + > > +#define RXA_ADD_DICT(stats, s) rte_tel_data_add_dict_u64(d, #s, > > +stats.s) > > + > > +static int > > +handle_rxa_stats(const char *cmd __rte_unused, > > + const char *params, > > + struct rte_tel_data *d) { > > + uint8_t rx_adapter_id; > > + struct rte_event_eth_rx_adapter_stats rx_adptr_stats; > > + > > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > > + return -1; > > + > > + /* Get Rx adapter ID from parameter string */ > > + rx_adapter_id = atoi(params); > > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, > > + -EINVAL); > > + > > + /* Get Rx adapter stats */ > > + if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, > > + &rx_adptr_stats)) { > > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); > > + return -1; > > + } > > + > > + rte_tel_data_start_dict(d); > > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > > + RXA_ADD_DICT(rx_adptr_stats, rx_packets); > > + RXA_ADD_DICT(rx_adptr_stats, rx_poll_count); > > + RXA_ADD_DICT(rx_adptr_stats, rx_dropped); > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_retry); > > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_count); > > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_size); > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_count); > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_start_ts); > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_block_cycles); > > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_end_ts); > > + RXA_ADD_DICT(rx_adptr_stats, rx_intr_packets); > > + > > + return 0; > > +} > > + > > +static int > > +handle_rxa_stats_reset(const char *cmd __rte_unused, > > + const char *params, > > + struct rte_tel_data *d __rte_unused) { > > + uint8_t rx_adapter_id; > > + > > + if (params == NULL || strlen(params) == 0 || ~isdigit(*params)) > > + return -1; > > + > > + /* Get Rx adapter ID from parameter string */ > > + rx_adapter_id = atoi(params); > > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, > > + -EINVAL); > > + > > + /* Reset Rx adapter stats */ > > + if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { > > + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); > > + return -1; > > + } > > + > > + return 0; > > +} > > + > > +static int > > +handle_rxa_get_queue_conf(const char *cmd __rte_unused, > > + const char *params, > > + struct rte_tel_data *d) { > > + uint8_t rx_adapter_id; > > + uint16_t rx_queue_id; > > + int eth_dev_id; > > + char *token, *l_params; > > + struct rte_event_eth_rx_adapter_queue_conf queue_conf; > > + > > + if (params == NULL || strlen(params) == 0 || !isdigit(*params)) > > + return -1; > > + > > + /* Get Rx adapter ID from parameter string */ > > + l_params = strdup(params); > > + token = strtok(l_params, ","); > > + rx_adapter_id = strtoul(token, NULL, 10); > > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, > > + -EINVAL); > > + > > + token = strtok(NULL, ","); > > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > > + return -1; > > + > > + /* Get device ID from parameter string */ > > + eth_dev_id = strtoul(token, NULL, 10); > > + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, -EINVAL); > > + > > + token = strtok(NULL, ","); > > + if (token == NULL || strlen(token) == 0 || !isdigit(*token)) > > + return -1; > > + > > + /* Get Rx queue ID from parameter string */ > > + rx_queue_id = strtoul(token, NULL, 10); > > + if (rx_queue_id >= rte_eth_devices[eth_dev_id].data->nb_rx_queues) { > > + RTE_EDEV_LOG_ERR("Invalid rx queue_id %u", rx_queue_id); > > + return -EINVAL; > > + } > > + > > + token = strtok(NULL, "\0"); > > + if (token != NULL) > > + RTE_EDEV_LOG_ERR("Extra parameters passed to eventdev" > > + " telemetry command, igrnoring"); > > + > > + if (rte_event_eth_rx_adapter_queue_conf_get(rx_adapter_id, > eth_dev_id, > > + rx_queue_id, &queue_conf)) { > > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter queue config"); > > + return -1; > > + } > > + > > + rte_tel_data_start_dict(d); > > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > > + rte_tel_data_add_dict_u64(d, "eth_dev_id", eth_dev_id); > > + rte_tel_data_add_dict_u64(d, "rx_queue_id", rx_queue_id); > > + RXA_ADD_DICT(queue_conf, rx_queue_flags); > > + RXA_ADD_DICT(queue_conf, servicing_weight); > > + RXA_ADD_DICT(queue_conf.ev, queue_id); > > + RXA_ADD_DICT(queue_conf.ev, sched_type); > > + RXA_ADD_DICT(queue_conf.ev, priority); > > + RXA_ADD_DICT(queue_conf.ev, flow_id); > > + > > + return 0; > > +} > > + > > +RTE_INIT(rxa_init_telemetry) > > +{ > > + rte_telemetry_register_cmd("/eventdev/rxa_stats", > > + handle_rxa_stats, > > + "Returns Rx adapter stats. Parameter: rx_adapter_id"); > > + > > + rte_telemetry_register_cmd("/eventdev/rxa_stats_reset", > > + handle_rxa_stats_reset, > > + "Reset Rx adapter stats. Parameter: rx_adapter_id"); > > + > > + rte_telemetry_register_cmd("/eventdev/rxa_queue_conf", > > + handle_rxa_get_queue_conf, > > + "Returns Rx queue config. Parameter: rxa_id, DevID, > > +que_id"); } > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h > > b/lib/eventdev/rte_event_eth_rx_adapter.h > > index 70ca427..acabed4 100644 > > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > > @@ -216,6 +216,10 @@ struct rte_event_eth_rx_adapter_stats { > > /**< Eventdev enqueue count */ > > uint64_t rx_enq_retry; > > /**< Eventdev enqueue retry count */ > > + uint64_t rx_event_buf_count; > > + /**< Rx event buffered count */ > > + uint64_t rx_event_buf_size; > > > Isn't ABI breakage? CI did not warn this. Isn't this a public structure? Please confirm if moving the above two members to end of the structure overcomes ABI breakage? > > > > > + /**< Rx event buffer size */ > > uint64_t rx_dropped; > > /**< Received packet dropped count */ > > uint64_t rx_enq_start_ts; > > -- > > 2.6.4 > > ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [dpdk-dev] [PATCH v1] eventdev/rx-adapter: add telemetry callbacks 2021-10-12 8:35 ` Kundapura, Ganapati @ 2021-10-12 8:47 ` Jerin Jacob 2021-10-12 9:10 ` Thomas Monjalon 0 siblings, 1 reply; 19+ messages in thread From: Jerin Jacob @ 2021-10-12 8:47 UTC (permalink / raw) To: Kundapura, Ganapati, Ray Kinsella, Thomas Monjalon, David Marchand Cc: dpdk-dev, Jayatheerthan, Jay On Tue, Oct 12, 2021 at 2:05 PM Kundapura, Ganapati <ganapati.kundapura@intel.com> wrote: > > Hi Jerin, > > > -----Original Message----- > > From: Jerin Jacob <jerinjacobk@gmail.com> > > Sent: 11 October 2021 21:44 > > To: Kundapura, Ganapati <ganapati.kundapura@intel.com> > > Cc: dpdk-dev <dev@dpdk.org>; Jayatheerthan, Jay > > > +que_id"); } > > > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h > > > b/lib/eventdev/rte_event_eth_rx_adapter.h > > > index 70ca427..acabed4 100644 > > > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > > > @@ -216,6 +216,10 @@ struct rte_event_eth_rx_adapter_stats { > > > /**< Eventdev enqueue count */ > > > uint64_t rx_enq_retry; > > > /**< Eventdev enqueue retry count */ > > > + uint64_t rx_event_buf_count; > > > + /**< Rx event buffered count */ > > > + uint64_t rx_event_buf_size; > > > > > > Isn't ABI breakage? CI did not warn this. Isn't this a public structure? > Please confirm if moving the above two members to end of the structure overcomes ABI breakage? + @Ray Kinsella @Thomas Monjalon @David Marchand It will still break the ABI. IMO, Since it is an ABI breaking release it is OK. If there are no other objections, Please move the variable to end of the structure and update release notes for ABI changes. > > > > > > > > > + /**< Rx event buffer size */ > > > uint64_t rx_dropped; > > > /**< Received packet dropped count */ > > > uint64_t rx_enq_start_ts; > > > -- > > > 2.6.4 > > > ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [dpdk-dev] [PATCH v1] eventdev/rx-adapter: add telemetry callbacks 2021-10-12 8:47 ` Jerin Jacob @ 2021-10-12 9:10 ` Thomas Monjalon 2021-10-12 9:26 ` Jerin Jacob 0 siblings, 1 reply; 19+ messages in thread From: Thomas Monjalon @ 2021-10-12 9:10 UTC (permalink / raw) To: Kundapura, Ganapati, Ray Kinsella, David Marchand, Jerin Jacob Cc: dpdk-dev, Jayatheerthan, Jay 12/10/2021 10:47, Jerin Jacob: > On Tue, Oct 12, 2021 at 2:05 PM Kundapura, Ganapati > <ganapati.kundapura@intel.com> wrote: > > From: Jerin Jacob <jerinjacobk@gmail.com> > > > > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > > > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > > > > @@ -216,6 +216,10 @@ struct rte_event_eth_rx_adapter_stats { > > > > /**< Eventdev enqueue count */ > > > > uint64_t rx_enq_retry; > > > > /**< Eventdev enqueue retry count */ > > > > + uint64_t rx_event_buf_count; > > > > + /**< Rx event buffered count */ > > > > + uint64_t rx_event_buf_size; > > > > > > > > > Isn't ABI breakage? CI did not warn this. Isn't this a public structure? > > Please confirm if moving the above two members to end of the structure overcomes ABI breakage? > > > + @Ray Kinsella @Thomas Monjalon @David Marchand > > It will still break the ABI. IMO, Since it is an ABI breaking release > it is OK. If there are no other objections, Please move the variable > to end > of the structure and update release notes for ABI changes. Why moving since it breaks ABI anyway? I think you can keep as is. ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [dpdk-dev] [PATCH v1] eventdev/rx-adapter: add telemetry callbacks 2021-10-12 9:10 ` Thomas Monjalon @ 2021-10-12 9:26 ` Jerin Jacob 2021-10-12 10:05 ` Kinsella, Ray 0 siblings, 1 reply; 19+ messages in thread From: Jerin Jacob @ 2021-10-12 9:26 UTC (permalink / raw) To: Thomas Monjalon Cc: Kundapura, Ganapati, Ray Kinsella, David Marchand, dpdk-dev, Jayatheerthan, Jay On Tue, Oct 12, 2021 at 2:40 PM Thomas Monjalon <thomas@monjalon.net> wrote: > > 12/10/2021 10:47, Jerin Jacob: > > On Tue, Oct 12, 2021 at 2:05 PM Kundapura, Ganapati > > <ganapati.kundapura@intel.com> wrote: > > > From: Jerin Jacob <jerinjacobk@gmail.com> > > > > > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > > > > > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > > > > > @@ -216,6 +216,10 @@ struct rte_event_eth_rx_adapter_stats { > > > > > /**< Eventdev enqueue count */ > > > > > uint64_t rx_enq_retry; > > > > > /**< Eventdev enqueue retry count */ > > > > > + uint64_t rx_event_buf_count; > > > > > + /**< Rx event buffered count */ > > > > > + uint64_t rx_event_buf_size; > > > > > > > > > > > > Isn't ABI breakage? CI did not warn this. Isn't this a public structure? > > > Please confirm if moving the above two members to end of the structure overcomes ABI breakage? > > > > > > + @Ray Kinsella @Thomas Monjalon @David Marchand > > > > It will still break the ABI. IMO, Since it is an ABI breaking release > > it is OK. If there are no other objections, Please move the variable > > to end > > of the structure and update release notes for ABI changes. > > Why moving since it breaks ABI anyway? There is no specific gain in keeping new additions in the middle of structure. > I think you can keep as is. > > > ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [dpdk-dev] [PATCH v1] eventdev/rx-adapter: add telemetry callbacks 2021-10-12 9:26 ` Jerin Jacob @ 2021-10-12 10:05 ` Kinsella, Ray 2021-10-12 10:29 ` Kundapura, Ganapati 0 siblings, 1 reply; 19+ messages in thread From: Kinsella, Ray @ 2021-10-12 10:05 UTC (permalink / raw) To: Jerin Jacob, Thomas Monjalon Cc: Kundapura, Ganapati, David Marchand, dpdk-dev, Jayatheerthan, Jay On 12/10/2021 10:26, Jerin Jacob wrote: > On Tue, Oct 12, 2021 at 2:40 PM Thomas Monjalon <thomas@monjalon.net> wrote: >> >> 12/10/2021 10:47, Jerin Jacob: >>> On Tue, Oct 12, 2021 at 2:05 PM Kundapura, Ganapati >>> <ganapati.kundapura@intel.com> wrote: >>>> From: Jerin Jacob <jerinjacobk@gmail.com> >>>>>> --- a/lib/eventdev/rte_event_eth_rx_adapter.h >>>>>> +++ b/lib/eventdev/rte_event_eth_rx_adapter.h >>>>>> @@ -216,6 +216,10 @@ struct rte_event_eth_rx_adapter_stats { >>>>>> /**< Eventdev enqueue count */ >>>>>> uint64_t rx_enq_retry; >>>>>> /**< Eventdev enqueue retry count */ >>>>>> + uint64_t rx_event_buf_count; >>>>>> + /**< Rx event buffered count */ >>>>>> + uint64_t rx_event_buf_size; >>>>> >>>>> >>>>> Isn't ABI breakage? CI did not warn this. Isn't this a public structure? >>>> Please confirm if moving the above two members to end of the structure overcomes ABI breakage? >>> >>> >>> + @Ray Kinsella @Thomas Monjalon @David Marchand >>> >>> It will still break the ABI. IMO, Since it is an ABI breaking release >>> it is OK. If there are no other objections, Please move the variable >>> to end >>> of the structure and update release notes for ABI changes. >> >> Why moving since it breaks ABI anyway? > > There is no specific gain in keeping new additions in the middle of structure. 21.11 is an ABI breaking release, so move it where you like :-) >> I think you can keep as is. >> >> >> ^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [dpdk-dev] [PATCH v1] eventdev/rx-adapter: add telemetry callbacks 2021-10-12 10:05 ` Kinsella, Ray @ 2021-10-12 10:29 ` Kundapura, Ganapati 0 siblings, 0 replies; 19+ messages in thread From: Kundapura, Ganapati @ 2021-10-12 10:29 UTC (permalink / raw) To: Kinsella, Ray, Jerin Jacob, Thomas Monjalon Cc: David Marchand, dpdk-dev, Jayatheerthan, Jay Hi, > -----Original Message----- > From: Kinsella, Ray <mdr@ashroe.eu> > Sent: 12 October 2021 15:35 > To: Jerin Jacob <jerinjacobk@gmail.com>; Thomas Monjalon > <thomas@monjalon.net> > Cc: Kundapura, Ganapati <ganapati.kundapura@intel.com>; David Marchand > <david.marchand@redhat.com>; dpdk-dev <dev@dpdk.org>; Jayatheerthan, Jay > <jay.jayatheerthan@intel.com> > Subject: Re: [PATCH v1] eventdev/rx-adapter: add telemetry callbacks > > > > On 12/10/2021 10:26, Jerin Jacob wrote: > > On Tue, Oct 12, 2021 at 2:40 PM Thomas Monjalon <thomas@monjalon.net> > wrote: > >> > >> 12/10/2021 10:47, Jerin Jacob: > >>> On Tue, Oct 12, 2021 at 2:05 PM Kundapura, Ganapati > >>> <ganapati.kundapura@intel.com> wrote: > >>>> From: Jerin Jacob <jerinjacobk@gmail.com> > >>>>>> --- a/lib/eventdev/rte_event_eth_rx_adapter.h > >>>>>> +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > >>>>>> @@ -216,6 +216,10 @@ struct rte_event_eth_rx_adapter_stats { > >>>>>> /**< Eventdev enqueue count */ > >>>>>> uint64_t rx_enq_retry; > >>>>>> /**< Eventdev enqueue retry count */ > >>>>>> + uint64_t rx_event_buf_count; > >>>>>> + /**< Rx event buffered count */ > >>>>>> + uint64_t rx_event_buf_size; > >>>>> > >>>>> > >>>>> Isn't ABI breakage? CI did not warn this. Isn't this a public structure? > >>>> Please confirm if moving the above two members to end of the structure > overcomes ABI breakage? > >>> > >>> > >>> + @Ray Kinsella @Thomas Monjalon @David Marchand > >>> > >>> It will still break the ABI. IMO, Since it is an ABI breaking > >>> release it is OK. If there are no other objections, Please move the > >>> variable to end of the structure and update release notes for ABI > >>> changes. > >> > >> Why moving since it breaks ABI anyway? > > > > There is no specific gain in keeping new additions in the middle of structure. > > 21.11 is an ABI breaking release, so move it where you like :-) Posted new patch with the new struct members moved to the end of the struct, updated release notes and review comments addressed. > > >> I think you can keep as is. > >> > >> > >> ^ permalink raw reply [flat|nested] 19+ messages in thread
end of thread, other threads:[~2021-10-14 8:26 UTC | newest] Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-10-07 12:57 [dpdk-dev] [PATCH v1] eventdev/rx-adapter: add telemetry callbacks Ganapati Kundapura 2021-10-07 13:46 ` [dpdk-dev] [PATCH v2] " Ganapati Kundapura 2021-10-07 16:02 ` [dpdk-dev] [EXT] " Gowrishankar Muthukrishnan 2021-10-12 10:25 ` [dpdk-dev] [PATCH v3] eventdev/rx_adapter: " Ganapati Kundapura 2021-10-12 13:09 ` Jayatheerthan, Jay 2021-10-12 14:05 ` Naga Harish K, S V 2021-10-12 16:13 ` Kundapura, Ganapati 2021-10-13 6:48 ` Naga Harish K, S V 2021-10-13 8:15 ` Kundapura, Ganapati 2021-10-13 7:57 ` [dpdk-dev] [PATCH v4] " Ganapati Kundapura 2021-10-13 12:09 ` Naga Harish K, S V 2021-10-14 8:25 ` Jerin Jacob 2021-10-11 16:14 ` [dpdk-dev] [PATCH v1] eventdev/rx-adapter: " Jerin Jacob 2021-10-12 8:35 ` Kundapura, Ganapati 2021-10-12 8:47 ` Jerin Jacob 2021-10-12 9:10 ` Thomas Monjalon 2021-10-12 9:26 ` Jerin Jacob 2021-10-12 10:05 ` Kinsella, Ray 2021-10-12 10:29 ` Kundapura, Ganapati
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).