* Re: [PATCH] ICMP: ICMP_MIB_OUTMSGS increment duplicated
2008-01-16 9:59 [PATCH] ICMP: ICMP_MIB_OUTMSGS increment duplicated Wang Chen
@ 2008-01-16 11:49 ` Herbert Xu
2008-01-16 16:23 ` David Stevens
2008-01-21 9:46 ` [PATCH 1/2] IPV6: ICMP6_MIB_OUTMSGS " Wang Chen
` (2 subsequent siblings)
3 siblings, 1 reply; 19+ messages in thread
From: Herbert Xu @ 2008-01-16 11:49 UTC (permalink / raw)
To: Wang Chen; +Cc: davem, dlstevens, netdev
Wang Chen <wangchen@cn.fujitsu.com> wrote:
> In tree net-2.6.25, commit "96793b482540f3a26e2188eaf75cb56b7829d3e3"
> made a mistake.
>
> In that patch, David L added a icmp_out_count() in ip_push_pending_frames(),
> remove icmp_out_count() from icmp_reply(). But he forgot to remove
> icmp_out_count() from icmp_send() too.
> Since icmp_send and icmp_reply will call icmp_push_reply, which will call
> ip_push_pending_frames, a duplicated increment happened in icmp_send.
Actually having the icmp_out_count call in ip_push_pending_frames seems
inconsistent. Having it there means that we count raw socket ICMP packets
too. But we don't do that for any other protocol, e.g., raw UDP packets
don't get counted.
So was the inclusion of raw ICMP packets intentional?
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] 19+ messages in thread* Re: [PATCH] ICMP: ICMP_MIB_OUTMSGS increment duplicated
2008-01-16 11:49 ` Herbert Xu
@ 2008-01-16 16:23 ` David Stevens
2008-01-16 23:17 ` Herbert Xu
2008-01-17 0:55 ` Wang Chen
0 siblings, 2 replies; 19+ messages in thread
From: David Stevens @ 2008-01-16 16:23 UTC (permalink / raw)
To: Herbert Xu; +Cc: davem, netdev, Wang Chen
Herbert Xu <herbert@gondor.apana.org.au> wrote on 01/16/2008 03:49:01 AM:
> Actually having the icmp_out_count call in ip_push_pending_frames seems
> inconsistent. Having it there means that we count raw socket ICMP
packets
> too. But we don't do that for any other protocol, e.g., raw UDP packets
> don't get counted.
Herbert,
The patch was to support the ICMPMsgStats table. Since none of
certain
types of output ICMP messages are generated by the kernel, but are
required
by the RFC, counting raw sockets is intentional (and the only way those
ICMP
types can be counted at all).
Raw UDP packets would not be counted either before or after the
patch,
but aren't part of the ICMPMsgStats table. Adding those might be
worthwhile,
but it isn't quite the hole that the ICMP out stats were, since there is a
cooked interface for UDP output that counts the common use, at least.
Wang,
I think your patch is correct; did you test the same case for
IPv6?
+-DLS
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH] ICMP: ICMP_MIB_OUTMSGS increment duplicated
2008-01-16 16:23 ` David Stevens
@ 2008-01-16 23:17 ` Herbert Xu
2008-01-17 0:10 ` David Stevens
2008-01-17 0:55 ` Wang Chen
1 sibling, 1 reply; 19+ messages in thread
From: Herbert Xu @ 2008-01-16 23:17 UTC (permalink / raw)
To: David Stevens; +Cc: herbert, davem, netdev, wangchen
David Stevens <dlstevens@us.ibm.com> wrote:
>
> The patch was to support the ICMPMsgStats table. Since none of
> certain
> types of output ICMP messages are generated by the kernel, but are
> required
> by the RFC, counting raw sockets is intentional (and the only way those
> ICMP
> types can be counted at all).
> Raw UDP packets would not be counted either before or after the
> patch,
> but aren't part of the ICMPMsgStats table. Adding those might be
> worthwhile,
> but it isn't quite the hole that the ICMP out stats were, since there is a
> cooked interface for UDP output that counts the common use, at least.
Fair enough. How about moving this code back into icmp.c and just
add a new count call in raw.c? The push pending function is used on
the UDP fast path so the leaner it is the better.
Thanks,
--
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] 19+ messages in thread* Re: [PATCH] ICMP: ICMP_MIB_OUTMSGS increment duplicated
2008-01-16 23:17 ` Herbert Xu
@ 2008-01-17 0:10 ` David Stevens
0 siblings, 0 replies; 19+ messages in thread
From: David Stevens @ 2008-01-17 0:10 UTC (permalink / raw)
To: Herbert Xu; +Cc: davem, herbert, netdev, netdev-owner, wangchen
netdev-owner@vger.kernel.org wrote on 01/16/2008 03:17:29 PM:
> Fair enough. How about moving this code back into icmp.c and just
> add a new count call in raw.c? The push pending function is used on
> the UDP fast path so the leaner it is the better.
I started out with it there, but it certainly wasn't
cleaner. You have to peek on the queue, which I didn't
want to do for all the SMP issues that brings in, and
then replicate all the code push_pending_frames does to
get you a protocol header pointer in one buffer, and there
are multiple ways in the raw path to get you there (so the
counter code itself would appear in multiple places).
I don't think the 2 instructions measurably impact
anything in the fast path and that is the earliest common
point for the multiple paths to generate ICMP output where
the header and type are available without replicating code.
So, simplicity is exactly why I put it there, rather than
the "obvious" places at the higher layer. :-) It's probably
the better, single place to put the other protocol "out messages"
counters, too, since those probably also have multiple paths
that end up here, but ICMPMsgStats was all that patch was
after.
+-DLS
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] ICMP: ICMP_MIB_OUTMSGS increment duplicated
2008-01-16 16:23 ` David Stevens
2008-01-16 23:17 ` Herbert Xu
@ 2008-01-17 0:55 ` Wang Chen
1 sibling, 0 replies; 19+ messages in thread
From: Wang Chen @ 2008-01-17 0:55 UTC (permalink / raw)
To: David Stevens; +Cc: Herbert Xu, davem, netdev
David Stevens said the following on 2008-1-17 0:23:
> Wang,
> I think your patch is correct; did you test the same case for
> IPv6?
>
I've tested IPv4, but IPv6 not yet.
If Davem accept this one, I will see the IPv6, or you take care of it.
--
WCN
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 1/2] IPV6: ICMP6_MIB_OUTMSGS increment duplicated
2008-01-16 9:59 [PATCH] ICMP: ICMP_MIB_OUTMSGS increment duplicated Wang Chen
2008-01-16 11:49 ` Herbert Xu
@ 2008-01-21 9:46 ` Wang Chen
2008-01-21 9:59 ` YOSHIFUJI Hideaki / 吉藤英明
2008-01-21 10:57 ` David Miller
2008-01-21 9:46 ` [PATCH 2/2] IPV6: RFC 2011 compatibility broken Wang Chen
2008-01-21 11:15 ` [PATCH] ICMP: ICMP_MIB_OUTMSGS increment duplicated Wang Chen
3 siblings, 2 replies; 19+ messages in thread
From: Wang Chen @ 2008-01-21 9:46 UTC (permalink / raw)
To: David S. Miller; +Cc: David L Stevens, netdev, Herbert Xu
[IPV6]: ICMP6_MIB_OUTMSGS increment duplicated
icmpv6_send() calls ip6_push_pending_frames() indirectly.
Both ip6_push_pending_frames() and icmpv6_send() increment
counter ICMP6_MIB_OUTMSGS.
This patch remove the increment from icmpv6_send.
Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
--- linux-2.6.24.rc8.org/net/ipv6/icmp.c 2008-01-16 17:45:03.000000000 +0800
+++ linux-2.6.24.rc8/net/ipv6/icmp.c 2008-01-21 15:56:06.000000000 +0800
@@ -458,8 +458,6 @@ void icmpv6_send(struct sk_buff *skb, in
}
err = icmpv6_push_pending_frames(sk, &fl, &tmp_hdr, len + sizeof(struct icmp6hdr));
- ICMP6_INC_STATS_BH(idev, ICMP6_MIB_OUTMSGS);
-
out_put:
if (likely(idev != NULL))
in6_dev_put(idev);
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 1/2] IPV6: ICMP6_MIB_OUTMSGS increment duplicated
2008-01-21 9:46 ` [PATCH 1/2] IPV6: ICMP6_MIB_OUTMSGS " Wang Chen
@ 2008-01-21 9:59 ` YOSHIFUJI Hideaki / 吉藤英明
2008-01-21 10:57 ` David Miller
1 sibling, 0 replies; 19+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2008-01-21 9:59 UTC (permalink / raw)
To: wangchen; +Cc: davem, dlstevens, netdev, herbert
In article <479469F8.4010203@cn.fujitsu.com> (at Mon, 21 Jan 2008 17:46:32 +0800), Wang Chen <wangchen@cn.fujitsu.com> says:
> [IPV6]: ICMP6_MIB_OUTMSGS increment duplicated
>
> icmpv6_send() calls ip6_push_pending_frames() indirectly.
> Both ip6_push_pending_frames() and icmpv6_send() increment
> counter ICMP6_MIB_OUTMSGS.
>
> This patch remove the increment from icmpv6_send.
>
> Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
--yoshfuji
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 1/2] IPV6: ICMP6_MIB_OUTMSGS increment duplicated
2008-01-21 9:46 ` [PATCH 1/2] IPV6: ICMP6_MIB_OUTMSGS " Wang Chen
2008-01-21 9:59 ` YOSHIFUJI Hideaki / 吉藤英明
@ 2008-01-21 10:57 ` David Miller
2008-01-21 10:59 ` Wang Chen
1 sibling, 1 reply; 19+ messages in thread
From: David Miller @ 2008-01-21 10:57 UTC (permalink / raw)
To: wangchen; +Cc: dlstevens, netdev, herbert
From: Wang Chen <wangchen@cn.fujitsu.com>
Date: Mon, 21 Jan 2008 17:46:32 +0800
> [IPV6]: ICMP6_MIB_OUTMSGS increment duplicated
>
> icmpv6_send() calls ip6_push_pending_frames() indirectly.
> Both ip6_push_pending_frames() and icmpv6_send() increment
> counter ICMP6_MIB_OUTMSGS.
>
> This patch remove the increment from icmpv6_send.
>
> Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Which tree are these two changes targetted at?
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 1/2] IPV6: ICMP6_MIB_OUTMSGS increment duplicated
2008-01-21 10:57 ` David Miller
@ 2008-01-21 10:59 ` Wang Chen
2008-01-21 11:06 ` David Miller
0 siblings, 1 reply; 19+ messages in thread
From: Wang Chen @ 2008-01-21 10:59 UTC (permalink / raw)
To: David Miller; +Cc: dlstevens, netdev, herbert
David Miller said the following on 2008-1-21 18:57:
>> [IPV6]: ICMP6_MIB_OUTMSGS increment duplicated
>>
>> icmpv6_send() calls ip6_push_pending_frames() indirectly.
>> Both ip6_push_pending_frames() and icmpv6_send() increment
>> counter ICMP6_MIB_OUTMSGS.
>>
>> This patch remove the increment from icmpv6_send.
>>
>> Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
>
> Which tree are these two changes targetted at?
>
>
Dave, because the network of my working place can't clone git
tree, I used 2.6.24-rc8 to make the patches.
Can you apply them to net-2.6 tree?
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 1/2] IPV6: ICMP6_MIB_OUTMSGS increment duplicated
2008-01-21 10:59 ` Wang Chen
@ 2008-01-21 11:06 ` David Miller
2008-01-21 11:12 ` Wang Chen
0 siblings, 1 reply; 19+ messages in thread
From: David Miller @ 2008-01-21 11:06 UTC (permalink / raw)
To: wangchen; +Cc: dlstevens, netdev, herbert
From: Wang Chen <wangchen@cn.fujitsu.com>
Date: Mon, 21 Jan 2008 18:59:43 +0800
> Dave, because the network of my working place can't clone git
> tree, I used 2.6.24-rc8 to make the patches.
Does someone know how to setup GIT to update the HTTP
fetch information as a post-push hook?
> Can you apply them to net-2.6 tree?
Done.
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 1/2] IPV6: ICMP6_MIB_OUTMSGS increment duplicated
2008-01-21 11:06 ` David Miller
@ 2008-01-21 11:12 ` Wang Chen
0 siblings, 0 replies; 19+ messages in thread
From: Wang Chen @ 2008-01-21 11:12 UTC (permalink / raw)
To: David Miller; +Cc: dlstevens, netdev, herbert
David Miller said the following on 2008-1-21 19:06:
> Does someone know how to setup GIT to update the HTTP
> fetch information as a post-push hook?
>
Seems Herbert knows how to do it.
Maybe run git-update-server-info every time when you rebase
your tree.
>> Can you apply them to net-2.6 tree?
>
> Done.
>
Thanks.
--
WCN
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH 2/2] IPV6: RFC 2011 compatibility broken
2008-01-16 9:59 [PATCH] ICMP: ICMP_MIB_OUTMSGS increment duplicated Wang Chen
2008-01-16 11:49 ` Herbert Xu
2008-01-21 9:46 ` [PATCH 1/2] IPV6: ICMP6_MIB_OUTMSGS " Wang Chen
@ 2008-01-21 9:46 ` Wang Chen
2008-01-21 9:58 ` YOSHIFUJI Hideaki / 吉藤英明
2008-01-21 19:17 ` David Stevens
2008-01-21 11:15 ` [PATCH] ICMP: ICMP_MIB_OUTMSGS increment duplicated Wang Chen
3 siblings, 2 replies; 19+ messages in thread
From: Wang Chen @ 2008-01-21 9:46 UTC (permalink / raw)
To: David S. Miller; +Cc: David L Stevens, netdev, Herbert Xu
[IPV6]: RFC 2011 compatibility broken
The snmp6 entry name was changed, and it broke compatibility
to RFC 2011.
Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
--- linux-2.6.24.rc8.org/net/ipv6/proc.c 2008-01-16 17:45:03.000000000 +0800
+++ linux-2.6.24.rc8/net/ipv6/proc.c 2008-01-21 15:48:52.000000000 +0800
@@ -88,7 +88,7 @@ static char *icmp6type2name[256] = {
[ICMPV6_PKT_TOOBIG] = "PktTooBigs",
[ICMPV6_TIME_EXCEED] = "TimeExcds",
[ICMPV6_PARAMPROB] = "ParmProblems",
- [ICMPV6_ECHO_REQUEST] = "EchoRequest",
+ [ICMPV6_ECHO_REQUEST] = "Echos",
[ICMPV6_ECHO_REPLY] = "EchoReplies",
[ICMPV6_MGM_QUERY] = "GroupMembQueries",
[ICMPV6_MGM_REPORT] = "GroupMembResponses",
@@ -98,7 +98,7 @@ static char *icmp6type2name[256] = {
[NDISC_ROUTER_SOLICITATION] = "RouterSolicits",
[NDISC_NEIGHBOUR_ADVERTISEMENT] = "NeighborAdvertisements",
[NDISC_NEIGHBOUR_SOLICITATION] = "NeighborSolicits",
- [NDISC_REDIRECT] = "NeighborRedirects",
+ [NDISC_REDIRECT] = "Redirects",
};
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH 2/2] IPV6: RFC 2011 compatibility broken
2008-01-21 9:46 ` [PATCH 2/2] IPV6: RFC 2011 compatibility broken Wang Chen
@ 2008-01-21 9:58 ` YOSHIFUJI Hideaki / 吉藤英明
2008-01-21 19:17 ` David Stevens
1 sibling, 0 replies; 19+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2008-01-21 9:58 UTC (permalink / raw)
To: wangchen; +Cc: davem, dlstevens, netdev, herbert
In article <47946A04.3080702@cn.fujitsu.com> (at Mon, 21 Jan 2008 17:46:44 +0800), Wang Chen <wangchen@cn.fujitsu.com> says:
> The snmp6 entry name was changed, and it broke compatibility
> to RFC 2011.
>
> Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
--yoshfuji
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH 2/2] IPV6: RFC 2011 compatibility broken
2008-01-21 9:46 ` [PATCH 2/2] IPV6: RFC 2011 compatibility broken Wang Chen
2008-01-21 9:58 ` YOSHIFUJI Hideaki / 吉藤英明
@ 2008-01-21 19:17 ` David Stevens
1 sibling, 0 replies; 19+ messages in thread
From: David Stevens @ 2008-01-21 19:17 UTC (permalink / raw)
To: Wang Chen; +Cc: David S. Miller, Herbert Xu, netdev, netdev-owner
RFC 2011 doesn't apply to IPv6, and the internal names of /proc entries
are not used by the SNMP protocol, but it is an unintentional
incompatibility with the
previous Linux entry names, so I agree. :-)
+-DLS
Acked-by: David L Stevens <dlstevens@us.ibm.com>
netdev-owner@vger.kernel.org wrote on 01/21/2008 01:46:44 AM:
> [IPV6]: RFC 2011 compatibility broken
>
> The snmp6 entry name was changed, and it broke compatibility
> to RFC 2011.
>
> Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
>
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] ICMP: ICMP_MIB_OUTMSGS increment duplicated
2008-01-16 9:59 [PATCH] ICMP: ICMP_MIB_OUTMSGS increment duplicated Wang Chen
` (2 preceding siblings ...)
2008-01-21 9:46 ` [PATCH 2/2] IPV6: RFC 2011 compatibility broken Wang Chen
@ 2008-01-21 11:15 ` Wang Chen
2008-01-21 11:25 ` David Miller
3 siblings, 1 reply; 19+ messages in thread
From: Wang Chen @ 2008-01-21 11:15 UTC (permalink / raw)
To: David S. Miller, David L Stevens; +Cc: netdev, Herbert Xu
Dave, how about this one.
It's like that one of IPV6.
Wang Chen said the following on 2008-1-16 17:59:
> In tree net-2.6.25, commit "96793b482540f3a26e2188eaf75cb56b7829d3e3"
> made a mistake.
>
> In that patch, David L added a icmp_out_count() in ip_push_pending_frames(),
> remove icmp_out_count() from icmp_reply(). But he forgot to remove
> icmp_out_count() from icmp_send() too.
> Since icmp_send and icmp_reply will call icmp_push_reply, which will call
> ip_push_pending_frames, a duplicated increment happened in icmp_send.
>
> This patch remove the icmp_out_count from icmp_send too.
>
> Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com>
> ---
> diff -Nurp linux-2.6.24.rc8.org/net/ipv4/icmp.c linux-2.6.24.rc8/net/ipv4/icmp.c
> --- linux-2.6.24.rc8.org/net/ipv4/icmp.c 2008-01-16 17:45:02.000000000 +0800
> +++ linux-2.6.24.rc8/net/ipv4/icmp.c 2008-01-16 17:52:13.000000000 +0800
> @@ -540,7 +540,6 @@ void icmp_send(struct sk_buff *skb_in, i
> icmp_param.data.icmph.checksum = 0;
> icmp_param.skb = skb_in;
> icmp_param.offset = skb_network_offset(skb_in);
> - icmp_out_count(icmp_param.data.icmph.type);
> inet_sk(icmp_socket->sk)->tos = tos;
> ipc.addr = iph->saddr;
> ipc.opt = &icmp_param.replyopts;
>
^ permalink raw reply [flat|nested] 19+ messages in thread