aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-02-22 19:45:50 -0500
committerBen Hutchings <bhutchings@solarflare.com>2012-02-22 19:45:50 -0500
commit73e0026fb2bee4f2ca85c702040e143ec504eaa6 (patch)
tree612050837d31b533a79db98679ccd6aaac7e028d
parent2d0cc56da39d62e141d4a60e3ac96522c52de4b1 (diff)
sfc: Correct efx_for_each_possible_channel_tx_queue() to skip non-TX channels
efx_for_each_possible_channel_tx_queue() should do nothing for RX-only or extra channels. The current definition results in allocating additional unused hardware TX queues when using the mqprio qdisc and either separate_tx_channels or SR-IOV. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r--drivers/net/ethernet/sfc/net_driver.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h
index 3fbec458c323..0b95505e8968 100644
--- a/drivers/net/ethernet/sfc/net_driver.h
+++ b/drivers/net/ethernet/sfc/net_driver.h
@@ -1030,9 +1030,12 @@ static inline bool efx_tx_queue_used(struct efx_tx_queue *tx_queue)
1030 1030
1031/* Iterate over all possible TX queues belonging to a channel */ 1031/* Iterate over all possible TX queues belonging to a channel */
1032#define efx_for_each_possible_channel_tx_queue(_tx_queue, _channel) \ 1032#define efx_for_each_possible_channel_tx_queue(_tx_queue, _channel) \
1033 for (_tx_queue = (_channel)->tx_queue; \ 1033 if (!efx_channel_has_tx_queues(_channel)) \
1034 _tx_queue < (_channel)->tx_queue + EFX_TXQ_TYPES; \ 1034 ; \
1035 _tx_queue++) 1035 else \
1036 for (_tx_queue = (_channel)->tx_queue; \
1037 _tx_queue < (_channel)->tx_queue + EFX_TXQ_TYPES; \
1038 _tx_queue++)
1036 1039
1037static inline bool efx_channel_has_rx_queue(struct efx_channel *channel) 1040static inline bool efx_channel_has_rx_queue(struct efx_channel *channel)
1038{ 1041{