netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]IPv6: Delete redundant counter of IPSTATS_MIB_REASMFAILS
@ 2010-02-11 10:12 Shan Wei
  2010-02-16  5:54 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Shan Wei @ 2010-02-11 10:12 UTC (permalink / raw)
  To: David Miller, kuznet, pekkas, jmorris, yoshfuji, Patrick McHardy,
	eric.dumazet, ado
  Cc: netdev@vger.kernel.org


When no more memory can be allocated, fq_find() will return NULL and 
increase the value of IPSTATS_MIB_REASMFAILS. In this case,
ipv6_frag_rcv() also increase the value of IPSTATS_MIB_REASMFAILS.

So, the patch deletes redundant counter of IPSTATS_MIB_REASMFAILS in fq_find().
and deletes the unused parameter of idev.


Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
---
 net/ipv6/reassembly.c |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 2cddea3..01a996f 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -237,8 +237,7 @@ out:
 }
 
 static __inline__ struct frag_queue *
-fq_find(struct net *net, __be32 id, struct in6_addr *src, struct in6_addr *dst,
-	struct inet6_dev *idev)
+fq_find(struct net *net, __be32 id, struct in6_addr *src, struct in6_addr *dst)
 {
 	struct inet_frag_queue *q;
 	struct ip6_create_arg arg;
@@ -254,13 +253,9 @@ fq_find(struct net *net, __be32 id, struct in6_addr *src, struct in6_addr *dst,
 
 	q = inet_frag_find(&net->ipv6.frags, &ip6_frags, &arg, hash);
 	if (q == NULL)
-		goto oom;
+		return NULL;
 
 	return container_of(q, struct frag_queue, q);
-
-oom:
-	IP6_INC_STATS_BH(net, idev, IPSTATS_MIB_REASMFAILS);
-	return NULL;
 }
 
 static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
@@ -606,8 +601,8 @@ static int ipv6_frag_rcv(struct sk_buff *skb)
 	if (atomic_read(&net->ipv6.frags.mem) > net->ipv6.frags.high_thresh)
 		ip6_evictor(net, ip6_dst_idev(skb_dst(skb)));
 
-	if ((fq = fq_find(net, fhdr->identification, &hdr->saddr, &hdr->daddr,
-			  ip6_dst_idev(skb_dst(skb)))) != NULL) {
+	fq = fq_find(net, fhdr->identification, &hdr->saddr, &hdr->daddr);
+	if (fq != NULL) {
 		int ret;
 
 		spin_lock(&fq->q.lock);
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH]IPv6: Delete redundant counter of IPSTATS_MIB_REASMFAILS
  2010-02-11 10:12 [PATCH]IPv6: Delete redundant counter of IPSTATS_MIB_REASMFAILS Shan Wei
@ 2010-02-16  5:54 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-02-16  5:54 UTC (permalink / raw)
  To: shanwei
  Cc: kuznet, pekkas, jmorris, yoshfuji, kaber, eric.dumazet, adobriyan,
	opurdila, yanghy, netdev

From: Shan Wei <shanwei@cn.fujitsu.com>
Date: Thu, 11 Feb 2010 18:12:45 +0800

> 
> When no more memory can be allocated, fq_find() will return NULL and 
> increase the value of IPSTATS_MIB_REASMFAILS. In this case,
> ipv6_frag_rcv() also increase the value of IPSTATS_MIB_REASMFAILS.
> 
> So, the patch deletes redundant counter of IPSTATS_MIB_REASMFAILS in fq_find().
> and deletes the unused parameter of idev.
> 
> 
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>

Applied to net-next-2.6, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-02-16  5:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-11 10:12 [PATCH]IPv6: Delete redundant counter of IPSTATS_MIB_REASMFAILS Shan Wei
2010-02-16  5:54 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).