[2/2] examples/qos_sched: report error if no pipes configured
Checks
Commit Message
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(+)
Comments
> -----Original Message-----
> From: Richardson, Bruce <bruce.richardson@intel.com>
> Sent: Tuesday, March 21, 2023 1:14 PM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>
> Subject: [PATCH 2/2] examples/qos_sched: report error if no pipes configured
>
> 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>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
@@ -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;