From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id E4A0F5A4A; Wed, 15 May 2019 09:54:41 +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 48E6F307D92F; Wed, 15 May 2019 07:54:41 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-116-80.ams2.redhat.com [10.36.116.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id D97F15D6A6; Wed, 15 May 2019 07:54:39 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, stephen@networkplumber.org, stable@dpdk.org, Cristian Dumitrescu Date: Wed, 15 May 2019 09:54:22 +0200 Message-Id: <1557906862-1116-4-git-send-email-david.marchand@redhat.com> In-Reply-To: <1557906862-1116-1-git-send-email-david.marchand@redhat.com> References: <1557906862-1116-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.48]); Wed, 15 May 2019 07:54:41 +0000 (UTC) Subject: [dpdk-dev] [PATCH 4/4] examples/qos_sched: do not dereference global config struct 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: , X-List-Received-Date: Wed, 15 May 2019 07:54:42 -0000 Prefer the existing apis rather than direct access the configuration structure. Fixes: de3cfa2c9823 ("sched: initial import") Cc: stable@dpdk.org Signed-off-by: David Marchand --- examples/qos_sched/args.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c index 83eee95..7431b29 100644 --- a/examples/qos_sched/args.c +++ b/examples/qos_sched/args.c @@ -90,16 +90,15 @@ static inline int str_is(const char *str, const char *is) static uint64_t app_eal_core_mask(void) { - uint32_t i; uint64_t cm = 0; - struct rte_config *cfg = rte_eal_get_configuration(); + uint32_t i; for (i = 0; i < APP_MAX_LCORE; i++) { - if (cfg->lcore_role[i] == ROLE_RTE) + if (rte_lcore_has_role(i, ROLE_RTE)) cm |= (1ULL << i); } - cm |= (1ULL << cfg->master_lcore); + cm |= (1ULL << rte_get_master_lcore()); return cm; } -- 1.8.3.1 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 468FEA00E6 for ; Wed, 15 May 2019 09:55:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 487B55F20; Wed, 15 May 2019 09:54:45 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id E4A0F5A4A; Wed, 15 May 2019 09:54:41 +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 48E6F307D92F; Wed, 15 May 2019 07:54:41 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-116-80.ams2.redhat.com [10.36.116.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id D97F15D6A6; Wed, 15 May 2019 07:54:39 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, stephen@networkplumber.org, stable@dpdk.org, Cristian Dumitrescu Date: Wed, 15 May 2019 09:54:22 +0200 Message-Id: <1557906862-1116-4-git-send-email-david.marchand@redhat.com> In-Reply-To: <1557906862-1116-1-git-send-email-david.marchand@redhat.com> References: <1557906862-1116-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.48]); Wed, 15 May 2019 07:54:41 +0000 (UTC) Subject: [dpdk-dev] [PATCH 4/4] examples/qos_sched: do not dereference global config struct 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: <20190515075422.3Pdo3XPWgj-EaE0knn_O8i3G9A3-ks6BmR7pvebmHFc@z> Prefer the existing apis rather than direct access the configuration structure. Fixes: de3cfa2c9823 ("sched: initial import") Cc: stable@dpdk.org Signed-off-by: David Marchand --- examples/qos_sched/args.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c index 83eee95..7431b29 100644 --- a/examples/qos_sched/args.c +++ b/examples/qos_sched/args.c @@ -90,16 +90,15 @@ static inline int str_is(const char *str, const char *is) static uint64_t app_eal_core_mask(void) { - uint32_t i; uint64_t cm = 0; - struct rte_config *cfg = rte_eal_get_configuration(); + uint32_t i; for (i = 0; i < APP_MAX_LCORE; i++) { - if (cfg->lcore_role[i] == ROLE_RTE) + if (rte_lcore_has_role(i, ROLE_RTE)) cm |= (1ULL << i); } - cm |= (1ULL << cfg->master_lcore); + cm |= (1ULL << rte_get_master_lcore()); return cm; } -- 1.8.3.1