From patchwork Wed May 15 07:54:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 53416 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 925D75A6A; Wed, 15 May 2019 09:54:37 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id CFB001D7; Wed, 15 May 2019 09:54:35 +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 1C5D246233; Wed, 15 May 2019 07:54:35 +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 5576C5D6A6; Wed, 15 May 2019 07:54:33 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, stephen@networkplumber.org, stable@dpdk.org, Rahul Lakkireddy Date: Wed, 15 May 2019 09:54:19 +0200 Message-Id: <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.29]); Wed, 15 May 2019 07:54:35 +0000 (UTC) Subject: [dpdk-dev] [PATCH 1/4] net/cxgbe: 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" Prefer the existing apis rather than direct access the configuration structure. Fixes: 92c8a63223e5 ("cxgbe: add device configuration and Rx support") Cc: stable@dpdk.org Signed-off-by: David Marchand Reviewed-by: Maxime Coquelin --- drivers/net/cxgbe/cxgbe_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c index 28c3c66..987aab4 100644 --- a/drivers/net/cxgbe/cxgbe_main.c +++ b/drivers/net/cxgbe/cxgbe_main.c @@ -504,7 +504,6 @@ int cxgbe_cfg_queue_count(struct rte_eth_dev *eth_dev) void cxgbe_cfg_queues(struct rte_eth_dev *eth_dev) { - struct rte_config *config = rte_eal_get_configuration(); struct port_info *pi = (struct port_info *)(eth_dev->data->dev_private); struct adapter *adap = pi->adapter; struct sge *s = &adap->sge; @@ -527,8 +526,8 @@ void cxgbe_cfg_queues(struct rte_eth_dev *eth_dev) (adap->params.nports - nb_ports)) / nb_ports; - if (q_per_port > config->lcore_count) - q_per_port = config->lcore_count; + if (q_per_port > rte_lcore_count()) + q_per_port = rte_lcore_count(); for_each_port(adap, i) { struct port_info *pi = adap2pinfo(adap, i); From patchwork Wed May 15 07:54:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 53417 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 280A45B2C; Wed, 15 May 2019 09:54:40 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 49D555B1C; Wed, 15 May 2019 09:54:38 +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 70579A971A; Wed, 15 May 2019 07:54:37 +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 C085F5D6A6; Wed, 15 May 2019 07:54:35 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, stephen@networkplumber.org, stable@dpdk.org, Jasvinder Singh , Cristian Dumitrescu Date: Wed, 15 May 2019 09:54:20 +0200 Message-Id: <1557906862-1116-2-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.38]); Wed, 15 May 2019 07:54:37 +0000 (UTC) Subject: [dpdk-dev] [PATCH 2/4] net/softnic: 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" Prefer the existing apis rather than direct access the configuration structure. Fixes: a958a5c07f4b ("net/softnic: support service cores") Cc: stable@dpdk.org Signed-off-by: David Marchand Reviewed-by: Maxime Coquelin --- drivers/net/softnic/rte_eth_softnic_thread.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/net/softnic/rte_eth_softnic_thread.c b/drivers/net/softnic/rte_eth_softnic_thread.c index 855408e..d610b16 100644 --- a/drivers/net/softnic/rte_eth_softnic_thread.c +++ b/drivers/net/softnic/rte_eth_softnic_thread.c @@ -99,17 +99,12 @@ static inline int thread_is_valid(struct pmd_internals *softnic, uint32_t thread_id) { - struct rte_config *cfg = rte_eal_get_configuration(); - enum rte_lcore_role_t role; - - if ((thread_id >= RTE_MAX_LCORE) || - (thread_id == cfg->master_lcore)) + if (thread_id == rte_get_master_lcore()) return 0; /* FALSE */ - role = cfg->lcore_role[thread_id]; - - if ((softnic->params.sc && (role == ROLE_SERVICE)) || - (!softnic->params.sc && (role == ROLE_RTE))) + if (softnic->params.sc && rte_lcore_has_role(thread_id, ROLE_SERVICE)) + return 1; /* TRUE */ + if (!softnic->params.sc && rte_lcore_has_role(thread_id, ROLE_RTE)) return 1; /* TRUE */ return 0; /* FALSE */ From patchwork Wed May 15 07:54:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 53418 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D75E65F19; Wed, 15 May 2019 09:54:42 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 01B335B20; Wed, 15 May 2019 09:54:40 +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 6522CC057F88; Wed, 15 May 2019 07:54:39 +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 E97815D6A6; Wed, 15 May 2019 07:54:37 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, stephen@networkplumber.org, stable@dpdk.org, Anatoly Burakov Date: Wed, 15 May 2019 09:54:21 +0200 Message-Id: <1557906862-1116-3-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.32]); Wed, 15 May 2019 07:54:39 +0000 (UTC) Subject: [dpdk-dev] [PATCH 3/4] examples/multi_process: 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" Prefer the existing apis rather than direct access the configuration structure. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: David Marchand Reviewed-by: Maxime Coquelin --- examples/multi_process/symmetric_mp/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c index c310e94..62771e0 100644 --- a/examples/multi_process/symmetric_mp/main.c +++ b/examples/multi_process/symmetric_mp/main.c @@ -271,7 +271,7 @@ struct port_stats{ assign_ports_to_cores(void) { - const unsigned lcores = rte_eal_get_configuration()->lcore_count; + const unsigned int lcores = rte_lcore_count(); const unsigned port_pairs = num_ports / 2; const unsigned pairs_per_lcore = port_pairs / lcores; unsigned extra_pairs = port_pairs % lcores; From patchwork Wed May 15 07:54:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 53419 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org 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" 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 Reviewed-by: Maxime Coquelin --- 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; }