* [XFRM]: Fix outbound statistics.
@ 2007-12-21 14:25 Masahide NAKAMURA
2007-12-21 15:11 ` Herbert Xu
2007-12-25 0:00 ` David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Masahide NAKAMURA @ 2007-12-21 14:25 UTC (permalink / raw)
To: davem, herbert; +Cc: netdev, usagi-core, Masahide NAKAMURA
Hello David,
I'm sorry, the previous mail contains wrong code:
> David, I failed to include this statistics codes since I didn't notice
> the conflict with the latest Herbert XFRM fix.
>
> Please apply this, too.
>
> Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
> ---
[snip]
>
> do {
> err = xfrm_state_check_space(x, skb);
> - if (err)
> + if (err) {
> goto error_nolock;
> + XFRM_INC_STATS(LINUX_MIB_XFRMOUTERROR);
> + }
Please apply the below patch instead of the previous.
Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
---
net/xfrm/xfrm_output.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 867484a..f8e5961 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -43,17 +43,23 @@ static int xfrm_output_one(struct sk_buff *skb, int err)
do {
err = xfrm_state_check_space(x, skb);
- if (err)
+ if (err) {
+ XFRM_INC_STATS(LINUX_MIB_XFRMOUTERROR);
goto error_nolock;
+ }
err = x->outer_mode->output(x, skb);
- if (err)
+ if (err) {
+ XFRM_INC_STATS(LINUX_MIB_XFRMOUTSTATEMODEERROR);
goto error_nolock;
+ }
spin_lock_bh(&x->lock);
err = xfrm_state_check_expire(x);
- if (err)
+ if (err) {
+ XFRM_INC_STATS(LINUX_MIB_XFRMOUTSTATEEXPIRED);
goto error;
+ }
if (x->type->flags & XFRM_TYPE_REPLAY_PROT) {
XFRM_SKB_CB(skb)->seq = ++x->replay.oseq;
--
1.4.4.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [XFRM]: Fix outbound statistics.
2007-12-21 14:25 [XFRM]: Fix outbound statistics Masahide NAKAMURA
@ 2007-12-21 15:11 ` Herbert Xu
2007-12-25 0:00 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2007-12-21 15:11 UTC (permalink / raw)
To: Masahide NAKAMURA; +Cc: davem, netdev, usagi-core
On Fri, Dec 21, 2007 at 11:25:00PM +0900, Masahide NAKAMURA wrote:
>
> do {
> err = xfrm_state_check_space(x, skb);
> - if (err)
> + if (err) {
> + XFRM_INC_STATS(LINUX_MIB_XFRMOUTERROR);
> goto error_nolock;
> + }
>
> err = x->outer_mode->output(x, skb);
> - if (err)
> + if (err) {
> + XFRM_INC_STATS(LINUX_MIB_XFRMOUTSTATEMODEERROR);
BTW, none of our existing mode output functions actually return
an error. I noticed that the description for this field is actually
"Transformation mode specific error, e.g. Outer header space is not
enough". This is slightly misleading as output header space is
checked by xfrm_state_check_space so if there's an error that's
where it'll show up.
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] 4+ messages in thread* Re: [XFRM]: Fix outbound statistics.
2007-12-21 14:25 [XFRM]: Fix outbound statistics Masahide NAKAMURA
2007-12-21 15:11 ` Herbert Xu
@ 2007-12-25 0:00 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2007-12-25 0:00 UTC (permalink / raw)
To: nakam; +Cc: herbert, netdev, usagi-core
From: Masahide NAKAMURA <nakam@linux-ipv6.org>
Date: Fri, 21 Dec 2007 23:25:00 +0900
> Hello David,
>
> I'm sorry, the previous mail contains wrong code:
...
> Please apply the below patch instead of the previous.
>
> Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [XFRM]: Fix outbound statistics.
@ 2007-12-21 14:17 Masahide NAKAMURA
0 siblings, 0 replies; 4+ messages in thread
From: Masahide NAKAMURA @ 2007-12-21 14:17 UTC (permalink / raw)
To: davem, herbert; +Cc: netdev, usagi-core, Masahide NAKAMURA
David, I failed to include this statistics codes since I didn't notice
the conflict with the latest Herbert XFRM fix.
Please apply this, too.
Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
---
net/xfrm/xfrm_output.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 867484a..8dee031 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -43,17 +43,23 @@ static int xfrm_output_one(struct sk_buff *skb, int err)
do {
err = xfrm_state_check_space(x, skb);
- if (err)
+ if (err) {
goto error_nolock;
+ XFRM_INC_STATS(LINUX_MIB_XFRMOUTERROR);
+ }
err = x->outer_mode->output(x, skb);
- if (err)
+ if (err) {
+ XFRM_INC_STATS(LINUX_MIB_XFRMOUTSTATEMODEERROR);
goto error_nolock;
+ }
spin_lock_bh(&x->lock);
err = xfrm_state_check_expire(x);
- if (err)
+ if (err) {
+ XFRM_INC_STATS(LINUX_MIB_XFRMOUTSTATEEXPIRED);
goto error;
+ }
if (x->type->flags & XFRM_TYPE_REPLAY_PROT) {
XFRM_SKB_CB(skb)->seq = ++x->replay.oseq;
--
1.4.4.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-12-25 0:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-21 14:25 [XFRM]: Fix outbound statistics Masahide NAKAMURA
2007-12-21 15:11 ` Herbert Xu
2007-12-25 0:00 ` David Miller
-- strict thread matches above, loose matches on Subject: below --
2007-12-21 14:17 Masahide NAKAMURA
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).