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 B64F9A0540; Wed, 15 Jul 2020 16:13:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DBDDD1B75C; Wed, 15 Jul 2020 16:13:19 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 9F6D54C8A for ; Wed, 15 Jul 2020 16:13:17 +0200 (CEST) IronPort-SDR: hmW+OGB3R7q1QdSdtUl7IG26PiVeYp4PGoYc+CDP5NaWouBIV3Ap1YuT1fsJzJmCeRgfefuD3A QgJNzOYuDc3A== X-IronPort-AV: E=McAfee;i="6000,8403,9682"; a="136606587" X-IronPort-AV: E=Sophos;i="5.75,355,1589266800"; d="scan'208";a="136606587" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jul 2020 07:13:16 -0700 IronPort-SDR: uWfJ3G0vODxeWac7oD1YxLhUdOFm0igsVOCt7lICSYnMrzRHc7FxMbX2iQOIe4MsO8QP9BpusS /wne9XqN4OOQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,355,1589266800"; d="scan'208";a="268966513" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga007.fm.intel.com with ESMTP; 15 Jul 2020 07:13:16 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 15 Jul 2020 07:13:15 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 15 Jul 2020 07:13:14 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.22]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.49]) with mapi id 14.03.0439.000; Wed, 15 Jul 2020 22:13:11 +0800 From: "Zhang, Qi Z" To: "Su, Simei" CC: "dev@dpdk.org" , "Guo, Junfeng" , "Guo, Jia" , "Xu, Ting" Thread-Topic: [PATCH v4] net/ice: fix invalid RSS type Thread-Index: AQHWWpLC+Gyb6CPQ60C4ZJ2rrNEDPakIrDcg Date: Wed, 15 Jul 2020 14:13:10 +0000 Message-ID: <039ED4275CED7440929022BC67E706115485D6EC@SHSMSX103.ccr.corp.intel.com> References: <1594476064-366701-1-git-send-email-simei.su@intel.com> <1594808751-138882-1-git-send-email-simei.su@intel.com> In-Reply-To: <1594808751-138882-1-git-send-email-simei.su@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4] net/ice: 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" > -----Original Message----- > From: Su, Simei > Sent: Wednesday, July 15, 2020 6:26 PM > To: Zhang, Qi Z > Cc: dev@dpdk.org; Guo, Junfeng ; Guo, Jia > ; Xu, Ting ; Su, Simei > > Subject: [PATCH v4] net/ice: fix invalid RSS type >=20 > When a RSS rule with only SRC/DST_ONLY or IPV6 prefix RSS type, it should > return failure. Besides, when a RSS rule with symmetric hash function, th= e RSS > type shouldn't carry with SRC/DST_ONLY. > This patch adds invalid RSS type check for the two cases. >=20 > Fixes: dfdc589f6ee0 ("net/ice: refactor PF hash flow") >=20 > Signed-off-by: Simei Su > --- >=20 > v4: > * Modify check logic for symmetric case. >=20 > v3: > * Add invalid RSS type check for symmetric case. > * Consider IPV6 prefix. > * Refine commit log. >=20 > v2: > * Add specific macro value in check rather than hard code. > --- > drivers/net/ice/ice_hash.c | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) >=20 > diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c inde= x > e57feff..009ea1f 100644 > --- a/drivers/net/ice/ice_hash.c > +++ b/drivers/net/ice/ice_hash.c > @@ -1049,13 +1049,41 @@ struct ice_hash_match_type ice_hash_type_list[] = =3D > { > combine_type =3D ETH_RSS_L2_SRC_ONLY | > ETH_RSS_L2_DST_ONLY | > RTE_ETH_RSS_L3_PRE32 | > + RTE_ETH_RSS_L3_PRE40 | > RTE_ETH_RSS_L3_PRE48 | > + RTE_ETH_RSS_L3_PRE56 | > RTE_ETH_RSS_L3_PRE64 | > + RTE_ETH_RSS_L3_PRE96 | > ETH_RSS_L3_SRC_ONLY | > ETH_RSS_L3_DST_ONLY | > ETH_RSS_L4_SRC_ONLY | > ETH_RSS_L4_DST_ONLY; Do we support 48, 56 and 96? Will they already be rejected during previous= check? Better to refactor the code to avoid duplicate, for example: rss_attr_src_dst =3D ETH_RSS_L2_DST_ONLY | ETH_RSS_L2_SRC_ONLY.... rss_attr_l3_pre =3D ETH_RSS_L3_PRE32 | PRE_40 | ... rss_attr_all =3D rss_attr_v6_prefix | rss_attr_src_dst >=20 > + /* Check if only SRC/DST_ONLY or ipv6 prefix exists. */ > + if ((rss_type & ~combine_type) =3D=3D 0) > + return rte_flow_error_set(error, ENOTSUP, > + RTE_FLOW_ERROR_TYPE_ACTION, action, > + "invalid rss types"); > + > + /** > + * Check if SRC/DST_ONLY is set for SYMMETRIC_TOEPLITZ > + * hash function. > + */ > + if (rss->func =3D=3D > + RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) { > + if (rss_type & (ETH_RSS_L2_SRC_ONLY | > + ETH_RSS_L2_DST_ONLY | > + ETH_RSS_L3_SRC_ONLY | > + ETH_RSS_L3_DST_ONLY | > + ETH_RSS_L4_SRC_ONLY | > + ETH_RSS_L4_DST_ONLY)) > + return rte_flow_error_set(error, > + ENOTSUP, > + RTE_FLOW_ERROR_TYPE_ACTION, > + action, > + "invalid rss types"); > + } > + > /* Check if rss types match pattern. */ > if (rss_type & ~combine_type & ~m->eth_rss_hint) { > return rte_flow_error_set(error, > -- > 1.8.3.1