sfc: Make efx_for_each_channel_rx_queue() more efficient
authorBen Hutchings <bhutchings@solarflare.com>
Mon, 1 Sep 2008 11:47:57 +0000 (12:47 +0100)
committerJeff Garzik <jgarzik@redhat.com>
Wed, 3 Sep 2008 13:53:46 +0000 (09:53 -0400)
Currently each channel can have at most one RX queue, so go straight to
that one.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/net/sfc/net_driver.h

index b5649b1..74e934c 100644 (file)
@@ -853,9 +853,9 @@ struct efx_nic_type {
 
 /* Iterate over all RX queues belonging to a channel */
 #define efx_for_each_channel_rx_queue(_rx_queue, _channel)             \
-       for (_rx_queue = &_channel->efx->rx_queue[0];                   \
-            _rx_queue < &_channel->efx->rx_queue[EFX_MAX_RX_QUEUES];   \
-            _rx_queue++)                                               \
+       for (_rx_queue = &_channel->efx->rx_queue[_channel->channel];   \
+            _rx_queue;                                                 \
+            _rx_queue = NULL)                                          \
                if (_rx_queue->channel != _channel)                     \
                        continue;                                       \
                else