aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ixgbe/ixgbe.h
diff options
context:
space:
mode:
authorEmil Tantilov <emil.s.tantilov@intel.com>2011-08-30 20:01:16 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-09-29 02:08:23 -0400
commitd5bf4f67a6b414628dc95b9c4891525296c09a29 (patch)
tree6f26c9b28c45f1aa923e138f5153505dc949aaaa /drivers/net/ethernet/intel/ixgbe/ixgbe.h
parentdd1ed3b7bfed15f6162f63840941e9cf4f3611a1 (diff)
ixgbe: Cleanup q_vector interrupt throttle rate logic
This patch is meant to help cleanup the interrupt throttle rate logic by storing the interrupt throttle rate as a value in microseconds instead of interrupts per second. The advantage to this approach is that the value can now be stored in an 16 bit field and doesn't require as much math to flip the value back and forth since the hardware already used microseconds when setting the rate. Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe.h')
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 1f4a4caeb00e..38940d72991d 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -301,26 +301,29 @@ struct ixgbe_ring_container {
301 */ 301 */
302struct ixgbe_q_vector { 302struct ixgbe_q_vector {
303 struct ixgbe_adapter *adapter; 303 struct ixgbe_adapter *adapter;
304 unsigned int v_idx; /* index of q_vector within array, also used for
305 * finding the bit in EICR and friends that
306 * represents the vector for this ring */
307#ifdef CONFIG_IXGBE_DCA 304#ifdef CONFIG_IXGBE_DCA
308 int cpu; /* CPU for DCA */ 305 int cpu; /* CPU for DCA */
309#endif 306#endif
310 struct napi_struct napi; 307 u16 v_idx; /* index of q_vector within array, also used for
308 * finding the bit in EICR and friends that
309 * represents the vector for this ring */
310 u16 itr; /* Interrupt throttle rate written to EITR */
311 struct ixgbe_ring_container rx, tx; 311 struct ixgbe_ring_container rx, tx;
312 u32 eitr; 312
313 struct napi_struct napi;
313 cpumask_var_t affinity_mask; 314 cpumask_var_t affinity_mask;
314 char name[IFNAMSIZ + 9]; 315 char name[IFNAMSIZ + 9];
315}; 316};
316 317
317/* Helper macros to switch between ints/sec and what the register uses. 318/*
318 * And yes, it's the same math going both ways. The lowest value 319 * microsecond values for various ITR rates shifted by 2 to fit itr register
319 * supported by all of the ixgbe hardware is 8. 320 * with the first 3 bits reserved 0
320 */ 321 */
321#define EITR_INTS_PER_SEC_TO_REG(_eitr) \ 322#define IXGBE_MIN_RSC_ITR 24
322 ((_eitr) ? (1000000000 / ((_eitr) * 256)) : 8) 323#define IXGBE_100K_ITR 40
323#define EITR_REG_TO_INTS_PER_SEC EITR_INTS_PER_SEC_TO_REG 324#define IXGBE_20K_ITR 200
325#define IXGBE_10K_ITR 400
326#define IXGBE_8K_ITR 500
324 327
325static inline u16 ixgbe_desc_unused(struct ixgbe_ring *ring) 328static inline u16 ixgbe_desc_unused(struct ixgbe_ring *ring)
326{ 329{