From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by dpdk.org (Postfix) with ESMTP id 658838E7F for ; Fri, 22 Jan 2016 02:38:34 +0100 (CET) Received: by mail-pa0-f47.google.com with SMTP id yy13so32321665pab.3 for ; Thu, 21 Jan 2016 17:38:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=2xPDRdmZ1n2yjJ/4zF1Yk69essJZIykrzxrQfWVl3Ko=; b=csdtMFBX/MwOn808UUA4S6PyG7lpMPnH20iZcDpt9huScReY91Mz/R/SsqVVKEgY3A bP5rcISKtsugHK8NB2iFSxpKl2mUjuYWlnYUcdwiF2RhgsRhr+JfFLVMPz0zX0swkhVz rgzXkVBIpr5cywPf0CIrb2MvCOdyn3ZXCD//7c6pAXiu4nYWjEPyuT1BAhrJGdMtrjRH 3D0fSxYKX2562Gm4MAHPGDYVLd+DgsQ3Ns09wrNR4zjiGP2i68ks5gl9InKFvyre6jIB NGQ8/0sWFJjr49G9nRUHsDmYyKPNZ7TEwIdXjCnP7i7pY6s8aiDZz5Hk3pK2bB4FA7cv 8yXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=2xPDRdmZ1n2yjJ/4zF1Yk69essJZIykrzxrQfWVl3Ko=; b=f28S2CokkitPCi82LHuLNW+gVnlMF/ik9H1YelMdR0K01offdY8FFDp/+/Zf7ergvX A3xwrh8H1Gmgoum62VuQnUhszEYlzwfmLQb4Ho0/SqbGI0UWO4DFy2CffH4goXovzHRM rA3VyBMdwjihmAAJCf6uqiDa8L2fVChZgf0rlENgHh8r/iBI5h3ZlEnOy/6/3LcNScf+ 0pGxbJJZ5f5vsceEQ2IIVIP+NeZmYhYFHHIEQnPD/Br1wv6MWNKiaVCi6eHTn9TDMVr4 FOsy4NvmK8xlGJcdP6EIBsTPpmEz1lTNwXlc3+GHVL66C3yR/F1NKg05wZGjxasqBlKF fF2w== X-Gm-Message-State: AG10YOQH4NhLrJutdIMTUDWSs7G3BTqk62u9P5AyYLqE5ruqG47i+UXK53ZLwyGM+Xmefg== X-Received: by 10.66.141.165 with SMTP id rp5mr647289pab.56.1453426713822; Thu, 21 Jan 2016 17:38:33 -0800 (PST) Received: from xeon-e3.home.lan (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id r12sm5357369pfi.9.2016.01.21.17.38.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Jan 2016 17:38:32 -0800 (PST) From: Stephen Hemminger To: wenzhuo.lu@intel.com Date: Thu, 21 Jan 2016 17:38:37 -0800 Message-Id: <1453426717-2522-1-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH] igb: set default thresholds correctly based on mac type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jan 2016 01:38:34 -0000 This brings the DPDK igb driver inline with the behavior used by the current Linux driver. The IGB hardware has several different MAC types and the threshold values that work vary based on the hardware. Since DPDK 1.8 it has been up to devices to provide the correct default configuration parameter. But the igb driver gives values that are broken on some devices, and always causes a warning message at startup. Please test this on real hardware, I don't have the luxury of a hardware lab full of variations of this chip. Signed-off-by: Stephen Hemminger --- drivers/net/e1000/igb_ethdev.c | 11 ++++++----- drivers/net/e1000/igb_rxtx.c | 8 ++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index d1bbcda..31b2c1f 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -61,13 +61,14 @@ * Default values for port configuration */ #define IGB_DEFAULT_RX_FREE_THRESH 32 -#define IGB_DEFAULT_RX_PTHRESH 8 + +#define IGB_DEFAULT_RX_PTHRESH ((hw->mac.type == e1000_i354) ? 12 : 8) #define IGB_DEFAULT_RX_HTHRESH 8 -#define IGB_DEFAULT_RX_WTHRESH 0 +#define IGB_DEFAULT_RX_WTHRESH ((hw->mac.type == e1000_82576) ? 1 : 4) -#define IGB_DEFAULT_TX_PTHRESH 32 -#define IGB_DEFAULT_TX_HTHRESH 0 -#define IGB_DEFAULT_TX_WTHRESH 0 +#define IGB_DEFAULT_TX_PTHRESH ((hw->mac.type == e1000_i354) ? 20: 8) +#define IGB_DEFAULT_TX_HTHRESH 1 +#define IGB_DEFAULT_TX_WTHRESH ((hw->mac.type == e1000_82576) ? 1 : 16) #define IGB_HKEY_MAX_INDEX 10 diff --git a/drivers/net/e1000/igb_rxtx.c b/drivers/net/e1000/igb_rxtx.c index 996e7da..499b6b4 100644 --- a/drivers/net/e1000/igb_rxtx.c +++ b/drivers/net/e1000/igb_rxtx.c @@ -1315,13 +1315,13 @@ eth_igb_tx_queue_setup(struct rte_eth_dev *dev, * driver. */ if (tx_conf->tx_free_thresh != 0) - PMD_INIT_LOG(WARNING, "The tx_free_thresh parameter is not " + PMD_INIT_LOG(INFO, "The tx_free_thresh parameter is not " "used for the 1G driver."); if (tx_conf->tx_rs_thresh != 0) - PMD_INIT_LOG(WARNING, "The tx_rs_thresh parameter is not " + PMD_INIT_LOG(INFO, "The tx_rs_thresh parameter is not " "used for the 1G driver."); - if (tx_conf->tx_thresh.wthresh == 0) - PMD_INIT_LOG(WARNING, "To improve 1G driver performance, " + if (tx_conf->tx_thresh.wthresh == 0 && hw->mac.type != e1000_82576) + PMD_INIT_LOG(INFO, "To improve 1G driver performance, " "consider setting the TX WTHRESH value to 4, 8, " "or 16."); -- 2.1.4