aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2011-04-22 00:07:43 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-05-14 20:59:20 -0400
commite606bfe74de63d6c3778c145ee0673d96ab257c9 (patch)
tree86a5ac602ad08c4fa80d4c630d9835c1dc5c6af2 /drivers/net/ixgbe
parent51275d37a85bc82bda7e5b179ee520e85e66e782 (diff)
ixgbe: move flags and state into the same cacheline
This change moves flags and state into the same cacheline. The reason for this change is because both are frequently read around the same time and infrequently written. By combining them into the same cacheline this should help to reduce memory utilization. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Evan Swanson <evan.swanson@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r--drivers/net/ixgbe/ixgbe.h88
1 files changed, 45 insertions, 43 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index 91c15403c6bb..ec948ffec553 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -341,10 +341,48 @@ struct ixgbe_q_vector {
341 341
342/* board specific private data structure */ 342/* board specific private data structure */
343struct ixgbe_adapter { 343struct ixgbe_adapter {
344 struct timer_list watchdog_timer; 344 unsigned long state;
345
346 /* Some features need tri-state capability,
347 * thus the additional *_CAPABLE flags.
348 */
349 u32 flags;
350#define IXGBE_FLAG_RX_CSUM_ENABLED (u32)(1)
351#define IXGBE_FLAG_MSI_CAPABLE (u32)(1 << 1)
352#define IXGBE_FLAG_MSI_ENABLED (u32)(1 << 2)
353#define IXGBE_FLAG_MSIX_CAPABLE (u32)(1 << 3)
354#define IXGBE_FLAG_MSIX_ENABLED (u32)(1 << 4)
355#define IXGBE_FLAG_RX_1BUF_CAPABLE (u32)(1 << 6)
356#define IXGBE_FLAG_RX_PS_CAPABLE (u32)(1 << 7)
357#define IXGBE_FLAG_RX_PS_ENABLED (u32)(1 << 8)
358#define IXGBE_FLAG_IN_NETPOLL (u32)(1 << 9)
359#define IXGBE_FLAG_DCA_ENABLED (u32)(1 << 10)
360#define IXGBE_FLAG_DCA_CAPABLE (u32)(1 << 11)
361#define IXGBE_FLAG_IMIR_ENABLED (u32)(1 << 12)
362#define IXGBE_FLAG_MQ_CAPABLE (u32)(1 << 13)
363#define IXGBE_FLAG_DCB_ENABLED (u32)(1 << 14)
364#define IXGBE_FLAG_RSS_ENABLED (u32)(1 << 16)
365#define IXGBE_FLAG_RSS_CAPABLE (u32)(1 << 17)
366#define IXGBE_FLAG_VMDQ_CAPABLE (u32)(1 << 18)
367#define IXGBE_FLAG_VMDQ_ENABLED (u32)(1 << 19)
368#define IXGBE_FLAG_FAN_FAIL_CAPABLE (u32)(1 << 20)
369#define IXGBE_FLAG_NEED_LINK_UPDATE (u32)(1 << 22)
370#define IXGBE_FLAG_IN_SFP_LINK_TASK (u32)(1 << 23)
371#define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 24)
372#define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 25)
373#define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 26)
374#define IXGBE_FLAG_FCOE_CAPABLE (u32)(1 << 27)
375#define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 28)
376#define IXGBE_FLAG_SRIOV_CAPABLE (u32)(1 << 29)
377#define IXGBE_FLAG_SRIOV_ENABLED (u32)(1 << 30)
378
379 u32 flags2;
380#define IXGBE_FLAG2_RSC_CAPABLE (u32)(1)
381#define IXGBE_FLAG2_RSC_ENABLED (u32)(1 << 1)
382#define IXGBE_FLAG2_TEMP_SENSOR_CAPABLE (u32)(1 << 2)
383
345 unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; 384 unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
346 u16 bd_number; 385 u16 bd_number;
347 struct work_struct reset_task;
348 struct ixgbe_q_vector *q_vector[MAX_MSIX_Q_VECTORS]; 386 struct ixgbe_q_vector *q_vector[MAX_MSIX_Q_VECTORS];
349 387
350 /* DCB parameters */ 388 /* DCB parameters */
@@ -387,43 +425,6 @@ struct ixgbe_adapter {
387 u32 alloc_rx_page_failed; 425 u32 alloc_rx_page_failed;
388 u32 alloc_rx_buff_failed; 426 u32 alloc_rx_buff_failed;
389 427
390 /* Some features need tri-state capability,
391 * thus the additional *_CAPABLE flags.
392 */
393 u32 flags;
394#define IXGBE_FLAG_RX_CSUM_ENABLED (u32)(1)
395#define IXGBE_FLAG_MSI_CAPABLE (u32)(1 << 1)
396#define IXGBE_FLAG_MSI_ENABLED (u32)(1 << 2)
397#define IXGBE_FLAG_MSIX_CAPABLE (u32)(1 << 3)
398#define IXGBE_FLAG_MSIX_ENABLED (u32)(1 << 4)
399#define IXGBE_FLAG_RX_1BUF_CAPABLE (u32)(1 << 6)
400#define IXGBE_FLAG_RX_PS_CAPABLE (u32)(1 << 7)
401#define IXGBE_FLAG_RX_PS_ENABLED (u32)(1 << 8)
402#define IXGBE_FLAG_IN_NETPOLL (u32)(1 << 9)
403#define IXGBE_FLAG_DCA_ENABLED (u32)(1 << 10)
404#define IXGBE_FLAG_DCA_CAPABLE (u32)(1 << 11)
405#define IXGBE_FLAG_IMIR_ENABLED (u32)(1 << 12)
406#define IXGBE_FLAG_MQ_CAPABLE (u32)(1 << 13)
407#define IXGBE_FLAG_DCB_ENABLED (u32)(1 << 14)
408#define IXGBE_FLAG_RSS_ENABLED (u32)(1 << 16)
409#define IXGBE_FLAG_RSS_CAPABLE (u32)(1 << 17)
410#define IXGBE_FLAG_VMDQ_CAPABLE (u32)(1 << 18)
411#define IXGBE_FLAG_VMDQ_ENABLED (u32)(1 << 19)
412#define IXGBE_FLAG_FAN_FAIL_CAPABLE (u32)(1 << 20)
413#define IXGBE_FLAG_NEED_LINK_UPDATE (u32)(1 << 22)
414#define IXGBE_FLAG_IN_SFP_LINK_TASK (u32)(1 << 23)
415#define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 24)
416#define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 25)
417#define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 26)
418#define IXGBE_FLAG_FCOE_CAPABLE (u32)(1 << 27)
419#define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 28)
420#define IXGBE_FLAG_SRIOV_CAPABLE (u32)(1 << 29)
421#define IXGBE_FLAG_SRIOV_ENABLED (u32)(1 << 30)
422
423 u32 flags2;
424#define IXGBE_FLAG2_RSC_CAPABLE (u32)(1)
425#define IXGBE_FLAG2_RSC_ENABLED (u32)(1 << 1)
426#define IXGBE_FLAG2_TEMP_SENSOR_CAPABLE (u32)(1 << 2)
427/* default to trying for four seconds */ 428/* default to trying for four seconds */
428#define IXGBE_TRY_LINK_TIMEOUT (4 * HZ) 429#define IXGBE_TRY_LINK_TIMEOUT (4 * HZ)
429 430
@@ -444,7 +445,6 @@ struct ixgbe_adapter {
444 u32 rx_eitr_param; 445 u32 rx_eitr_param;
445 u32 tx_eitr_param; 446 u32 tx_eitr_param;
446 447
447 unsigned long state;
448 u64 tx_busy; 448 u64 tx_busy;
449 unsigned int tx_ring_count; 449 unsigned int tx_ring_count;
450 unsigned int rx_ring_count; 450 unsigned int rx_ring_count;
@@ -453,15 +453,18 @@ struct ixgbe_adapter {
453 bool link_up; 453 bool link_up;
454 unsigned long link_check_timeout; 454 unsigned long link_check_timeout;
455 455
456 struct work_struct reset_task;
456 struct work_struct watchdog_task; 457 struct work_struct watchdog_task;
457 struct work_struct sfp_task; 458 struct work_struct sfp_task;
458 struct timer_list sfp_timer;
459 struct work_struct multispeed_fiber_task; 459 struct work_struct multispeed_fiber_task;
460 struct work_struct sfp_config_module_task; 460 struct work_struct sfp_config_module_task;
461 struct work_struct fdir_reinit_task;
462 struct work_struct check_overtemp_task;
463 struct timer_list watchdog_timer;
464 struct timer_list sfp_timer;
461 u32 fdir_pballoc; 465 u32 fdir_pballoc;
462 u32 atr_sample_rate; 466 u32 atr_sample_rate;
463 spinlock_t fdir_perfect_lock; 467 spinlock_t fdir_perfect_lock;
464 struct work_struct fdir_reinit_task;
465#ifdef IXGBE_FCOE 468#ifdef IXGBE_FCOE
466 struct ixgbe_fcoe fcoe; 469 struct ixgbe_fcoe fcoe;
467#endif /* IXGBE_FCOE */ 470#endif /* IXGBE_FCOE */
@@ -472,7 +475,6 @@ struct ixgbe_adapter {
472 475
473 int node; 476 int node;
474 u32 led_reg; 477 u32 led_reg;
475 struct work_struct check_overtemp_task;
476 u32 interrupt_event; 478 u32 interrupt_event;
477 char lsc_int_name[IFNAMSIZ + 9]; 479 char lsc_int_name[IFNAMSIZ + 9];
478 480