1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Intel Corporation
8 #ifndef _RTE_TELEMETRY_INTERNAL_H_
9 #define _RTE_TELEMETRY_INTERNAL_H_
12 extern int telemetry_log_level;
14 #define TELEMETRY_LOG(level, fmt, args...) \
15 rte_log(RTE_LOG_ ##level, telemetry_log_level, "%s(): "fmt "\n", \
18 #define TELEMETRY_LOG_ERR(fmt, args...) \
19 TELEMETRY_LOG(ERR, fmt, ## args)
21 #define TELEMETRY_LOG_WARN(fmt, args...) \
22 TELEMETRY_LOG(WARNING, fmt, ## args)
24 #define TELEMETRY_LOG_INFO(fmt, args...) \
25 TELEMETRY_LOG(INFO, fmt, ## args)
27 typedef struct telemetry_client {
30 TAILQ_ENTRY(telemetry_client) client_list;
33 typedef struct telemetry_impl {
39 int reg_index[RTE_MAX_ETHPORTS];
40 int metrics_register_done;
41 TAILQ_HEAD(, telemetry_client) client_list_head;
42 struct telemetry_client *request_client;
43 int register_fail_count;
46 enum rte_telemetry_parser_actions {
52 rte_telemetry_parse_client_message(struct telemetry_impl *telemetry, char *buf);
55 rte_telemetry_send_error_response(struct telemetry_impl *telemetry,
59 rte_telemetry_register_client(struct telemetry_impl *telemetry,
60 const char *client_path);
63 rte_telemetry_unregister_client(struct telemetry_impl *telemetry,
64 const char *client_path);
67 * This is a wrapper for the ethdev api rte_eth_find_next().
68 * If rte_eth_find_next() returns the same port id that we passed it,
69 * then we know that that port is active.
72 rte_telemetry_is_port_active(int port_id);
75 rte_telemetry_send_ports_stats_values(uint32_t *metric_ids, int num_metric_ids,
76 uint32_t *port_ids, int num_port_ids, struct telemetry_impl *telemetry);
79 rte_telemetry_socket_messaging_testing(int index, int socket);