netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Serhey Popovych <serhe.popovych@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute2-next 0/4] ip: Introduce and use helper to read /proc/net/dev
Date: Wed, 31 Jan 2018 15:04:44 -0800	[thread overview]
Message-ID: <20180131150444.439b9d20@xeon-e3> (raw)
In-Reply-To: <1517428189-29279-1-git-send-email-serhe.popovych@gmail.com>

On Wed, 31 Jan 2018 21:49:45 +0200
Serhey Popovych <serhe.popovych@gmail.com> wrote:

> Currently there is two places in ip(8) where /proc/net/dev is read line
> by line with nearly identical steps: iptunnel.c and ip6tunnel.c
> 
> On the other hand we have iptuntap.c that uses /sys/class/net that could
> be problematic in case of unshare(1)d network namespace without sysfs
> being mounted.
> 
> Introduce and use do_each_proc_net_dev() helper to read data from
> /proc/net/dev line by line and pass this information to implementation
> specific callback function.
> 
> See individual patch description message for more details.
> 
> Series is open for reviews and comments.
> 
> Tested only by compiling and executing ip [-46] [-s] [-d] tunnel in
> various combinations: no problem so far. More can be done by request.
> 
> Thanks,
> Serhii
> 
> Serhey Popovych (4):
>   utils: Introduce do_each_proc_net_dev() helper
>   iptunnel: Use do_each_proc_net_dev()
>   ip6tunnel: Use do_each_proc_net_dev()
>   tuntap: Use do_each_proc_net_dev()
> 
>  include/utils.h |   10 ++++++
>  ip/ip6tunnel.c  |   94 ++++++++++++++++++++------------------------------
>  ip/iptunnel.c   |  102 +++++++++++++++++++++++++------------------------------
>  ip/iptuntap.c   |   59 ++++++++++++++------------------
>  lib/utils.c     |   51 ++++++++++++++++++++++++++++
>  5 files changed, 170 insertions(+), 146 deletions(-)
> 

/proc/net/dev is legacy and unextensible.

I would rather see netlink used everywhere and not /proc/net/dev or sysfs!

  parent reply	other threads:[~2018-01-31 23:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31 19:49 [PATCH iproute2-next 0/4] ip: Introduce and use helper to read /proc/net/dev Serhey Popovych
2018-01-31 19:49 ` [PATCH iproute2-next 1/4] utils: Introduce do_each_proc_net_dev() helper Serhey Popovych
2018-01-31 19:49 ` [PATCH iproute2-next 2/4] iptunnel: Use do_each_proc_net_dev() Serhey Popovych
2018-01-31 19:49 ` [PATCH iproute2-next 3/4] ip6tunnel: " Serhey Popovych
2018-01-31 19:49 ` [PATCH iproute2-next 4/4] tuntap: " Serhey Popovych
2018-01-31 23:04 ` Stephen Hemminger [this message]
2018-02-01  3:17   ` [PATCH iproute2-next 0/4] ip: Introduce and use helper to read /proc/net/dev David Ahern
2018-02-01 19:49   ` Serhey Popovych

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180131150444.439b9d20@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=netdev@vger.kernel.org \
    --cc=serhe.popovych@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).