From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 6A2392935 for ; Fri, 28 Apr 2017 09:54:28 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Apr 2017 00:54:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,387,1488873600"; d="scan'208";a="850740611" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 28 Apr 2017 00:54:27 -0700 Received: from fmsmsx123.amr.corp.intel.com (10.18.125.38) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 28 Apr 2017 00:54:27 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx123.amr.corp.intel.com (10.18.125.38) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 28 Apr 2017 00:54:26 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.117]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.224]) with mapi id 14.03.0319.002; Fri, 28 Apr 2017 15:54:23 +0800 From: "Wu, Jingjing" To: Michael Lilja , "elin.zhang@intel.com" CC: "dev@dpdk.org" Thread-Topic: [PATCH] drivers/net/i40e/i40e_fdir.c: Improved i40e FDIR programming times Thread-Index: AdK+fF9XJzhS+qx4RkaCMtW6n3fwzABd9DqA Date: Fri, 28 Apr 2017 07:54:23 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810D59F5B@SHSMSX103.ccr.corp.intel.com> References: In-Reply-To: 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] drivers/net/i40e/i40e_fdir.c: Improved i40e FDIR programming times 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: Fri, 28 Apr 2017 07:54:29 -0000 Hi, Lijia Thanks for the patch? Are you using git send-email. The mail is html format, not friendly to discuss by mail thread. About the change, just one comments: >+ uint32_t w; Could you move it above? Thanks From: Michael Lilja [mailto:ml@napatech.com]=20 Sent: Wednesday, April 26, 2017 7:15 PM To: elin.zhang@intel.com; Wu, Jingjing Cc: dev@dpdk.org Subject: [PATCH] drivers/net/i40e/i40e_fdir.c: Improved i40e FDIR programmi= ng times During my work (https://www.napatech.com/hw-acceleration-via-rte_flow/)on a= flowtable application example that use rte_flow I discovered that the rte_= flow programming times on a i40e was +11ms. The patch below result in an av= erage programming time of 22usec with a max of 60usec instead of +11ms. Could the following patch be useful? There might be a good reason for the o= riginal code, I'm unable to tell, so I will let it up to the maintainer to = decide. =A0 Signed-off-by: Michael Lilja --- drivers/net/i40e/i40e_fdir.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c index 28cc554f5..a1ec66063 100644 --- a/drivers/net/i40e/i40e_fdir.c +++ b/drivers/net/i40e/i40e_fdir.c @@ -1296,23 +1296,29 @@ i40e_fdir_filter_programming(struct i40e_pf *pf, =A0=A0=A0=A0 rte_wmb(); =A0=A0=A0=A0 I40E_PCI_REG_WRITE(txq->qtx_tail, txq->tx_tail); -=A0=A0=A0=A0 for (i =3D 0; i < I40E_FDIR_WAIT_COUNT; i++) { -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_delay_us(I40E_FDIR_WAIT_INTERVAL_US); +=A0=A0=A0=A0 for (i =3D 0; i < (I40E_FDIR_WAIT_COUNT * I40E_FDIR_WAIT_INTE= RVAL_US); i++) { =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if ((txdp->cmd_type_offset_bsz & =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_cpu_= to_le_64(I40E_TXD_QW1_DTYPE_MASK)) =3D=3D =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_cpu_= to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE)) =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 break; +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_delay_us(1); =A0=A0=A0=A0 } -=A0=A0=A0=A0 if (i >=3D I40E_FDIR_WAIT_COUNT) { +=A0=A0=A0=A0 if (i >=3D (I40E_FDIR_WAIT_COUNT * I40E_FDIR_WAIT_INTERVAL_US= )) { =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 PMD_DRV_LOG(ERR, "Failed to program FDIR fil= ter:" =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0" time out to = get DD on tx queue."); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -ETIMEDOUT; =A0=A0=A0=A0 } =A0=A0=A0=A0 /* totally delay 10 ms to check programming status*/ -=A0=A0=A0=A0 rte_delay_us((I40E_FDIR_WAIT_COUNT - i) * I40E_FDIR_WAIT_INTE= RVAL_US); +=A0 uint32_t w; +=A0=A0=A0=A0 for (w =3D 0; w < (I40E_FDIR_WAIT_COUNT * I40E_FDIR_WAIT_INTE= RVAL_US); w++) { +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 if (i40e_check_fdir_programming_status(rxq)= >=3D 0) { +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 break; +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 } +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 rte_delay_us(1); +=A0=A0=A0=A0 } =A0=A0=A0=A0 if (i40e_check_fdir_programming_status(rxq) < 0) { =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 PMD_DRV_LOG(ERR, "Failed to program FDIR fil= ter:" -=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0 " programming s= tatus reported."); +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =A0=A0= =A0 " programming status reported."); =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 return -ENOSYS; =A0=A0=A0=A0 } --=20 Disclaimer: This email and any files transmitted with it may contain confid= ential information intended for the addressee(s) only. The information is n= ot to be surrendered or copied to unauthorized persons. If you have receive= d this communication in error, please notify the sender immediately and del= ete this e-mail from your system.=20