From: Bruce Richardson Date: Thu, 25 Mar 2021 13:57:06 +0000 (+0000) Subject: telemetry: rename internal-only header file X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=d700251c7a855aa360268d6d2f9f868c2734d994;p=dpdk.git telemetry: rename internal-only header file The header file containing the legacy telemetry function prototypes was all internal-only, so we rename the file to be an internal-only one to make it clearer it's not for installation. Signed-off-by: Bruce Richardson Acked-by: Ciara Power --- diff --git a/lib/librte_metrics/rte_metrics_telemetry.c b/lib/librte_metrics/rte_metrics_telemetry.c index 795bd29fe3..c24990d923 100644 --- a/lib/librte_metrics/rte_metrics_telemetry.c +++ b/lib/librte_metrics/rte_metrics_telemetry.c @@ -5,7 +5,7 @@ #include #include #ifdef RTE_LIB_TELEMETRY -#include +#include #endif #include "rte_metrics.h" diff --git a/lib/librte_telemetry/rte_telemetry_legacy.h b/lib/librte_telemetry/rte_telemetry_legacy.h deleted file mode 100644 index fb44740186..0000000000 --- a/lib/librte_telemetry/rte_telemetry_legacy.h +++ /dev/null @@ -1,87 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2020 Intel Corporation - */ - -#ifndef _RTE_TELEMETRY_LEGACY_H_ -#define _RTE_TELEMETRY_LEGACY_H_ - -#include -#include "rte_telemetry.h" - -/** - * @internal - * @warning - * @b EXPERIMENTAL: this API may change without prior notice - - * @file - * RTE Telemetry Legacy - * - ***/ - -/** - * @internal - * Value representing if data is required for the command - */ -enum rte_telemetry_legacy_data_req { - DATA_NOT_REQ = 0, - DATA_REQ -}; - -/** - * This telemetry callback is used when registering a legacy telemetry command. - * It handles getting and formatting stats to be returned to telemetry when - * requested. Stats up to buf_len in length are put in the buffer. - * - * @param cmd - * The cmd that was requested by the client. - * @param params - * Contains data required by the callback function. - * @param buffer - * A buffer to hold the formatted response. - * @param buf_len - * Length of the buffer. - * - * @return - * Length of buffer used on success. - * @return - * Negative integer on error. - */ -typedef int (*telemetry_legacy_cb)(const char *cmd, const char *params, - char *buffer, int buf_len); - -/** - * @internal - * Counter for the number of registered legacy callbacks - */ -extern int num_legacy_callbacks; - -/** - * @internal - * Used for handling data received over the legacy telemetry socket. - * - * @return - * Void. - */ -void * -legacy_client_handler(void *sock_id); - -/** - * @internal - * - * Used when registering a command and callback function with - * telemetry legacy support. - * - * @return - * 0 on success. - * @return - * -EINVAL for invalid parameters failure. - * @return - * -ENOENT if max callbacks limit has been reached. - */ -__rte_internal -int -rte_telemetry_legacy_register(const char *cmd, - enum rte_telemetry_legacy_data_req data_req, - telemetry_legacy_cb fn); - -#endif diff --git a/lib/librte_telemetry/telemetry.c b/lib/librte_telemetry/telemetry.c index 042136b820..7e08afd221 100644 --- a/lib/librte_telemetry/telemetry.c +++ b/lib/librte_telemetry/telemetry.c @@ -20,7 +20,7 @@ #include "rte_telemetry.h" #include "telemetry_json.h" #include "telemetry_data.h" -#include "rte_telemetry_legacy.h" +#include "telemetry_internal.h" #define MAX_CMD_LEN 56 #define MAX_HELP_LEN 64 diff --git a/lib/librte_telemetry/telemetry_internal.h b/lib/librte_telemetry/telemetry_internal.h new file mode 100644 index 0000000000..ad076b9119 --- /dev/null +++ b/lib/librte_telemetry/telemetry_internal.h @@ -0,0 +1,87 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2020 Intel Corporation + */ + +#ifndef _RTE_TELEMETRY_INTERNAL_H_ +#define _RTE_TELEMETRY_INTERNAL_H_ + +#include +#include "rte_telemetry.h" + +/** + * @internal + * @warning + * @b EXPERIMENTAL: this API may change without prior notice + + * @file + * RTE Telemetry Legacy and internal definitions + * + ***/ + +/** + * @internal + * Value representing if data is required for the command + */ +enum rte_telemetry_legacy_data_req { + DATA_NOT_REQ = 0, + DATA_REQ +}; + +/** + * This telemetry callback is used when registering a legacy telemetry command. + * It handles getting and formatting stats to be returned to telemetry when + * requested. Stats up to buf_len in length are put in the buffer. + * + * @param cmd + * The cmd that was requested by the client. + * @param params + * Contains data required by the callback function. + * @param buffer + * A buffer to hold the formatted response. + * @param buf_len + * Length of the buffer. + * + * @return + * Length of buffer used on success. + * @return + * Negative integer on error. + */ +typedef int (*telemetry_legacy_cb)(const char *cmd, const char *params, + char *buffer, int buf_len); + +/** + * @internal + * Counter for the number of registered legacy callbacks + */ +extern int num_legacy_callbacks; + +/** + * @internal + * Used for handling data received over the legacy telemetry socket. + * + * @return + * Void. + */ +void * +legacy_client_handler(void *sock_id); + +/** + * @internal + * + * Used when registering a command and callback function with + * telemetry legacy support. + * + * @return + * 0 on success. + * @return + * -EINVAL for invalid parameters failure. + * @return + * -ENOENT if max callbacks limit has been reached. + */ +__rte_internal +int +rte_telemetry_legacy_register(const char *cmd, + enum rte_telemetry_legacy_data_req data_req, + telemetry_legacy_cb fn); + +#endif diff --git a/lib/librte_telemetry/telemetry_legacy.c b/lib/librte_telemetry/telemetry_legacy.c index edd76ca359..5e9af37db1 100644 --- a/lib/librte_telemetry/telemetry_legacy.c +++ b/lib/librte_telemetry/telemetry_legacy.c @@ -15,7 +15,7 @@ #include #include -#include "rte_telemetry_legacy.h" +#include "telemetry_internal.h" #define MAX_LEN 128 #define BUF_SIZE 1024