[4/5] examples _use RTE_DIM
Checks
Commit Message
Use RTE_DIM instead of computing directly with sizeof.
Patch automatically generated via cocci/rte_dim.cocci.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/l3fwd/main.c | 3 +--
examples/qos_sched/init.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
Comments
On Tue, Apr 16, 2024 at 08:19:30AM -0700, Stephen Hemminger wrote:
> Use RTE_DIM instead of computing directly with sizeof.
> Patch automatically generated via cocci/rte_dim.cocci.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
@@ -116,8 +116,7 @@ static struct lcore_params lcore_params_array_default[] = {
};
static struct lcore_params * lcore_params = lcore_params_array_default;
-static uint16_t nb_lcore_params = sizeof(lcore_params_array_default) /
- sizeof(lcore_params_array_default[0]);
+static uint16_t nb_lcore_params = RTE_DIM(lcore_params_array_default);
static struct rte_eth_conf port_conf = {
.rxmode = {
@@ -206,8 +206,7 @@ struct rte_sched_subport_params subport_params[MAX_SCHED_SUBPORTS] = {
.n_pipes_per_subport_enabled = 4096,
.qsize = {64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64},
.pipe_profiles = pipe_profiles,
- .n_pipe_profiles = sizeof(pipe_profiles) /
- sizeof(struct rte_sched_pipe_params),
+ .n_pipe_profiles = RTE_DIM(pipe_profiles),
.n_max_pipe_profiles = MAX_SCHED_PIPE_PROFILES,
.cman_params = NULL,
},