From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, stephen@networkplumber.org, stable@dpdk.org,
Jasvinder Singh <jasvinder.singh@intel.com>,
Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Subject: [dpdk-dev] [PATCH 2/4] net/softnic: do not dereference global config struct
Date: Wed, 15 May 2019 09:54:20 +0200 [thread overview]
Message-ID: <1557906862-1116-2-git-send-email-david.marchand@redhat.com> (raw)
Message-ID: <20190515075420.KsHGoAhCM6EXLW8gAZ6TT95HEguwzqcChFhO_V1J4Mw@z> (raw)
In-Reply-To: <1557906862-1116-1-git-send-email-david.marchand@redhat.com>
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 <david.marchand@redhat.com>
---
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 */
--
1.8.3.1
next prev parent reply other threads:[~2019-05-15 7:54 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-15 7:54 [dpdk-dev] [PATCH 1/4] net/cxgbe: " David Marchand
2019-05-15 7:54 ` David Marchand
2019-05-15 7:54 ` David Marchand [this message]
2019-05-15 7:54 ` [dpdk-dev] [PATCH 2/4] net/softnic: " David Marchand
2019-05-15 10:06 ` Maxime Coquelin
2019-05-15 10:06 ` Maxime Coquelin
2019-05-15 7:54 ` [dpdk-dev] [PATCH 3/4] examples/multi_process: " David Marchand
2019-05-15 7:54 ` David Marchand
2019-05-15 10:07 ` Maxime Coquelin
2019-05-15 10:07 ` Maxime Coquelin
2019-05-15 7:54 ` [dpdk-dev] [PATCH 4/4] examples/qos_sched: " David Marchand
2019-05-15 7:54 ` David Marchand
2019-05-15 10:08 ` Maxime Coquelin
2019-05-15 10:08 ` Maxime Coquelin
2019-05-15 9:29 ` [dpdk-dev] [PATCH 1/4] net/cxgbe: " Maxime Coquelin
2019-05-15 9:29 ` Maxime Coquelin
2019-05-29 22:31 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1557906862-1116-2-git-send-email-david.marchand@redhat.com \
--to=david.marchand@redhat.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=jasvinder.singh@intel.com \
--cc=stable@dpdk.org \
--cc=stephen@networkplumber.org \
--cc=thomas@monjalon.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).