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 /net/ipv4/inet_lro.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 'net/ipv4/inet_lro.c')
-rw-r--r-- | net/ipv4/inet_lro.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c index 8e6be5aad115..cc280a3f4f96 100644 --- a/net/ipv4/inet_lro.c +++ b/net/ipv4/inet_lro.c | |||
@@ -244,11 +244,11 @@ static void lro_add_frags(struct net_lro_desc *lro_desc, | |||
244 | skb->truesize += truesize; | 244 | skb->truesize += truesize; |
245 | 245 | ||
246 | skb_frags[0].page_offset += hlen; | 246 | skb_frags[0].page_offset += hlen; |
247 | skb_frags[0].size -= hlen; | 247 | skb_frag_size_sub(&skb_frags[0], hlen); |
248 | 248 | ||
249 | while (tcp_data_len > 0) { | 249 | while (tcp_data_len > 0) { |
250 | *(lro_desc->next_frag) = *skb_frags; | 250 | *(lro_desc->next_frag) = *skb_frags; |
251 | tcp_data_len -= skb_frags->size; | 251 | tcp_data_len -= skb_frag_size(skb_frags); |
252 | lro_desc->next_frag++; | 252 | lro_desc->next_frag++; |
253 | skb_frags++; | 253 | skb_frags++; |
254 | skb_shinfo(skb)->nr_frags++; | 254 | skb_shinfo(skb)->nr_frags++; |
@@ -400,14 +400,14 @@ static struct sk_buff *lro_gen_skb(struct net_lro_mgr *lro_mgr, | |||
400 | skb_frags = skb_shinfo(skb)->frags; | 400 | skb_frags = skb_shinfo(skb)->frags; |
401 | while (data_len > 0) { | 401 | while (data_len > 0) { |
402 | *skb_frags = *frags; | 402 | *skb_frags = *frags; |
403 | data_len -= frags->size; | 403 | data_len -= skb_frag_size(frags); |
404 | skb_frags++; | 404 | skb_frags++; |
405 | frags++; | 405 | frags++; |
406 | skb_shinfo(skb)->nr_frags++; | 406 | skb_shinfo(skb)->nr_frags++; |
407 | } | 407 | } |
408 | 408 | ||
409 | skb_shinfo(skb)->frags[0].page_offset += hdr_len; | 409 | skb_shinfo(skb)->frags[0].page_offset += hdr_len; |
410 | skb_shinfo(skb)->frags[0].size -= hdr_len; | 410 | skb_frag_size_sub(&skb_shinfo(skb)->frags[0], hdr_len); |
411 | 411 | ||
412 | skb->ip_summed = ip_summed; | 412 | skb->ip_summed = ip_summed; |
413 | skb->csum = sum; | 413 | skb->csum = sum; |