summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2012-02-13 23:29:16 +0000
committerBen Hutchings <bhutchings@solarflare.com>2012-02-13 23:40:38 +0000
commitd9ab70079a9730f2d748714cbe4242bc707b9eef (patch)
tree5369dab94326cc5ef40bbba766868fc655cb1cf5
parent7280f5ae0d71f2259a42d1f7603480809e4867fb (diff)
downloadblackbird-op-linux-d9ab70079a9730f2d748714cbe4242bc707b9eef.tar.gz
blackbird-op-linux-d9ab70079a9730f2d748714cbe4242bc707b9eef.zip
sfc: Skip RX end-of-batch work on channels without an RX queue
The code in efx_process_channel() to update the RX queue after each batch of RX completions works out as a no-op on a TX-only channel where the RX queue structure is set to all-zeroes, but (1) efx_channel_get_rx_queue() will BUG() if DEBUG is defined, and (2) it's a waste of time. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r--drivers/net/ethernet/sfc/efx.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 952d0bf7695a..b7cf9f0108ed 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -224,19 +224,20 @@ static int efx_process_channel(struct efx_channel *channel, int budget)
return 0;
spent = efx_nic_process_eventq(channel, budget);
- if (spent == 0)
- return 0;
+ if (spent && efx_channel_has_rx_queue(channel)) {
+ struct efx_rx_queue *rx_queue =
+ efx_channel_get_rx_queue(channel);
+
+ /* Deliver last RX packet. */
+ if (channel->rx_pkt) {
+ __efx_rx_packet(channel, channel->rx_pkt);
+ channel->rx_pkt = NULL;
+ }
- /* Deliver last RX packet. */
- if (channel->rx_pkt) {
- __efx_rx_packet(channel, channel->rx_pkt);
- channel->rx_pkt = NULL;
+ efx_rx_strategy(channel);
+ efx_fast_push_rx_descriptors(rx_queue);
}
- efx_rx_strategy(channel);
-
- efx_fast_push_rx_descriptors(efx_channel_get_rx_queue(channel));
-
return spent;
}
OpenPOWER on IntegriCloud