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 B0840A0096 for ; Tue, 9 Apr 2019 09:43:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 47A8A58CB; Tue, 9 Apr 2019 09:43:21 +0200 (CEST) Received: from mail-vs1-f67.google.com (mail-vs1-f67.google.com [209.85.217.67]) by dpdk.org (Postfix) with ESMTP id 9CCB956A1 for ; Tue, 9 Apr 2019 09:43:19 +0200 (CEST) Received: by mail-vs1-f67.google.com with SMTP id i207so9214542vsd.10 for ; Tue, 09 Apr 2019 00:43:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9ha7y1THQUqE+9LE0saLvM8jhCrtW8nKDuXk3bst+Go=; b=UOt2VbT3BVWSRs1/q1MReZ9ToQG62ty0bsVNe/9E1LQAeShqC4otXzZEk5KFuNZ7lc OP3QpD08k8JoYvsU8pFiVasorr1GQaJYAKb5RixJIGSTVIS2FROymh8KJZ+OkrJdeVQa iEV5PXrvPypD+ePULUVlIrqRbfxUKehTu8kFra//RzQ21TYDuqx7N2pg5OUeawRo1its rBPJDFSn0A4zLs29vqwEN6JtAAaWn7Alh3HTMMPNGaUqRSps2Tre6CD3GZuh+4TLz0Il kzM1g9DlJ6DT4XTpDKkzE3o+tAw1sC3KL1Xr6SSlimlndD4bZ1Qnf4khiyDu+kkTBy1C ax2w== X-Gm-Message-State: APjAAAWkdQ9dl+62ISsZIwoO9wCNKDiY/Xhm2dY5N28iciFJsyq8LHPH mCn54pisCS5KyL3rsoMaCb+Wzpx/UQACxpkhWWatMZp3 X-Google-Smtp-Source: APXvYqwdEVCYr8zQIgzbxs9jOx2FaNWU5qXGVuj10qw1GZpsV1wZByvNzA5FEjftFHGUqxXK7Tn7J8rYNVMwXUHG2qw= X-Received: by 2002:a67:7ac9:: with SMTP id v192mr16573114vsc.100.1554795799045; Tue, 09 Apr 2019 00:43:19 -0700 (PDT) MIME-Version: 1.0 References: <20190408182510.16078-1-stephen@networkplumber.org> <20190408182510.16078-3-stephen@networkplumber.org> In-Reply-To: <20190408182510.16078-3-stephen@networkplumber.org> From: David Marchand Date: Tue, 9 Apr 2019 09:43:08 +0200 Message-ID: To: Stephen Hemminger Cc: dev Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [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" Message-ID: <20190409074308.PitAKsCuGf45SOmEUe1PWd3BiB4qknrQEzdVK4AT6e0@z> On Mon, Apr 8, 2019 at 8:25 PM Stephen Hemminger wrote: > 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 > > Reviewed-by: David Marchand -- David Marchand