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 DD55DA0AC5 for ; Fri, 3 May 2019 19:25:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4B5121B122; Fri, 3 May 2019 19:25:24 +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 82F3D4C77 for ; Fri, 3 May 2019 19:25:21 +0200 (CEST) Received: by mail-pf1-f195.google.com with SMTP id 13so2892701pfw.9 for ; Fri, 03 May 2019 10:25:21 -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 :mime-version:content-transfer-encoding; bh=Tk+THDTtwwPo1XgpH2f5PsOUp7bFrD3PI8G0F2fMdg0=; b=g5kDJNoNiOHRQtxnpRjZdzUgXvmCIqaxkUpdGX5LEdcFCxuIzwwB4S/KyTNRnFo3fq ytA16sjM1te+mZHT/bH6nA1CeJCjxPDScUv+qJOUaQSaPkjxLrawSSFrL8XgnMJGbp+G X2+QlBeQsG96XROMRea2SkPJC1GIsDrp1IN93J7gnn6V4QoVirJKgMo6bIOsxhYNmgA/ WhYt4qUZogP01zwVkQfVjLGLWfpapNbVXjJtHqB1O8QdWCK2oVvtxcDHRBwXrq6CE0pB y9toAdvyvDHGcr576mr3SxkiaxJg5G8XwQ9VT3/cXyvmcbIcZU8M/WaLOmAZbS5MBLDP li+g== 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:mime-version:content-transfer-encoding; bh=Tk+THDTtwwPo1XgpH2f5PsOUp7bFrD3PI8G0F2fMdg0=; b=k2sdRrTM2Uks7x/ZkSWodsK851Xfj0j9vJUhXmUqbENRs6hzLEK7wLmD9kEPOLvNe/ uGS5ieew1qwHNLRUtCXHcXjMaSQZhfEakv1/aw6b0NsJZJmIBd500wkznNu98fDjM15q i/uugj+jZAWlKjVCD69wHDCp22b+Vn+SgPynKjdJVRtHDvaBecipbszBh9uGYh5oG3e6 9EPiQjUjZ51Vt923k7trGHFfJB2pUJz4bBrays2WpUfJ1tBVpcol8vQI6E3GBp4+g197 r5nK1MSIALJXIj+EQiGc8jR1kIIXEyrQMrESnJt8gvNWfrnL+ELviTaN2ML1PuyRFxxW oCOg== X-Gm-Message-State: APjAAAUNab6qv+V/ov4Cn0ilNeucQtgkAVsQHAOk4S0ASWbrZddV4bjt F2OmvZhHREmjZVsuihYvR8qxhp8aFvE= X-Google-Smtp-Source: APXvYqyeawqYL1hc/2m0JNx+na4vIzQbJbK5L/MGxiqj4ffIpWnE/OOqM5hbC2Kw9JNr86JHOiUJ5A== X-Received: by 2002:aa7:8190:: with SMTP id g16mr12562413pfi.92.1556904320017; Fri, 03 May 2019 10:25:20 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id t13sm3109578pgj.49.2019.05.03.10.25.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 May 2019 10:25:18 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , David Marchand Date: Fri, 3 May 2019 10:25:05 -0700 Message-Id: <20190503172507.5272-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190503172507.5272-1-stephen@networkplumber.org> References: <20190410171603.8979-1-stephen@networkplumber.org> <20190503172507.5272-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 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 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: <20190503172505.Cp6KQ5BuTwXh2hu3m-R_N9gnSkN4-Pe8371rfZAvgbM@z> The lcore_config structure will be hidden in future release. Signed-off-by: Stephen Hemminger Reviewed-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(-) 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.20.1