diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-10-18 17:00:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-10-19 03:10:46 -0400 |
commit | 9e903e085262ffbf1fc44a17ac06058aca03524a (patch) | |
tree | 4acefc97ba38c1733474d25c0b2053b56af97db1 /drivers/net/xen-netfront.c | |
parent | dd767856a36e00b631d65ebc4bb81b19915532d6 (diff) |
net: add skb frag size accessors
To ease skb->truesize sanitization, its better to be able to localize
all references to skb frags size.
Define accessors : skb_frag_size() to fetch frag size, and
skb_frag_size_{set|add|sub}() to manipulate it.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netfront.c')
-rw-r--r-- | drivers/net/xen-netfront.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 6e5d4c09e5d7..226faab23603 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -467,7 +467,7 @@ static void xennet_make_frags(struct sk_buff *skb, struct net_device *dev, | |||
467 | 467 | ||
468 | tx->gref = np->grant_tx_ref[id] = ref; | 468 | tx->gref = np->grant_tx_ref[id] = ref; |
469 | tx->offset = frag->page_offset; | 469 | tx->offset = frag->page_offset; |
470 | tx->size = frag->size; | 470 | tx->size = skb_frag_size(frag); |
471 | tx->flags = 0; | 471 | tx->flags = 0; |
472 | } | 472 | } |
473 | 473 | ||
@@ -965,7 +965,7 @@ err: | |||
965 | if (rx->status > len) { | 965 | if (rx->status > len) { |
966 | skb_shinfo(skb)->frags[0].page_offset = | 966 | skb_shinfo(skb)->frags[0].page_offset = |
967 | rx->offset + len; | 967 | rx->offset + len; |
968 | skb_shinfo(skb)->frags[0].size = rx->status - len; | 968 | skb_frag_size_set(&skb_shinfo(skb)->frags[0], rx->status - len); |
969 | skb->data_len = rx->status - len; | 969 | skb->data_len = rx->status - len; |
970 | } else { | 970 | } else { |
971 | __skb_fill_page_desc(skb, 0, NULL, 0, 0); | 971 | __skb_fill_page_desc(skb, 0, NULL, 0, 0); |