From patchwork Fri Sep 10 08:08:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenjun Wu X-Patchwork-Id: 98557 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CD4EBA0547; Fri, 10 Sep 2021 10:26:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A964C4067E; Fri, 10 Sep 2021 10:26:57 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id B01A44003E for ; Fri, 10 Sep 2021 10:26:53 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10102"; a="208136136" X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="208136136" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2021 01:26:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="540346326" Received: from wuwenjun.sh.intel.com ([10.67.110.178]) by FMSMGA003.fm.intel.com with ESMTP; 10 Sep 2021 01:26:47 -0700 From: Wenjun Wu To: dev@dpdk.org, qi.z.zhang@intel.com Cc: Yuying Zhang Date: Fri, 10 Sep 2021 16:08:15 +0800 Message-Id: <20210910080821.18718-2-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210910080821.18718-1-wenjun1.wu@intel.com> References: <20210910080821.18718-1-wenjun1.wu@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 20.11 1/7] net/ice: add priority check for flow filters 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 Sender: "dev" From: Yuying Zhang This patch is not for LTS upstream, just for users to cherry-pick. Priority 0 and 1 were supported in switch filter. However, FDIR, ACL and RSS don't support priority 1. Add priority check in FDIR, ACL and RSS filter parse functions. Signed-off-by: Yuying Zhang --- drivers/net/ice/ice_acl_filter.c | 5 ++++- drivers/net/ice/ice_fdir_filter.c | 5 ++++- drivers/net/ice/ice_hash.c | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/ice/ice_acl_filter.c b/drivers/net/ice/ice_acl_filter.c index 14e36aa9f6..201c9fb382 100644 --- a/drivers/net/ice/ice_acl_filter.c +++ b/drivers/net/ice/ice_acl_filter.c @@ -904,7 +904,7 @@ ice_acl_parse(struct ice_adapter *ad, uint32_t array_len, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], - uint32_t priority __rte_unused, + uint32_t priority, void **meta, struct rte_flow_error *error) { @@ -914,6 +914,9 @@ ice_acl_parse(struct ice_adapter *ad, uint64_t input_set; int ret; + if (priority >= 1) + return -rte_errno; + memset(filter, 0, sizeof(*filter)); item = ice_search_pattern_match_item(pattern, array, array_len, error); if (!item) diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c index be04fcb8f3..1a9280a2eb 100644 --- a/drivers/net/ice/ice_fdir_filter.c +++ b/drivers/net/ice/ice_fdir_filter.c @@ -2029,7 +2029,7 @@ ice_fdir_parse(struct ice_adapter *ad, uint32_t array_len, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], - uint32_t priority __rte_unused, + uint32_t priority, void **meta, struct rte_flow_error *error) { @@ -2039,6 +2039,9 @@ ice_fdir_parse(struct ice_adapter *ad, uint64_t input_set; int ret; + if (priority >= 1) + return -rte_errno; + memset(filter, 0, sizeof(*filter)); item = ice_search_pattern_match_item(pattern, array, array_len, error); if (!item) diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index ae095eb3cf..b8a87ea1dd 100644 --- a/drivers/net/ice/ice_hash.c +++ b/drivers/net/ice/ice_hash.c @@ -1238,7 +1238,7 @@ ice_hash_parse_pattern_action(__rte_unused struct ice_adapter *ad, uint32_t array_len, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], - uint32_t priority __rte_unused, + uint32_t priority, void **meta, struct rte_flow_error *error) { @@ -1246,6 +1246,9 @@ ice_hash_parse_pattern_action(__rte_unused struct ice_adapter *ad, struct ice_pattern_match_item *pattern_match_item; struct rss_meta *rss_meta_ptr; + if (priority >= 1) + return -rte_errno; + rss_meta_ptr = rte_zmalloc(NULL, sizeof(*rss_meta_ptr), 0); if (!rss_meta_ptr) { rte_flow_error_set(error, EINVAL,