From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 13CB0A0C43; Fri, 24 Sep 2021 07:42:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 08D57412B7; Fri, 24 Sep 2021 07:42:36 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 2BE7140142; Fri, 24 Sep 2021 07:42:34 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10116"; a="223649440" X-IronPort-AV: E=Sophos;i="5.85,319,1624345200"; d="scan'208";a="223649440" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2021 22:42:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,319,1624345200"; d="scan'208";a="485274537" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga008.jf.intel.com with ESMTP; 23 Sep 2021 22:42:33 -0700 Received: from shsmsx604.ccr.corp.intel.com (10.109.6.214) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 23 Sep 2021 22:42:32 -0700 Received: from shsmsx601.ccr.corp.intel.com (10.109.6.141) by SHSMSX604.ccr.corp.intel.com (10.109.6.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 24 Sep 2021 13:42:30 +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.2242.012; Fri, 24 Sep 2021 13:42:30 +0800 From: "Zhang, Qi Z" To: Qiming Chen , "dev@dpdk.org" CC: "Xing, Beilei" , "Wu, Jingjing" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/iavf: fix frequent command interaction leads to high cpu Thread-Index: AQHXpsH7IRuoZlvQwkCeNRF/eHwPaauyv79Q Date: Fri, 24 Sep 2021 05:42:30 +0000 Message-ID: <6d80c69e10de4299a9e0a7bcb4194b0d@intel.com> References: <20210911040221.3681-1-chenqiming_huawei@163.com> In-Reply-To: <20210911040221.3681-1-chenqiming_huawei@163.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.200.16 dlp-product: dlpe-windows 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/iavf: fix frequent command interaction leads to high cpu X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" > -----Original Message----- > From: dev On Behalf Of Qiming Chen > Sent: Saturday, September 11, 2021 12:02 PM > To: dev@dpdk.org > Cc: Xing, Beilei ; Wu, Jingjing ; > Qiming Chen ; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] net/iavf: fix frequent command interaction le= ads > to high cpu >=20 > There is currently a scenario test, which will continuously obtain port s= tatistics, > causing the CPU usage to soar, which does not meet the demand. After > positioning analysis, it is found that the vf and pf command interaction = is > completed through the iavf_execute_vf_cmd function. > After the message is sent, it needs to wait for the interrupt thread to o= btain > the response from the PF. For the data, the rte_delay_ms interface is use= d here > to wait, but the CPU will not be released during the waiting period of th= is > interface, which will cause the statistics to keep occupying the CPU. Thi= s is also > the root cause of the soaring cpu. > The command interaction should belong to the control plane, and there wil= l > not be too high requirements for performance. It is recommended to wait f= or > the interface iavf_msec_delay to complete without taking up the CPU time. >=20 > Fixes: 22b123a36d07 ("net/avf: initialize PMD") > Cc: stable@dpdk.org >=20 > Signed-off-by: Qiming Chen Acked-by: Qi Zhang Applied to dpdk-next-net-intel. Thanks Qi > --- > drivers/net/iavf/iavf_vchnl.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.= c index > 06dc663947..2f39c2077c 100644 > --- a/drivers/net/iavf/iavf_vchnl.c > +++ b/drivers/net/iavf/iavf_vchnl.c > @@ -181,7 +181,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, > struct iavf_cmd_info *args) > args->out_buffer); > if (result =3D=3D IAVF_MSG_CMD) > break; > - rte_delay_ms(ASQ_DELAY_MS); > + iavf_msec_delay(ASQ_DELAY_MS); > } while (i++ < MAX_TRY_TIMES); > if (i >=3D MAX_TRY_TIMES || > vf->cmd_retval !=3D VIRTCHNL_STATUS_SUCCESS) { @@ -207,7 > +207,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct > iavf_cmd_info *args) > err =3D -1; > break; > } > - rte_delay_ms(ASQ_DELAY_MS); > + iavf_msec_delay(ASQ_DELAY_MS); > /* If don't read msg or read sys event, continue */ > } while (i++ < MAX_TRY_TIMES); > if (i >=3D MAX_TRY_TIMES || > @@ -225,7 +225,7 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, > struct iavf_cmd_info *args) > do { > if (vf->pend_cmd =3D=3D VIRTCHNL_OP_UNKNOWN) > break; > - rte_delay_ms(ASQ_DELAY_MS); > + iavf_msec_delay(ASQ_DELAY_MS); > /* If don't read msg or read sys event, continue */ > } while (i++ < MAX_TRY_TIMES); >=20 > -- > 2.30.1.windows.1