From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9F6FBA00C5 for ; Wed, 8 Jul 2020 11:07:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 88E2C1DD0A; Wed, 8 Jul 2020 11:07:30 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id AAF141DAE4; Wed, 8 Jul 2020 11:07:26 +0200 (CEST) IronPort-SDR: lOrGv2TB2GMLr/e/v8BOYc9kdBMndLHpH1YPZGGWoHfBhJzf7qUX/lT0mZPH3p0DQwsZZWImbe 4U+SzPMyFCJA== X-IronPort-AV: E=McAfee;i="6000,8403,9675"; a="135225858" X-IronPort-AV: E=Sophos;i="5.75,327,1589266800"; d="scan'208";a="135225858" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2020 02:07:25 -0700 IronPort-SDR: ewXTkBklMXH1OjkG3KAsnp05DgUhRBFgA51NVpm2Ysek+oSe+hnn8PEIY5oOolpNXc/aQ0CqU4 KcTR4c5ggGyg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,327,1589266800"; d="scan'208";a="358047154" Received: from dpdk-xuting-main.sh.intel.com ([10.67.117.84]) by orsmga001.jf.intel.com with ESMTP; 08 Jul 2020 02:07:23 -0700 From: Ting Xu To: dev@dpdk.org Cc: qiming.yang@intel.com, qi.z.zhang@intel.com, stable@dpdk.org Date: Wed, 8 Jul 2020 17:07:08 +0800 Message-Id: <20200708090708.27182-1-ting.xu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-stable] [PATCH v1] net/ice: fix invalid symmetric RSS rule created X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" The flow rule with symmetric toeplitz hash function and SRC_ONLY or DST_ONLY RSS type together should not be created successfully. Fix the RSS action parse function to stop the rule creation in this situation. Fixes: 5ad3db8d4bdd ("net/ice: enable advanced RSS") Cc: stable@dpdk.org Signed-off-by: Ting Xu --- drivers/net/ice/ice_hash.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index 3433cab28c..3c84a6a73f 100644 --- a/drivers/net/ice/ice_hash.c +++ b/drivers/net/ice/ice_hash.c @@ -1044,6 +1044,19 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item, ETH_RSS_L4_SRC_ONLY | ETH_RSS_L4_DST_ONLY; + /** + * Check if SRC_ONLY or DST_ONLY is set for + * SYMMETRIC_TOEPLITZ hash function. + */ + if (rss->func == + RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) { + if (rss_type & combine_type) + return rte_flow_error_set(error, + ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, + action, "Not supported RSS types for " + "symmetric toeplitz hash"); + } + /* Check if rss types match pattern. */ if (rss_type & ~combine_type & ~m->eth_rss_hint) { return rte_flow_error_set(error, -- 2.17.1