* [PATCH net 1/2] iptunnel: make rx/tx bytes counters consistent
@ 2015-09-18 9:47 Nicolas Dichtel
2015-09-18 9:47 ` [PATCH net 2/2] ip6tunnel: " Nicolas Dichtel
2015-09-21 5:35 ` [PATCH net 1/2] iptunnel: " David Miller
0 siblings, 2 replies; 6+ messages in thread
From: Nicolas Dichtel @ 2015-09-18 9:47 UTC (permalink / raw)
To: davem; +Cc: netdev, herbert, Nicolas Dichtel
This was already done a long time ago in
commit 64194c31a0b6 ("inet: Make tunnel RX/TX byte counters more consistent")
but tx path was broken (at least since 3.10).
Before the patch the gre header was included on tx.
After the patch:
$ ping -c1 192.168.0.121 ; ip -s l ls dev gre1
PING 192.168.0.121 (192.168.0.121) 56(84) bytes of data.
64 bytes from 192.168.0.121: icmp_req=1 ttl=64 time=2.95 ms
--- 192.168.0.121 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.955/2.955/2.955/0.000 ms
7: gre1@NONE: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1468 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/gre 10.16.0.249 peer 10.16.0.121
RX: bytes packets errors dropped overrun mcast
84 1 0 0 0 0
TX: bytes packets errors dropped carrier collsns
84 1 0 0 0 0
Reported-by: Julien Meunier <julien.meunier@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
net/ipv4/ip_tunnel_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
index 29ed6c5a5185..9b97204b8c81 100644
--- a/net/ipv4/ip_tunnel_core.c
+++ b/net/ipv4/ip_tunnel_core.c
@@ -51,7 +51,7 @@ int iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb,
__be32 src, __be32 dst, __u8 proto,
__u8 tos, __u8 ttl, __be16 df, bool xnet)
{
- int pkt_len = skb->len;
+ int pkt_len = skb->len - skb_inner_network_offset(skb);
struct iphdr *iph;
int err;
--
2.4.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net 2/2] ip6tunnel: make rx/tx bytes counters consistent
2015-09-18 9:47 [PATCH net 1/2] iptunnel: make rx/tx bytes counters consistent Nicolas Dichtel
@ 2015-09-18 9:47 ` Nicolas Dichtel
2015-09-21 5:35 ` David Miller
2015-09-21 5:35 ` [PATCH net 1/2] iptunnel: " David Miller
1 sibling, 1 reply; 6+ messages in thread
From: Nicolas Dichtel @ 2015-09-18 9:47 UTC (permalink / raw)
To: davem; +Cc: netdev, herbert, Nicolas Dichtel
Like the previous patch, which fixes ipv4 tunnels, here is the ipv6 part.
Before the patch, the external ipv6 header + gre header were included on
tx.
After the patch:
$ ping -c1 192.168.6.121 ; ip -s l ls dev ip6gre1
PING 192.168.6.121 (192.168.6.121) 56(84) bytes of data.
64 bytes from 192.168.6.121: icmp_req=1 ttl=64 time=1.92 ms
--- 192.168.6.121 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.923/1.923/1.923/0.000 ms
7: ip6gre1@NONE: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1440 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/gre6 20:01:06:60:30:08:c1:c3:00:00:00:00:00:00:01:23 peer 20:01:06:60:30:08:c1:c3:00:00:00:00:00:00:01:21
RX: bytes packets errors dropped overrun mcast
84 1 0 0 0 0
TX: bytes packets errors dropped carrier collsns
84 1 0 0 0 0
$ ping -c1 192.168.1.121 ; ip -s l ls dev ip6tnl1
PING 192.168.1.121 (192.168.1.121) 56(84) bytes of data.
64 bytes from 192.168.1.121: icmp_req=1 ttl=64 time=2.28 ms
--- 192.168.1.121 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.288/2.288/2.288/0.000 ms
8: ip6tnl1@NONE: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1452 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/tunnel6 2001:660:3008:c1c3::123 peer 2001:660:3008:c1c3::121
RX: bytes packets errors dropped overrun mcast
84 1 0 0 0 0
TX: bytes packets errors dropped carrier collsns
84 1 0 0 0 0
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
---
include/net/ip6_tunnel.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index 65c2a9397b3c..fa915fa0f703 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -86,7 +86,7 @@ static inline void ip6tunnel_xmit(struct sock *sk, struct sk_buff *skb,
struct net_device_stats *stats = &dev->stats;
int pkt_len, err;
- pkt_len = skb->len;
+ pkt_len = skb->len - skb_inner_network_offset(skb);
err = ip6_local_out_sk(sk, skb);
if (net_xmit_eval(err) == 0) {
--
2.4.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net 1/2] iptunnel: make rx/tx bytes counters consistent
2015-09-18 9:47 [PATCH net 1/2] iptunnel: make rx/tx bytes counters consistent Nicolas Dichtel
2015-09-18 9:47 ` [PATCH net 2/2] ip6tunnel: " Nicolas Dichtel
@ 2015-09-21 5:35 ` David Miller
2015-09-21 5:37 ` David Miller
1 sibling, 1 reply; 6+ messages in thread
From: David Miller @ 2015-09-21 5:35 UTC (permalink / raw)
To: nicolas.dichtel; +Cc: netdev, herbert
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Fri, 18 Sep 2015 11:47:40 +0200
> This was already done a long time ago in
> commit 64194c31a0b6 ("inet: Make tunnel RX/TX byte counters more consistent")
> but tx path was broken (at least since 3.10).
>
> Before the patch the gre header was included on tx.
>
> After the patch:
> $ ping -c1 192.168.0.121 ; ip -s l ls dev gre1
> PING 192.168.0.121 (192.168.0.121) 56(84) bytes of data.
> 64 bytes from 192.168.0.121: icmp_req=1 ttl=64 time=2.95 ms
>
> --- 192.168.0.121 ping statistics ---
> 1 packets transmitted, 1 received, 0% packet loss, time 0ms
> rtt min/avg/max/mdev = 2.955/2.955/2.955/0.000 ms
> 7: gre1@NONE: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1468 qdisc noqueue state UNKNOWN mode DEFAULT group default
> link/gre 10.16.0.249 peer 10.16.0.121
> RX: bytes packets errors dropped overrun mcast
> 84 1 0 0 0 0
> TX: bytes packets errors dropped carrier collsns
> 84 1 0 0 0 0
>
> Reported-by: Julien Meunier <julien.meunier@6wind.com>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 2/2] ip6tunnel: make rx/tx bytes counters consistent
2015-09-18 9:47 ` [PATCH net 2/2] ip6tunnel: " Nicolas Dichtel
@ 2015-09-21 5:35 ` David Miller
0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2015-09-21 5:35 UTC (permalink / raw)
To: nicolas.dichtel; +Cc: netdev, herbert
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Fri, 18 Sep 2015 11:47:41 +0200
> Like the previous patch, which fixes ipv4 tunnels, here is the ipv6 part.
>
> Before the patch, the external ipv6 header + gre header were included on
> tx.
>
> After the patch:
> $ ping -c1 192.168.6.121 ; ip -s l ls dev ip6gre1
> PING 192.168.6.121 (192.168.6.121) 56(84) bytes of data.
> 64 bytes from 192.168.6.121: icmp_req=1 ttl=64 time=1.92 ms
>
> --- 192.168.6.121 ping statistics ---
> 1 packets transmitted, 1 received, 0% packet loss, time 0ms
> rtt min/avg/max/mdev = 1.923/1.923/1.923/0.000 ms
> 7: ip6gre1@NONE: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1440 qdisc noqueue state UNKNOWN mode DEFAULT group default
> link/gre6 20:01:06:60:30:08:c1:c3:00:00:00:00:00:00:01:23 peer 20:01:06:60:30:08:c1:c3:00:00:00:00:00:00:01:21
> RX: bytes packets errors dropped overrun mcast
> 84 1 0 0 0 0
> TX: bytes packets errors dropped carrier collsns
> 84 1 0 0 0 0
> $ ping -c1 192.168.1.121 ; ip -s l ls dev ip6tnl1
> PING 192.168.1.121 (192.168.1.121) 56(84) bytes of data.
> 64 bytes from 192.168.1.121: icmp_req=1 ttl=64 time=2.28 ms
>
> --- 192.168.1.121 ping statistics ---
> 1 packets transmitted, 1 received, 0% packet loss, time 0ms
> rtt min/avg/max/mdev = 2.288/2.288/2.288/0.000 ms
> 8: ip6tnl1@NONE: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1452 qdisc noqueue state UNKNOWN mode DEFAULT group default
> link/tunnel6 2001:660:3008:c1c3::123 peer 2001:660:3008:c1c3::121
> RX: bytes packets errors dropped overrun mcast
> 84 1 0 0 0 0
> TX: bytes packets errors dropped carrier collsns
> 84 1 0 0 0 0
>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Applied.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 1/2] iptunnel: make rx/tx bytes counters consistent
2015-09-21 5:35 ` [PATCH net 1/2] iptunnel: " David Miller
@ 2015-09-21 5:37 ` David Miller
2015-09-21 7:39 ` Nicolas Dichtel
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2015-09-21 5:37 UTC (permalink / raw)
To: nicolas.dichtel; +Cc: netdev, herbert
From: David Miller <davem@davemloft.net>
Date: Sun, 20 Sep 2015 22:35:13 -0700 (PDT)
>> After the patch:
>> $ ping -c1 192.168.0.121 ; ip -s l ls dev gre1
>> PING 192.168.0.121 (192.168.0.121) 56(84) bytes of data.
>> 64 bytes from 192.168.0.121: icmp_req=1 ttl=64 time=2.95 ms
>>
>> --- 192.168.0.121 ping statistics ---
>> 1 packets transmitted, 1 received, 0% packet loss, time 0ms
>> rtt min/avg/max/mdev = 2.955/2.955/2.955/0.000 ms
BTW, when you includ PING output in a commit message like this
it really makes things difficult.
"---" denotes end of the commit as far as tools like "git am"
are concerned.
I happened to notice this time and fix up the commit messages by hand,
but it'd be much better if it weren't left up to chance like that.
Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 1/2] iptunnel: make rx/tx bytes counters consistent
2015-09-21 5:37 ` David Miller
@ 2015-09-21 7:39 ` Nicolas Dichtel
0 siblings, 0 replies; 6+ messages in thread
From: Nicolas Dichtel @ 2015-09-21 7:39 UTC (permalink / raw)
To: David Miller; +Cc: netdev, herbert
Le 21/09/2015 07:37, David Miller a écrit :
> From: David Miller <davem@davemloft.net>
> Date: Sun, 20 Sep 2015 22:35:13 -0700 (PDT)
>
>>> After the patch:
>>> $ ping -c1 192.168.0.121 ; ip -s l ls dev gre1
>>> PING 192.168.0.121 (192.168.0.121) 56(84) bytes of data.
>>> 64 bytes from 192.168.0.121: icmp_req=1 ttl=64 time=2.95 ms
>>>
>>> --- 192.168.0.121 ping statistics ---
>>> 1 packets transmitted, 1 received, 0% packet loss, time 0ms
>>> rtt min/avg/max/mdev = 2.955/2.955/2.955/0.000 ms
>
> BTW, when you includ PING output in a commit message like this
> it really makes things difficult.
>
> "---" denotes end of the commit as far as tools like "git am"
> are concerned.
>
> I happened to notice this time and fix up the commit messages by hand,
> but it'd be much better if it weren't left up to chance like that.
Oh ok. I will take care of that next time.
Thank you for fixing it.
Regards,
Nicolas
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-09-21 7:39 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-18 9:47 [PATCH net 1/2] iptunnel: make rx/tx bytes counters consistent Nicolas Dichtel
2015-09-18 9:47 ` [PATCH net 2/2] ip6tunnel: " Nicolas Dichtel
2015-09-21 5:35 ` David Miller
2015-09-21 5:35 ` [PATCH net 1/2] iptunnel: " David Miller
2015-09-21 5:37 ` David Miller
2015-09-21 7:39 ` Nicolas Dichtel
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).