diff options
author | Sathya Perla <sathya.perla@emulex.com> | 2011-03-21 20:49:25 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-03-30 21:39:19 -0700 |
commit | ac6a0c4aab16070d7d55f49a52de33f716ae1d3d (patch) | |
tree | 4b61658c9c3cbe141e18d667cc715c20992430b8 /drivers/net/benet/be.h | |
parent | 311fddc7569d7a3340d61de262cff11685060f74 (diff) | |
download | linux-ac6a0c4aab16070d7d55f49a52de33f716ae1d3d.tar.gz linux-ac6a0c4aab16070d7d55f49a52de33f716ae1d3d.tar.bz2 linux-ac6a0c4aab16070d7d55f49a52de33f716ae1d3d.zip |
be2net: refactor code that decides adapter->num_rx_queues
The code has been refactored to not set num_rx_qs inside be_enable_msix().
num_rx_qs is now set at the time of queue creation based on the number of
available msix vectors.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be.h')
-rw-r--r-- | drivers/net/benet/be.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index f803c58b941d..3937bca3d431 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h @@ -84,7 +84,8 @@ static inline char *nic_name(struct pci_dev *pdev) #define MCC_CQ_LEN 256 #define MAX_RSS_QS 4 /* BE limit is 4 queues/port */ -#define BE_MAX_MSIX_VECTORS (MAX_RSS_QS + 1 + 1)/* RSS qs + 1 def Rx + Tx */ +#define MAX_RX_QS (MAX_RSS_QS + 1) /* RSS qs + 1 def Rx */ +#define BE_MAX_MSIX_VECTORS (MAX_RX_QS + 1)/* RX + TX */ #define BE_NAPI_WEIGHT 64 #define MAX_RX_POST BE_NAPI_WEIGHT /* Frags posted at a time */ #define RX_FRAGS_REFILL_WM (RX_Q_LEN - MAX_RX_POST) @@ -276,7 +277,7 @@ struct be_adapter { spinlock_t mcc_cq_lock; struct msix_entry msix_entries[BE_MAX_MSIX_VECTORS]; - bool msix_enabled; + u32 num_msix_vec; bool isr_registered; /* TX Rings */ @@ -287,7 +288,7 @@ struct be_adapter { u32 cache_line_break[8]; /* Rx rings */ - struct be_rx_obj rx_obj[MAX_RSS_QS + 1]; /* one default non-rss Q */ + struct be_rx_obj rx_obj[MAX_RX_QS]; u32 num_rx_qs; u32 big_page_size; /* Compounded page size shared by rx wrbs */ @@ -351,6 +352,7 @@ struct be_adapter { extern const struct ethtool_ops be_ethtool_ops; +#define msix_enabled(adapter) (adapter->num_msix_vec > 0) #define tx_stats(adapter) (&adapter->tx_stats) #define rx_stats(rxo) (&rxo->stats) |