sfc: batch up RX delivery
Improves packet rate of 1-byte UDP receives by up to 10%. Signed-off-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>hifive-unleashed-5.1
parent
f6ad8c1bcd
commit
e090bfb9f1
|
@ -264,11 +264,17 @@ static int efx_check_disabled(struct efx_nic *efx)
|
||||||
static int efx_process_channel(struct efx_channel *channel, int budget)
|
static int efx_process_channel(struct efx_channel *channel, int budget)
|
||||||
{
|
{
|
||||||
struct efx_tx_queue *tx_queue;
|
struct efx_tx_queue *tx_queue;
|
||||||
|
struct list_head rx_list;
|
||||||
int spent;
|
int spent;
|
||||||
|
|
||||||
if (unlikely(!channel->enabled))
|
if (unlikely(!channel->enabled))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
/* Prepare the batch receive list */
|
||||||
|
EFX_WARN_ON_PARANOID(channel->rx_list != NULL);
|
||||||
|
INIT_LIST_HEAD(&rx_list);
|
||||||
|
channel->rx_list = &rx_list;
|
||||||
|
|
||||||
efx_for_each_channel_tx_queue(tx_queue, channel) {
|
efx_for_each_channel_tx_queue(tx_queue, channel) {
|
||||||
tx_queue->pkts_compl = 0;
|
tx_queue->pkts_compl = 0;
|
||||||
tx_queue->bytes_compl = 0;
|
tx_queue->bytes_compl = 0;
|
||||||
|
@ -291,6 +297,10 @@ static int efx_process_channel(struct efx_channel *channel, int budget)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Receive any packets we queued up */
|
||||||
|
netif_receive_skb_list(channel->rx_list);
|
||||||
|
channel->rx_list = NULL;
|
||||||
|
|
||||||
return spent;
|
return spent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -555,6 +565,8 @@ static int efx_probe_channel(struct efx_channel *channel)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
channel->rx_list = NULL;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
|
|
@ -448,6 +448,7 @@ enum efx_sync_events_state {
|
||||||
* __efx_rx_packet(), or zero if there is none
|
* __efx_rx_packet(), or zero if there is none
|
||||||
* @rx_pkt_index: Ring index of first buffer for next packet to be delivered
|
* @rx_pkt_index: Ring index of first buffer for next packet to be delivered
|
||||||
* by __efx_rx_packet(), if @rx_pkt_n_frags != 0
|
* by __efx_rx_packet(), if @rx_pkt_n_frags != 0
|
||||||
|
* @rx_list: list of SKBs from current RX, awaiting processing
|
||||||
* @rx_queue: RX queue for this channel
|
* @rx_queue: RX queue for this channel
|
||||||
* @tx_queue: TX queues for this channel
|
* @tx_queue: TX queues for this channel
|
||||||
* @sync_events_state: Current state of sync events on this channel
|
* @sync_events_state: Current state of sync events on this channel
|
||||||
|
@ -500,6 +501,8 @@ struct efx_channel {
|
||||||
unsigned int rx_pkt_n_frags;
|
unsigned int rx_pkt_n_frags;
|
||||||
unsigned int rx_pkt_index;
|
unsigned int rx_pkt_index;
|
||||||
|
|
||||||
|
struct list_head *rx_list;
|
||||||
|
|
||||||
struct efx_rx_queue rx_queue;
|
struct efx_rx_queue rx_queue;
|
||||||
struct efx_tx_queue tx_queue[EFX_TXQ_TYPES];
|
struct efx_tx_queue tx_queue[EFX_TXQ_TYPES];
|
||||||
|
|
||||||
|
|
|
@ -634,6 +634,11 @@ static void efx_rx_deliver(struct efx_channel *channel, u8 *eh,
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Pass the packet up */
|
/* Pass the packet up */
|
||||||
|
if (channel->rx_list != NULL)
|
||||||
|
/* Add to list, will pass up later */
|
||||||
|
list_add_tail(&skb->list, channel->rx_list);
|
||||||
|
else
|
||||||
|
/* No list, so pass it up now */
|
||||||
netif_receive_skb(skb);
|
netif_receive_skb(skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue