Patchwork [net-next,3/3] myri10ge: Use skb_fill_page_desc().

login
register
mail settings
Submitter Andrew Gallatin
Date Nov. 14, 2012, 1:06 p.m.
Message ID <50A39762.1070707@myri.com>
Download mbox | patch
Permalink /patch/198900/
State Changes Requested
Delegated to: David Miller
Headers show

Comments

Andrew Gallatin - Nov. 14, 2012, 1:06 p.m.
Now that LRO is gone, the receive routine is much simpler, and
we are able to use the standard skb_fill_page_desc() in myri10ge.

Signed-off-by: Andrew Gallatin <gallatin@myri.com>
---
  drivers/net/ethernet/myricom/myri10ge/myri10ge.c |   11 ++++-------
  1 file changed, 4 insertions(+), 7 deletions(-)

  	rx_frags[0].page_offset += MXGEFW_PAD;

Patch

diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c 
b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index b9b6dfd..82e9dcc 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -1347,17 +1347,14 @@  myri10ge_rx_done(struct myri10ge_slice_state 
*ss, int len, __wsum csum)
  	/* Fill skb_frag_struct(s) with data from our receive */
  	for (i = 0, remainder = len; remainder > 0; i++) {
  		myri10ge_unmap_rx_page(pdev, &rx->info[idx], bytes);
-		__skb_frag_set_page(&rx_frags[i], rx->info[idx].page);
-		rx_frags[i].page_offset = rx->info[idx].page_offset;
-		if (remainder < MYRI10GE_ALLOC_SIZE)
-			skb_frag_size_set(&rx_frags[i], remainder);
-		else
-			skb_frag_size_set(&rx_frags[i], MYRI10GE_ALLOC_SIZE);
+		skb_fill_page_desc(skb, i, rx->info[idx].page,
+				   rx->info[idx].page_offset,
+				   remainder < MYRI10GE_ALLOC_SIZE ?
+				   remainder : MYRI10GE_ALLOC_SIZE);
  		rx->cnt++;
  		idx = rx->cnt & rx->mask;
  		remainder -= MYRI10GE_ALLOC_SIZE;
  	}
-	skb_shinfo(skb)->nr_frags = i;

  	/* remove padding */