From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id C3E6A8E9D for ; Thu, 21 Jan 2016 11:36:12 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 21 Jan 2016 02:36:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,324,1449561600"; d="scan'208";a="731625956" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga003.jf.intel.com with ESMTP; 21 Jan 2016 02:36:11 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id u0LAa9nQ005187; Thu, 21 Jan 2016 18:36:09 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id u0LAa6Rl011479; Thu, 21 Jan 2016 18:36:08 +0800 Received: (from xiaowan1@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id u0LAa69J011475; Thu, 21 Jan 2016 18:36:06 +0800 From: Wang Xiao W To: jing.d.chen@intel.com Date: Thu, 21 Jan 2016 18:35:47 +0800 Message-Id: <1453372561-11431-3-git-send-email-xiao.w.wang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1453372561-11431-1-git-send-email-xiao.w.wang@intel.com> References: <1453372561-11431-1-git-send-email-xiao.w.wang@intel.com> Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH 02/16] fm10k/base: use bitshift for itr_scale 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: Thu, 21 Jan 2016 10:36:13 -0000 Upstream community wishes us to use bitshift instead of a divisor, because this is faster, and prevents any need for a '0' check. In our case, this even works out because default Gen3 will be 0. Because of this, we are also able to remove the check for non-zero value in the vf code path since that will already be the default Gen3 case. Signed-off-by: Wang Xiao W --- drivers/net/fm10k/base/fm10k_type.h | 6 +++--- drivers/net/fm10k/base/fm10k_vf.c | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/net/fm10k/base/fm10k_type.h b/drivers/net/fm10k/base/fm10k_type.h index 62fa73f..44187b1 100644 --- a/drivers/net/fm10k/base/fm10k_type.h +++ b/drivers/net/fm10k/base/fm10k_type.h @@ -352,9 +352,9 @@ struct fm10k_hw; #define FM10K_TDLEN(_n) ((0x40 * (_n)) + 0x8002) #define FM10K_TDLEN_ITR_SCALE_SHIFT 9 #define FM10K_TDLEN_ITR_SCALE_MASK 0x00000E00 -#define FM10K_TDLEN_ITR_SCALE_GEN1 4 -#define FM10K_TDLEN_ITR_SCALE_GEN2 2 -#define FM10K_TDLEN_ITR_SCALE_GEN3 1 +#define FM10K_TDLEN_ITR_SCALE_GEN1 2 +#define FM10K_TDLEN_ITR_SCALE_GEN2 1 +#define FM10K_TDLEN_ITR_SCALE_GEN3 0 #define FM10K_TPH_TXCTRL(_n) ((0x40 * (_n)) + 0x8003) #define FM10K_TPH_TXCTRL_DESC_TPHEN 0x00000020 #define FM10K_TPH_TXCTRL_DESC_RROEN 0x00000200 diff --git a/drivers/net/fm10k/base/fm10k_vf.c b/drivers/net/fm10k/base/fm10k_vf.c index 7822ab6..39bc927 100644 --- a/drivers/net/fm10k/base/fm10k_vf.c +++ b/drivers/net/fm10k/base/fm10k_vf.c @@ -159,10 +159,6 @@ STATIC s32 fm10k_init_hw_vf(struct fm10k_hw *hw) FM10K_TDLEN_ITR_SCALE_MASK) >> FM10K_TDLEN_ITR_SCALE_SHIFT; - /* ensure a non-zero itr scale */ - if (!hw->mac.itr_scale) - hw->mac.itr_scale = FM10K_TDLEN_ITR_SCALE_GEN3; - return FM10K_SUCCESS; } -- 1.9.3