Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753483AbdHORlf (ORCPT ); Tue, 15 Aug 2017 13:41:35 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34189 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751580AbdHORlc (ORCPT ); Tue, 15 Aug 2017 13:41:32 -0400 Subject: Re: [PATCH net-next 11/11] net: dsa: debugfs: add port vlan To: Vivien Didelot , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Andrew Lunn , Egil Hjelmeland , John Crispin , Woojung Huh , Sean Wang , Volodymyr Bendiuga , Nikita Yushchenko , Maxime Hadjinlian , Chris Healy , Maxim Uvarov , Stefan Eichenberger , Jason Cobham , Juergen Borleis , Tobias Waldekranz References: <20170814222242.10643-1-vivien.didelot@savoirfairelinux.com> <20170814222242.10643-12-vivien.didelot@savoirfairelinux.com> From: Florian Fainelli Message-ID: <25e9b8fb-5d60-93c7-4a15-64d5ff62aacd@gmail.com> Date: Tue, 15 Aug 2017 10:41:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170814222242.10643-12-vivien.didelot@savoirfairelinux.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1363 Lines: 51 On 08/14/2017 03:22 PM, Vivien Didelot wrote: > Add a debug filesystem "vlan" entry to query a port's hardware VLAN > entries through the .port_vlan_dump switch operation. > > This is really convenient to query directly the hardware or inspect DSA > or CPU links, since these ports are not exposed to userspace. > > Here are the VLAN entries for a CPU port: > > # cat port5/vlan > vid 1 > vid 42 pvid > > Signed-off-by: Vivien Didelot > --- > net/dsa/debugfs.c | 33 +++++++++++++++++++++++++++++++++ > 1 file changed, 33 insertions(+) > > diff --git a/net/dsa/debugfs.c b/net/dsa/debugfs.c > index 98c5068d20da..b00942368d29 100644 > --- a/net/dsa/debugfs.c > +++ b/net/dsa/debugfs.c > @@ -286,6 +286,34 @@ static const struct dsa_debugfs_ops dsa_debugfs_tree_ops = { > .read = dsa_debugfs_tree_read, > }; > > +static int dsa_debugfs_vlan_dump_cb(u16 vid, bool pvid, bool untagged, > + void *data) > +{ > + struct seq_file *seq = data; > + > + seq_printf(seq, "vid %d", vid); > + if (pvid) > + seq_puts(seq, " pvid"); > + if (untagged) > + seq_puts(seq, " untagged"); Personal preference: could we just specify something like: vid 1 (t) vid 42 (u) pvid to clearly show which VLAN is tagged/untagged? Other than that: Reviewed-by: Florian Fainelli -- Florian