From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 686D9A054F; Tue, 2 Mar 2021 16:28:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2996622A293; Tue, 2 Mar 2021 16:28:34 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by mails.dpdk.org (Postfix) with ESMTP id AC9B322A278 for ; Tue, 2 Mar 2021 16:28:30 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from talshn@nvidia.com) with SMTP; 2 Mar 2021 17:28:21 +0200 Received: from nvidia.com (l-wincomp04-vm.mtl.labs.mlnx [10.237.1.5]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 122FSL2W024047; Tue, 2 Mar 2021 17:28:21 +0200 From: Tal Shnaiderman To: dev@dpdk.org Cc: thomas@monjalon.net, pallavi.kadam@intel.com, dmitry.kozliuk@gmail.com, navasile@linux.microsoft.com, dmitrym@microsoft.com, david.marchand@redhat.com, anatoly.burakov@intel.com, vladimir.medvedkin@intel.com, mb@smartsharesystems.com Date: Tue, 2 Mar 2021 17:26:58 +0200 Message-Id: <20210302152658.9136-3-talshn@nvidia.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20210302152658.9136-1-talshn@nvidia.com> References: <20210302152658.9136-1-talshn@nvidia.com> Subject: [dpdk-dev] [PATCH v2 2/2] eal: rename key opaque pointer in TLS API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" rename the key opaque pointer from rte_tls_key to rte_thread_key to avoid confusion with transport layer security. Suggested-by: Vladimir Medvedkin Signed-off-by: Tal Shnaiderman --- drivers/net/mlx5/linux/mlx5_flow_os.c | 2 +- drivers/net/mlx5/windows/mlx5_flow_os.c | 2 +- lib/librte_eal/include/rte_thread.h | 13 +++++++------ lib/librte_eal/unix/rte_thread.c | 8 ++++---- lib/librte_eal/windows/rte_thread.c | 8 ++++---- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/net/mlx5/linux/mlx5_flow_os.c b/drivers/net/mlx5/linux/mlx5_flow_os.c index 732b1b2dd8..80b25ca25a 100644 --- a/drivers/net/mlx5/linux/mlx5_flow_os.c +++ b/drivers/net/mlx5/linux/mlx5_flow_os.c @@ -7,7 +7,7 @@ #include /* Key of thread specific flow workspace data. */ -static rte_tls_key key_workspace; +static rte_thread_key key_workspace; int mlx5_flow_os_init_workspace_once(void) diff --git a/drivers/net/mlx5/windows/mlx5_flow_os.c b/drivers/net/mlx5/windows/mlx5_flow_os.c index 2cc02df322..8f4dd99fac 100644 --- a/drivers/net/mlx5/windows/mlx5_flow_os.c +++ b/drivers/net/mlx5/windows/mlx5_flow_os.c @@ -252,7 +252,7 @@ struct mlx5_workspace_thread { */ static struct mlx5_workspace_thread *curr; static struct mlx5_workspace_thread *first; -rte_tls_key ws_tls_index; +rte_thread_key ws_tls_index; static pthread_mutex_t lock_thread_list; static bool diff --git a/lib/librte_eal/include/rte_thread.h b/lib/librte_eal/include/rte_thread.h index 39737d1829..e44be3d252 100644 --- a/lib/librte_eal/include/rte_thread.h +++ b/lib/librte_eal/include/rte_thread.h @@ -23,7 +23,7 @@ extern "C" { /** * TLS key type, an opaque pointer. */ -typedef struct eal_tls_key *rte_tls_key; +typedef struct eal_tls_key *rte_thread_key; /** * Set core affinity of the current thread. @@ -63,7 +63,8 @@ void rte_thread_get_affinity(rte_cpuset_t *cpusetp); */ __rte_experimental -int rte_thread_tls_key_create(rte_tls_key *key, void (*destructor)(void *)); +int rte_thread_tls_key_create(rte_thread_key *key, + void (*destructor)(void *)); /** * Delete a TLS data key visible to all threads in the process. @@ -76,7 +77,7 @@ int rte_thread_tls_key_create(rte_tls_key *key, void (*destructor)(void *)); * On failure, a negative number and an error number is set in rte_errno. */ __rte_experimental -int rte_thread_tls_key_delete(rte_tls_key key); +int rte_thread_tls_key_delete(rte_thread_key key); /** * Set value bound to the TLS key on behalf of the calling thread. @@ -84,14 +85,14 @@ int rte_thread_tls_key_delete(rte_tls_key key); * @param key * The key allocated by rte_thread_tls_key_create(). * @param value - * The value bound to the rte_tls_key key for the calling thread. + * The value bound to the rte_thread_key key for the calling thread. * * @return * On success, zero. * On failure, a negative number and an error number is set in rte_errno. */ __rte_experimental -int rte_thread_tls_value_set(rte_tls_key key, const void *value); +int rte_thread_tls_value_set(rte_thread_key key, const void *value); /** * Get value bound to the TLS key on behalf of the calling thread. @@ -104,7 +105,7 @@ int rte_thread_tls_value_set(rte_tls_key key, const void *value); * On failure, NULL and an error number is set in rte_errno. */ __rte_experimental -void *rte_thread_tls_value_get(rte_tls_key key); +void *rte_thread_tls_value_get(rte_thread_key key); #ifdef __cplusplus } diff --git a/lib/librte_eal/unix/rte_thread.c b/lib/librte_eal/unix/rte_thread.c index 86e42bf653..923b069f77 100644 --- a/lib/librte_eal/unix/rte_thread.c +++ b/lib/librte_eal/unix/rte_thread.c @@ -17,7 +17,7 @@ struct eal_tls_key { }; int -rte_thread_tls_key_create(rte_tls_key *key, void (*destructor)(void *)) +rte_thread_tls_key_create(rte_thread_key *key, void (*destructor)(void *)) { int err; @@ -39,7 +39,7 @@ rte_thread_tls_key_create(rte_tls_key *key, void (*destructor)(void *)) } int -rte_thread_tls_key_delete(rte_tls_key key) +rte_thread_tls_key_delete(rte_thread_key key) { int err; @@ -61,7 +61,7 @@ rte_thread_tls_key_delete(rte_tls_key key) } int -rte_thread_tls_value_set(rte_tls_key key, const void *value) +rte_thread_tls_value_set(rte_thread_key key, const void *value) { int err; @@ -81,7 +81,7 @@ rte_thread_tls_value_set(rte_tls_key key, const void *value) } void * -rte_thread_tls_value_get(rte_tls_key key) +rte_thread_tls_value_get(rte_thread_key key) { if (!key) { RTE_LOG(DEBUG, EAL, "Invalid TLS key.\n"); diff --git a/lib/librte_eal/windows/rte_thread.c b/lib/librte_eal/windows/rte_thread.c index 1c226b3e30..1e56ef6090 100644 --- a/lib/librte_eal/windows/rte_thread.c +++ b/lib/librte_eal/windows/rte_thread.c @@ -12,7 +12,7 @@ struct eal_tls_key { }; int -rte_thread_tls_key_create(rte_tls_key *key, +rte_thread_tls_key_create(rte_thread_key *key, __rte_unused void (*destructor)(void *)) { *key = malloc(sizeof(**key)); @@ -32,7 +32,7 @@ rte_thread_tls_key_create(rte_tls_key *key, } int -rte_thread_tls_key_delete(rte_tls_key key) +rte_thread_tls_key_delete(rte_thread_key key) { if (!key) { RTE_LOG(DEBUG, EAL, "Invalid TLS key.\n"); @@ -50,7 +50,7 @@ rte_thread_tls_key_delete(rte_tls_key key) } int -rte_thread_tls_value_set(rte_tls_key key, const void *value) +rte_thread_tls_value_set(rte_thread_key key, const void *value) { char *p; @@ -70,7 +70,7 @@ rte_thread_tls_value_set(rte_tls_key key, const void *value) } void * -rte_thread_tls_value_get(rte_tls_key key) +rte_thread_tls_value_get(rte_thread_key key) { void *output; -- 2.16.1.windows.4