table/selector: fix action selector group size log2 value setting
Checks
Commit Message
The incorrect variable for the number of groups was used, so in the
case of values not power of 2 the incorrect result was produced.
Fixes: f7598a62d11 (table: support selector table)
Cc: stable@dpdk.org
Signed-off-by: Yogesh Jangra <yogesh.jangra@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
lib/table/rte_swx_table_selector.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
09/03/2023 14:58, Yogesh Jangra:
> The incorrect variable for the number of groups was used, so in the
> case of values not power of 2 the incorrect result was produced.
>
> Fixes: f7598a62d11 (table: support selector table)
Please use "git fixline" with this in your .gitconfig:
[alias]
fixline = log -1 --abbrev=12 --format='Fixes: %h (\"%s\")%nCc: %ae'
ref: https://core.dpdk.org/contribute/
> Cc: stable@dpdk.org
>
> Signed-off-by: Yogesh Jangra <yogesh.jangra@intel.com>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Applied, thanks.
@@ -232,7 +232,7 @@ table_params_copy(struct table *t, struct rte_swx_table_selector_params *params)
t->params.n_members_per_group_max = rte_align32pow2(params->n_members_per_group_max);
for (i = 0; i < 32; i++)
- if (params->n_members_per_group_max == 1U << i)
+ if (t->params.n_members_per_group_max == 1U << i)
t->n_members_per_group_max_log2 = i;
/* t->params.selector_mask */