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 EF7A84614F; Thu, 30 Jan 2025 17:14:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61D1140B99; Thu, 30 Jan 2025 17:14:49 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by mails.dpdk.org (Postfix) with ESMTP id E83FD4025A; Thu, 30 Jan 2025 17:14:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1738253688; x=1769789688; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yNIj1oQ9fBcO6Fh1p5jcu2W8GJ8bBqghT8tyw+DmYJI=; b=cFrT+Wv9okpFDCdEQ6P8JMzXpmMoJqFnMpuHCZcR+DKLlyjSnrKEJGuV 6+vhHNUEaKzgNl0DOt5c/Xz4IAnfNcRXpC6Eu6ct/h/Mfo0SjugTyJar+ hWsBwRPqDLkAk+wjQRwLDYeww6q9a0SlAiJo/W/N1uAJcBIFVRmInzA3R f47Nvmp2RGL627/CmansUKVrt+0Tzj7MuPvzNJ0OUCnui7iqJizWL5cfq 0/6FOXZwJvat1EQ6Nv274Xcu6Z0FzClHf3wbdrDuW7i0mV9n514SVZh8G NBqPDRM8Fkt8EYmwJ+wA/P9yIQzliAAHBsqgXzYnO8MjCTAd6V5t9Km3P A==; X-CSE-ConnectionGUID: KwP73XjDS5ePdmdxGTIHuA== X-CSE-MsgGUID: /Wul9ePLQy+dMtExDIKY0w== X-IronPort-AV: E=McAfee;i="6700,10204,11331"; a="49793950" X-IronPort-AV: E=Sophos;i="6.13,245,1732608000"; d="scan'208";a="49793950" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2025 08:14:47 -0800 X-CSE-ConnectionGUID: mz0p5ioBR6m5C87uIjKHDQ== X-CSE-MsgGUID: p96fv5DGT2++Ku7YF0FrbA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="146556941" Received: from unknown (HELO silpixa00401176.ir.intel.com) ([10.243.23.51]) by orviesa001.jf.intel.com with ESMTP; 30 Jan 2025 08:14:44 -0800 From: Vladimir Medvedkin To: dev@dpdk.org Cc: kai.ji@intel.com, anatoly.burakov@intel.com, bruce.richardson@intel.com, qi.z.zhang@intel.com, stable@dpdk.org Subject: [PATCH v2] net/ice: fix how ice driver handles flows Date: Thu, 30 Jan 2025 16:14:42 +0000 Message-ID: <20250130161442.2730917-1-vladimir.medvedkin@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250130155011.2658800-1-vladimir.medvedkin@intel.com> References: <20250130155011.2658800-1-vladimir.medvedkin@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Currently ICE PMD uses group attribute to select the appropriate HW engine to offload the flow. This behavior violates the rte_flow API, existing documentation/examples, and reveals hardware specific details. This patch eliminates the use of the group attribute and runs each engine parser in the order they work in the HW pipeline. Fixes: 9c5f0070fa3f ("net/ice: map group to pipeline stage") Cc: qi.z.zhang@intel.com Cc: stable@dpdk.org Signed-off-by: Vladimir Medvedkin --- drivers/net/intel/ice/ice_generic_flow.c | 30 ++++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers/net/intel/ice/ice_generic_flow.c b/drivers/net/intel/ice/ice_generic_flow.c index 50d760004f..5c34e0385f 100644 --- a/drivers/net/intel/ice/ice_generic_flow.c +++ b/drivers/net/intel/ice/ice_generic_flow.c @@ -20,6 +20,8 @@ #define ICE_FLOW_ENGINE_DISABLED(mask, type) ((mask) & BIT(type)) +#define ICE_FLOW_ENGINE_NB 3 + static struct ice_engine_list engine_list = TAILQ_HEAD_INITIALIZER(engine_list); @@ -2295,21 +2297,23 @@ ice_flow_process_filter(struct rte_eth_dev *dev, return 0; } - parser = get_flow_parser(attr->group); - if (parser == NULL) { - rte_flow_error_set(error, EINVAL, - RTE_FLOW_ERROR_TYPE_ATTR, - NULL, "NULL attribute."); - return -rte_errno; - } + for (int i = 0; i < ICE_FLOW_ENGINE_NB; i++) { + parser = get_flow_parser(i); + if (parser == NULL) { + rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ATTR, + NULL, "NULL attribute."); + return -rte_errno; + } - if (ice_parse_engine(ad, flow, parser, attr->priority, - pattern, actions, error)) { - *engine = parser->engine; - return 0; - } else { - return -rte_errno; + if (ice_parse_engine(ad, flow, parser, attr->priority, + pattern, actions, error)) { + *engine = parser->engine; + return 0; + } } + + return -rte_errno; } static int -- 2.43.0