diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2012-02-13 18:29:16 -0500 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2012-02-13 18:40:38 -0500 |
commit | d9ab70079a9730f2d748714cbe4242bc707b9eef (patch) | |
tree | 5369dab94326cc5ef40bbba766868fc655cb1cf5 /drivers/net/ethernet/sfc/efx.c | |
parent | 7280f5ae0d71f2259a42d1f7603480809e4867fb (diff) |
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>
Diffstat (limited to 'drivers/net/ethernet/sfc/efx.c')
-rw-r--r-- | drivers/net/ethernet/sfc/efx.c | 21 |
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) | |||
224 | return 0; | 224 | return 0; |
225 | 225 | ||
226 | spent = efx_nic_process_eventq(channel, budget); | 226 | spent = efx_nic_process_eventq(channel, budget); |
227 | if (spent == 0) | 227 | if (spent && efx_channel_has_rx_queue(channel)) { |
228 | return 0; | 228 | struct efx_rx_queue *rx_queue = |
229 | efx_channel_get_rx_queue(channel); | ||
230 | |||
231 | /* Deliver last RX packet. */ | ||
232 | if (channel->rx_pkt) { | ||
233 | __efx_rx_packet(channel, channel->rx_pkt); | ||
234 | channel->rx_pkt = NULL; | ||
235 | } | ||
229 | 236 | ||
230 | /* Deliver last RX packet. */ | 237 | efx_rx_strategy(channel); |
231 | if (channel->rx_pkt) { | 238 | efx_fast_push_rx_descriptors(rx_queue); |
232 | __efx_rx_packet(channel, channel->rx_pkt); | ||
233 | channel->rx_pkt = NULL; | ||
234 | } | 239 | } |
235 | 240 | ||
236 | efx_rx_strategy(channel); | ||
237 | |||
238 | efx_fast_push_rx_descriptors(efx_channel_get_rx_queue(channel)); | ||
239 | |||
240 | return spent; | 241 | return spent; |
241 | } | 242 | } |
242 | 243 | ||