From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 19C6041E23 for ; Thu, 9 Mar 2023 15:00:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 147AC42C54; Thu, 9 Mar 2023 15:00:29 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 7988B400D7; Thu, 9 Mar 2023 15:00:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678370426; x=1709906426; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=upD/terLy6krPKEUb/gNjS5kJGY1RGq+PxKz8+J3cy8=; b=Qh8DytS4qWAFc7QAvGp34k2dfIJFVIvgYoTmYF7LfJ9TrgbxyHj+VpfQ 9pWlFORHdHxdIriOhppaooiuxYH3CikZ4K77AlTcAH9ETDzi7agEwsIiN venwy5BGlSgjsPMgzNgDe4B391uugPuMV6I8LFqEmZh1LkRXz87VBtHtb q0LZWKNwGIEUZaCsjVkWTf/0DHfnseFoWbWcOmgvDswdACfygq0O+tI7L Tj4BeRrxTjG2dCKz1/p9K6roGE6u+wf2iAnwVUgcDVzi9sojzNS0hWEGo hgIpGNF9cyy+8Ip7O7qXXsKR5VXd0LiNAkyNPlyMqvGaput+eHR8DqlBS w==; X-IronPort-AV: E=McAfee;i="6500,9779,10643"; a="337975694" X-IronPort-AV: E=Sophos;i="5.98,246,1673942400"; d="scan'208";a="337975694" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2023 06:00:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10643"; a="677377061" X-IronPort-AV: E=Sophos;i="5.98,246,1673942400"; d="scan'208";a="677377061" Received: from ena4.iind.intel.com ([10.190.200.224]) by orsmga002.jf.intel.com with ESMTP; 09 Mar 2023 06:00:23 -0800 From: Yogesh Jangra 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 Message-Id: <20230309135842.1197818-1-yogesh.jangra@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org 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 Acked-by: Cristian Dumitrescu --- 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