aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/sfc/rx.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/net/sfc/rx.c b/drivers/net/sfc/rx.c
index c4073522c0a..9e33391db35 100644
--- a/drivers/net/sfc/rx.c
+++ b/drivers/net/sfc/rx.c
@@ -449,15 +449,19 @@ static void efx_rx_packet_lro(struct efx_channel *channel,
449 449
450 /* Pass the skb/page into the LRO engine */ 450 /* Pass the skb/page into the LRO engine */
451 if (rx_buf->page) { 451 if (rx_buf->page) {
452 struct sk_buff *skb = napi_get_frags(napi); 452 struct page *page = rx_buf->page;
453 struct sk_buff *skb;
453 454
455 EFX_BUG_ON_PARANOID(rx_buf->skb);
456 rx_buf->page = NULL;
457
458 skb = napi_get_frags(napi);
454 if (!skb) { 459 if (!skb) {
455 put_page(rx_buf->page); 460 put_page(page);
456 gro_result = GRO_DROP; 461 return;
457 goto out;
458 } 462 }
459 463
460 skb_shinfo(skb)->frags[0].page = rx_buf->page; 464 skb_shinfo(skb)->frags[0].page = page;
461 skb_shinfo(skb)->frags[0].page_offset = 465 skb_shinfo(skb)->frags[0].page_offset =
462 efx_rx_buf_offset(rx_buf); 466 efx_rx_buf_offset(rx_buf);
463 skb_shinfo(skb)->frags[0].size = rx_buf->len; 467 skb_shinfo(skb)->frags[0].size = rx_buf->len;
@@ -470,16 +474,14 @@ static void efx_rx_packet_lro(struct efx_channel *channel,
470 checksummed ? CHECKSUM_UNNECESSARY : CHECKSUM_NONE; 474 checksummed ? CHECKSUM_UNNECESSARY : CHECKSUM_NONE;
471 475
472 gro_result = napi_gro_frags(napi); 476 gro_result = napi_gro_frags(napi);
473
474out:
475 EFX_BUG_ON_PARANOID(rx_buf->skb);
476 rx_buf->page = NULL;
477 } else { 477 } else {
478 EFX_BUG_ON_PARANOID(!rx_buf->skb); 478 struct sk_buff *skb = rx_buf->skb;
479 EFX_BUG_ON_PARANOID(!checksummed);
480 479
481 gro_result = napi_gro_receive(napi, rx_buf->skb); 480 EFX_BUG_ON_PARANOID(!skb);
481 EFX_BUG_ON_PARANOID(!checksummed);
482 rx_buf->skb = NULL; 482 rx_buf->skb = NULL;
483
484 gro_result = napi_gro_receive(napi, skb);
483 } 485 }
484 486
485 if (gro_result == GRO_NORMAL) { 487 if (gro_result == GRO_NORMAL) {