From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 64794A04B5; Mon, 2 Dec 2019 16:42:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 025451BDFD; Mon, 2 Dec 2019 16:42:11 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id DEC091BDFD for ; Mon, 2 Dec 2019 16:42:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575301329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RIHeK1j4oXPi6ZvVIBfd7V7RyeHhAv+KgjUpHAcFENA=; b=gQHZ/iB5Rb9aF4l+6CV+nOqudQnRgfHqvKG1bpLxUf/VDSUn5Do2OuMrQiRDNLqMv/rO1v AbVdP24IzIRhZ/sagd+sh0SFktkK6uX0MJDbRz+fYZ8YJ4ssIus+eLHX8viWExhfBGkJyd 9n64E3sN8bcd2VnY9J0iBZoEZ7OKY4c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-305-VCzHXVXpMEGFXzs7-hk_dA-1; Mon, 02 Dec 2019 10:42:08 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 703531099BAF for ; Mon, 2 Dec 2019 15:42:07 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-205-88.brq.redhat.com [10.40.205.88]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4ACDE5DA2C; Mon, 2 Dec 2019 15:42:05 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: aconole@redhat.com Date: Mon, 2 Dec 2019 16:42:01 +0100 Message-Id: <20191202154201.10721-1-david.marchand@redhat.com> In-Reply-To: <20191202153559.9709-1-david.marchand@redhat.com> References: <20191202153559.9709-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: VCzHXVXpMEGFXzs7-hk_dA-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-dev] [PATCH 2/4] eal: do not cache lcore detection state 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" We use this state in control path only for services cores and -c/-l options. The value is not updated when using --lcores. Use the internal helper where needed. Signed-off-by: David Marchand --- lib/librte_eal/common/eal_common_lcore.c | 4 +--- lib/librte_eal/common/eal_common_options.c | 10 +++++----- lib/librte_eal/common/eal_private.h | 1 - 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/librte_eal/common/eal_common_lcore.c b/lib/librte_eal/comm= on/eal_common_lcore.c index 39efadef1a..1d16fb2156 100644 --- a/lib/librte_eal/common/eal_common_lcore.c +++ b/lib/librte_eal/common/eal_common_lcore.c @@ -139,9 +139,7 @@ rte_eal_cpu_init(void) =09=09socket_id =3D eal_cpu_socket_id(lcore_id); =09=09lcore_to_socket_id[lcore_id] =3D socket_id; =20 -=09=09/* in 1:1 mapping, record related cpu detected state */ -=09=09lcore_config[lcore_id].detected =3D eal_cpu_detected(lcore_id); -=09=09if (lcore_config[lcore_id].detected =3D=3D 0) { +=09=09if (eal_cpu_detected(lcore_id) =3D=3D 0) { =09=09=09config->lcore_role[lcore_id] =3D ROLE_OFF; =09=09=09lcore_config[lcore_id].core_index =3D -1; =09=09=09continue; diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/co= mmon/eal_common_options.c index a7f9c5f9bd..68f7d1cd73 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -373,7 +373,7 @@ eal_parse_service_coremask(const char *coremask) =09=09=09=09=09return -1; =09=09=09=09} =20 -=09=09=09=09if (!lcore_config[idx].detected) { +=09=09=09=09if (eal_cpu_detected(idx) =3D=3D 0) { =09=09=09=09=09RTE_LOG(ERR, EAL, =09=09=09=09=09=09"lcore %u unavailable\n", idx); =09=09=09=09=09return -1; @@ -429,7 +429,7 @@ update_lcore_config(int *cores) =20 =09for (i =3D 0; i < RTE_MAX_LCORE; i++) { =09=09if (cores[i] !=3D -1) { -=09=09=09if (!lcore_config[i].detected) { +=09=09=09if (eal_cpu_detected(i) =3D=3D 0) { =09=09=09=09RTE_LOG(ERR, EAL, "lcore %u unavailable\n", i); =09=09=09=09ret =3D -1; =09=09=09=09continue; @@ -785,7 +785,7 @@ convert_to_cpuset(rte_cpuset_t *cpusetp, =09=09if (!set[idx]) =09=09=09continue; =20 -=09=09if (!lcore_config[idx].detected) { +=09=09if (eal_cpu_detected(idx) =3D=3D 0) { =09=09=09RTE_LOG(ERR, EAL, "core %u " =09=09=09=09"unavailable\n", idx); =09=09=09return -1; @@ -1138,7 +1138,7 @@ available_cores(void) =20 =09/* find the first available cpu */ =09for (idx =3D 0; idx < RTE_MAX_LCORE; idx++) { -=09=09if (!lcore_config[idx].detected) +=09=09if (eal_cpu_detected(idx) =3D=3D 0) =09=09=09continue; =09=09break; =09} @@ -1152,7 +1152,7 @@ available_cores(void) =09sequence =3D 0; =20 =09for (idx++ ; idx < RTE_MAX_LCORE; idx++) { -=09=09if (!lcore_config[idx].detected) +=09=09if (eal_cpu_detected(idx) =3D=3D 0) =09=09=09continue; =20 =09=09if (idx =3D=3D previous + 1) { diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/ea= l_private.h index 8a9d493f0c..ddcfbe2e44 100644 --- a/lib/librte_eal/common/eal_private.h +++ b/lib/librte_eal/common/eal_private.h @@ -29,7 +29,6 @@ struct lcore_config { =09unsigned int core_id; /**< core number on socket for this lcore */ =09int core_index; /**< relative index, starting from 0 */ =09uint8_t core_role; /**< role of core eg: OFF, RTE, SERVICE */ -=09uint8_t detected; /**< true if lcore was detected */ =20 =09rte_cpuset_t cpuset; /**< cpu set which the lcore affinity to */ }; --=20 2.23.0