Skip to content

Commit

Permalink
sfc: Skip RX end-of-batch work on channels without an RX queue
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Hutchings committed Feb 13, 2012
1 parent 7280f5a commit d9ab700
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions drivers/net/ethernet/sfc/efx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit d9ab700

Please sign in to comment.