aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-10-29 03:21:24 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-30 00:37:06 -0400
commit18e1d2beb6c2307d3cab7ecb44fd3d4382adcf6a (patch)
tree4d1279868352923fdf7fcf27176896f4d96d7cb0
parentc7c4b3b6e976b95facbb723951bdcd554a3530a4 (diff)
sfc: Feed GRO result into RX allocation policy and interrupt moderation
When GRO is successfully merging received packets, we should allocate raw page buffers rather than skbs that will be discarded by GRO. Otherwise, we should allocate skbs. GRO also benefits from higher interrupt moderation, so increase the score for mergeable RX packets. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/sfc/rx.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/net/sfc/rx.c b/drivers/net/sfc/rx.c
index 4b65c626a457..9277e9aaad09 100644
--- a/drivers/net/sfc/rx.c
+++ b/drivers/net/sfc/rx.c
@@ -445,6 +445,7 @@ static void efx_rx_packet_lro(struct efx_channel *channel,
445 bool checksummed) 445 bool checksummed)
446{ 446{
447 struct napi_struct *napi = &channel->napi_str; 447 struct napi_struct *napi = &channel->napi_str;
448 gro_result_t gro_result;
448 449
449 /* Pass the skb/page into the LRO engine */ 450 /* Pass the skb/page into the LRO engine */
450 if (rx_buf->page) { 451 if (rx_buf->page) {
@@ -452,6 +453,7 @@ static void efx_rx_packet_lro(struct efx_channel *channel,
452 453
453 if (!skb) { 454 if (!skb) {
454 put_page(rx_buf->page); 455 put_page(rx_buf->page);
456 gro_result = GRO_DROP;
455 goto out; 457 goto out;
456 } 458 }
457 459
@@ -467,7 +469,7 @@ static void efx_rx_packet_lro(struct efx_channel *channel,
467 skb->ip_summed = 469 skb->ip_summed =
468 checksummed ? CHECKSUM_UNNECESSARY : CHECKSUM_NONE; 470 checksummed ? CHECKSUM_UNNECESSARY : CHECKSUM_NONE;
469 471
470 napi_gro_frags(napi); 472 gro_result = napi_gro_frags(napi);
471 473
472out: 474out:
473 EFX_BUG_ON_PARANOID(rx_buf->skb); 475 EFX_BUG_ON_PARANOID(rx_buf->skb);
@@ -476,9 +478,16 @@ out:
476 EFX_BUG_ON_PARANOID(!rx_buf->skb); 478 EFX_BUG_ON_PARANOID(!rx_buf->skb);
477 EFX_BUG_ON_PARANOID(!checksummed); 479 EFX_BUG_ON_PARANOID(!checksummed);
478 480
479 napi_gro_receive(napi, rx_buf->skb); 481 gro_result = napi_gro_receive(napi, rx_buf->skb);
480 rx_buf->skb = NULL; 482 rx_buf->skb = NULL;
481 } 483 }
484
485 if (gro_result == GRO_NORMAL) {
486 channel->rx_alloc_level += RX_ALLOC_FACTOR_SKB;
487 } else if (gro_result != GRO_DROP) {
488 channel->rx_alloc_level += RX_ALLOC_FACTOR_LRO;
489 channel->irq_mod_score += 2;
490 }
482} 491}
483 492
484void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index, 493void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index,