From patchwork Thu May 23 13:58:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 53670 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C45DB1B9A3; Thu, 23 May 2019 16:00:09 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id AF6901B996 for ; Thu, 23 May 2019 16:00:05 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 57C0D300270E; Thu, 23 May 2019 13:59:53 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-124.brq.redhat.com [10.40.204.124]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3AE265B684; Thu, 23 May 2019 13:59:49 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, stephen@networkplumber.org, Hemant Agrawal , Shreyansh Jain Date: Thu, 23 May 2019 15:58:59 +0200 Message-Id: <1558619942-9723-4-git-send-email-david.marchand@redhat.com> In-Reply-To: <1558619942-9723-1-git-send-email-david.marchand@redhat.com> References: <20190408182510.16078-1-stephen@networkplumber.org> <1558619942-9723-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 23 May 2019 14:00:05 +0000 (UTC) Subject: [dpdk-dev] [PATCH v4 3/5] drivers/bus: use lcore accessors 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" From: Stephen Hemminger The lcore_config structure will be hidden in future release. Signed-off-by: Stephen Hemminger Signed-off-by: David Marchand --- drivers/bus/dpaa/dpaa_bus.c | 6 ++++-- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) --- Changelog since v3: - updated title diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index ac20ecc..08c8227 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 7bcbde8..8efb24a 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -366,7 +366,9 @@ static struct dpaa2_dpio_dev *dpaa2_get_qbman_swp(int lcoreid) 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) {