From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0F3C3A0567; Fri, 13 Mar 2020 09:34:20 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6E4A71C01E; Fri, 13 Mar 2020 09:34:19 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 5D9B51BFFE for ; Fri, 13 Mar 2020 09:34:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584088456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jrKFOTFrwvHvYZRfF99lnvyO5EIdx4SnhiJeDEuYQKg=; b=Q4yqD8qbmXjLPX0r1fL3AAEs/zZfE8xW3bBaXje1F3dNXlch1NcO/TZSUKrRkPAqHSVIN9 SLqXdvsPYSWPE/H4LDrUiXU6XKpzWgUtRFXdY+T/wupdgna6LTLpN1CTy8a1isoU8zLruQ zAGoNpuVRQcLfoR+nnkEC5SBf+fUHa0= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-76-CbWPpOuOMxejS9A3I-tcGA-1; Fri, 13 Mar 2020 04:34:15 -0400 X-MC-Unique: CbWPpOuOMxejS9A3I-tcGA-1 Received: by mail-vk1-f200.google.com with SMTP id b189so1661946vkg.15 for ; Fri, 13 Mar 2020 01:34:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/e2wnCtBBojuPH2AafoP5z3Kj0HSy/e0lBVaKgZ10Yk=; b=rj2SYJOPhkYAuA38+5qvZtUIauuEKASf+hKOo5fTxvz/vaVxvwGL/p/bZAjcblKAlp Q9EPzyvMLvN5/55YmcWQKGgQJv7/u91o2e5ntN4LtiORdp4DSSVz9hffMP/YMpONsUzH yQfUG5BEddq28NoWuqPIpGdaG1kiesbB5xoihuUjwOvFVuh3eEde7zdz43Kh/Orwch1h zFMXXw29eCA1j5btriuiFsg6Qui8mbEPoqMsjQaZuLdfPTd8cUiT7J7LrM1PE3ytYtEB 80kKxW2vl2r/UzeObCvutLehtfLP1XnaPk74JADzLnpcABdRoO2RnEmjAgHCjXmnEcxh H4zQ== X-Gm-Message-State: ANhLgQ1Jo88cTKUExUnrfF0jJMSrzFuXX/BWQPbvTFKCi4r1jvh+g+5U 2SdmO/H4zvxDLYgqCzIHm7uVDyf67X7KfmT1kC+O7DiFG4otYLxepiHmdjUrztk7t/YFazlYobb iCPXovge5EeNRPHEUZZw= X-Received: by 2002:a05:6102:30ba:: with SMTP id y26mr8251024vsd.198.1584088454558; Fri, 13 Mar 2020 01:34:14 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsE1hwKBDgew8P+Wtai8HN3RaU5tXAvxSjWv68GNXKpkTFiKexNw7zXK9kBVRy70n4bTLVtGDY22pcuKr7Jt3s= X-Received: by 2002:a05:6102:30ba:: with SMTP id y26mr8251015vsd.198.1584088454310; Fri, 13 Mar 2020 01:34:14 -0700 (PDT) MIME-Version: 1.0 References: <20200205102416.698395-1-jerinj@marvell.com> In-Reply-To: <20200205102416.698395-1-jerinj@marvell.com> From: David Marchand Date: Fri, 13 Mar 2020 09:34:03 +0100 Message-ID: To: Jerin Jacob Kollanukkaran Cc: dev , Olivier Matz X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH] eal: store control thread CPU affinity in TLS X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" On Wed, Feb 5, 2020 at 11:24 AM wrote: > > From: Jerin Jacob > > _cpuset TLS variable stores the CPU affinity of eal thread. > Populate the _cpuset TLS variable for control thread to > > 1) Make rte_thread_get_affinity() and eal_thread_dump_affinity > functional with control thread. > 2) Quick access to cpu affinity. > > Signed-off-by: Jerin Jacob > --- > lib/librte_eal/common/eal_common_thread.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/lib/librte_eal/common/eal_common_thread.c b/lib/librte_eal/c= ommon/eal_common_thread.c > index 78581753c..99fe1aa4e 100644 > --- a/lib/librte_eal/common/eal_common_thread.c > +++ b/lib/librte_eal/common/eal_common_thread.c > @@ -152,10 +152,14 @@ struct rte_thread_ctrl_params { > static void *rte_thread_init(void *arg) > { > int ret; > + rte_cpuset_t *cpuset =3D &internal_config.ctrl_cpuset; > struct rte_thread_ctrl_params *params =3D arg; > void *(*start_routine)(void *) =3D params->start_routine; > void *routine_arg =3D params->arg; > > + /* Store cpuset in TLS for quick access */ > + memmove(&RTE_PER_LCORE(_cpuset), cpuset, sizeof(rte_cpuset_t)); > + > ret =3D pthread_barrier_wait(¶ms->configured); > if (ret =3D=3D PTHREAD_BARRIER_SERIAL_THREAD) { > pthread_barrier_destroy(¶ms->configured); Reviewed-by: David Marchand --=20 David Marchand