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 1FB1DA058E; Thu, 26 Mar 2020 03:00:55 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8B5FA1B75C; Thu, 26 Mar 2020 03:00:52 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 0A83F3B5; Thu, 26 Mar 2020 03:00:49 +0100 (CET) IronPort-SDR: Hkm6xnXutHaTUf3CnhULIuIrgUp8ffJu25EizkgRPByWeWZx2WMUcIG88KPmgQGd5xF1Db9jPy /gUXmEcN8HfA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 19:00:48 -0700 IronPort-SDR: sJ9UikqqF3mJa6IdXDjobNpSGTslU6jBF8MBD8zjHtags8b9DOEokG3p880p4J/Gdac5Lai/KQ j/6UKKV5TuVg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,306,1580803200"; d="scan'208";a="236118762" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by orsmga007.jf.intel.com with ESMTP; 25 Mar 2020 19:00:48 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Mar 2020 19:00:48 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Wed, 25 Mar 2020 19:00:47 -0700 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Wed, 25 Mar 2020 19:00:47 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.101) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 25 Mar 2020 19:00:45 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KKOqSsjE9QcWeRSTVZMlWNII+XMKRHFwTHR/jLfeRfb1frkbdSi3aN0Y/FNXzuxHo3Pp+OhdCcLNjDX1nBiv+Y5dAXACG55UGz7m+6WXpVMVl8ayrBkfo744TK3ShskPWxAC3NwuJCXpba76S6bzJeD5kDT5WKanZr4V767GYwS8RF5kHidYdAcWdX8u4bfIgSHCrTSfJy0go2Gpn4plF5roo8Ol8ctQ2RC0ueASFlUqmq6UdONRoo8P4zZ4Qmt3qnMv6tZZ5MAdL56Ivy/2AuiYLB3wDR2pXVmYBQbvsDyDYh5CEKHdGkE+CpOiQ/apx+3JzSW1WIluG83Ba1wmFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=odQKUO7l6V98PrPKmp4YFd3b9wvDmw+87dSrhdCibPw=; b=b/lgA7S/pWzzhOfjGwylGL7mV5WIZnQW0/TpryD+IjaTvEndL9o40wMSjRJRRH/mYuAnUmcYuK9QfgKVNRptDh/DDy8Ndn8IFAAaDkak6qqKiu9+liUlPeMo0TtZomMi8W3T+4gsdFm2grg3yuol+OeGwrrmSjnjGzhGx1ERy27beBsccijlyy5yKZVTmiKzscwKmenHfhN/O8KY6ulFwkwH1c7ArBqJzKJOi87CcY4FmesEwj5xJmBnhMi7CfOnG0y05NaFj8BOXEf3pfVTisgWE+l+yEpEJ598+rJ8P5WHCoM8S0MQiEiyXHK/CtiTbhbJGMnOsdzg+JuZpHaNqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=odQKUO7l6V98PrPKmp4YFd3b9wvDmw+87dSrhdCibPw=; b=ztUPrI/aypxobAahszm0+Pri4w8GcV8QRsI0+iu0IS+OpQv9AXYGOTN2JtLXPpJDCSC/1VZBNj3zkgZtL5OhrvzanmQwKmd9W/WjG8ji6fh5nnxi6f9VgYgPWPzWFJj+QrMQeagUKjXM0WGh4K/5vvWXJhTreHs17BXyWleAgM4= Received: from MN2PR11MB3582.namprd11.prod.outlook.com (2603:10b6:208:ec::28) by MN2PR11MB4143.namprd11.prod.outlook.com (2603:10b6:208:137::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.22; Thu, 26 Mar 2020 02:00:41 +0000 Received: from MN2PR11MB3582.namprd11.prod.outlook.com ([fe80::f091:55f5:2e58:8b26]) by MN2PR11MB3582.namprd11.prod.outlook.com ([fe80::f091:55f5:2e58:8b26%6]) with mapi id 15.20.2835.021; Thu, 26 Mar 2020 02:00:41 +0000 From: "Yang, Qiming" To: "Jiang, JunyuX" , "dev@dpdk.org" CC: "Zhang, Qi Z" , "stable@dpdk.org" Thread-Topic: [PATCH] net/ice: fix RSS advanced rule invalid issue Thread-Index: AQHV/cQcim70M9aomEy+1bwrMqd+V6haJoUw Date: Thu, 26 Mar 2020 02:00:41 +0000 Message-ID: References: <20200319074825.16035-1-junyux.jiang@intel.com> In-Reply-To: <20200319074825.16035-1-junyux.jiang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=qiming.yang@intel.com; x-originating-ip: [192.102.204.36] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 76fd55b8-e942-4e25-8ff7-08d7d1297ce4 x-ms-traffictypediagnostic: MN2PR11MB4143: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1775; x-forefront-prvs: 0354B4BED2 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(366004)(136003)(346002)(396003)(376002)(2906002)(86362001)(4326008)(450100002)(316002)(71200400001)(33656002)(26005)(5660300002)(186003)(66476007)(66556008)(66946007)(76116006)(64756008)(110136005)(66446008)(9686003)(53546011)(6506007)(52536014)(8676002)(81156014)(81166006)(478600001)(54906003)(7696005)(8936002)(55016002); DIR:OUT; SFP:1102; SCL:1; SRVR:MN2PR11MB4143; H:MN2PR11MB3582.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: MLMXV8fA/9rQ36M2tdyV9ci/ohfuSmpe4Qe7kLjruS2e3QQpjDsyau8s7GcNf51R8DjKyGXhSEnCS1dzHJtCc7+ouVLcIc/4ByiEsOl/KZi4Ohp63Qtu8zx/Y80WMkOIPmVgCXBmAXZeygi98AZL0tKrgEom9qrz2AHpyPZ9A3PCjdacT6QPrOw3vYEa1iLv6jour1knhQNhcY2SP2McSKthSdCPD6qHBUnpkX6lJ/O6LNT6uMfy2fNRg4tCqQcCrIXp4EhGkI7FendE9LHmlI+PxBPGZ2NmE2KHPsyrhRgPdNOZPmvnhLmPwrETKRFROeF9BVp4+RrWuQagKpdAUS3o5bLd+sFRjeJ4DQFzEkp8lPbbLXUrT3NOuDKHZ+vSppGlRcE4DK7ZqW751bJc7jUrRWhNs7ZhK3SqRukx+7XEtL+uaWObo7hqiP5t5FdA x-ms-exchange-antispam-messagedata: k66GqcTMX6c1SaDl7YRxhtZsqeF+FkZ+4irOUOVBZXKM8BPBL8NIiyuBr134YL05zxyqQ1EQcp80W/U3bEgckgxK9FlnezbwZPCPtFYYbV14CFtrrNJx5ghlt9/VGaUPPZCKTLSWE1UHzl3rXD3+8w== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 76fd55b8-e942-4e25-8ff7-08d7d1297ce4 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2020 02:00:41.4093 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: uZ/cOTcJ4henFixVvE9QWiI/3UGh3UrQlUtvT1aA+8/i8r+HbsSyy0wM8OFPA53j5v+65k2kxrLlnBrfbee65w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB4143 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] net/ice: fix RSS advanced rule invalid issue 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" Hi, Junyu Comments inline. And I have a proposal, why we don't put ice_rss_init into ice_dev_init, so = the rss rule will not recovery. Qiming > -----Original Message----- > From: Jiang, JunyuX > Sent: Thursday, March 19, 2020 15:48 > To: dev@dpdk.org > Cc: Yang, Qiming ; Zhang, Qi Z > ; Jiang, JunyuX ; > stable@dpdk.org > Subject: [PATCH] net/ice: fix RSS advanced rule invalid issue >=20 > This patch added a restore function of RSS advanced rule to fix the rule I think it should be 'for RSS advanced rule' > invalid when after running port stop and port start. Delete 'when' >=20 > Fixes: 5ad3db8d4bdd ("net/ice: enable advanced RSS") > Cc: stable@dpdk.org >=20 > Signed-off-by: Junyu Jiang > --- > drivers/net/ice/ice_ethdev.c | 47 > ++++++++++++++++++++++++++++++++++++ > 1 file changed, 47 insertions(+) >=20 > diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c > index 85ef83e92..2dd8120f1 100644 > --- a/drivers/net/ice/ice_ethdev.c > +++ b/drivers/net/ice/ice_ethdev.c > @@ -47,6 +47,11 @@ struct proto_xtr_ol_flag { > bool required; > }; >=20 > +struct ice_hash_flow_cfg { > + bool simple_xor; Why not an enum for the algorithm? > + struct ice_rss_cfg rss_cfg; > +}; > + > static struct proto_xtr_ol_flag ice_proto_xtr_ol_flag_params[] =3D { > [PROTO_XTR_VLAN] =3D { > .param =3D { .name =3D "ice_dynflag_proto_xtr_vlan" }, @@ - > 2464,6 +2469,45 @@ ice_dev_configure(struct rte_eth_dev *dev) > return 0; > } >=20 > +static int > +ice_rss_restore(struct rte_eth_dev *dev) { > + struct ice_pf *pf =3D ICE_DEV_PRIVATE_TO_PF(dev->data- > >dev_private); > + struct ice_hw *hw =3D ICE_PF_TO_HW(pf); Please use the same function as PF, like DEV_TO_PF > + struct ice_vsi *vsi =3D pf->main_vsi; > + struct rte_flow *p_flow; > + struct ice_hash_flow_cfg *filter_ptr; What's the ptr means? > + struct ice_flow_engine *engine; > + uint32_t reg; > + int ret; > + > + TAILQ_FOREACH(p_flow, &pf->flow_list, node) { > + engine =3D p_flow->engine; > + if (engine->type =3D=3D ICE_FLOW_ENGINE_HASH) { > + filter_ptr =3D (struct ice_hash_flow_cfg *)p_flow->rule; > + /* Enable registers for simple_xor hash function. */ > + if (filter_ptr->simple_xor =3D=3D 1) { > + reg =3D ICE_READ_REG(hw, > + VSIQF_HASH_CTL(vsi->vsi_id)); > + reg =3D (reg & > (~VSIQF_HASH_CTL_HASH_SCHEME_M)) | > + (2 << > VSIQF_HASH_CTL_HASH_SCHEME_S); > + ICE_WRITE_REG(hw, > + VSIQF_HASH_CTL(vsi->vsi_id), reg); > + } else { > + 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) > + PMD_DRV_LOG(ERR, > + "%s restore rss fail %d", > + __func__, ret); > + } > + } > + } > + return 0; > +} > + > static int ice_init_rss(struct ice_pf *pf) { > struct ice_hw *hw =3D ICE_PF_TO_HW(pf); > @@ -2591,6 +2635,9 @@ static int ice_init_rss(struct ice_pf *pf) > PMD_DRV_LOG(ERR, "%s PPPoE/PPPoD_SessionID rss flow > fail %d", > __func__, ret); >=20 > + /* restore RSS configuration */ > + ice_rss_restore(dev); > + > return 0; > } >=20 > -- > 2.17.1