From patchwork Thu Apr 12 05:32:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: junjie.j.chen@intel.com X-Patchwork-Id: 37956 X-Patchwork-Delegate: helin.zhang@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 40BF51B7E6; Thu, 12 Apr 2018 08:17:47 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id C18EC1B7E1 for ; Thu, 12 Apr 2018 08:17:45 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Apr 2018 23:17:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,440,1517904000"; d="scan'208";a="32768538" Received: from cjj-s2600wft.sh.intel.com ([10.67.111.131]) by orsmga007.jf.intel.com with ESMTP; 11 Apr 2018 23:17:42 -0700 From: Junjie Chen To: beilei.xing@intel.com, qi.z.zhang@intel.com Cc: dev@dpdk.org, "Chen, Junjie" , Chen@dpdk.org Date: Thu, 12 Apr 2018 13:32:26 +0800 Message-Id: <20180412053226.295226-1-junjie.j.chen@intel.com> X-Mailer: git-send-email 2.16.0 Subject: [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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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. 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; if (tx_rs_thresh >= (nb_desc - 2)) { PMD_INIT_LOG(ERR, "tx_rs_thresh must be less than the " "number of TX descriptors minus 2. "