From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Subject: [PATCH 2/2] examples/qos_sched: report error if no pipes configured
Date: Tue, 21 Mar 2023 13:13:50 +0000 [thread overview]
Message-ID: <20230321131350.122290-3-bruce.richardson@intel.com> (raw)
In-Reply-To: <20230321131350.122290-1-bruce.richardson@intel.com>
Have the QoS scheduler sample application report an error if no pipes
are configured for a subport.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
examples/qos_sched/init.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c
index 7a27c03b64..d8abae635a 100644
--- a/examples/qos_sched/init.c
+++ b/examples/qos_sched/init.c
@@ -233,6 +233,7 @@ app_init_sched_port(uint32_t portid, uint32_t socketid)
struct rte_eth_link link;
struct rte_sched_port *port = NULL;
uint32_t pipe, subport;
+ uint32_t pipe_count;
int err;
err = rte_eth_link_get(portid, &link);
@@ -263,6 +264,7 @@ app_init_sched_port(uint32_t portid, uint32_t socketid)
uint32_t n_pipes_per_subport =
subport_params[subport].n_pipes_per_subport_enabled;
+ pipe_count = 0;
for (pipe = 0; pipe < n_pipes_per_subport; pipe++) {
if (app_pipe_to_profile[subport][pipe] != -1) {
err = rte_sched_pipe_config(port, subport, pipe,
@@ -272,8 +274,13 @@ app_init_sched_port(uint32_t portid, uint32_t socketid)
"for profile %d, err=%d\n", pipe,
app_pipe_to_profile[subport][pipe], err);
}
+ pipe_count++;
}
}
+
+ if (pipe_count == 0)
+ rte_exit(EXIT_FAILURE, "Error: invalid config, no pipes enabled for sched subport %u\n",
+ subport);
}
return port;
--
2.37.2
next prev parent reply other threads:[~2023-03-21 13:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-21 13:13 [PATCH 0/2] small fixes for QoS profile handling Bruce Richardson
2023-03-21 13:13 ` [PATCH 1/2] examples/qos_sched: fix config entries in wrong sections Bruce Richardson
2023-03-21 17:38 ` Dumitrescu, Cristian
2023-03-21 13:13 ` Bruce Richardson [this message]
2023-03-21 17:37 ` [PATCH 2/2] examples/qos_sched: report error if no pipes configured Dumitrescu, Cristian
2023-03-23 9:11 ` [PATCH 0/2] small fixes for QoS profile handling 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=20230321131350.122290-3-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=cristian.dumitrescu@intel.com \
--cc=dev@dpdk.org \
/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).