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 B352AA0C43; Wed, 18 Aug 2021 15:46:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 01FD4411F8; Wed, 18 Aug 2021 15:46:09 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 23312411EC; Wed, 18 Aug 2021 15:46:08 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1059) id 7748E20C325D; Wed, 18 Aug 2021 06:46:07 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7748E20C325D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1629294367; bh=GtA9GHTWasEK4XCBlxRQBGRV/MXTJCEwYQ7LSzdRHS4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ld8yTISCgpyjtMSClyOLefrILUp4pTveRz3SFScmDbxTLH5CrvS2ynD01Hma/X7Cm N0elQHQ3M/quFWZyAmC8iY95Gjj7fa4JRU77i3FA2MYq3avuzpPKp5DEKPYl0bqk36 lDIDdNHAewU5KyDP25pPEcd6yXfujZpHC2E92Mi8= From: Narcisa Ana Maria Vasile To: dev@dpdk.org, thomas@monjalon.net, dmitry.kozliuk@gmail.com, khot@microsoft.com, navasile@microsoft.com, dmitrym@microsoft.com, roretzla@microsoft.com, talshn@nvidia.com, ocardona@microsoft.com Cc: bruce.richardson@intel.com, david.marchand@redhat.com, pallavi.kadam@intel.com, stable@dpdk.org Date: Wed, 18 Aug 2021 06:46:00 -0700 Message-Id: <1629294360-5737-1-git-send-email-navasile@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1625018165-27103-1-git-send-email-navasile@linux.microsoft.com> References: <1625018165-27103-1-git-send-email-navasile@linux.microsoft.com> Subject: [dpdk-dev] [PATCH v3] eal/windows: ensure all enabled CPUs are counted 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" From: Narcisa Vasile On Windows, -l/--lcores EAL option was unable to process CPU sets containing CPUs other than 0 and 1, because CPU_COUNT() macro only checked these CPUs in the set. Fix CPU_COUNT() by enumerating all possible CPU indices. Fixes: e8428a9d89f1 ("eal/windows: add some basic functions and macros") Cc: pallavi.kadam@intel.com Cc: stable@dpdk.org Signed-off-by: Narcisa Vasile Acked-by: Dmitry Kozlyuk Acked-by: Pallavi Kadam --- lib/eal/windows/include/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/eal/windows/include/sched.h b/lib/eal/windows/include/sched.h index ff572b5dcb..bc31cc8465 100644 --- a/lib/eal/windows/include/sched.h +++ b/lib/eal/windows/include/sched.h @@ -49,7 +49,7 @@ count_cpu(rte_cpuset_t *s) unsigned int _i; int count = 0; - for (_i = 0; _i < _NUM_SETS(CPU_SETSIZE); _i++) + for (_i = 0; _i < CPU_SETSIZE; _i++) if (CPU_ISSET(_i, s) != 0LL) count++; return count; -- 2.31.0.vfs.0.1