From patchwork Fri Apr 28 07:54:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jingjing Wu X-Patchwork-Id: 23990 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 467322C18; Fri, 28 Apr 2017 09:54:30 +0200 (CEST) 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] 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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] 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 programming 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 average 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 original code, I'm unable to tell, so I will let it up to the maintainer to decide.   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,      rte_wmb();      I40E_PCI_REG_WRITE(txq->qtx_tail, txq->tx_tail); -     for (i = 0; i < I40E_FDIR_WAIT_COUNT; i++) { -           rte_delay_us(I40E_FDIR_WAIT_INTERVAL_US); +     for (i = 0; i < (I40E_FDIR_WAIT_COUNT * I40E_FDIR_WAIT_INTERVAL_US); i++) {            if ((txdp->cmd_type_offset_bsz &                        rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) ==                        rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE))                  break; +           rte_delay_us(1);      } -     if (i >= I40E_FDIR_WAIT_COUNT) { +     if (i >= (I40E_FDIR_WAIT_COUNT * I40E_FDIR_WAIT_INTERVAL_US)) {            PMD_DRV_LOG(ERR, "Failed to program FDIR filter:"                      " time out to get DD on tx queue.");            return -ETIMEDOUT;      }      /* totally delay 10 ms to check programming status*/ -     rte_delay_us((I40E_FDIR_WAIT_COUNT - i) * I40E_FDIR_WAIT_INTERVAL_US); +  uint32_t w; +     for (w = 0; w < (I40E_FDIR_WAIT_COUNT * I40E_FDIR_WAIT_INTERVAL_US); w++) { +           if (i40e_check_fdir_programming_status(rxq) >= 0) { +                 break; +           } +           rte_delay_us(1); +     }      if (i40e_check_fdir_programming_status(rxq) < 0) {            PMD_DRV_LOG(ERR, "Failed to program FDIR filter:" -                     " programming status reported."); +                           " programming status reported.");            return -ENOSYS;      }