From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stephen@networkplumber.org>
Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com
 [209.85.210.195]) by dpdk.org (Postfix) with ESMTP id 8F3781B204
 for <dev@dpdk.org>; Wed, 10 Apr 2019 19:16:12 +0200 (CEST)
Received: by mail-pf1-f195.google.com with SMTP id c207so1864273pfc.7
 for <dev@dpdk.org>; Wed, 10 Apr 2019 10:16:12 -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=y7bNq0DV23fPxTb/9SFokp9NiKGie8S4xtcH1e+yZRk=;
 b=GE4OVfGcIKAYz4Hrat8SH2pZNDGZ1qcRpL+0S2wa8acNbkoNQD8b1/lPp8VxSK3a7i
 ajL4KZ85yjRI0BgTfuntVtQCkK0eYvGVZ2CMQbEkUjlwCzZPk6iCln2wgvevVG/qOKUK
 36b8N0aIp/GyiV1SWkRzQ7L0WBePwWdAegZ0nYRQsDK+mN5BKM/8nreV2Aj6lh+NKqAK
 V/TXYccR9FpjvmHWwr0F+TWbSxtEf34f4WnqaI8VE3gfh4nbGHU/7kgUzuJgi2+s8Azu
 W3/T06xp1NqIEX3MaZ5vnn/bT9JudheNE3MeKgYoPt+n1z9hjjldVAyeoJm09kSWH3Mz
 Xuxw==
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=y7bNq0DV23fPxTb/9SFokp9NiKGie8S4xtcH1e+yZRk=;
 b=XSzs/mqUqdFcJYI9iEK30Yb2hY2qG7ljKv1NRlWU7+sH/Z3ancLWyYjd2LpTKKN6oS
 OIILM18wYAXz2o2dNq+QgHEcBiu/w/W/0/p7uekGQAjky3bNQXJU+ZHJ8GpjMdbPHWIQ
 o5VSgU3/+AnYqPJnS8lPHcgpgGcwRgqwqM7b3RdRFtQFlJ1vt7Nj55FgPJ1BmwWM/FTP
 bOuCbat0LFWqxQJyFh/fUNEL5FZ+Xa5g6pBVEmDenxcaaSk39EfBY1oHfDSPd220qK49
 gJr3gZkDf0ByTn3ex/5nHTOMuzabIpsC2GyKX88QjD340qpUNKP8Q45Q4plDRFYDGHjG
 K5Mg==
X-Gm-Message-State: APjAAAWjQz5dyYkEFB+VAKF4odqkYAUNBUQX79yW9EeK+s6ixSYit0aZ
 FP8DRYambip/7/7jzmw8g+KelGo4qS4=
X-Google-Smtp-Source: APXvYqyrgFdRz4ClWq+PICfEoi83ncApVlS63GW9WvnSmvSMGQXiokIiGzrPdiSy7W9+YGkidVN5Kw==
X-Received: by 2002:a63:1548:: with SMTP id 8mr39348689pgv.277.1554916571503; 
 Wed, 10 Apr 2019 10:16:11 -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 d25sm48995244pfn.154.2019.04.10.10.16.09
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 10 Apr 2019 10:16:09 -0700 (PDT)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 10 Apr 2019 10:16:01 -0700
Message-Id: <20190410171603.8979-4-stephen@networkplumber.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20190410171603.8979-1-stephen@networkplumber.org>
References: <20190408182510.16078-1-stephen@networkplumber.org>
 <20190410171603.8979-1-stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH v2 3/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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 10 Apr 2019 17:16:13 -0000

The lcore_config structure will be hidden in future release.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 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: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id 8BF47A0096
	for <public@inbox.dpdk.org>; Wed, 10 Apr 2019 19:16:38 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 2E6FA1B296;
	Wed, 10 Apr 2019 19:16:21 +0200 (CEST)
Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com
 [209.85.210.195]) by dpdk.org (Postfix) with ESMTP id 8F3781B204
 for <dev@dpdk.org>; Wed, 10 Apr 2019 19:16:12 +0200 (CEST)
Received: by mail-pf1-f195.google.com with SMTP id c207so1864273pfc.7
 for <dev@dpdk.org>; Wed, 10 Apr 2019 10:16:12 -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=y7bNq0DV23fPxTb/9SFokp9NiKGie8S4xtcH1e+yZRk=;
 b=GE4OVfGcIKAYz4Hrat8SH2pZNDGZ1qcRpL+0S2wa8acNbkoNQD8b1/lPp8VxSK3a7i
 ajL4KZ85yjRI0BgTfuntVtQCkK0eYvGVZ2CMQbEkUjlwCzZPk6iCln2wgvevVG/qOKUK
 36b8N0aIp/GyiV1SWkRzQ7L0WBePwWdAegZ0nYRQsDK+mN5BKM/8nreV2Aj6lh+NKqAK
 V/TXYccR9FpjvmHWwr0F+TWbSxtEf34f4WnqaI8VE3gfh4nbGHU/7kgUzuJgi2+s8Azu
 W3/T06xp1NqIEX3MaZ5vnn/bT9JudheNE3MeKgYoPt+n1z9hjjldVAyeoJm09kSWH3Mz
 Xuxw==
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=y7bNq0DV23fPxTb/9SFokp9NiKGie8S4xtcH1e+yZRk=;
 b=XSzs/mqUqdFcJYI9iEK30Yb2hY2qG7ljKv1NRlWU7+sH/Z3ancLWyYjd2LpTKKN6oS
 OIILM18wYAXz2o2dNq+QgHEcBiu/w/W/0/p7uekGQAjky3bNQXJU+ZHJ8GpjMdbPHWIQ
 o5VSgU3/+AnYqPJnS8lPHcgpgGcwRgqwqM7b3RdRFtQFlJ1vt7Nj55FgPJ1BmwWM/FTP
 bOuCbat0LFWqxQJyFh/fUNEL5FZ+Xa5g6pBVEmDenxcaaSk39EfBY1oHfDSPd220qK49
 gJr3gZkDf0ByTn3ex/5nHTOMuzabIpsC2GyKX88QjD340qpUNKP8Q45Q4plDRFYDGHjG
 K5Mg==
X-Gm-Message-State: APjAAAWjQz5dyYkEFB+VAKF4odqkYAUNBUQX79yW9EeK+s6ixSYit0aZ
 FP8DRYambip/7/7jzmw8g+KelGo4qS4=
X-Google-Smtp-Source: APXvYqyrgFdRz4ClWq+PICfEoi83ncApVlS63GW9WvnSmvSMGQXiokIiGzrPdiSy7W9+YGkidVN5Kw==
X-Received: by 2002:a63:1548:: with SMTP id 8mr39348689pgv.277.1554916571503; 
 Wed, 10 Apr 2019 10:16:11 -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 d25sm48995244pfn.154.2019.04.10.10.16.09
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Wed, 10 Apr 2019 10:16:09 -0700 (PDT)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Date: Wed, 10 Apr 2019 10:16:01 -0700
Message-Id: <20190410171603.8979-4-stephen@networkplumber.org>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20190410171603.8979-1-stephen@networkplumber.org>
References: <20190408182510.16078-1-stephen@networkplumber.org>
 <20190410171603.8979-1-stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH v2 3/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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Content-Type: text/plain; charset="UTF-8"
Message-ID: <20190410171601.BFGnlHRLWOxzzD23TicRsRt6tPk-_jGc06COhcI8mNQ@z>

The lcore_config structure will be hidden in future release.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: David Marchand <david.marchand@redhat.com>
---
 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