From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 22CBF2C55 for ; Tue, 12 Dec 2017 04:40:45 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2017 19:40:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,393,1508828400"; d="scan'208";a="185863015" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga005.fm.intel.com with ESMTP; 11 Dec 2017 19:40:44 -0800 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 11 Dec 2017 19:40:44 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 11 Dec 2017 19:40:44 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.159]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Tue, 12 Dec 2017 11:40:42 +0800 From: "Xing, Beilei" To: "Rybalchenko, Kirill" , "'dev@dpdk.org'" CC: "Chilikin, Andrey" , "Wu, Jingjing" Thread-Topic: [PATCH] net/i40e: do not turn on flexible payload on driver init Thread-Index: AQHTaRFpTUUpqOXBX0upp9ntkhaf46MuGY2AgA+SP7CAAXZDIA== Date: Tue, 12 Dec 2017 03:40:41 +0000 Message-ID: <94479800C636CB44BD422CB454846E013207EA75@SHSMSX101.ccr.corp.intel.com> References: <1511960148-128836-1-git-send-email-kirill.rybalchenko@intel.com> <1512142049-122930-1-git-send-email-kirill.rybalchenko@intel.com> <94479800C636CB44BD422CB454846E013207E0DF@SHSMSX101.ccr.corp.intel.com> In-Reply-To: <94479800C636CB44BD422CB454846E013207E0DF@SHSMSX101.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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/i40e: do not turn on flexible payload on driver init 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: , X-List-Received-Date: Tue, 12 Dec 2017 03:40:46 -0000 > -----Original Message----- > From: Xing, Beilei > Sent: Monday, December 11, 2017 2:00 PM > To: Rybalchenko, Kirill ; dev@dpdk.org > Cc: Chilikin, Andrey ; Wu, Jingjing > > Subject: RE: [PATCH] net/i40e: do not turn on flexible payload on driver = init >=20 > > -----Original Message----- > > From: Rybalchenko, Kirill > > Sent: Friday, December 1, 2017 11:27 PM > > To: dev@dpdk.org > > Cc: Rybalchenko, Kirill ; Chilikin, > > Andrey ; Xing, Beilei > > ; Wu, Jingjing > > Subject: [PATCH] net/i40e: do not turn on flexible payload on driver > > init > > > > Function i40e_GLQF_reg_init() overwrites global register for flexible > > payload, forcing extraction of first 16 bytes of > > L2/L3/L4 payload to the field vector even if flexible payload is not > > used by an application. Such unconditional turn on of flexible payload > > effectively disables ability to use outer IP Destination address for > > RSS/FDIR for tunnelled packets, as flexible payload overwrites outer > > IP destination address on the field vector. > > > > Now flexible payload turned on only when flow director is enabled and > > configured. > > > > v1: > > Global registers will be set only when payload is enabled. > > They will be reset if payload is disabled or on port reset (uninit). > > > > Signed-off-by: Kirill Rybalchenko > > --- > > drivers/net/i40e/i40e_ethdev.c | 32 +++++++++++++++++++++----------- > > drivers/net/i40e/i40e_ethdev.h | 1 + > > drivers/net/i40e/i40e_fdir.c | 1 + > > 3 files changed, 23 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/net/i40e/i40e_ethdev.c > > b/drivers/net/i40e/i40e_ethdev.c index 811cc9f..d6a207f 100644 > > --- a/drivers/net/i40e/i40e_ethdev.c > > +++ b/drivers/net/i40e/i40e_ethdev.c > > @@ -701,17 +701,6 @@ RTE_PMD_REGISTER_KMOD_DEP(net_i40e, "* > igb_uio | > > uio_pci_generic | vfio-pci"); static inline void > > i40e_GLQF_reg_init(struct i40e_hw *hw) { > > /* > > - * Force global configuration for flexible payload > > - * to the first 16 bytes of the corresponding L2/L3/L4 paylod. > > - * This should be removed from code once proper > > - * configuration API is added to avoid configuration conflicts > > - * between ports of the same device. > > - */ > > - I40E_WRITE_REG(hw, I40E_GLQF_ORT(33), 0x000000E0); > > - I40E_WRITE_REG(hw, I40E_GLQF_ORT(34), 0x000000E3); > > - I40E_WRITE_REG(hw, I40E_GLQF_ORT(35), 0x000000E6); > > - > > - /* > > * Initialize registers for parsing packet type of QinQ > > * This should be removed from code once proper > > * configuration API is added to avoid configuration conflicts @@ - > > 1435,6 +1424,24 @@ i40e_rm_fdir_filter_list(struct i40e_pf *pf) > > } > > } > > > > +void i40e_flex_payload_reg_cfg(struct i40e_hw *hw, bool enable) { > > + if (enable) { > > + /* > > + * Set global configuration for flexible payload > > + * to the first 16 bytes of the corresponding L2/L3/L4 paylod. > > + */ > > + I40E_WRITE_REG(hw, I40E_GLQF_ORT(33), 0x000000E0); > > + I40E_WRITE_REG(hw, I40E_GLQF_ORT(34), 0x000000E3); > > + I40E_WRITE_REG(hw, I40E_GLQF_ORT(35), 0x000000E6); > > + } else { > > + /* Disable flexible payload in global configuration */ > > + I40E_WRITE_REG(hw, I40E_GLQF_ORT(33), 0x00000000); > > + I40E_WRITE_REG(hw, I40E_GLQF_ORT(34), 0x00000000); > > + I40E_WRITE_REG(hw, I40E_GLQF_ORT(35), 0x00000000); >=20 > I'm not sure if 0 is the default value for the three registers, just remi= nd to > check the value in FW first. >=20 > > + } > > +} > > + > > static int > > eth_i40e_dev_uninit(struct rte_eth_dev *dev) { @@ -1478,6 +1485,9 @@ > > eth_i40e_dev_uninit(struct rte_eth_dev *dev) > > hw->fc.requested_mode =3D I40E_FC_NONE; > > i40e_set_fc(hw, &aq_fail, TRUE); > > > > + /* Disable flexible payload in global configuration */ > > + i40e_flex_payload_reg_cfg(hw, false); > > + >=20 > How about moving it to dev_close and also adding disable flexible payload= in > dev_init function? > Guarantee flexible payload is disabled during the next launch if applicat= ion > quits in unexpected way. >=20 > > /* uninitialize pf host driver */ > > i40e_pf_host_uninit(dev); > > > > diff --git a/drivers/net/i40e/i40e_ethdev.h > > b/drivers/net/i40e/i40e_ethdev.h index cd67453..2cbe9cb 100644 > > --- a/drivers/net/i40e/i40e_ethdev.h > > +++ b/drivers/net/i40e/i40e_ethdev.h > > @@ -1198,6 +1198,7 @@ int i40e_dcb_init_configure(struct rte_eth_dev > > *dev, bool sw_dcb); int i40e_flush_queue_region_all_conf(struct > > rte_eth_dev *dev, > > struct i40e_hw *hw, struct i40e_pf *pf, uint16_t on); void > > i40e_init_queue_region_conf(struct rte_eth_dev *dev); > > +void i40e_flex_payload_reg_cfg(struct i40e_hw *hw, bool enable); > > > > #define I40E_DEV_TO_PCI(eth_dev) \ > > RTE_DEV_TO_PCI((eth_dev)->device) > > diff --git a/drivers/net/i40e/i40e_fdir.c > > b/drivers/net/i40e/i40e_fdir.c index 3d7170d..0ae8fbd 100644 > > --- a/drivers/net/i40e/i40e_fdir.c > > +++ b/drivers/net/i40e/i40e_fdir.c > > @@ -671,6 +671,7 @@ i40e_fdir_configure(struct rte_eth_dev *dev) > > return -EINVAL; > > } > > /* configure flex payload */ > > + i40e_flex_payload_reg_cfg(hw, !!conf->nb_payloads); Besides, I don't think it's the right place to configure flexible payload h= ere.=20 When use rte_flow API to create a FDIR flow with flexible payload, flow_dir= ector_flex_payload CLI is not needed, then the configuration will be failed= to set. > > for (i =3D 0; i < conf->nb_payloads; i++) > > i40e_set_flx_pld_cfg(pf, &conf->flex_set[i]); > > /* configure flex mask*/ > > -- > > 2.5.5