From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx3-rdu2.redhat.com ([66.187.233.73]:48506 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751052AbeBTKoY (ORCPT ); Tue, 20 Feb 2018 05:44:24 -0500 Date: Tue, 20 Feb 2018 11:44:21 +0100 From: Sabrina Dubroca To: Serhey Popovych Cc: netdev@vger.kernel.org, David Ahern , sbrivio@redhat.com Subject: Re: [PATCH iproute2-next] ip link: add support to display extended tun attributes Message-ID: <20180220104421.GA21674@bistromath.localdomain> References: <8bea9df2ab3ee8202f6696fdbea331abacdbb8b5.1518775084.git.sd@queasysnail.net> <73c75acb-4607-d405-8a0d-71b2904e1f64@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <73c75acb-4607-d405-8a0d-71b2904e1f64@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: 2018-02-20, 00:19:25 +0200, Serhey Popovych wrote: > I get following checkpatch.pl warnings: > > WARNING: Missing a blank line after declarations > #73: FILE: ip/iptuntap.c:497: > + __u8 mq = rta_getattr_u8(tb[IFLA_TUN_MULTI_QUEUE]); > + if (!mq) > > WARNING: Missing a blank line after declarations > #80: FILE: ip/iptuntap.c:504: > + __u32 numq = rta_getattr_u32(tb[IFLA_TUN_NUM_QUEUES]); > + fprintf(f, "numqueues %u ", numq); > > WARNING: Missing a blank line after declarations > #85: FILE: ip/iptuntap.c:509: > + __u32 numq = > rta_getattr_u32(tb[IFLA_TUN_NUM_DISABLED_QUEUES]); > + fprintf(f, "numdisabled %u ", numq); > > maybe they should be fixed before accepting? IMHO fixing those makes the code slightly uglier, but sure, I'll send a v2. > I wonder if we can use tun_print_opt() and it's infrastructure > in print_tuntap(). Now they use read_prop() to read same information > from sysfs while netlink provides it. I wouldn't, for 2 reasons: - these netlink attributes aren't exposed by older kernels, so if you run "ip tuntap" on an older kernel, you won't get any information about tun/tap devices anymore - the output format is not the same, I don't want to break existing users of ip tuntap that expect a specific format -- Sabrina