diff options
author | Peter Waskiewicz <peter.p.waskiewicz.jr@intel.com> | 2010-10-04 21:27:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-07 02:48:09 -0400 |
commit | b25ebfd21b03b3b59c1c7a7e0c597fd28286bb10 (patch) | |
tree | 2a7cabafb223a741dcd5e7b833a941ee59d53b20 /drivers | |
parent | 9deec17f9fe260f1b6467748fe5e16feea8e98f0 (diff) |
ixgbe: Use affinity_hint when Flow Director is enabled
Use the new infrastructure to balance interrupts for flow
alignment when ATR or Flow Director are enabled.
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Tested-by: Stephen Ko <stephen.s.ko@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ixgbe/ixgbe.h | 2 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 25 |
2 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index 5cebc3755b64..a8c47b01a6fa 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/types.h> | 31 | #include <linux/types.h> |
32 | #include <linux/pci.h> | 32 | #include <linux/pci.h> |
33 | #include <linux/netdevice.h> | 33 | #include <linux/netdevice.h> |
34 | #include <linux/cpumask.h> | ||
34 | #include <linux/aer.h> | 35 | #include <linux/aer.h> |
35 | 36 | ||
36 | #include "ixgbe_type.h" | 37 | #include "ixgbe_type.h" |
@@ -241,6 +242,7 @@ struct ixgbe_q_vector { | |||
241 | u8 tx_itr; | 242 | u8 tx_itr; |
242 | u8 rx_itr; | 243 | u8 rx_itr; |
243 | u32 eitr; | 244 | u32 eitr; |
245 | cpumask_var_t affinity_mask; | ||
244 | }; | 246 | }; |
245 | 247 | ||
246 | /* Helper macros to switch between ints/sec and what the register uses. | 248 | /* Helper macros to switch between ints/sec and what the register uses. |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index c35e13c01dbe..95dbf60c8169 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -1433,6 +1433,21 @@ static void ixgbe_configure_msix(struct ixgbe_adapter *adapter) | |||
1433 | q_vector->eitr = adapter->rx_eitr_param; | 1433 | q_vector->eitr = adapter->rx_eitr_param; |
1434 | 1434 | ||
1435 | ixgbe_write_eitr(q_vector); | 1435 | ixgbe_write_eitr(q_vector); |
1436 | /* If Flow Director is enabled, set interrupt affinity */ | ||
1437 | if ((adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE) || | ||
1438 | (adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE)) { | ||
1439 | /* | ||
1440 | * Allocate the affinity_hint cpumask, assign the mask | ||
1441 | * for this vector, and set our affinity_hint for | ||
1442 | * this irq. | ||
1443 | */ | ||
1444 | if (!alloc_cpumask_var(&q_vector->affinity_mask, | ||
1445 | GFP_KERNEL)) | ||
1446 | return; | ||
1447 | cpumask_set_cpu(v_idx, q_vector->affinity_mask); | ||
1448 | irq_set_affinity_hint(adapter->msix_entries[v_idx].vector, | ||
1449 | q_vector->affinity_mask); | ||
1450 | } | ||
1436 | } | 1451 | } |
1437 | 1452 | ||
1438 | if (adapter->hw.mac.type == ixgbe_mac_82598EB) | 1453 | if (adapter->hw.mac.type == ixgbe_mac_82598EB) |
@@ -3816,6 +3831,7 @@ void ixgbe_down(struct ixgbe_adapter *adapter) | |||
3816 | u32 rxctrl; | 3831 | u32 rxctrl; |
3817 | u32 txdctl; | 3832 | u32 txdctl; |
3818 | int i, j; | 3833 | int i, j; |
3834 | int num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; | ||
3819 | 3835 | ||
3820 | /* signal that we are down to the interrupt handler */ | 3836 | /* signal that we are down to the interrupt handler */ |
3821 | set_bit(__IXGBE_DOWN, &adapter->state); | 3837 | set_bit(__IXGBE_DOWN, &adapter->state); |
@@ -3854,6 +3870,15 @@ void ixgbe_down(struct ixgbe_adapter *adapter) | |||
3854 | 3870 | ||
3855 | ixgbe_napi_disable_all(adapter); | 3871 | ixgbe_napi_disable_all(adapter); |
3856 | 3872 | ||
3873 | /* Cleanup the affinity_hint CPU mask memory and callback */ | ||
3874 | for (i = 0; i < num_q_vectors; i++) { | ||
3875 | struct ixgbe_q_vector *q_vector = adapter->q_vector[i]; | ||
3876 | /* clear the affinity_mask in the IRQ descriptor */ | ||
3877 | irq_set_affinity_hint(adapter->msix_entries[i]. vector, NULL); | ||
3878 | /* release the CPU mask memory */ | ||
3879 | free_cpumask_var(q_vector->affinity_mask); | ||
3880 | } | ||
3881 | |||
3857 | if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE || | 3882 | if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE || |
3858 | adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE) | 3883 | adapter->flags & IXGBE_FLAG_FDIR_PERFECT_CAPABLE) |
3859 | cancel_work_sync(&adapter->fdir_reinit_task); | 3884 | cancel_work_sync(&adapter->fdir_reinit_task); |