Skip to content

Commit

Permalink
netfilter: defrag: remove one redundant atomic ops
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shan Wei authored and Patrick McHardy committed Jun 14, 2010
1 parent c86ee67 commit 841a594
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions net/ipv6/netfilter/nf_conntrack_reasm.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,6 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
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, &nf_init_frags.mem);

for (fp=head->next; fp; fp = fp->next) {
head->data_len += fp->len;
Expand All @@ -452,8 +451,8 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
else if (head->ip_summed == CHECKSUM_COMPLETE)
head->csum = csum_add(head->csum, fp->csum);
head->truesize += fp->truesize;
atomic_sub(fp->truesize, &nf_init_frags.mem);
}
atomic_sub(head->truesize, &nf_init_frags.mem);

head->next = NULL;
head->dev = dev;
Expand Down

0 comments on commit 841a594

Please sign in to comment.