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 DE9F3A09FF; Mon, 28 Dec 2020 03:32:44 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B6E362BA2; Mon, 28 Dec 2020 03:32:42 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 5EE0E2B94 for ; Mon, 28 Dec 2020 03:32:41 +0100 (CET) IronPort-SDR: Ub01S+/ENEGrXm8dw5RDyLekxX8LoiEPt19jYIDNvoc3Dl3lvXbyMEKVAAxN5lzuJLgPe7CA2g hYBngruR1IjQ== X-IronPort-AV: E=McAfee;i="6000,8403,9847"; a="163399045" X-IronPort-AV: E=Sophos;i="5.78,453,1599548400"; d="scan'208";a="163399045" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2020 18:32:39 -0800 IronPort-SDR: HskeueAflOaGuK8oQJjS5V0p+Cgk9WemswIVD1matLggNMNS3gbpqO5jG6G7yRWyCtYKfIoC2V LeHvm90ZVqbQ== X-IronPort-AV: E=Sophos;i="5.78,453,1599548400"; d="scan'208";a="375446653" Received: from unknown (HELO intel-npg-odc-srv02.cd.intel.com) ([10.240.178.186]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2020 18:32:35 -0800 From: Murphy Yang To: dev@dpdk.org Cc: qiming.yang@intel.com, jia.guo@intel.com, qi.z.zhang@intel.com, stevex.yang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com, Murphy Yang Date: Mon, 28 Dec 2020 02:28:36 +0000 Message-Id: <20201228022836.41870-1-murphyx.yang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201224022044.84292-1-murphyx.yang@intel.com> References: <20201224022044.84292-1-murphyx.yang@intel.com> Subject: [dpdk-dev] [PATCH v6] net/iavf: fix invalid RSS combinations rule can be created 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" Currently, when use 'flow' command to create a rule that combine with several RSS types, even the RSS type combination is invalid or unsupported, it also be created successfully. Here list some invalid RSS combinations: - ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP - ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP Here list some currently unsupported RSS combinations: - ETH_RSS_GTPU | ETH_RSS_IPV4 - ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP - ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP - ETH_RSS_GTPU | ETH_RSS_IPV6 - ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP - ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP For invalid RSS combinations, this patch adds these combinations in 'invalid_rss_comb' array to do valid check, if the combination check failed, the rule will be created unsuccessful. For unsupported RSS combinations, this patch adds these combinations in 'unsupported_rss_comb' array to do valid check, if the combination check failed, the rule will be created unsuccessful. Fixes: 91f27b2e39ab ("net/iavf: refactor RSS") Signed-off-by: Murphy Yang --- v6: - add unsupported RSS combinations array. v5: - remove 'ETH_RSS_GTPU' from input set mask. v4: - use 'ETH_RSS_XXX' replace 'IAVF_RSS_TYPE_INNER_XXX' v3: - update the comments. v2: - add invalid RSS combinations. drivers/net/iavf/iavf_hash.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/net/iavf/iavf_hash.c b/drivers/net/iavf/iavf_hash.c index c4c73e6644..0061eb6652 100644 --- a/drivers/net/iavf/iavf_hash.c +++ b/drivers/net/iavf/iavf_hash.c @@ -806,12 +806,23 @@ static void iavf_refine_proto_hdrs(struct virtchnl_proto_hdrs *proto_hdrs, static uint64_t invalid_rss_comb[] = { ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP, + ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP, ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP, + ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP, RTE_ETH_RSS_L3_PRE32 | RTE_ETH_RSS_L3_PRE40 | RTE_ETH_RSS_L3_PRE48 | RTE_ETH_RSS_L3_PRE56 | RTE_ETH_RSS_L3_PRE96 }; +static uint64_t unsupported_rss_comb[] = { + ETH_RSS_GTPU | ETH_RSS_IPV4, + ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_UDP, + ETH_RSS_GTPU | ETH_RSS_IPV4 | ETH_RSS_NONFRAG_IPV4_TCP, + ETH_RSS_GTPU | ETH_RSS_IPV6, + ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_UDP, + ETH_RSS_GTPU | ETH_RSS_IPV6 | ETH_RSS_NONFRAG_IPV6_TCP +}; + struct rss_attr_type { uint64_t attr; uint64_t type; @@ -875,6 +886,13 @@ iavf_any_invalid_rss_type(enum rte_eth_hash_function rss_func, return true; } + /* check unsupported rss combination */ + for (i = 0; i < RTE_DIM(unsupported_rss_comb); i++) { + if (__builtin_popcountll(rss_type & + unsupported_rss_comb[i]) > 1) + return true; + } + /* check invalid RSS attribute */ for (i = 0; i < RTE_DIM(rss_attr_to_valid_type); i++) { struct rss_attr_type *rat = &rss_attr_to_valid_type[i]; -- 2.17.1