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 16219A09E9; Tue, 15 Dec 2020 05:36:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6880D1E2F; Tue, 15 Dec 2020 05:36:52 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id EC7CBA3 for ; Tue, 15 Dec 2020 05:36:50 +0100 (CET) IronPort-SDR: 3UgP7KgURlQeLOOdk/GYE/0QvnosVC2LLXwyBJPKAbMRkhuCLu13eblsKFnkl9LfUGdKqPP3Mf xowTO5u1rX7w== X-IronPort-AV: E=McAfee;i="6000,8403,9835"; a="174934035" X-IronPort-AV: E=Sophos;i="5.78,420,1599548400"; d="scan'208";a="174934035" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2020 20:36:48 -0800 IronPort-SDR: Z593wxDusYp6Z58Iz4tQrLfVkP/fapPWgE7e+kUlXBdAxgafxoyjFpEo2qCTAkkJFn3LRL/RfC dZ/gJ4bwZd3w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,420,1599548400"; d="scan'208";a="558565051" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga005.fm.intel.com with ESMTP; 14 Dec 2020 20:36:48 -0800 Received: from shsmsx605.ccr.corp.intel.com (10.109.6.215) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 14 Dec 2020 20:36:47 -0800 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX605.ccr.corp.intel.com (10.109.6.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 15 Dec 2020 12:36:46 +0800 Received: from shsmsx601.ccr.corp.intel.com ([10.109.6.141]) by SHSMSX601.ccr.corp.intel.com ([10.109.6.141]) with mapi id 15.01.1713.004; Tue, 15 Dec 2020 12:36:45 +0800 From: "Guo, Jia" To: "Yu, DapengX" CC: "dev@dpdk.org" , "Yu, DapengX" , "Zhang, Qi Z" Thread-Topic: [PATCH] net/ixgbe: fix fdirctrl register setting Thread-Index: AQHWz13myBxCROATL0ybNZiy+5Na66n3k5qg Date: Tue, 15 Dec 2020 04:36:45 +0000 Message-ID: <07e98f22a664460c9d3180119d034e28@intel.com> References: <20201211013506.49885-1-dapengx.yu@intel.com> In-Reply-To: <20201211013506.49885-1-dapengx.yu@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 x-originating-ip: [10.239.127.36] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/ixgbe: fix fdirctrl register setting 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, dapeng > -----Original Message----- > From: dapengx.yu@intel.com > Sent: Friday, December 11, 2020 9:35 AM > To: Guo, Jia > Cc: dev@dpdk.org; Yu, DapengX ; Zhang, Qi Z > > Subject: [PATCH] net/ixgbe: fix fdirctrl register setting >=20 > From: YU DAPENG >=20 > The function ixgbe_fdir_set_flexbytes_offset is used when create FDir rul= e > for flexbytes. It set a register: FDIRCTRL.FLEX_OFFSET, which cause that = even > if the FDir flexbytes rule is destroyed, the rule still direct the packet= and > transfer it to the wrong place. It is because Setting FDIRCTRL shall only= be > permitted on Flow Director initialization flow or Clearing the Flow Direc= tor > table, otherwise unexpected happens. In order to evade the limit, add cod= e > to make setting FDIRCTRL work without unexpected effects. >=20 > Fixes: f35fec63dde1 ("net/ixgbe: enable flex bytes for generic flow API") > Cc: qi.z.zhang@intel.com >=20 > Signed-off-by: YU DAPENG > --- > drivers/net/ixgbe/ixgbe_fdir.c | 23 +++++++++++++++++++++++ > drivers/net/ixgbe/ixgbe_flow.c | 7 +++---- > 2 files changed, 26 insertions(+), 4 deletions(-) >=20 > diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdi= r.c > index a0fab5070..56dddd56b 100644 > --- a/drivers/net/ixgbe/ixgbe_fdir.c > +++ b/drivers/net/ixgbe/ixgbe_fdir.c > @@ -503,9 +503,32 @@ ixgbe_fdir_set_flexbytes_offset(struct rte_eth_dev > *dev, > uint16_t offset) > { > struct ixgbe_hw *hw =3D IXGBE_DEV_PRIVATE_TO_HW(dev->data- > >dev_private); > + struct ixgbe_hw_fdir_info *fdir_info =3D > + IXGBE_DEV_PRIVATE_TO_FDIR_INFO(dev->data- > >dev_private); > uint32_t fdirctrl; > int i; >=20 > + if (fdir_info->flex_bytes_offset =3D=3D offset) > + return 0; > + > + fdir_info->flex_bytes_offset =3D offset; Should this value assign at the end of the polling checking? And could you kindly help to check is the timeout checking (i >=3D IXGBE_FD= IR_INIT_DONE_POLL) also need in the "ixgbe_fdir_set_flexbytes_offset"? > + > + /* /* -> /** > + * 82599 adapters flow director init flow cannot be restarted, > + * Workaround 82599 silicon errata by performing the following steps > + * before re-writing the FDIRCTRL control register with the same > value. > + * - write 1 to bit 8 of FDIRCMD register & > + * - write 0 to bit 8 of FDIRCMD register > + */ > + IXGBE_WRITE_REG(hw, IXGBE_FDIRCMD, > + (IXGBE_READ_REG(hw, IXGBE_FDIRCMD) | > + IXGBE_FDIRCMD_CLEARHT)); > + IXGBE_WRITE_FLUSH(hw); > + IXGBE_WRITE_REG(hw, IXGBE_FDIRCMD, > + (IXGBE_READ_REG(hw, IXGBE_FDIRCMD) & > + ~IXGBE_FDIRCMD_CLEARHT)); > + IXGBE_WRITE_FLUSH(hw); > + So you mean the above steps should be done before re-writing the FDIRCTRL, = just like the Flow Director initialization flow or Clearing the Flow Director, right? If so, please refine your commit log and make it more clear, since Setting = FDIRCTRL shall is not only be permitted on Flow Director initialization flow or Clearing the Flow Directo= r table. > fdirctrl =3D IXGBE_READ_REG(hw, IXGBE_FDIRCTRL); >=20 > fdirctrl &=3D ~IXGBE_FDIRCTRL_FLEX_MASK; diff --git > a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c index > 39f6ed73f..b37541d9b 100644 > --- a/drivers/net/ixgbe/ixgbe_flow.c > +++ b/drivers/net/ixgbe/ixgbe_flow.c > @@ -3137,8 +3137,6 @@ ixgbe_flow_create(struct rte_eth_dev *dev, > rte_memcpy(&fdir_info->mask, > &fdir_rule.mask, > sizeof(struct ixgbe_hw_fdir_mask)); > - fdir_info->flex_bytes_offset =3D > - fdir_rule.flex_bytes_offset; >=20 > if (fdir_rule.mask.flex_bytes_mask) > ixgbe_fdir_set_flexbytes_offset(dev, > @@ -3161,8 +3159,9 @@ ixgbe_flow_create(struct rte_eth_dev *dev, > if (ret) > goto out; >=20 > - if (fdir_info->flex_bytes_offset !=3D > - fdir_rule.flex_bytes_offset) > + if (fdir_rule.mask.flex_bytes_mask && > + (fdir_info->flex_bytes_offset !=3D Suggest you check the line align.=20 > + fdir_rule.flex_bytes_offset)) This line is the same as above. > goto out; > } > } > -- > 2.26.2.windows.1