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 C3E39A0C44; Wed, 9 Jun 2021 01:04:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3EF3410FB; Wed, 9 Jun 2021 01:04:04 +0200 (CEST) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) by mails.dpdk.org (Postfix) with ESMTP id BA86A410FB for ; Wed, 9 Jun 2021 01:04:03 +0200 (CEST) Received: by mail-lj1-f170.google.com with SMTP id s22so8759664ljg.5 for ; Tue, 08 Jun 2021 16:04:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jr1hTjIt6HzjwIIgKKxdh/FDIIPxTsmS7qoCUD3pYFk=; b=jR4LLJjqIzw/3XBa9RUzbwtu0B27auBrLj6F+4CMi+VXtPPopBfTUTieKDBiXrRCZB SNzuEjelg0GJBVBYeQRvjftjuPLyrnbcP72VUvDCPHmhY8soe8pxgKlJPECuUP1IHB/k H/9fdeuFYamBE/2gwUh8os4hxhT60AEKMqdlEyUQEofBprD723Z1nosDrwr//qItQhHC lbZwV+Vds+YjTuc7alMZYmRNeTFul61Jj7QlmK79+sndHbJQH7GQ0/VkAa9y4jZlG+tB tgoLlLfr+Ab5g0PWPhVYSUkLFZjYZl0cIaKOsblndnnzoSAaw13k0BvISAptOsyEpFRf 6RNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jr1hTjIt6HzjwIIgKKxdh/FDIIPxTsmS7qoCUD3pYFk=; b=PLpqLG3l/6I2TCMoTHOHGv5Oxk8n9Voa06wsgWH2W3SDDbxxAS0S/2sanUsrKjEp25 MJOP2kW4Dge9UM+TaPBgGslmuYPJvfDFfakcVstIghsNWevX4A60ugFOu6DkLNSy3awm H35EKUxviSbVF++A++oPS1xnhZrH6ywwtZe2Qplu5JryP6qukd7CEpyvkd2kppURI6Ti 3Ujb/iecJDOoOOlBXynskJEvQvhFPeCqLdr9+1o2AAHktQp0GYoUsWQmtfy8sLtpwhYw h6o8FZLWGWUmUNa4dQY19SIWhEgkgQaAi8T6XPzRlR6fwepaFFo8REvN2chNwsoE4w4k 8Q0w== X-Gm-Message-State: AOAM533+4p9U3jDwkO274GIlTIlt6DHF+39CIcTfd8/vr3bPnGTq5t86 r6BDPygz1Nkuj2dhSKjyqZE= X-Google-Smtp-Source: ABdhPJwAPzrZWrcZ9OxqGuLvjbFT/7gvbUR44hgHEt/hiNsmGNDE5PszUbvvuLhOWCrpHRfAK3pJ/w== X-Received: by 2002:a05:651c:1311:: with SMTP id u17mr19778412lja.48.1623193443281; Tue, 08 Jun 2021 16:04:03 -0700 (PDT) Received: from sovereign (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id m3sm120792lfg.241.2021.06.08.16.04.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 16:04:02 -0700 (PDT) Date: Wed, 9 Jun 2021 02:04:01 +0300 From: Dmitry Kozlyuk To: Narcisa Ana Maria Vasile Cc: dev@dpdk.org, thomas@monjalon.net, khot@microsoft.com, navasile@microsoft.com, dmitrym@microsoft.com, roretzla@microsoft.com, talshn@nvidia.com, ocardona@microsoft.com, bruce.richardson@intel.com, david.marchand@redhat.com, pallavi.kadam@intel.com Message-ID: <20210609020401.32de8fce@sovereign> In-Reply-To: <1622849908-5710-5-git-send-email-navasile@linux.microsoft.com> References: <1622580952-25169-1-git-send-email-navasile@linux.microsoft.com> <1622849908-5710-1-git-send-email-navasile@linux.microsoft.com> <1622849908-5710-5-git-send-email-navasile@linux.microsoft.com> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v8 04/10] eal: implement functions for thread affinity management 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" 2021-06-04 16:38 (UTC-0700), Narcisa Ana Maria Vasile: [...] > +static int > +rte_convert_cpuset_to_affinity(const rte_cpuset_t *cpuset, > + PGROUP_AFFINITY affinity) > +{ > + int ret = 0; > + PGROUP_AFFINITY cpu_affinity = NULL; > + > + memset(affinity, 0, sizeof(GROUP_AFFINITY)); > + affinity->Group = (USHORT)-1; > + > + /* Check that all cpus of the set belong to the same processor group and > + * accumulate thread affinity to be applied. > + */ > + for (unsigned int cpu_idx = 0; cpu_idx < CPU_SETSIZE; cpu_idx++) { > + if (!CPU_ISSET(cpu_idx, cpuset)) > + continue; > + > + cpu_affinity = eal_get_cpu_affinity(cpu_idx); > + > + if (affinity->Group == (USHORT)-1) { > + affinity->Group = cpu_affinity->Group; > + } else if (affinity->Group != cpu_affinity->Group) { > + ret = EINVAL; > + goto cleanup; > + } > + > + affinity->Mask |= cpu_affinity->Mask; > + } For v5 I asked a question that possibly got lost among other comments. Repeating it here for convenience: Just to be clear: is it a kernel limitation that a thread can only run on cores of one processor group, or do we impose it so that API is atomic (transactional), i.e. because one of multiple SetThreadGroupAffinity() calls may fail and leave thread partially affinitized?