From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: jasvinder.singh@intel.com,
Bruce Richardson <bruce.richardson@intel.com>,
Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Subject: [PATCH 4/4] examples/qos_sched: remove limit on core ids
Date: Fri, 3 Feb 2023 10:05:33 +0000 [thread overview]
Message-ID: <20230203100533.10377-5-bruce.richardson@intel.com> (raw)
In-Reply-To: <20230203100533.10377-1-bruce.richardson@intel.com>
The qos_sched app was limited to using lcores between 0 and 64 only,
even if RTE_MAX_LCORE was set to a higher value (as it is by default).
Remove some of the checks on the lcore ids in order to support running
with core ids > 64.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
examples/qos_sched/args.c | 72 ++-------------------------------------
examples/qos_sched/main.h | 10 +-----
2 files changed, 4 insertions(+), 78 deletions(-)
diff --git a/examples/qos_sched/args.c b/examples/qos_sched/args.c
index b2959499ae..e97273152a 100644
--- a/examples/qos_sched/args.c
+++ b/examples/qos_sched/args.c
@@ -24,7 +24,6 @@
static uint32_t app_main_core = 1;
static uint32_t app_numa_mask;
-static uint64_t app_used_core_mask = 0;
static uint64_t app_used_port_mask = 0;
static uint64_t app_used_rx_port_mask = 0;
static uint64_t app_used_tx_port_mask = 0;
@@ -82,43 +81,6 @@ app_usage(const char *prgname)
}
-/* returns core mask used by DPDK */
-static uint64_t
-app_eal_core_mask(void)
-{
- uint64_t cm = 0;
- uint32_t i;
-
- for (i = 0; i < APP_MAX_LCORE; i++) {
- if (rte_lcore_has_role(i, ROLE_RTE))
- cm |= (1ULL << i);
- }
-
- cm |= (1ULL << rte_get_main_lcore());
-
- return cm;
-}
-
-
-/* returns total number of cores presented in a system */
-static uint32_t
-app_cpu_core_count(void)
-{
- int i, len;
- char path[PATH_MAX];
- uint32_t ncores = 0;
-
- for (i = 0; i < APP_MAX_LCORE; i++) {
- len = snprintf(path, sizeof(path), SYS_CPU_DIR, i);
- if (len <= 0 || (unsigned)len >= sizeof(path))
- continue;
-
- if (access(path, F_OK) == 0)
- ncores++;
- }
-
- return ncores;
-}
/* returns:
number of values parsed
@@ -261,15 +223,6 @@ app_parse_flow_conf(const char *conf_str)
app_used_tx_port_mask |= mask;
app_used_port_mask |= mask;
- mask = 1lu << pconf->rx_core;
- app_used_core_mask |= mask;
-
- mask = 1lu << pconf->wt_core;
- app_used_core_mask |= mask;
-
- mask = 1lu << pconf->tx_core;
- app_used_core_mask |= mask;
-
nb_pfc++;
return 0;
@@ -322,7 +275,7 @@ app_parse_args(int argc, char **argv)
int opt, ret;
int option_index;
char *prgname = argv[0];
- uint32_t i, nb_lcores;
+ uint32_t i;
static struct option lgopts[] = {
{OPT_PFC, 1, NULL, OPT_PFC_NUM},
@@ -425,23 +378,6 @@ app_parse_args(int argc, char **argv)
}
}
- /* check main core index validity */
- for (i = 0; i <= app_main_core; i++) {
- if (app_used_core_mask & RTE_BIT64(app_main_core)) {
- RTE_LOG(ERR, APP, "Main core index is not configured properly\n");
- app_usage(prgname);
- return -1;
- }
- }
- app_used_core_mask |= RTE_BIT64(app_main_core);
-
- if ((app_used_core_mask != app_eal_core_mask()) ||
- (app_main_core != rte_get_main_lcore())) {
- RTE_LOG(ERR, APP, "EAL core mask not configured properly, must be %" PRIx64
- " instead of %" PRIx64 "\n" , app_used_core_mask, app_eal_core_mask());
- return -1;
- }
-
if (nb_pfc == 0) {
RTE_LOG(ERR, APP, "Packet flow not configured!\n");
app_usage(prgname);
@@ -449,15 +385,13 @@ app_parse_args(int argc, char **argv)
}
/* sanity check for cores assignment */
- nb_lcores = app_cpu_core_count();
-
for(i = 0; i < nb_pfc; i++) {
- if (qos_conf[i].rx_core >= nb_lcores) {
+ if (qos_conf[i].rx_core >= RTE_MAX_LCORE) {
RTE_LOG(ERR, APP, "pfc %u: invalid RX lcore index %u\n", i + 1,
qos_conf[i].rx_core);
return -1;
}
- if (qos_conf[i].wt_core >= nb_lcores) {
+ if (qos_conf[i].wt_core >= RTE_MAX_LCORE) {
RTE_LOG(ERR, APP, "pfc %u: invalid WT lcore index %u\n", i + 1,
qos_conf[i].wt_core);
return -1;
diff --git a/examples/qos_sched/main.h b/examples/qos_sched/main.h
index d8f3e32c83..bc647ec595 100644
--- a/examples/qos_sched/main.h
+++ b/examples/qos_sched/main.h
@@ -37,15 +37,7 @@ extern "C" {
#define TX_HTHRESH 0 /**< Default values of TX host threshold reg. */
#define TX_WTHRESH 0 /**< Default values of TX write-back threshold reg. */
-#ifndef APP_MAX_LCORE
-#if (RTE_MAX_LCORE > 64)
-#define APP_MAX_LCORE 64
-#else
-#define APP_MAX_LCORE RTE_MAX_LCORE
-#endif
-#endif
-
-#define MAX_DATA_STREAMS (APP_MAX_LCORE/2)
+#define MAX_DATA_STREAMS RTE_MAX_LCORE/2
#define MAX_SCHED_SUBPORTS 8
#define MAX_SCHED_PIPES 4096
#define MAX_SCHED_PIPE_PROFILES 256
--
2.37.2
next prev parent reply other threads:[~2023-02-03 10:06 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-03 10:05 [PATCH 0/4] small fixes and improvements for qos_sched example Bruce Richardson
2023-02-03 10:05 ` [PATCH 1/4] examples/qos_sched: fix errors when TX port not up Bruce Richardson
2023-02-17 16:19 ` Dumitrescu, Cristian
2023-02-03 10:05 ` [PATCH 2/4] examples/qos_sched: remove TX buffering Bruce Richardson
2023-02-17 16:19 ` Dumitrescu, Cristian
2023-02-03 10:05 ` [PATCH 3/4] examples/qos_sched: use bigger bursts on dequeue Bruce Richardson
2023-02-17 16:20 ` Dumitrescu, Cristian
2023-02-03 10:05 ` Bruce Richardson [this message]
2023-02-17 16:20 ` [PATCH 4/4] examples/qos_sched: remove limit on core ids Dumitrescu, Cristian
2023-02-20 15:41 ` [PATCH 0/4] small fixes and improvements for qos_sched example 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=20230203100533.10377-5-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
--cc=jasvinder.singh@intel.com \
/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).