From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 26AAD4F9C for ; Mon, 8 Apr 2019 20:25:17 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id i2so7769165pgj.11 for ; Mon, 08 Apr 2019 11:25:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3FO51MkZ21vvvofbgTf+19JWuMHY3hfQGqQwdvpJkxY=; b=ywqKRz34fqKrxqzwxy4s3SHebEFBIExl1brUBYR20vA9t6sIuxRGQJbcMc0vDgqzWW 77hF1SuWI4WMzLD66GBi9EXTI8uGBc7wLdMiH7GMi9tDttWRTKZcb9TnYpgWdLLga81h OE1Q+N0I0UdjfpLKujNgt3AVkPTmJ/3rOlYL+DyBm4NMRiA4aLo4DfKPT+InLkX1R/P2 XosEu++eidD1JH2lI/PvChAOoQFh36xVYYsZEQqBv4rljAmYOSpxUsbBWkGAN40i+J1L 4GByl4scsSubJGyF4TMRvoIw05brFyjZ/7aDkXNCVGGS0iXyLLuYwluTH8S/Lwc80ZQ7 YUYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3FO51MkZ21vvvofbgTf+19JWuMHY3hfQGqQwdvpJkxY=; b=pNVnys6FoHi9UcIoWjThX0cLDdlMlKD1YqG87Se3CdncBrPbKUyYflyiHIQDKvRtJ3 pYL2l/iWUsnSU+QGcRRZG8ifdz1iXuEmE4SGk2enLB71CrFg2BNiw3k1EzhqSx483UTF gebp5ooSdkNJRL99c1cTzS7QJWnq7gYWwBL09ql1xA5z2m+5Etj35r58lxcymUNwKRoW BdRuRXpLYMgHgNqVnZnhaPY5J5rRpBWMPVCIlTGAxmAtRTymBwk/0TOEx4YI9D6BKVi4 SELdn47832qk66TKiOYRiWjectMFtqgQri3PZxsRGUnLikHtbMey8awwxH2HcdWkhs0Q qdPQ== X-Gm-Message-State: APjAAAVAynY9/cvTwr4Hya2uH2TD2bsB3q6XB8OvFIhkDUvizoTamKDG NPWpglwuDaS1CSXaAp2W+EU8CVnD8FnJoQ== X-Google-Smtp-Source: APXvYqxAn56iZixNzRvWzMh54ob0IP62RYM//HinDiqNO/Ust6uRmAaI2NYFUDUg+PYheOYxwzS0QQ== X-Received: by 2002:a62:6f47:: with SMTP id k68mr15292363pfc.196.1554747916035; Mon, 08 Apr 2019 11:25:16 -0700 (PDT) Received: from shemminger-XPS-13-9360.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id d25sm40891081pfn.154.2019.04.08.11.25.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Apr 2019 11:25:15 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Mon, 8 Apr 2019 11:25:07 -0700 Message-Id: <20190408182510.16078-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190408182510.16078-1-stephen@networkplumber.org> References: <20190408182510.16078-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH v1 2/5] bus: use lcore accessor functions 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: , X-List-Received-Date: Mon, 08 Apr 2019 18:25:17 -0000 Fix the bus logic in fslmc and dpaa drivers to use the new accessor functions. Signed-off-by: Stephen Hemminger --- drivers/bus/dpaa/dpaa_bus.c | 6 ++++-- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index ac20eccd53c1..08c822781d9d 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -254,6 +254,7 @@ int rte_dpaa_portal_init(void *arg) unsigned int cpu, lcore = rte_lcore_id(); int ret; struct dpaa_portal *dpaa_io_portal; + rte_cpuset_t cpuset; BUS_INIT_FUNC_TRACE(); @@ -263,12 +264,13 @@ int rte_dpaa_portal_init(void *arg) if (lcore >= RTE_MAX_LCORE) return -1; - cpu = lcore_config[lcore].core_id; + cpu = rte_lcore_to_cpu_id(lcore); /* Set CPU affinity for this thread.*/ id = pthread_self(); + cpuset = rte_lcore_cpuset(lcore); ret = pthread_setaffinity_np(id, sizeof(cpu_set_t), - &lcore_config[lcore].cpuset); + &cpuset); if (ret) { DPAA_BUS_LOG(ERR, "pthread_setaffinity_np failed on core :%u" " (lcore=%u) with ret: %d", cpu, lcore, ret); diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index 7bcbde840e63..8efb24af5c6a 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -366,7 +366,9 @@ dpaa2_check_lcore_cpuset(void) for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { for (i = 0; i < RTE_MAX_LCORE; i++) { - if (CPU_ISSET(i, &lcore_config[lcore_id].cpuset)) { + rte_cpuset_t cpuset = rte_lcore_cpuset(lcore_id); + + if (CPU_ISSET(i, &cpuset)) { RTE_LOG(DEBUG, EAL, "lcore id = %u cpu=%u\n", lcore_id, i); if (dpaa2_cpu[lcore_id] != 0xffffffff) { -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 37C12A0096 for ; Mon, 8 Apr 2019 20:25:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 814975681; Mon, 8 Apr 2019 20:25:23 +0200 (CEST) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 26AAD4F9C for ; Mon, 8 Apr 2019 20:25:17 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id i2so7769165pgj.11 for ; Mon, 08 Apr 2019 11:25:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3FO51MkZ21vvvofbgTf+19JWuMHY3hfQGqQwdvpJkxY=; b=ywqKRz34fqKrxqzwxy4s3SHebEFBIExl1brUBYR20vA9t6sIuxRGQJbcMc0vDgqzWW 77hF1SuWI4WMzLD66GBi9EXTI8uGBc7wLdMiH7GMi9tDttWRTKZcb9TnYpgWdLLga81h OE1Q+N0I0UdjfpLKujNgt3AVkPTmJ/3rOlYL+DyBm4NMRiA4aLo4DfKPT+InLkX1R/P2 XosEu++eidD1JH2lI/PvChAOoQFh36xVYYsZEQqBv4rljAmYOSpxUsbBWkGAN40i+J1L 4GByl4scsSubJGyF4TMRvoIw05brFyjZ/7aDkXNCVGGS0iXyLLuYwluTH8S/Lwc80ZQ7 YUYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3FO51MkZ21vvvofbgTf+19JWuMHY3hfQGqQwdvpJkxY=; b=pNVnys6FoHi9UcIoWjThX0cLDdlMlKD1YqG87Se3CdncBrPbKUyYflyiHIQDKvRtJ3 pYL2l/iWUsnSU+QGcRRZG8ifdz1iXuEmE4SGk2enLB71CrFg2BNiw3k1EzhqSx483UTF gebp5ooSdkNJRL99c1cTzS7QJWnq7gYWwBL09ql1xA5z2m+5Etj35r58lxcymUNwKRoW BdRuRXpLYMgHgNqVnZnhaPY5J5rRpBWMPVCIlTGAxmAtRTymBwk/0TOEx4YI9D6BKVi4 SELdn47832qk66TKiOYRiWjectMFtqgQri3PZxsRGUnLikHtbMey8awwxH2HcdWkhs0Q qdPQ== X-Gm-Message-State: APjAAAVAynY9/cvTwr4Hya2uH2TD2bsB3q6XB8OvFIhkDUvizoTamKDG NPWpglwuDaS1CSXaAp2W+EU8CVnD8FnJoQ== X-Google-Smtp-Source: APXvYqxAn56iZixNzRvWzMh54ob0IP62RYM//HinDiqNO/Ust6uRmAaI2NYFUDUg+PYheOYxwzS0QQ== X-Received: by 2002:a62:6f47:: with SMTP id k68mr15292363pfc.196.1554747916035; Mon, 08 Apr 2019 11:25:16 -0700 (PDT) Received: from shemminger-XPS-13-9360.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id d25sm40891081pfn.154.2019.04.08.11.25.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Apr 2019 11:25:15 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Mon, 8 Apr 2019 11:25:07 -0700 Message-Id: <20190408182510.16078-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190408182510.16078-1-stephen@networkplumber.org> References: <20190408182510.16078-1-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH v1 2/5] bus: use lcore accessor functions 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190408182507.H8PQNFuT7TOnZ9Rt7TDj089VNISpoN5IrzofradAm8s@z> Fix the bus logic in fslmc and dpaa drivers to use the new accessor functions. Signed-off-by: Stephen Hemminger --- drivers/bus/dpaa/dpaa_bus.c | 6 ++++-- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index ac20eccd53c1..08c822781d9d 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -254,6 +254,7 @@ int rte_dpaa_portal_init(void *arg) unsigned int cpu, lcore = rte_lcore_id(); int ret; struct dpaa_portal *dpaa_io_portal; + rte_cpuset_t cpuset; BUS_INIT_FUNC_TRACE(); @@ -263,12 +264,13 @@ int rte_dpaa_portal_init(void *arg) if (lcore >= RTE_MAX_LCORE) return -1; - cpu = lcore_config[lcore].core_id; + cpu = rte_lcore_to_cpu_id(lcore); /* Set CPU affinity for this thread.*/ id = pthread_self(); + cpuset = rte_lcore_cpuset(lcore); ret = pthread_setaffinity_np(id, sizeof(cpu_set_t), - &lcore_config[lcore].cpuset); + &cpuset); if (ret) { DPAA_BUS_LOG(ERR, "pthread_setaffinity_np failed on core :%u" " (lcore=%u) with ret: %d", cpu, lcore, ret); diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index 7bcbde840e63..8efb24af5c6a 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -366,7 +366,9 @@ dpaa2_check_lcore_cpuset(void) for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) { for (i = 0; i < RTE_MAX_LCORE; i++) { - if (CPU_ISSET(i, &lcore_config[lcore_id].cpuset)) { + rte_cpuset_t cpuset = rte_lcore_cpuset(lcore_id); + + if (CPU_ISSET(i, &cpuset)) { RTE_LOG(DEBUG, EAL, "lcore id = %u cpu=%u\n", lcore_id, i); if (dpaa2_cpu[lcore_id] != 0xffffffff) { -- 2.17.1