sfc: Use 'skb_add_rx_frag()' instead of hand coding it
Some lines of code can be merged into an equivalent 'skb_add_rx_frag()' call which is less verbose. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c3105f8485
commit
c438a801e0
@ -94,12 +94,11 @@ static struct sk_buff *efx_rx_mk_skb(struct efx_channel *channel,
|
|||||||
rx_buf->len -= hdr_len;
|
rx_buf->len -= hdr_len;
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags,
|
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
||||||
rx_buf->page, rx_buf->page_offset,
|
rx_buf->page, rx_buf->page_offset,
|
||||||
rx_buf->len);
|
rx_buf->len, efx->rx_buffer_truesize);
|
||||||
rx_buf->page = NULL;
|
rx_buf->page = NULL;
|
||||||
skb->len += rx_buf->len;
|
|
||||||
skb->data_len += rx_buf->len;
|
|
||||||
if (skb_shinfo(skb)->nr_frags == n_frags)
|
if (skb_shinfo(skb)->nr_frags == n_frags)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -111,8 +110,6 @@ static struct sk_buff *efx_rx_mk_skb(struct efx_channel *channel,
|
|||||||
n_frags = 0;
|
n_frags = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
skb->truesize += n_frags * efx->rx_buffer_truesize;
|
|
||||||
|
|
||||||
/* Move past the ethernet header */
|
/* Move past the ethernet header */
|
||||||
skb->protocol = eth_type_trans(skb, efx->net_dev);
|
skb->protocol = eth_type_trans(skb, efx->net_dev);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user