diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-06-14 01:02:24 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-16 03:12:44 +0200 |
commit | d27f9b35827ec91d71d3561c127a0a8135fb470d (patch) | |
tree | a6a9c67628bf3b807d8bf24375fe6c075b25af32 /net/ipv6 | |
parent | ipv6: syncookies: do not skip ->iif initialization (diff) | |
download | linux-d27f9b35827ec91d71d3561c127a0a8135fb470d.tar.xz linux-d27f9b35827ec91d71d3561c127a0a8135fb470d.zip |
ip_frag: Remove some atomic ops
Instead of doing one atomic operation per frag, we can factorize them.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/reassembly.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c index 6d4292ff5854..a630506151c3 100644 --- a/net/ipv6/reassembly.c +++ b/net/ipv6/reassembly.c @@ -524,7 +524,6 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev, skb_shinfo(head)->frag_list = head->next; skb_reset_transport_header(head); skb_push(head, head->data - skb_network_header(head)); - atomic_sub(head->truesize, &fq->q.net->mem); for (fp=head->next; fp; fp = fp->next) { head->data_len += fp->len; @@ -534,8 +533,8 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev, else if (head->ip_summed == CHECKSUM_COMPLETE) head->csum = csum_add(head->csum, fp->csum); head->truesize += fp->truesize; - atomic_sub(fp->truesize, &fq->q.net->mem); } + atomic_sub(head->truesize, &fq->q.net->mem); head->next = NULL; head->dev = dev; |