DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] table/selector: fix action selector group size log2 value setting
@ 2023-03-09 13:58 Yogesh Jangra
  2023-03-10 17:04 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Yogesh Jangra @ 2023-03-09 13:58 UTC (permalink / raw)
  To: dev
  Cc: cristian.dumitrescu, yogesh.jangra, kamalakannan.r,
	harshad.suresh.narayane, stable

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(-)

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 */
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-10 17:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-09 13:58 [PATCH] table/selector: fix action selector group size log2 value setting Yogesh Jangra
2023-03-10 17:04 ` Thomas Monjalon

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).