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 ABE15A04C1; Tue, 12 Nov 2019 14:38:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B86CB2AB; Tue, 12 Nov 2019 14:38:04 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 7D4D1271 for ; Tue, 12 Nov 2019 14:38:02 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Nov 2019 05:38:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,296,1569308400"; d="scan'208";a="202693496" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga007.fm.intel.com with ESMTP; 12 Nov 2019 05:38:01 -0800 Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 12 Nov 2019 05:38:01 -0800 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 12 Nov 2019 05:37:54 -0800 Received: from shsmsx105.ccr.corp.intel.com ([169.254.11.225]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.41]) with mapi id 14.03.0439.000; Tue, 12 Nov 2019 21:37:53 +0800 From: "Zhang, Qi Z" To: "Su, Simei" , "Ye, Xiaolong" , "Yang, Qiming" CC: "dev@dpdk.org" Thread-Topic: [PATCH] net/ice: add a structure for RSS Thread-Index: AQHVmTEIfWP5GTf1TES1qwwlnopd96eHiCmw Date: Tue, 12 Nov 2019 13:37:52 +0000 Message-ID: <039ED4275CED7440929022BC67E7061153DC84E0@SHSMSX105.ccr.corp.intel.com> References: <1573546349-341486-1-git-send-email-simei.su@intel.com> In-Reply-To: <1573546349-341486-1-git-send-email-simei.su@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTkyZmU5YmMtMThmNi00NjBjLWEyODktMzc4NGZjNWUxNDcyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTWNPamVPcWFoQjJSN05tYnRnWUtWdEhRa1pBeXlFWkhKWHJUQk5oZlNadXFnb2ZYalpLVDNFTWxzUGxXb2V2OSJ9 x-ctpclassification: CTP_NT 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] net/ice: add a structure for RSS 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: Tuesday, November 12, 2019 4:12 PM > To: Zhang, Qi Z ; Ye, Xiaolong ; > Yang, Qiming > Cc: dev@dpdk.org; Su, Simei > Subject: [PATCH] net/ice: add a structure for RSS Add a structure is not the patch's purpose, we want to fix the flow destroy= issue, and we need to add a new flag (new structure) for this fix. So please change the title to "fix ...." >=20 > This patch adds a structure to include a flag to indicate if it is a simp= le_xor flow > so that it's easier to remove the config when destroying the flow. The pa= tch > also simplifies code implementation logic in ice_hash_create(). >=20 > In ice_hash_create(), whatever the hash_function is, the filter_ptr->symm= is > always 0 and when we destroy the flow, the ice_rem_rss_cfg() is never car= ried > out. So the destroy function never works well. The patch fixes this issue= and at > the same time distinguishes semanteme between simple_xor and > symmetric_toeplitz. Please put above segment at first in the commit log. >=20 > Fixes: 5ad3db8d4bdd ("net/ice: enable advanced RSS") >=20 > Signed-off-by: Simei Su > --- > drivers/net/ice/ice_hash.c | 42 +++++++++++++++++++++++-----------------= -- > 1 file changed, 23 insertions(+), 19 deletions(-) >=20 > diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c inde= x > 57e7d55..d884343 100644 > --- a/drivers/net/ice/ice_hash.c > +++ b/drivers/net/ice/ice_hash.c > @@ -41,6 +41,11 @@ struct rss_meta { > uint8_t hash_function; > }; >=20 > +struct ice_hash_flow_cfg { > + bool simple_xor; > + struct ice_rss_cfg rss_cfg; > +}; > + > static int > ice_hash_init(struct ice_adapter *ad); >=20 > @@ -452,14 +457,14 @@ struct ice_hash_match_type ice_hash_type_list[] =3D= { > struct ice_vsi *vsi =3D pf->main_vsi; > int ret; > uint32_t reg; > - struct ice_rss_cfg *filter_ptr; > + struct ice_hash_flow_cfg *filter_ptr; >=20 > uint32_t headermask =3D ((struct rss_meta *)meta)->pkt_hdr; > uint64_t hash_field =3D ((struct rss_meta *)meta)->hash_flds; > uint8_t hash_function =3D ((struct rss_meta *)meta)->hash_function; >=20 > filter_ptr =3D rte_zmalloc("ice_rss_filter", > - sizeof(struct ice_rss_cfg), 0); > + sizeof(struct ice_hash_flow_cfg), 0); > if (!filter_ptr) { > rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_HANDLE, NULL, > @@ -474,19 +479,20 @@ struct ice_hash_match_type ice_hash_type_list[] =3D= { > (2 << VSIQF_HASH_CTL_HASH_SCHEME_S); > ICE_WRITE_REG(hw, VSIQF_HASH_CTL(vsi->vsi_id), reg); >=20 > - filter_ptr->symm =3D 0; > + filter_ptr->simple_xor =3D 1; >=20 > goto out; > - } else if (hash_function =3D=3D > RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ) { > - ret =3D ice_add_rss_cfg(hw, vsi->idx, hash_field, headermask, 1); > - if (ret) { > - rte_flow_error_set(error, EINVAL, > - RTE_FLOW_ERROR_TYPE_HANDLE, NULL, > - "rss flow create fail"); > - goto error; > - } > } else { > - ret =3D ice_add_rss_cfg(hw, vsi->idx, hash_field, headermask, 0); > + filter_ptr->rss_cfg.packet_hdr =3D headermask; > + filter_ptr->rss_cfg.hashed_flds =3D hash_field; > + filter_ptr->rss_cfg.symm =3D > + (hash_function =3D=3D > + RTE_ETH_HASH_FUNCTION_SYMMETRIC_TOEPLITZ); > + > + ret =3D ice_add_rss_cfg(hw, vsi->idx, > + filter_ptr->rss_cfg.hashed_flds, > + filter_ptr->rss_cfg.packet_hdr, > + filter_ptr->rss_cfg.symm); > if (ret) { > rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_HANDLE, NULL, > @@ -495,9 +501,6 @@ struct ice_hash_match_type ice_hash_type_list[] =3D { > } > } >=20 > - filter_ptr->packet_hdr =3D headermask; > - filter_ptr->hashed_flds =3D hash_field; > - > out: > flow->rule =3D filter_ptr; > rte_free(meta); > @@ -519,11 +522,11 @@ struct ice_hash_match_type ice_hash_type_list[] =3D= { > struct ice_vsi *vsi =3D pf->main_vsi; > int ret; > uint32_t reg; > - struct ice_rss_cfg *filter_ptr; > + struct ice_hash_flow_cfg *filter_ptr; >=20 > - filter_ptr =3D (struct ice_rss_cfg *)flow->rule; > + filter_ptr =3D (struct ice_hash_flow_cfg *)flow->rule; >=20 > - if (filter_ptr->symm =3D=3D 0) { > + if (filter_ptr->simple_xor =3D=3D 1) { > /* Return to symmetric_toeplitz state. */ > reg =3D ICE_READ_REG(hw, VSIQF_HASH_CTL(vsi->vsi_id)); > reg =3D (reg & (~VSIQF_HASH_CTL_HASH_SCHEME_M)) | @@ -531,7 > +534,8 @@ struct ice_hash_match_type ice_hash_type_list[] =3D { > ICE_WRITE_REG(hw, VSIQF_HASH_CTL(vsi->vsi_id), reg); > } else { > ret =3D ice_rem_rss_cfg(hw, vsi->idx, > - filter_ptr->hashed_flds, filter_ptr->packet_hdr); > + filter_ptr->rss_cfg.hashed_flds, > + filter_ptr->rss_cfg.packet_hdr); > if (ret) { > rte_flow_error_set(error, EINVAL, > RTE_FLOW_ERROR_TYPE_HANDLE, NULL, > -- > 1.8.3.1