diff options
author | Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> | 2009-02-01 04:18:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-01 04:18:58 -0500 |
commit | eb7f139ce523bfe03b1628c66d3e1d50f3c07196 (patch) | |
tree | d41b641e1a94911aaddc22b63d3d470f6cfd3ef1 /drivers/net/ixgbe/ixgbe_main.c | |
parent | 2f21bdd3542838dc5513a585a32aa13f01b019e7 (diff) |
ixgbe: Refactor MSI-X allocation mechanism
Our current MSI-X allocation mechanism does not support new hardware
at all. It also isn't getting the actual number of supported MSI-X vectors
from the device.
This patch allows the number of MSI-X vectors to be specific to a device,
plus it gets the number of MSI-X vectors available from PCIe configuration
space.
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@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/net/ixgbe/ixgbe_main.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 82afc606c238..7bbafa3ebbe3 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -2421,7 +2421,13 @@ static void ixgbe_acquire_msix_vectors(struct ixgbe_adapter *adapter, | |||
2421 | ixgbe_set_num_queues(adapter); | 2421 | ixgbe_set_num_queues(adapter); |
2422 | } else { | 2422 | } else { |
2423 | adapter->flags |= IXGBE_FLAG_MSIX_ENABLED; /* Woot! */ | 2423 | adapter->flags |= IXGBE_FLAG_MSIX_ENABLED; /* Woot! */ |
2424 | adapter->num_msix_vectors = vectors; | 2424 | /* |
2425 | * Adjust for only the vectors we'll use, which is minimum | ||
2426 | * of max_msix_q_vectors + NON_Q_VECTORS, or the number of | ||
2427 | * vectors we were allocated. | ||
2428 | */ | ||
2429 | adapter->num_msix_vectors = min(vectors, | ||
2430 | adapter->max_msix_q_vectors + NON_Q_VECTORS); | ||
2425 | } | 2431 | } |
2426 | } | 2432 | } |
2427 | 2433 | ||
@@ -2746,6 +2752,7 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter) | |||
2746 | adapter->ring_feature[RING_F_RSS].indices = rss; | 2752 | adapter->ring_feature[RING_F_RSS].indices = rss; |
2747 | adapter->flags |= IXGBE_FLAG_RSS_ENABLED; | 2753 | adapter->flags |= IXGBE_FLAG_RSS_ENABLED; |
2748 | adapter->ring_feature[RING_F_DCB].indices = IXGBE_MAX_DCB_INDICES; | 2754 | adapter->ring_feature[RING_F_DCB].indices = IXGBE_MAX_DCB_INDICES; |
2755 | adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82598; | ||
2749 | 2756 | ||
2750 | #ifdef CONFIG_IXGBE_DCB | 2757 | #ifdef CONFIG_IXGBE_DCB |
2751 | /* Configure DCB traffic classes */ | 2758 | /* Configure DCB traffic classes */ |