i40e: fix u64 division usage
Subsystems (2)
PATCH 1/1 i40e: fix u64 division usage
Commit 52eb1ff93e98 ("i40e: Add support setting TC max bandwidth rates") and commit 1ea6f21ae530 ("i40e: Refactor VF BW rate limiting") add some needed functionality for TC bandwidth rate limiting. Unfortunately they introduce several usages of unsigned 64-bit division which needs to be handled special by the kernel to support all architectures.
rates")
--- drivers/net/ethernet/intel/i40e/i40e.h | 3 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 59 +++++++++++++++++++---------- 2 files changed, 42 insertions(+), 20 deletions(-)
drivers/net/ethernet/intel/i40e/i40e.h +2 -1
@@ -130,7 +130,8 @@/* BW rate limiting */ #define I40E_BW_CREDIT_DIVISOR 50/* 50Mbps per BW credit */ -#define I40E_MAX_BW_INACTIVE_ACCUM 4/* accumulate 4 credits max */ +#define I40E_BW_MBPS_DIVISOR 125000/* rate / (1000000 / 8) Mbps */ +#define I40E_MAX_BW_INACTIVE_ACCUM 4/* accumulate 4 credits max */ /* driver state flags */ enum i40e_state_t {
drivers/net/ethernet/intel/i40e/i40e_main.c +40 -19
140 lines not on this page · raw message
Signature · 1 line
2.14.1
Bowers
PATCH 1/1 i40e: fix u64 division usage
Quoted 15 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Alan Brady
Sent: Monday, October 9, 2017 3:49 PM
To: intel-wired-lan at lists.osuosl.org
Subject: [Intel-wired-lan] [PATCH net-next] i40e: fix u64 division usageCommit
52eb1ff93e98("i40e: Add support setting TC max bandwidth rates") and commit1ea6f21ae530("i40e: Refactor VF BW rate limiting") add some needed functionality for TC bandwidth rate limiting. Unfortunately they introduce several usages of unsigned 64-bit division which needs to be handled special by the kernel to support all architectures.Fixes 52eb1ff93e98 ("i40e: Add support setting TC max bandwidthrates")
Quoted 8 lines
Fixes 1ea6f21ae530 ("i40e: Refactor VF BW rate limiting")Signed-off-by Alan Brady <[email protected]>--- drivers/net/ethernet/intel/i40e/i40e.h | 3 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 59 +++++++++++++++++++-- -------- 2 files changed, 42 insertions(+), 20 deletions(-)