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 3659FA04E7; Mon, 2 Nov 2020 03:12:49 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 19975592B; Mon, 2 Nov 2020 03:12:48 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id A603E5916 for ; Mon, 2 Nov 2020 03:12:45 +0100 (CET) IronPort-SDR: 3JhyJ9k9ZOz43N7r9iL5rs0IbenToSAvaf/VzPb49gsEFqyNb762EWTGzXWEKfR1xL3jVb3LxL J8qzgVKmyMSg== X-IronPort-AV: E=McAfee;i="6000,8403,9792"; a="148680063" X-IronPort-AV: E=Sophos;i="5.77,443,1596524400"; d="scan'208";a="148680063" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2020 18:12:44 -0800 IronPort-SDR: /q1BdZ3pcZYNiG3zQi2T+9qXbtHNaGD/reL6HjqSDaE67ii5m/oCmt9viv32ROkK77PoUBsFF2 v+n+msfKNZpA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,443,1596524400"; d="scan'208";a="470207771" Received: from unknown (HELO npg-dpdk-cvl-simeisu-118d193.sh.intel.com) ([10.67.119.195]) by orsmga004.jf.intel.com with ESMTP; 01 Nov 2020 18:12:42 -0800 From: Simei Su To: qi.z.zhang@intel.com Cc: dev@dpdk.org, junfeng.guo@intel.com, jia.guo@intel.com, Simei Su Date: Mon, 2 Nov 2020 10:04:19 +0800 Message-Id: <20201102020419.149961-1-simei.su@intel.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20201030031638.370766-1-simei.su@intel.com> References: <20201030031638.370766-1-simei.su@intel.com> Subject: [dpdk-dev] [PATCH v2] net/iavf: fix invalid RSS type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" When a RSS rule with symmetric hash function, the RSS type shouldn't carry with SRC/DST_ONLY. This patch adds invalid RSS type check for the case. Fixes: 91f27b2e39ab ("net/iavf: refactor RSS") Signed-off-by: Simei Su --- drivers/net/iavf/iavf_hash.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index be821b6..c58566c 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -834,10 +834,22 @@ static struct rss_attr_type rss_attr_to_valid_type[] = { }; static bool -iavf_any_invalid_rss_type(uint64_t rss_type, uint64_t allow_rss_type) +iavf_any_invalid_rss_type(enum rte_eth_hash_function func, + uint64_t rss_type, uint64_t allow_rss_type) { uint32_t i; + /** + * Check if SRC/DST_ONLY is set for SYMMETRIC_TOEPLITZ + * hash function. + */ + if (func == RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) { + if (rss_type & ((VALID_RSS_ATTR & + ~RTE_ETH_RSS_L3_PRE64) | + ~(VALID_RSS_IPV4 | VALID_RSS_IPV6))) + return true; + } + /* check invalid combination */ for (i = 0; i < RTE_DIM(invalid_rss_comb); i++) { if (__builtin_popcountll(rss_type & invalid_rss_comb[i]) > 1) @@ -917,7 +929,7 @@ iavf_hash_parse_action(struct iavf_pattern_match_item *match_item, */ rss_type = rte_eth_rss_hf_refine(rss_type); - if (iavf_any_invalid_rss_type(rss_type, + if (iavf_any_invalid_rss_type(rss->func, rss_type, match_item->input_set_mask)) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, -- 2.9.5