Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Edward Cree and committed by
David S. Miller
e090bfb9 f6ad8c1b

+21 -1
+12
drivers/net/ethernet/sfc/efx.c
··· 264 264 static int efx_process_channel(struct efx_channel *channel, int budget) 265 265 { 266 266 struct efx_tx_queue *tx_queue; 267 + struct list_head rx_list; 267 268 int spent; 268 269 269 270 if (unlikely(!channel->enabled)) 270 271 return 0; 272 + 273 + /* Prepare the batch receive list */ 274 + EFX_WARN_ON_PARANOID(channel->rx_list != NULL); 275 + INIT_LIST_HEAD(&rx_list); 276 + channel->rx_list = &rx_list; 271 277 272 278 efx_for_each_channel_tx_queue(tx_queue, channel) { 273 279 tx_queue->pkts_compl = 0; ··· 296 290 tx_queue->pkts_compl, tx_queue->bytes_compl); 297 291 } 298 292 } 293 + 294 + /* Receive any packets we queued up */ 295 + netif_receive_skb_list(channel->rx_list); 296 + channel->rx_list = NULL; 299 297 300 298 return spent; 301 299 } ··· 564 554 if (rc) 565 555 goto fail; 566 556 } 557 + 558 + channel->rx_list = NULL; 567 559 568 560 return 0; 569 561
+3
drivers/net/ethernet/sfc/net_driver.h
··· 448 448 * __efx_rx_packet(), or zero if there is none 449 449 * @rx_pkt_index: Ring index of first buffer for next packet to be delivered 450 450 * by __efx_rx_packet(), if @rx_pkt_n_frags != 0 451 + * @rx_list: list of SKBs from current RX, awaiting processing 451 452 * @rx_queue: RX queue for this channel 452 453 * @tx_queue: TX queues for this channel 453 454 * @sync_events_state: Current state of sync events on this channel ··· 500 499 501 500 unsigned int rx_pkt_n_frags; 502 501 unsigned int rx_pkt_index; 502 + 503 + struct list_head *rx_list; 503 504 504 505 struct efx_rx_queue rx_queue; 505 506 struct efx_tx_queue tx_queue[EFX_TXQ_TYPES];
+6 -1
drivers/net/ethernet/sfc/rx.c
··· 634 634 return; 635 635 636 636 /* Pass the packet up */ 637 - netif_receive_skb(skb); 637 + if (channel->rx_list != NULL) 638 + /* Add to list, will pass up later */ 639 + list_add_tail(&skb->list, channel->rx_list); 640 + else 641 + /* No list, so pass it up now */ 642 + netif_receive_skb(skb); 638 643 } 639 644 640 645 /* Handle a received packet. Second half: Touches packet payload. */