From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E4DBCA5FF1 for ; Wed, 7 Oct 2026 06:03:28 +0000 (UTC) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C8F5D4275B; Wed, 7 Oct 2026 08:02:47 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id 4368A410EA for ; Wed, 7 Oct 2026 08:02:42 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 213DB1A0070; Wed, 7 Oct 2026 08:02:42 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id E0EB01A002E; Wed, 7 Oct 2026 08:02:41 +0200 (CEST) Received: from lsv031405.swis.in-blr01.nxp.com (lsv031405.swis.in-blr01.nxp.com [92.120.147.93]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 8B1D91800226; Wed, 7 Oct 2026 14:02:40 +0800 (+08) From: Prashant Gupta To: stephen@networkplumber.org, dev@dpdk.org Cc: Hemant Agrawal Subject: [PATCH v7-S2 09/13] net/dpaa2: add minimum key size support Date: Wed, 7 Oct 2026 11:32:23 +0530 Message-ID: <20261007060227.219835-10-prashant.gupta_3@nxp.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261007060227.219835-1-prashant.gupta_3@nxp.com> References: <20261006151009.3593348-1-prashant.gupta_3@nxp.com> <20261007060227.219835-1-prashant.gupta_3@nxp.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Hemant Agrawal The default size for a QoS key is 24 bytes. If the key size is smaller than the maximum, use the default (minimum) key size instead of always returning the maximum size (56 bytes). This allows smaller flow tables to be used when the extracted key fits within the default size. Signed-off-by: Hemant Agrawal --- drivers/net/dpaa2/dpaa2_flow.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c index b7b79929b4..f3bb2a858f 100644 --- a/drivers/net/dpaa2/dpaa2_flow.c +++ b/drivers/net/dpaa2/dpaa2_flow.c @@ -26,8 +26,11 @@ static char *dpaa2_flow_control_log; static int dpaa2_sp_loaded = -1; +/* Default size of a key */ +#define DPNI_DEFAULT_KEY_SIZE 24 + enum dpaa2_flow_entry_size { - DPAA2_FLOW_ENTRY_MIN_SIZE = (DPNI_MAX_KEY_SIZE / 2), + DPAA2_FLOW_ENTRY_MIN_SIZE = DPNI_DEFAULT_KEY_SIZE, DPAA2_FLOW_ENTRY_MAX_SIZE = DPNI_MAX_KEY_SIZE }; @@ -4532,8 +4535,7 @@ dpaa2_flow_entry_size(uint16_t key_max_size) if (key_max_size > DPAA2_FLOW_ENTRY_MIN_SIZE) return DPAA2_FLOW_ENTRY_MAX_SIZE; - /* Current MC only support fixed entry size(56)*/ - return DPAA2_FLOW_ENTRY_MAX_SIZE; + return DPAA2_FLOW_ENTRY_MIN_SIZE; } static inline int -- 2.43.0