telemetry: make socket handler typedef private
PATCH 1/1 telemetry: make socket handler typedef private
The socket handler typedef, just called "handler" does not belong in the public namespace, especially since it is unprefixed. Rename to "telemetry_sock_handler" and move to internal header.
Doing so also clears shadowing warnings in dmadev library, when it is built with -Wshadow.
---
NOTE: This patch was originally submitted as part of series[1], but I think this is a serious enough fix to consider taking into 25.11.
[1] https://patches.dpdk.org/project/dpdk/list/?series=36607&state=*
--- lib/telemetry/rte_telemetry.h | 11 ----------- lib/telemetry/telemetry.c | 2 +- lib/telemetry/telemetry_internal.h | 11 +++++++++++ 3 files changed, 12 insertions(+), 12 deletions(-)
lib/telemetry/rte_telemetry.h +0 -11
@@ -325,17 +325,6 @@ typedef int (*telemetry_cb)(const char *cmd, const char *params,typedef int (*telemetry_arg_cb )(const char *cmd,const char *params,void *arg,struct rte_tel_data *info); -/** -* Used for handling data received over a telemetry socket. -* -* @param sock_id -* ID for the socket to be used by the handler. -* -* @return -* Void. -*/ -typedef void * (*handler )(void *sock_id); -/** * Used when registering a command and callback function with telemetry. *
lib/telemetry/telemetry.c +1 -1
@@ -47,7 +47,7 @@ struct cmd_callback {struct socket {int sock;char path[sizeof (((struct sockaddr_un *)0 )->sun_path)]; -handler fn; +telemetry_sock_handler fn;RTE_ATOMIC (uint16_t ) *num_clients; };static struct socket v2_socket;/* socket for v2 telemetry */
lib/telemetry/telemetry_internal.h +11 -0
@@ -25,6 +25,17 @@ enum rte_telemetry_legacy_data_req { DATA_REQ }; +/** +* Used for handling data received over a telemetry socket. +* +* @param sock_id +* ID for the socket to be used by the handler. +* +* @return +* Void. +*/ +typedef void * (*telemetry_sock_handler )(void *sock_id); +/** * This telemetry callback is used when registering a legacy telemetry command. * It handles getting and formatting stats to be returned to telemetry when
Signature · 1 line
2.48.1
Thomas Monjalon
Applied07/11/2025 10:32, Bruce Richardson:
Quoted 10 lines
The socket handler typedef, just called "handler" does not belong in the public namespace, especially since it is unprefixed. Rename to "
telemetry_sock_handler" and move to internal header.Doing so also clears shadowing warnings in dmadev library, when it is built with -Wshadow.
Fixes 6dd571fd07c3 ("telemetry: introduce new functionality")
Quoted 6 lines
Signed-off-by Bruce Richardson <[email protected]>Acked-by Chengwen Feng <[email protected]>---
NOTE: This patch was originally submitted as part of series[1], but I think this is a serious enough fix to consider taking into 25.11.
Applied, thanks.