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 51298A0C41 for ; Thu, 18 Nov 2021 08:36:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D095541143; Thu, 18 Nov 2021 08:36:15 +0100 (CET) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mails.dpdk.org (Postfix) with ESMTP id 7088440696 for ; Thu, 18 Nov 2021 08:36:14 +0100 (CET) Received: by mail-wm1-f42.google.com with SMTP id y196so4394358wmc.3 for ; Wed, 17 Nov 2021 23:36:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=L1bdJ2hvwP78xlgMxsHMdtYqQFuMWxQdozFR04ce2Q0=; b=l8l9T+pApRuJsfg8FzOFTz0BV5Z5hXUjnb+GxoNjYvPysTLAURvsyN2yI6+czHCw1N 0aJGkezFYV2RcGyyruKhtXaun+JvlzJIL180F6tmcZr7Kaae7ct89UkbnZkQHeObwNcd xx2EprzI+WCyPiB2L++HWWTG/M051BZktjiY3708cF1pE10uZVM83LkoDRXBIrODF+1h SQGfFvu6m0AzQZofFpYv6d/rVzV74Zq1XuW3+YyTVf3tPmARO1ZkxTJlk86KDpVFNidc Tw2CjSRYcQWgG5jBBDMbsjkB1hpoCGhYe2IjaM/ISUg9xtVQwVfCKQV4JquwSROFByR0 9EgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=L1bdJ2hvwP78xlgMxsHMdtYqQFuMWxQdozFR04ce2Q0=; b=FpOKGsK2jp8Lb+S3w3/n7oZys255ftILkvAcNmD7y1iJqMO1zo3Ghctl3M2/OwjZSB mDVGRQkA0GOOlRGnuxO481fv5KzXlgczxjhDSBQJStwLKgv8OQ7ZE4lwW2N6n3Son99N KAPPMDY0k4rSryMAeH3iEow6xtk+odADdfwxMhVvCCLKaRcoxtWK5uAD0GrZRlxTEq5h tVk30J4qjF+vY4Dug8OWqrca5Lxx+nSo1n6+H9Z3XI3FcqTWUQpitAFieA3L8nvStO7W vPCuo0PfuqPem/dp3Opl+j6rVXJNldZ5E2WXPfQifBKRNwR3HlFGNF23uLeiNu/om4yR tgpA== X-Gm-Message-State: AOAM530FoenxbCXuHmjoITDTATIfcxruBR+TASC4A4qOp9rVKk5Rj5NH CMvjTyQfUqLdsnhKiWo/cGIdh9R28FLWoH4gQ1plC/l5k+s= X-Google-Smtp-Source: ABdhPJzyYk/eN+TVA/mR80lDbB4M22ezN0gRH2k9TZnF55F2sc7yvRBQ0qSA7IQjvy8BJnV2x4tI/UQnWcbzTHDmjUo= X-Received: by 2002:a1c:a5c7:: with SMTP id o190mr7765893wme.186.1637220974219; Wed, 17 Nov 2021 23:36:14 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Pavel Vazharov Date: Thu, 18 Nov 2021 09:36:02 +0200 Message-ID: Subject: Re: Accessing TLS for EAL threads To: Antonio Di Bacco Cc: "users@dpdk.org" Content-Type: multipart/alternative; boundary="00000000000096567705d10b362d" X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org --00000000000096567705d10b362d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi there, I think the DPDK uses the pthread_ functions to manages its threads. You can see in `rte_eal_init` in `lib/librte_eal/linux/eal.c` that it "spawns" the threads using ``` /* create a thread for each lcore */ ret =3D pthread_create(&lcore_config[i].thread_id, NULL, eal_thread_loop, NULL); ``` So I think you should be able to use other pthread_ functions without problems from inside the EAL threads. Hope that helps. Regards, Pavel. On Thu, Nov 18, 2021 at 9:24 AM Antonio Di Bacco < antonio.di-bacco@keysight.com> wrote: > I need to emulate the pthread_setspecific and pthread_getspecific for EAL > threads. I don=E2=80=99t 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= =E2=80=99t > find any API that allows me to access the TLS for those threads. > > > > > > > > > --00000000000096567705d10b362d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi there,

I think the DPDK uses the= pthread_ functions to manages its threads. You can see in `rte_eal_init` i= n `lib/librte_eal/linux/eal.c` that it "spawns" the threads using=
```
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* create a thread for e= ach lcore */ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 ret =3D pthread_create(&lcore_config[i].thread_id,= NULL, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0eal_thread_loop, NULL);
```
So I think you should be ab= le to use other pthread_ functions without problems from inside the EAL thr= eads.
Hope that helps.

Regards,
Pavel.

On Thu, Nov 18, 2021 at 9:24 AM Antonio Di Bacco <antonio.di-bacco@keysight.com= > wrote:

I need to emulate the pthread_setspecific and pthrea= d_getspecific for EAL threads. I don=E2=80=99t find any suitable APIs in th= e DPDK to access the TLS and get and set keys.

=C2=A0

I launched a number of threads using the rte_eal_rem= ote launch but I don=E2=80=99t find any API that allows me to access the TL= S for those threads.

=C2=A0

=C2=A0

=C2=A0

=C2=A0

--00000000000096567705d10b362d--