From: Xiao Wang Date: Fri, 19 Feb 2016 11:06:51 +0000 (+0800) Subject: fm10k/base: use bit shift for ITR scale X-Git-Tag: spdx-start~7336 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=285e9a7beaa3bfe6db27173c6e3a93932f6c1d8d;p=dpdk.git fm10k/base: use bit shift for ITR scale Use bitshift instead of a divisor, because this is faster, and eliminates 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 Tested-by: Heng Ding Acked-by: Jing Chen --- diff --git a/drivers/net/fm10k/base/fm10k_type.h b/drivers/net/fm10k/base/fm10k_type.h index df1d27613b..4bc0d53ec8 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 7822ab632a..39bc92705e 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; }