From mboxrd@z Thu Jan 1 00:00:00 1970 From: Serhey Popovych Subject: Re: [PATCH iproute2-next 0/4] ip: Introduce and use helper to read /proc/net/dev Date: Thu, 1 Feb 2018 21:49:23 +0200 Message-ID: <2f2f641c-a2f7-8d68-467f-20f44bee54f9@gmail.com> References: <1517428189-29279-1-git-send-email-serhe.popovych@gmail.com> <20180131150444.439b9d20@xeon-e3> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Ly8kxv3kh53eQpNJwxrtDwtSX5uRBPE1q" Cc: Linux Kernel Network Developers To: Stephen Hemminger , David Ahern Return-path: Received: from mail-wm0-f67.google.com ([74.125.82.67]:50281 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752838AbeBATti (ORCPT ); Thu, 1 Feb 2018 14:49:38 -0500 Received: by mail-wm0-f67.google.com with SMTP id f71so8235794wmf.0 for ; Thu, 01 Feb 2018 11:49:37 -0800 (PST) In-Reply-To: <20180131150444.439b9d20@xeon-e3> Sender: netdev-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Ly8kxv3kh53eQpNJwxrtDwtSX5uRBPE1q Content-Type: multipart/mixed; boundary="wp1CgRih2AIdmlhVgGPC5fTAOxRRXQl8k"; protected-headers="v1" From: Serhey Popovych To: Stephen Hemminger , David Ahern Cc: Linux Kernel Network Developers Message-ID: <2f2f641c-a2f7-8d68-467f-20f44bee54f9@gmail.com> Subject: Re: [PATCH iproute2-next 0/4] ip: Introduce and use helper to read /proc/net/dev References: <1517428189-29279-1-git-send-email-serhe.popovych@gmail.com> <20180131150444.439b9d20@xeon-e3> In-Reply-To: <20180131150444.439b9d20@xeon-e3> --wp1CgRih2AIdmlhVgGPC5fTAOxRRXQl8k Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Stephen Hemminger wrote: > On Wed, 31 Jan 2018 21:49:45 +0200 > Serhey Popovych wrote: >=20 >> Currently there is two places in ip(8) where /proc/net/dev is read lin= e >> 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 cou= ld >> 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(-) >> >=20 > /proc/net/dev is legacy and unextensible. >=20 > I would rather see netlink used everywhere and not /proc/net/dev or sys= fs! >=20 Look at my RFC series against iproute2-next with cover letter subject: "ip: Use netlink to walk through network device list". Thanks, Serhii --wp1CgRih2AIdmlhVgGPC5fTAOxRRXQl8k-- --Ly8kxv3kh53eQpNJwxrtDwtSX5uRBPE1q Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAEBAgAGBQJac29PAAoJEBTawMmQ61bBKCwH/Azkyp/Iwy2mFqIc4d4y6sMe tfUZlq9i+WKdIUGEMIxrC9o6yknBeYIX+IYx19+dRnFr6Agy/rILXCxk7hCsIHkd wro7AgtJ804/kunSHAiHFaw12F3bFONZBDx+ZUcjRyjdMLtMczpfToBgkfGL/y1D 2p0xjGH0oaKDjx0jgkMb4KFD2WXczKpPBtBsEnwBMTjcPtG7TTOlhQD6GKiaJxfN 2KHDqhINaRJUvf7xUfLDsJflLBS387XATJWCUtKqzXyWgDevkNtldv3o37MUaTIe Cz4WkLd9Yb5ymT8FEvif8qn1KtUV0AW2rqIM/oP8Cj9gcjK19qnrF6CmdqIaHrA= =nRbG -----END PGP SIGNATURE----- --Ly8kxv3kh53eQpNJwxrtDwtSX5uRBPE1q--