From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id CA53A1BC51 for ; Thu, 12 Apr 2018 15:12:11 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2018 06:12:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,441,1517904000"; d="scan'208";a="32153971" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.51]) by fmsmga008.fm.intel.com with SMTP; 12 Apr 2018 06:12:06 -0700 Received: by (sSMTP sendmail emulation); Thu, 12 Apr 2018 14:12:05 +0100 Date: Thu, 12 Apr 2018 14:12:05 +0100 From: Bruce Richardson To: "Zhang, Qi Z" Cc: "Ananyev, Konstantin" , "Chen, Junjie J" , "Xing, Beilei" , "dev@dpdk.org" , "Chen@dpdk.org" Message-ID: <20180412131205.GA49540@bricha3-MOBL.ger.corp.intel.com> References: <20180412053226.295226-1-junjie.j.chen@intel.com> <2601191342CEEE43887BDE71AB977258AE9143FC@IRSMSX102.ger.corp.intel.com> <039ED4275CED7440929022BC67E7061153190506@SHSMSX103.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <039ED4275CED7440929022BC67E7061153190506@SHSMSX103.ccr.corp.intel.com> Organization: Intel Research and Development Ireland Ltd. User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH] net/i40e: update tx_free_threshold to improve zero copy performance 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: Thu, 12 Apr 2018 13:12:13 -0000 On Thu, Apr 12, 2018 at 12:20:07PM +0000, Zhang, Qi Z wrote: > Hi Junjie: > > > -----Original Message----- > > From: Ananyev, Konstantin > > Sent: Thursday, April 12, 2018 7:52 PM > > To: Chen, Junjie J ; Xing, Beilei > > ; Zhang, Qi Z > > Cc: dev@dpdk.org; Chen, Junjie J ; Chen@dpdk.org > > Subject: RE: [dpdk-dev] [PATCH] net/i40e: update tx_free_threshold to > > improve zero copy performance > > > > > > > > > -----Original Message----- > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Junjie Chen > > > Sent: Thursday, April 12, 2018 6:32 AM > > > To: Xing, Beilei ; Zhang, Qi Z > > > > > > Cc: dev@dpdk.org; Chen, Junjie J ; > > > Chen@dpdk.org > > > Subject: [dpdk-dev] [PATCH] net/i40e: update tx_free_threshold to > > > improve zero copy performance > > > > > > From: "Chen, Junjie" > > > > > > When vhost backend works in dequeue zero copy mode, nic locks virtio's > > > buffer until there is less or equal than tx_free_threshold buffer > > > remain and then free number of tx burst buffer. This causes packets > > > drop in virtio side and impacts zero copy performance. So we need to > > > increase the tx_free_threshold to let nic free virtio's buffer as soon as > > possible. > > > Also we keep the upper limit to tx max burst size to ensure least > > > performance impact on non zero copy. > > > > Ok but why vhost app can't just use tx_queue_setup() to specify desired value > > for tx_free_thresh? > > Why instead we have to modify PMD to satisfy needs of one app? > > Konstantin > > I think the commit log could include the explanation that this change is proved not impact > driver's performance and it reduce total memory be locked by PMD Tx, so basically it benefit > application that share the same mem pool overall, vhost dequeue zero copy is one of the example. > > > > > > > > > Signed-off-by: Chen, Junjie > > > --- > > > drivers/net/i40e/i40e_rxtx.c | 2 ++ > > > 1 file changed, 2 insertions(+) > > > > > > diff --git a/drivers/net/i40e/i40e_rxtx.c > > > b/drivers/net/i40e/i40e_rxtx.c index 56a854cec..d9569bdc9 100644 > > > --- a/drivers/net/i40e/i40e_rxtx.c > > > +++ b/drivers/net/i40e/i40e_rxtx.c > > > @@ -2039,6 +2039,8 @@ i40e_dev_tx_queue_setup(struct rte_eth_dev > > *dev, > > > tx_conf->tx_rs_thresh : DEFAULT_TX_RS_THRESH); > > > tx_free_thresh = (uint16_t)((tx_conf->tx_free_thresh) ? > > > tx_conf->tx_free_thresh : DEFAULT_TX_FREE_THRESH); > > > + if (tx_free_thresh < nb_desc - I40E_TX_MAX_BURST) > > > + tx_free_thresh = nb_desc - I40E_TX_MAX_BURST; > > I think we'd better still allow application to set tx_free_thresh, since a small tx_free_thresh may still have benefit to let driver handle the first strike after device restarted > So, nb_desc - I40E_TX_MAX_BURST can only be set when tx_conf->tx_rs_thresh = 0 > > Regards > Qi > +1 for just changing in this case. /Bruce