[dpdk-dev] [PATCH 2/2] eal: rename key opaque pointer in TLS API
Morten Brørup
mb at smartsharesystems.com
Tue Mar 2 13:41:48 CET 2021
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Tal Shnaiderman
> Sent: Tuesday, March 2, 2021 12:25 PM
>
> rename the key opaque pointer from rte_tls_key to
> rte_thread_tls_key to avoid confusion with transport layer security.
>
[...]
> diff --git a/lib/librte_eal/include/rte_thread.h
> b/lib/librte_eal/include/rte_thread.h
> index 39737d1829..90bcb02554 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_tls_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_tls_key *key,
> + void (*destructor)(void *));
>
I agree with your argument for TLS confusion.
How about rte_thread_key, instead of rte_thread_tls_key. Having both thread and tls seems redundant.
Here are some more thoughts... It is meant as a provocation only, not a real suggestion:
The DPDK API often uses the term "lcore" as the abstraction for threads, e.g. rte_per_lcore.h refers to thread local storage using "per_lcore", while it is in fact "per thread". Why use another terminology in the API for thread keys, instead of sticking with the "lcore" naming tradition, e.g. struct rte_lcore_key?
Med venlig hilsen / kind regards
- Morten Brørup
More information about the dev
mailing list