From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH iproute 2/2] utils: fix get_rtnl_link_stats_rta stats parsing Date: Mon, 15 Oct 2018 09:41:15 -0700 Message-ID: <20181015094115.2a0c7dfe@xeon-e3> References: <8b8bb899db6c8ce78d91aa8b192e6c697daf4e27.1539182623.git.lorenzo.bianconi@redhat.com> <20181010121139.335ff091@xeon-e3> <20181011122401.GA10363@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Lorenzo Bianconi Return-path: Received: from mail-pf1-f196.google.com ([209.85.210.196]:44126 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726525AbeJPA1S (ORCPT ); Mon, 15 Oct 2018 20:27:18 -0400 Received: by mail-pf1-f196.google.com with SMTP id r9-v6so9955246pff.11 for ; Mon, 15 Oct 2018 09:41:19 -0700 (PDT) In-Reply-To: <20181011122401.GA10363@localhost.localdomain> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 11 Oct 2018 14:24:03 +0200 Lorenzo Bianconi wrote: > > > iproute2 walks through the list of available tunnels using netlink > > > protocol in order to get device info instead of reading > > > them from proc filesystem. However the kernel reports device statistics > > > using IFLA_INET6_STATS/IFLA_INET6_ICMP6STATS attributes nested in > > > IFLA_PROTINFO one but iproutes expects these info in > > > IFLA_STATS64/IFLA_STATS attributes. > > > The issue can be triggered with the following reproducer: > > > > > > $ip link add ip6d0 type ip6tnl mode ip6ip6 local 1111::1 remote 2222::1 > > > $ip -6 -d -s tunnel show ip6d0 > > > ip6d0: ipv6/ipv6 remote 2222::1 local 1111::1 encaplimit 4 hoplimit 64 > > > tclass 0x00 flowlabel 0x00000 (flowinfo 0x00000000) > > > Dump terminated > > > > > > Fix the issue introducing IFLA_INET6_STATS attribute parsing > > > > > > Fixes: 3e953938717f ("iptunnel/ip6tunnel: Use netlink to walk through > > > tunnels list") > > > > > > Signed-off-by: Lorenzo Bianconi > > > > Can't we fix the kernel to report statistics properly, rather than > > starting iproute2 doing more /proc interfaces. > > > > Hi Stephen, > > sorry, I did not get what you mean. Current iproute implementation > walks through tunnels list using netlink protocol and parses device > statistics in the kernel netlink message. However it does not take > into account the actual netlink message layout since the statistic > attribute is nested in IFLA_PROTINFO one. > Moreover AFAIU the related kernel code has not changed since iproute > commit 3e953938717f, so I guess we should fix the issue in iproute code > instead in the kernel one. Do you agree? > > Regards, > Lorenzo Applied to current iproute2.