From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <users-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 5FE86A0C41
	for <public@inbox.dpdk.org>; Thu, 18 Nov 2021 17:26:43 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id DF6FB40687;
	Thu, 18 Nov 2021 17:26:42 +0100 (CET)
Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com
 [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id 91BCE40395
 for <users@dpdk.org>; Thu, 18 Nov 2021 17:26:41 +0100 (CET)
Received: by mail-pj1-f49.google.com with SMTP id x7so5588482pjn.0
 for <users@dpdk.org>; Thu, 18 Nov 2021 08:26:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20210112.gappssmtp.com; s=20210112;
 h=date:from:to:cc:subject:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=j7CdFSwBLbky3UT2lnCtakrjdRIp1HU1aduFlzGlcQg=;
 b=XCWMA0Gh3gMH5+//gOXWzc3BdxKcrtUGPIgODvefgLzcf+iadH88n4PVSNw6zfsbk2
 cOyhPW/CmFUfR4U/Lvwagv4DdPNcVi9l4sbuUB3f56OEThrvuiK6RDbyUu/5JPe1BHai
 VCprQF4NDjJewaob/qPFKuTeeIoykvh7xUKJs8YoKUmQsRWjUQzbiGVWF0Y41XU02Lh1
 FXRlSJjMoTOJouPKRgHTPyicFyIbzoNaOKwIYAsz+ZD6mAHy6mMLoPWE5z36UnaLmPoj
 Lvz+hjIGcupyh4xTnB/PeVieh3kgROYiy5Fh2YgD9xFFbgCTgsXZdJBg1FdBiFwHwWTM
 WE+g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=j7CdFSwBLbky3UT2lnCtakrjdRIp1HU1aduFlzGlcQg=;
 b=RsFJLqIzoqu9RUFcFDLkpLeBYwW0qd47XFlCSxOwUUf10hRUPU8a0pTwlIv9X43pmq
 VjZ6/k/DDE54upcoeAmk4jJvSoQsOCM+3RV2mzpNo6KIH0PbyKj5gMcKekBrFe1nKLyS
 ZO+Yz8db2fsagLB4aV50x0LOmTwUhuA1wt2p+vVHJcq88gebMNhx+49+biul2pGQ4g1P
 Wep7Wordrhrs4i34+hqaiPu9PgqIZUiI7aw/QCrgtV3pbWFjOFSEpqeaMMXwrJSYcKic
 0ldcVhwCxHX9Qon6gP660htaiKUZZHPqudZfigSMMfE0U/bvXDr4/PKkKLptEwq4obvM
 kU3A==
X-Gm-Message-State: AOAM5313lZdnVgTebERBS8fSNDG9CDmIZCWw8YYIx0Wyifywug6Gc6Lt
 h0K8eZXsq3iUsnReRJSmb4qHxQ==
X-Google-Smtp-Source: ABdhPJwpz1yWTSxCmexdD9Tak2OBWUOOjA7za2UvodUT4pHmZqPeeg51DegxxkLD8SiGczBGORrdew==
X-Received: by 2002:a17:90b:1b0a:: with SMTP id
 nu10mr11786886pjb.35.1637252800753; 
 Thu, 18 Nov 2021 08:26:40 -0800 (PST)
Received: from hermes.local (204-195-33-123.wavecable.com. [204.195.33.123])
 by smtp.gmail.com with ESMTPSA id x17sm97263pfa.209.2021.11.18.08.26.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 18 Nov 2021 08:26:40 -0800 (PST)
Date: Thu, 18 Nov 2021 08:26:37 -0800
From: Stephen Hemminger <stephen@networkplumber.org>
To: Antonio Di Bacco <antonio.di-bacco@keysight.com>
Cc: "users@dpdk.org" <users@dpdk.org>
Subject: Re: Accessing TLS for EAL threads
Message-ID: <20211118082637.24ca9876@hermes.local>
In-Reply-To: <DM6PR17MB3546109A8DE0870AF76DBE43BD999@DM6PR17MB3546.namprd17.prod.outlook.com>
References: <DM6PR17MB3546109A8DE0870AF76DBE43BD999@DM6PR17MB3546.namprd17.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-BeenThere: users@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK usage discussions <users.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/users>,
 <mailto:users-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/users/>
List-Post: <mailto:users@dpdk.org>
List-Help: <mailto:users-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/users>,
 <mailto:users-request@dpdk.org?subject=subscribe>
Errors-To: users-bounces@dpdk.org

On Tue, 16 Nov 2021 17:38:43 +0000
Antonio Di Bacco <antonio.di-bacco@keysight.com> wrote:

> I need to emulate the pthread_setspecific and pthread_getspecific for EAL threads. I don't find any suitable APIs in the DPDK to access the TLS and get and set keys.
> 
> I launched a number of threads using the rte_eal_remote launch but I don't find any API that allows me to access the TLS for those threads.

There is not an API for a thread to access another threads local storage directly.
The DPDK TLS is wrapper around the glibc (and Windows) implementation of TLS.

For particular data structures, you can create a global data structure that is an
array of pointers indexed by lcore, and each lcore fills in itself.

Or do a more complex API via message passing.