summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDavid Marchand <david.marchand@redhat.com>2019-05-15 09:54:22 +0200
committerThomas Monjalon <thomas@monjalon.net>2019-05-30 00:30:17 +0200
commit4df7d46bbdba4f390816476fa62f21668f87b995 (patch)
tree3e1ae15d603a1607434638c8a5fb2a5591a0b4e0 /examples
parent200bc52e5aa0d72e70464c9cd22b55cf536ed13c (diff)
downloaddpdk-4df7d46bbdba4f390816476fa62f21668f87b995.zip
dpdk-4df7d46bbdba4f390816476fa62f21668f87b995.tar.gz
dpdk-4df7d46bbdba4f390816476fa62f21668f87b995.tar.xz
examples/qos_sched: do not dereference global config struct
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 <david.marchand@redhat.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/qos_sched/args.c7
1 files 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;
}