X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_telemetry%2Frte_telemetry_internal.h;h=3f8dbc2db536140a62127b08071028e557d58772;hb=657cd1370dccf15d8d61e49b7e751ccc7ae6a29b;hp=e3292cf4006dcc63b50962a0be54b87ab0086d8e;hpb=ee5ff0d3297e9bf284dd2c0de62b0e3024ae20b0;p=dpdk.git diff --git a/lib/librte_telemetry/rte_telemetry_internal.h b/lib/librte_telemetry/rte_telemetry_internal.h index e3292cf400..3f8dbc2db5 100644 --- a/lib/librte_telemetry/rte_telemetry_internal.h +++ b/lib/librte_telemetry/rte_telemetry_internal.h @@ -24,6 +24,8 @@ extern int telemetry_log_level; #define TELEMETRY_LOG_INFO(fmt, args...) \ TELEMETRY_LOG(INFO, fmt, ## args) +#define MAX_METRICS 256 + typedef struct telemetry_client { char *file_path; int fd; @@ -36,13 +38,40 @@ typedef struct telemetry_impl { pthread_t thread_id; int thread_status; uint32_t socket_id; - int reg_index; + int reg_index[RTE_MAX_ETHPORTS]; int metrics_register_done; TAILQ_HEAD(, telemetry_client) client_list_head; struct telemetry_client *request_client; int register_fail_count; } telemetry_impl; +enum rte_telemetry_parser_actions { + ACTION_GET = 0, + ACTION_DELETE = 2 +}; + +enum rte_telemetry_stats_type { + PORT_STATS = 0, + GLOBAL_STATS = 1 +}; + +/* @internal */ +struct telemetry_encode_param { + enum rte_telemetry_stats_type type; + union { + struct port_param { + int num_metric_ids; + uint32_t metric_ids[MAX_METRICS]; + int num_port_ids; + uint32_t port_ids[RTE_MAX_ETHPORTS]; + } pp; + struct global_param { + int num_metric_ids; + uint32_t metric_ids[MAX_METRICS]; + } gp; + }; +}; + int32_t rte_telemetry_parse_client_message(struct telemetry_impl *telemetry, char *buf); @@ -58,4 +87,26 @@ int32_t rte_telemetry_unregister_client(struct telemetry_impl *telemetry, const char *client_path); +/** + * This is a wrapper for the ethdev api rte_eth_find_next(). + * If rte_eth_find_next() returns the same port id that we passed it, + * then we know that that port is active. + */ +int32_t +rte_telemetry_is_port_active(int port_id); + +int32_t +rte_telemetry_send_ports_stats_values(struct telemetry_encode_param *ep, + struct telemetry_impl *telemetry); + +int32_t +rte_telemetry_socket_messaging_testing(int index, int socket); + +int32_t +rte_telemetry_send_global_stats_values(struct telemetry_encode_param *ep, + struct telemetry_impl *telemetry); + +int32_t +rte_telemetry_parser_test(struct telemetry_impl *telemetry); + #endif