aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShan Wei <shanwei@cn.fujitsu.com>2010-06-14 10:28:23 -0400
committerPatrick McHardy <kaber@trash.net>2010-06-14 10:28:23 -0400
commit841a5940eb872d70dad2b9ee7f946d8fd13a8c22 (patch)
tree7727cf76129dbb783f02059517bc293183f545db
parentc86ee67c7c4bbab2818f653eb00a70671821624a (diff)
netfilter: defrag: remove one redundant atomic ops
Instead of doing one atomic operation per frag, we can factorize them. Reported from Eric Dumazet. Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com> Acked-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 6fb890187de0..bc5b86d477c1 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -442,7 +442,6 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
442 skb_shinfo(head)->frag_list = head->next; 442 skb_shinfo(head)->frag_list = head->next;
443 skb_reset_transport_header(head); 443 skb_reset_transport_header(head);
444 skb_push(head, head->data - skb_network_header(head)); 444 skb_push(head, head->data - skb_network_header(head));
445 atomic_sub(head->truesize, &nf_init_frags.mem);
446 445
447 for (fp=head->next; fp; fp = fp->next) { 446 for (fp=head->next; fp; fp = fp->next) {
448 head->data_len += fp->len; 447 head->data_len += fp->len;
@@ -452,8 +451,8 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
452 else if (head->ip_summed == CHECKSUM_COMPLETE) 451 else if (head->ip_summed == CHECKSUM_COMPLETE)
453 head->csum = csum_add(head->csum, fp->csum); 452 head->csum = csum_add(head->csum, fp->csum);
454 head->truesize += fp->truesize; 453 head->truesize += fp->truesize;
455 atomic_sub(fp->truesize, &nf_init_frags.mem);
456 } 454 }
455 atomic_sub(head->truesize, &nf_init_frags.mem);
457 456
458 head->next = NULL; 457 head->next = NULL;
459 head->dev = dev; 458 head->dev = dev;