From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 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: , X-List-Received-Date: Thu, 12 Apr 2018 06:17:46 -0000 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. " -- 2.16.0