diff options
author | Sathya Perla <sathya.perla@emulex.com> | 2011-06-12 16:01:58 -0400 |
---|---|---|
committer | David S. Miller <davem@conan.davemloft.net> | 2011-06-16 23:02:04 -0400 |
commit | 3c8def9776c3d4636291432522ea312f7a44be95 (patch) | |
tree | eec2cc837656dd9ee2a5e16dd7648d6a18e592d1 /drivers/net/benet/be.h | |
parent | 15b4d93f0316caec44e07255c1d73bde4fac12e4 (diff) |
be2net: support multiple TX queues
This patch provides support for multiple TX queues.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@conan.davemloft.net>
Diffstat (limited to 'drivers/net/benet/be.h')
-rw-r--r-- | drivers/net/benet/be.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index a7db870d1641..a36f5a6a8462 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
@@ -87,6 +87,7 @@ static inline char *nic_name(struct pci_dev *pdev) | |||
87 | 87 | ||
88 | #define MAX_RSS_QS 4 /* BE limit is 4 queues/port */ | 88 | #define MAX_RSS_QS 4 /* BE limit is 4 queues/port */ |
89 | #define MAX_RX_QS (MAX_RSS_QS + 1) /* RSS qs + 1 def Rx */ | 89 | #define MAX_RX_QS (MAX_RSS_QS + 1) /* RSS qs + 1 def Rx */ |
90 | #define MAX_TX_QS 8 | ||
90 | #define BE_MAX_MSIX_VECTORS (MAX_RX_QS + 1)/* RX + TX */ | 91 | #define BE_MAX_MSIX_VECTORS (MAX_RX_QS + 1)/* RX + TX */ |
91 | #define BE_NAPI_WEIGHT 64 | 92 | #define BE_NAPI_WEIGHT 64 |
92 | #define MAX_RX_POST BE_NAPI_WEIGHT /* Frags posted at a time */ | 93 | #define MAX_RX_POST BE_NAPI_WEIGHT /* Frags posted at a time */ |
@@ -170,7 +171,6 @@ struct be_tx_stats { | |||
170 | u32 be_tx_reqs; /* number of TX requests initiated */ | 171 | u32 be_tx_reqs; /* number of TX requests initiated */ |
171 | u32 be_tx_stops; /* number of times TX Q was stopped */ | 172 | u32 be_tx_stops; /* number of times TX Q was stopped */ |
172 | u32 be_tx_wrbs; /* number of tx WRBs used */ | 173 | u32 be_tx_wrbs; /* number of tx WRBs used */ |
173 | u32 be_tx_events; /* number of tx completion events */ | ||
174 | u32 be_tx_compl; /* number of tx completion entries processed */ | 174 | u32 be_tx_compl; /* number of tx completion entries processed */ |
175 | ulong be_tx_jiffies; | 175 | ulong be_tx_jiffies; |
176 | u64 be_tx_bytes; | 176 | u64 be_tx_bytes; |
@@ -184,6 +184,7 @@ struct be_tx_obj { | |||
184 | struct be_queue_info cq; | 184 | struct be_queue_info cq; |
185 | /* Remember the skbs that were transmitted */ | 185 | /* Remember the skbs that were transmitted */ |
186 | struct sk_buff *sent_skb_list[TX_Q_LEN]; | 186 | struct sk_buff *sent_skb_list[TX_Q_LEN]; |
187 | struct be_tx_stats stats; | ||
187 | }; | 188 | }; |
188 | 189 | ||
189 | /* Struct to remember the pages posted for rx frags */ | 190 | /* Struct to remember the pages posted for rx frags */ |
@@ -319,8 +320,8 @@ struct be_adapter { | |||
319 | 320 | ||
320 | /* TX Rings */ | 321 | /* TX Rings */ |
321 | struct be_eq_obj tx_eq; | 322 | struct be_eq_obj tx_eq; |
322 | struct be_tx_obj tx_obj; | 323 | struct be_tx_obj tx_obj[MAX_TX_QS]; |
323 | struct be_tx_stats tx_stats; | 324 | u8 num_tx_qs; |
324 | 325 | ||
325 | u32 cache_line_break[8]; | 326 | u32 cache_line_break[8]; |
326 | 327 | ||
@@ -391,7 +392,7 @@ struct be_adapter { | |||
391 | extern const struct ethtool_ops be_ethtool_ops; | 392 | extern const struct ethtool_ops be_ethtool_ops; |
392 | 393 | ||
393 | #define msix_enabled(adapter) (adapter->num_msix_vec > 0) | 394 | #define msix_enabled(adapter) (adapter->num_msix_vec > 0) |
394 | #define tx_stats(adapter) (&adapter->tx_stats) | 395 | #define tx_stats(txo) (&txo->stats) |
395 | #define rx_stats(rxo) (&rxo->stats) | 396 | #define rx_stats(rxo) (&rxo->stats) |
396 | 397 | ||
397 | #define BE_SET_NETDEV_OPS(netdev, ops) (netdev->netdev_ops = ops) | 398 | #define BE_SET_NETDEV_OPS(netdev, ops) (netdev->netdev_ops = ops) |
@@ -405,6 +406,10 @@ extern const struct ethtool_ops be_ethtool_ops; | |||
405 | for (i = 0, rxo = &adapter->rx_obj[i+1]; i < (adapter->num_rx_qs - 1);\ | 406 | for (i = 0, rxo = &adapter->rx_obj[i+1]; i < (adapter->num_rx_qs - 1);\ |
406 | i++, rxo++) | 407 | i++, rxo++) |
407 | 408 | ||
409 | #define for_all_tx_queues(adapter, txo, i) \ | ||
410 | for (i = 0, txo = &adapter->tx_obj[i]; i < adapter->num_tx_qs; \ | ||
411 | i++, txo++) | ||
412 | |||
408 | #define PAGE_SHIFT_4K 12 | 413 | #define PAGE_SHIFT_4K 12 |
409 | #define PAGE_SIZE_4K (1 << PAGE_SHIFT_4K) | 414 | #define PAGE_SIZE_4K (1 << PAGE_SHIFT_4K) |
410 | 415 | ||