netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][XFRM] Statistics: Add outbound-dropping error.
@ 2008-01-08  4:29 Masahide NAKAMURA
  2008-01-08  4:33 ` Herbert Xu
  2008-01-08  5:46 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Masahide NAKAMURA @ 2008-01-08  4:29 UTC (permalink / raw)
  To: davem; +Cc: herbert, netdev, Masahide NAKAMURA

Hello,

I found two more points where they should be incremented
as XFRM packet dropping counter. Please apply it.

P.S.
I don't touch XFRM_LOOKUP_ICMP related error at __xfrm_lookup()
since it may not drop the packet.
Correct me if it is wrong or comments are welcomed.


[PATCH][XFRM] Statistics: Add outbound-dropping error.

o Increment PolError counter when flow_cache_lookup() returns
  errored pointer.

o Increment NoStates counter at larval-drop.

Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
---
 net/xfrm/xfrm_policy.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 280f8de..d83227b 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1510,8 +1510,10 @@ restart:
 		policy = flow_cache_lookup(fl, dst_orig->ops->family,
 					   dir, xfrm_policy_lookup);
 		err = PTR_ERR(policy);
-		if (IS_ERR(policy))
+		if (IS_ERR(policy)) {
+			XFRM_INC_STATS(LINUX_MIB_XFRMOUTPOLERROR);
 			goto dropdst;
+		}
 	}
 
 	if (!policy)
@@ -1603,6 +1605,7 @@ restart:
 				/* EREMOTE tells the caller to generate
 				 * a one-shot blackhole route.
 				 */
+				XFRM_INC_STATS(LINUX_MIB_XFRMOUTNOSTATES);
 				xfrm_pol_put(policy);
 				return -EREMOTE;
 			}
-- 
1.4.4.2


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

* Re: [PATCH][XFRM] Statistics: Add outbound-dropping error.
  2008-01-08  4:29 [PATCH][XFRM] Statistics: Add outbound-dropping error Masahide NAKAMURA
@ 2008-01-08  4:33 ` Herbert Xu
  2008-01-08  5:46 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2008-01-08  4:33 UTC (permalink / raw)
  To: Masahide NAKAMURA; +Cc: davem, netdev

On Tue, Jan 08, 2008 at 01:29:28PM +0900, Masahide NAKAMURA wrote:
>
> P.S.
> I don't touch XFRM_LOOKUP_ICMP related error at __xfrm_lookup()
> since it may not drop the packet.
> Correct me if it is wrong or comments are welcomed.

Right, whether the packet is dropped would be decided by the caller.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

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

* Re: [PATCH][XFRM] Statistics: Add outbound-dropping error.
  2008-01-08  4:29 [PATCH][XFRM] Statistics: Add outbound-dropping error Masahide NAKAMURA
  2008-01-08  4:33 ` Herbert Xu
@ 2008-01-08  5:46 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2008-01-08  5:46 UTC (permalink / raw)
  To: nakam; +Cc: herbert, netdev

From: Masahide NAKAMURA <nakam@linux-ipv6.org>
Date: Tue,  8 Jan 2008 13:29:28 +0900

> [PATCH][XFRM] Statistics: Add outbound-dropping error.
> 
> o Increment PolError counter when flow_cache_lookup() returns
>   errored pointer.
> 
> o Increment NoStates counter at larval-drop.
> 
> Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>

Applied, thanks.

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

end of thread, other threads:[~2008-01-08  5:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-08  4:29 [PATCH][XFRM] Statistics: Add outbound-dropping error Masahide NAKAMURA
2008-01-08  4:33 ` Herbert Xu
2008-01-08  5:46 ` 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).