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 D5E9AA0679 for ; Wed, 3 Apr 2019 19:16:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A9EDD1B51A; Wed, 3 Apr 2019 19:16:28 +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 C3A041B508 for ; Wed, 3 Apr 2019 19:16:18 +0200 (CEST) Received: by mail-pf1-f195.google.com with SMTP id 8so8481644pfr.4 for ; Wed, 03 Apr 2019 10:16:18 -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=c40HeXx52VHI2D46+ok2id6Yb3hqj92EcHgJ5otlbYg=; b=b52/GCVeLA+4SF6BWfTKLGvPGQ1sk+Zo2Tji+TZgVSEGp2b46k5LmGVI/CM3qTiXuA oXvGoOMXaDGeh7pSaBBa52/eu0ARyd7rD7+syQgWgtwqwnreIju2DxPVNZU17O8MqKdi kAj3m00Z1ZiCpn/L8RH1WdeOPu0fLfBs4+9fEVlhqvir+HV58FDtjERZlkUtC7OiHeIQ CLaaOtW7+KZt78Qdwc178/ElEyU7rPGMFn0dsq469Jq+rG4++YU01GYWV5nxADh8QU2U L4dC87c0gvtWlhjhdc74fgY1zvQ/Oq1fApb0hvZFHyokKcAZ0G/BwPUQU8bfdwXTsRlz LtTg== 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=c40HeXx52VHI2D46+ok2id6Yb3hqj92EcHgJ5otlbYg=; b=XszNGzqDZ5KhQPYlA40T4Xv4AlveheGjzTwbPt1ySqXMuciod0VhJ0Ulf/nZLZhIjT Rn/QF46HGEKuAD3Lz5Q/nRKg0dE2PAoqBLBkoxNGVptxOAcU23RmrrNBIBmD88B8Grv6 y3vOyku7uCY76liAVMeKctccbE09WxDIIDOeITy3FdAgRVEew0s/pYGHbpd5ymeDFasX 0wKK88csXaJZSNKDa49Xte7YE+ig959PhqmoD2zllJisiQjP7JAVhC0qZFzyp7IGO6L2 Xq8m/W0Qne85rH4xWPS2i2OlHdXfncIFUx4rqa3YtG52QyETWj6zLueXzB/7ez/mZktb VO+g== X-Gm-Message-State: APjAAAXVbbvCbIKv6geNsf6NBgcoHzogOfcHZ0kdFWO5lF5Ah1qC8MaW rBSfDPtSxegx+9ZIdECCf2eiJQNzb2V5Jg== X-Google-Smtp-Source: APXvYqxK/RTn8dB2i5OPl7UdILqpPR0G8eNm8sW/gzTZOrfcq70Bn8SGIqjhwob8CxrYj3+FzF57Ig== X-Received: by 2002:a62:b40b:: with SMTP id h11mr554917pfn.133.1554311777560; Wed, 03 Apr 2019 10:16:17 -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 k14sm23041693pfb.125.2019.04.03.10.16.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Apr 2019 10:16:16 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Wed, 3 Apr 2019 10:16:07 -0700 Message-Id: <20190403171610.23970-3-stephen@networkplumber.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190403171610.23970-1-stephen@networkplumber.org> References: <20190403171610.23970-1-stephen@networkplumber.org> Subject: [dpdk-dev] [RFC 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: <20190403171607.Zm6U3awAcukIOsHTkTiRsO2X6bQOfe4taaJfLNxRLko@z> The lcore_config structure will be hidden in future release. 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