DPDK patches and discussions
 help / color / mirror / Atom feed
From: Yogesh Jangra <yogesh.jangra@intel.com>
To: dev@dpdk.org
Cc: cristian.dumitrescu@intel.com, yogesh.jangra@intel.com,
	kamalakannan.r@intel.com, harshad.suresh.narayane@intel.com,
	stable@dpdk.org
Subject: [PATCH] table/selector: fix action selector group size log2 value setting
Date: Thu,  9 Mar 2023 13:58:42 +0000	[thread overview]
Message-ID: <20230309135842.1197818-1-yogesh.jangra@intel.com> (raw)

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


             reply	other threads:[~2023-03-09 14:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 13:58 Yogesh Jangra [this message]
2023-03-10 17:04 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230309135842.1197818-1-yogesh.jangra@intel.com \
    --to=yogesh.jangra@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=harshad.suresh.narayane@intel.com \
    --cc=kamalakannan.r@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).