diff mbox

[ovs-dev,v3,28/28] datapath: backport: iptunnel: make rx/tx bytes counters consistent

Message ID 1467421259-121789-9-git-send-email-pshelar@ovn.org
State Superseded
Headers show

Commit Message

Pravin Shelar July 2, 2016, 1 a.m. UTC
Upstream commit:
commit bc22a0e2ea03b75b51a1f722f93821744b5b5ff1
Author: Nicolas Dichtel <nicolas.dichtel@6wind.com>

    iptunnel: make rx/tx bytes counters consistent

    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>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
---
 datapath/linux/compat/ip_tunnels_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jesse Gross July 5, 2016, 8:11 p.m. UTC | #1
On Fri, Jul 1, 2016 at 6:00 PM, Pravin B Shelar <pshelar@ovn.org> wrote:
> Upstream commit:
> commit bc22a0e2ea03b75b51a1f722f93821744b5b5ff1
> Author: Nicolas Dichtel <nicolas.dichtel@6wind.com>
>
>     iptunnel: make rx/tx bytes counters consistent
>
>     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>
>     Signed-off-by: David S. Miller <davem@davemloft.net>
>
> Signed-off-by: Pravin B Shelar <pshelar@ovn.org>

Acked-by: Jesse Gross <jesse@kernel.org>
diff mbox

Patch

diff --git a/datapath/linux/compat/ip_tunnels_core.c b/datapath/linux/compat/ip_tunnels_core.c
index 84684bf..9a7af73 100644
--- a/datapath/linux/compat/ip_tunnels_core.c
+++ b/datapath/linux/compat/ip_tunnels_core.c
@@ -43,7 +43,7 @@  void rpl_iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb,
                       __be16 df, bool xnet)
 {
 	struct net_device *dev = skb->dev;
-	int pkt_len = skb->len;
+	int pkt_len = skb->len - skb_inner_network_offset(skb);
 	struct iphdr *iph;
 	int err;