From patchwork Fri Mar 7 12:10:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ding Tianhong X-Patchwork-Id: 327929 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 45C2F2C0353 for ; Fri, 7 Mar 2014 23:11:30 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752216AbaCGML0 (ORCPT ); Fri, 7 Mar 2014 07:11:26 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:19470 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751878AbaCGMLZ (ORCPT ); Fri, 7 Mar 2014 07:11:25 -0500 Received: from 172.24.2.119 (EHLO szxeml207-edg.china.huawei.com) ([172.24.2.119]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id ALN64382; Fri, 07 Mar 2014 20:11:14 +0800 (CST) Received: from SZXEML424-HUB.china.huawei.com (10.82.67.163) by szxeml207-edg.china.huawei.com (172.24.2.56) with Microsoft SMTP Server (TLS) id 14.3.158.1; Fri, 7 Mar 2014 20:10:56 +0800 Received: from localhost (10.177.22.246) by szxeml424-hub.china.huawei.com (10.82.67.163) with Microsoft SMTP Server id 14.3.158.1; Fri, 7 Mar 2014 20:10:54 +0800 From: Ding Tianhong To: , CC: Subject: [PATCH net-next 1/2] vlan: add proto for proc interface Date: Fri, 7 Mar 2014 20:10:50 +0800 Message-ID: <1394194251-11656-2-git-send-email-dingtianhong@huawei.com> X-Mailer: git-send-email 1.8.5.2.msysgit.0 In-Reply-To: <1394194251-11656-1-git-send-email-dingtianhong@huawei.com> References: <1394194251-11656-1-git-send-email-dingtianhong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.22.246] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The vlan could support 2 proto: 802.1q and 802.1ad, so add it to proc interface, the user could easily distinguish the proto for each vlan dev. And the dev->priv_flags seems inappropriate, modify to Priv_Flags, looks more comfortable. ---------------------- the old format: -------------------------- eth2.10 VID: 10 REORDER_HDR: 1 dev->priv_flags: 1 total frames received 5 total bytes received 336 Broadcast/Multicast Rcvd 0 total frames transmitted 13 total bytes transmitted 1026 Device: eth2 INGRESS priority mappings: 0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0 EGRESS priority mappings: ----------------------- the new format: ------------------------- eth2.20 Proto: 802.1q VID: 20 REORDER_HDR: 1 Priv_Flags: 1 total frames received 0 total bytes received 0 Broadcast/Multicast Rcvd 0 total frames transmitted 0 total bytes transmitted 0 Device: eth2 INGRESS priority mappings: 0:0 1:0 2:0 3:0 4:0 5:0 6:0 7:0 EGRESS priority mappings: ---------------------------------------------------------------- Signed-off-by: Ding Tianhong Nacked-by: Patrick McHardy --- net/8021q/vlanproc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c index 1d0e8921..a40abbc 100644 --- a/net/8021q/vlanproc.c +++ b/net/8021q/vlanproc.c @@ -285,8 +285,10 @@ static int vlandev_seq_show(struct seq_file *seq, void *offset) stats = dev_get_stats(vlandev, &temp); seq_printf(seq, - "%s VID: %d REORDER_HDR: %i dev->priv_flags: %hx\n", - vlandev->name, vlan->vlan_id, + "%s Proto: %s VID: %d REORDER_HDR: %i Priv_Flags: %hx\n", + vlandev->name, + vlan->vlan_proto == htons(ETH_P_8021Q) ? "802.1q" : "802.1ad", + vlan->vlan_id, (int)(vlan->flags & 1), vlandev->priv_flags); seq_printf(seq, fmt64, "total frames received", stats->rx_packets);