Skip to contentSkip to conversation

i40e: fix u64 division usage

PATCH New Alan Brady 2 participants 2 messages Oct 9, 2017 – Oct 10, 2017

Subsystems (2)
lore
Share & tools
lore

Alan Brady

author
#0 lore raw

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.

Fixes 52eb1ff93e98 ("i40e: Add support setting TC max bandwidth

rates")

Fixes 1ea6f21ae530 ("i40e: Refactor VF BW rate limiting")
---
 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
index 266e1dc5e786..eb017763646d 100644
@@ -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
#1 lore raw

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 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.

Fixes 52eb1ff93e98 ("i40e: Add support setting TC max bandwidth

rates")

Quoted 8 lines
Fixes 1ea6f21ae530 ("i40e: Refactor VF BW rate limiting")
---
 drivers/net/ethernet/intel/i40e/i40e.h      |  3 +-
 drivers/net/ethernet/intel/i40e/i40e_main.c | 59 +++++++++++++++++++--
--------
 2 files changed, 42 insertions(+), 20 deletions(-)