table/selector: fix action selector group size log2 value setting

Message ID 20230309135842.1197818-1-yogesh.jangra@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series table/selector: fix action selector group size log2 value setting |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-testing warning Testing issues
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Yogesh Jangra March 9, 2023, 1:58 p.m. UTC
  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

Thomas Monjalon March 10, 2023, 5:04 p.m. UTC | #1
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.
  

Patch

diff --git a/lib/table/rte_swx_table_selector.c b/lib/table/rte_swx_table_selector.c
index ad99f18453..18e021fe6f 100644
--- a/lib/table/rte_swx_table_selector.c
+++ b/lib/table/rte_swx_table_selector.c
@@ -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 */