From patchwork Fri Apr 12 20:13:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 162138 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1060813jan; Fri, 12 Apr 2019 13:11:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyaxGz2kQBxSZuYlLiWGnggjBTY+HP5w8qhJM3lMRYlWhmPFQgT3u9raFiRnwMaEmag52Tr X-Received: by 2002:a17:902:1101:: with SMTP id d1mr42417417pla.16.1555099863847; Fri, 12 Apr 2019 13:11:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555099863; cv=none; d=google.com; s=arc-20160816; b=BBVYZ37ogdV0hQSQM5kJmP3ar+3ui7EDWG6FljRA//t8+RRd1q/YQV62jytYjqCjWu Qu36elC97/3PIoE9vbt36lROJgrSxJ+CBG4naSSteg9Ppf1PZbKIiWB+MWIPp0peffg1 AQ4b0m1VYquw8Zii7FPrr2owcXpN/tUAGZcOhQ1nb297Wy8h/H2U2QIVBlpDZCfO1B44 GHftFsnKj3Axc9caekvg5Hta05s8brXhis/z11deRjCm+gNS0BijKOicm2mOM45hpd9Z xB99rKUVZZtQ+rT1gcC+K9jHYqr9esrdCxIt6iDIHR0zDFAmFVarJvJwbKHzPlgTP+vH 7D5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=naeODMw2JTB2zvbveGzI7NZUxJdvIvz0O8ekQwSm0jY=; b=u0C4Fn0eYaWZPCSXlLCQkQCU0S6ZaaI5Re5SaN9o3na58yxCC1Zpf5vGDDipZ4qV1C Ay6yuE3SEHOB9OVEgv1EOoGR8OjoajeRxdYnc0uha0dEG/gfNZbgfqiC18LhV4whdebE Uwzvp84EFOJghnTL70rkZJvnO9Fu0mOEhUBYHaEU6kEc4roJ2cgE9mxuapzXDCXMxr3M 2prU3ReBQxEb2ldXve/bYjx+Afk0yN56+ZacwHUQ8E1LDZ72iJ9YVob9JyvYZnns1Cel T6YxQY3uiQ0W9m/izs4vKpB/GaVuhQdC027JRyrId4I1yNaR5FoArCq9x5MZKsct/XFo 1g+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=jqP1isbL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12si9034820plk.310.2019.04.12.13.11.02; Fri, 12 Apr 2019 13:11:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=jqP1isbL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727170AbfDLUKz (ORCPT + 31 others); Fri, 12 Apr 2019 16:10:55 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:60418 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726870AbfDLUKy (ORCPT ); Fri, 12 Apr 2019 16:10:54 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x3CKAoFS009652; Fri, 12 Apr 2019 15:10:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1555099850; bh=naeODMw2JTB2zvbveGzI7NZUxJdvIvz0O8ekQwSm0jY=; h=From:To:Subject:Date:In-Reply-To:References; b=jqP1isbLYIK2uNnjdS5M9oeBxbvt4nFpt7ewbNLsVuUTQtSPJem49fqk9Xd6CEV2S Zvop/LzHZyRJYex9pHGdPyjzsl6xL88u+7mC/YMxssTGb+342ogSKnV3McmTpKb9bs O8INUn21YrG02z/uhFx3cIcGjzyeoohfyGaQl29k= Received: from DLEE107.ent.ti.com (dlee107.ent.ti.com [157.170.170.37]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x3CKAoF6110714 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 12 Apr 2019 15:10:50 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 12 Apr 2019 15:10:49 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 12 Apr 2019 15:10:49 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id x3CKAnc7059487; Fri, 12 Apr 2019 15:10:49 -0500 From: Murali Karicheri To: , , , Subject: [net-next PATCH 1/3] net: hsr: fix naming of file and functions Date: Fri, 12 Apr 2019 16:13:23 -0400 Message-ID: <20190412201325.29001-2-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190412201325.29001-1-m-karicheri2@ti.com> References: <20190412201325.29001-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the file name and functions to match with existing implementation. Signed-off-by: Murali Karicheri --- net/hsr/Makefile | 2 +- net/hsr/{hsr_prp_debugfs.c => hsr_debugfs.c} | 34 ++++++++++---------- net/hsr/hsr_device.c | 4 +-- net/hsr/hsr_main.h | 8 ++--- 4 files changed, 24 insertions(+), 24 deletions(-) rename net/hsr/{hsr_prp_debugfs.c => hsr_debugfs.c} (74%) -- 2.17.0 diff --git a/net/hsr/Makefile b/net/hsr/Makefile index d74d89d013b0..e45757fc477f 100644 --- a/net/hsr/Makefile +++ b/net/hsr/Makefile @@ -6,4 +6,4 @@ obj-$(CONFIG_HSR) += hsr.o hsr-y := hsr_main.o hsr_framereg.o hsr_device.o \ hsr_netlink.o hsr_slave.o hsr_forward.o -hsr-$(CONFIG_DEBUG_FS) += hsr_prp_debugfs.o +hsr-$(CONFIG_DEBUG_FS) += hsr_debugfs.o diff --git a/net/hsr/hsr_prp_debugfs.c b/net/hsr/hsr_debugfs.c similarity index 74% rename from net/hsr/hsr_prp_debugfs.c rename to net/hsr/hsr_debugfs.c index b30e98734c61..b5a955013976 100644 --- a/net/hsr/hsr_prp_debugfs.c +++ b/net/hsr/hsr_debugfs.c @@ -1,5 +1,5 @@ /* - * hsr_prp_debugfs code + * hsr_debugfs code * Copyright (C) 2017 Texas Instruments Incorporated * * Author(s): @@ -26,9 +26,9 @@ static void print_mac_address(struct seq_file *sfp, unsigned char *mac) mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); } -/* hsr_prp_node_table_show - Formats and prints node_table entries */ +/* hsr_node_table_show - Formats and prints node_table entries */ static int -hsr_prp_node_table_show(struct seq_file *sfp, void *data) +hsr_node_table_show(struct seq_file *sfp, void *data) { struct hsr_priv *priv = (struct hsr_priv *)sfp->private; struct hsr_node *node; @@ -52,40 +52,40 @@ hsr_prp_node_table_show(struct seq_file *sfp, void *data) return 0; } -/* hsr_prp_node_table_open - Open the node_table file +/* hsr_node_table_open - Open the node_table file * * Description: * This routine opens a debugfs file node_table of specific hsr device */ static int -hsr_prp_node_table_open(struct inode *inode, struct file *filp) +hsr_node_table_open(struct inode *inode, struct file *filp) { - return single_open(filp, hsr_prp_node_table_show, inode->i_private); + return single_open(filp, hsr_node_table_show, inode->i_private); } -static const struct file_operations hsr_prp_fops = { +static const struct file_operations hsr_fops = { .owner = THIS_MODULE, - .open = hsr_prp_node_table_open, + .open = hsr_node_table_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -/* hsr_prp_debugfs_init - create hsr-prp node_table file for dumping +/* hsr_debugfs_init - create hsr node_table file for dumping * the node table * * Description: * When debugfs is configured this routine sets up the node_table file per - * hsr/prp device for dumping the node_table entries + * hsr device for dumping the node_table entries */ -int hsr_prp_debugfs_init(struct hsr_priv *priv) +int hsr_debugfs_init(struct hsr_priv *priv) { int rc = -1; struct dentry *de = NULL; de = debugfs_create_dir("hsr", NULL); if (!de) { - pr_err("Cannot create hsr-prp debugfs root\n"); + pr_err("Cannot create hsr debugfs root\n"); return rc; } @@ -93,9 +93,9 @@ int hsr_prp_debugfs_init(struct hsr_priv *priv) de = debugfs_create_file("node_table", S_IFREG | 0444, priv->node_tbl_root, priv, - &hsr_prp_fops); + &hsr_fops); if (!de) { - pr_err("Cannot create hsr-prp node_table directory\n"); + pr_err("Cannot create hsr node_table directory\n"); return rc; } priv->node_tbl_file = de; @@ -104,14 +104,14 @@ int hsr_prp_debugfs_init(struct hsr_priv *priv) return rc; } -/* hsr_prp_debugfs_term - Tear down debugfs intrastructure +/* hsr_debugfs_term - Tear down debugfs intrastructure * * Description: * When Debufs is configured this routine removes debugfs file system - * elements that are specific to hsr-prp + * elements that are specific to hsr */ void -hsr_prp_debugfs_term(struct hsr_priv *priv) +hsr_debugfs_term(struct hsr_priv *priv) { debugfs_remove(priv->node_tbl_file); priv->node_tbl_file = NULL; diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index b47a621e3f4e..58cf500ebf94 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -354,7 +354,7 @@ static void hsr_dev_destroy(struct net_device *hsr_dev) hsr = netdev_priv(hsr_dev); - hsr_prp_debugfs_term(hsr); + hsr_debugfs_term(hsr); rtnl_lock(); hsr_for_each_port(hsr, port) @@ -485,7 +485,7 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], goto fail; mod_timer(&hsr->prune_timer, jiffies + msecs_to_jiffies(PRUNE_PERIOD)); - res = hsr_prp_debugfs_init(hsr); + res = hsr_debugfs_init(hsr); if (res) goto fail; diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h index 778213f07fe0..6cd4dff58727 100644 --- a/net/hsr/hsr_main.h +++ b/net/hsr/hsr_main.h @@ -184,15 +184,15 @@ static inline u16 hsr_get_skb_sequence_nr(struct sk_buff *skb) } #if IS_ENABLED(CONFIG_DEBUG_FS) -int hsr_prp_debugfs_init(struct hsr_priv *priv); -void hsr_prp_debugfs_term(struct hsr_priv *priv); +int hsr_debugfs_init(struct hsr_priv *priv); +void hsr_debugfs_term(struct hsr_priv *priv); #else -static inline int hsr_prp_debugfs_init(struct hsr_priv *priv) +static inline int hsr_debugfs_init(struct hsr_priv *priv) { return 0; } -static inline void hsr_prp_debugfs_term(struct hsr_priv *priv) +static inline void hsr_debugfs_term(struct hsr_priv *priv) {} #endif From patchwork Fri Apr 12 20:13:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 162137 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1060747jan; Fri, 12 Apr 2019 13:11:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMM/yWZthQAkVRllkboZ72AfW/HWv8HbX2vW3XFlsTnkEtELv+JsMlqdJKzLCTrqUBMT6o X-Received: by 2002:a65:6212:: with SMTP id d18mr52283487pgv.162.1555099860610; Fri, 12 Apr 2019 13:11:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555099860; cv=none; d=google.com; s=arc-20160816; b=egPxOVouvDx16nj0bH7PP5NDZBH7YlMCZO8R9JvrQvAKOSSBWHFd5f8hkW3IOnlLjs RPms5rLSwaRhiHRp7xGySLD3hUOYe208/RTlQ3oFJZNhTX6KiZwaD+msrzG1Ovj5jV8H GR3CpOpvKY6N+lzkLY0kb9dmBUPglku4y2Byli7QwirIP5JqeOhzi9/y7Rb03jgvUbgO j78+nbM3tZwhWu16QDvk83GxeQb2Md+scU5gUnUC+ADyMGcRMK8qr7A2racd+/I/ktsy aiNG9kmmGJSf8mwjPvgmiDkN7xIIOwo5t5QK1jbx987P0CVyuaOfn7hpYqsPFRe7A0eX 5Usw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=H3LKlIrfRwgmq5pVnhzc/VGMX7Hhbcyy0jI90TfgWyU=; b=nSv10SFO4ly9ZLheTQcvGZJbsog/qPwpKTrTuhjvPwJutXJKX0CEXl9RIik56wBQgx o2m25ixnkdGLRdXH0sQdjSDBnsp/8KS3/fHZhSgLks0ZvsAFR/P3S+oQnUUgaUBJvayB fqDLDxKtorE6ZwAEgN7DEipk3C/VMukxHhmAG3ryvJfjqL9CYBPFrtXVSOgDkQGxnA4k pk/A8n0wQF488Wq3dOUYrdCXTBwAHSpiWHPuB1KknhQBPQjF3Ye/4N4MHGBUnsGhCyjo N9WdP4syUzm9AtCTOy3od2ZDmf3moq7uEm3/KrufofzXHqrLp9lAfka3xoOlheh22xUI urXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=yQl5xGDd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m12si29093562pgv.586.2019.04.12.13.10.58; Fri, 12 Apr 2019 13:11:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=yQl5xGDd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727199AbfDLUK5 (ORCPT + 31 others); Fri, 12 Apr 2019 16:10:57 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:34504 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726953AbfDLUKy (ORCPT ); Fri, 12 Apr 2019 16:10:54 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id x3CKAoMG127390; Fri, 12 Apr 2019 15:10:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1555099850; bh=H3LKlIrfRwgmq5pVnhzc/VGMX7Hhbcyy0jI90TfgWyU=; h=From:To:Subject:Date:In-Reply-To:References; b=yQl5xGDdgJTx4NGwHfk2izRhhvfBA3rtGjK7rAUKOJZIhkxumY4w9qylt0VRvAR5i 6tPb2z7D1IM6mwxdGu0g3CAbhQCwcOY411Hek7k/4UKPsBQ/KQKD518eLqiPeGIsd0 RK9ECWyuChNYVnqk5lLCXTMjuu4HzSio5O3HhNtc= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x3CKAofT031255 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 12 Apr 2019 15:10:50 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 12 Apr 2019 15:10:50 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 12 Apr 2019 15:10:50 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id x3CKAnc8059487; Fri, 12 Apr 2019 15:10:49 -0500 From: Murali Karicheri To: , , , Subject: [net-next PATCH 2/3] net: hsr: fix debugfs path to support multiple interfaces Date: Fri, 12 Apr 2019 16:13:24 -0400 Message-ID: <20190412201325.29001-3-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190412201325.29001-1-m-karicheri2@ti.com> References: <20190412201325.29001-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the path of hsr debugfs root directory to use the net device name so that it can work with multiple interfaces. While at it, also fix some typos. Signed-off-by: Murali Karicheri --- net/hsr/hsr_debugfs.c | 11 +++++------ net/hsr/hsr_device.c | 2 +- net/hsr/hsr_main.h | 5 +++-- 3 files changed, 9 insertions(+), 9 deletions(-) -- 2.17.0 diff --git a/net/hsr/hsr_debugfs.c b/net/hsr/hsr_debugfs.c index b5a955013976..94447974a3c0 100644 --- a/net/hsr/hsr_debugfs.c +++ b/net/hsr/hsr_debugfs.c @@ -1,9 +1,9 @@ /* * hsr_debugfs code - * Copyright (C) 2017 Texas Instruments Incorporated + * Copyright (C) 2019 Texas Instruments Incorporated * * Author(s): - * Murali Karicheri * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -78,12 +78,12 @@ static const struct file_operations hsr_fops = { * When debugfs is configured this routine sets up the node_table file per * hsr device for dumping the node_table entries */ -int hsr_debugfs_init(struct hsr_priv *priv) +int hsr_debugfs_init(struct hsr_priv *priv, struct net_device *hsr_dev) { int rc = -1; struct dentry *de = NULL; - de = debugfs_create_dir("hsr", NULL); + de = debugfs_create_dir(hsr_dev->name, NULL); if (!de) { pr_err("Cannot create hsr debugfs root\n"); return rc; @@ -99,9 +99,8 @@ int hsr_debugfs_init(struct hsr_priv *priv) return rc; } priv->node_tbl_file = de; - rc = 0; - return rc; + return 0; } /* hsr_debugfs_term - Tear down debugfs intrastructure diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index 58cf500ebf94..15c72065df79 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -485,7 +485,7 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], goto fail; mod_timer(&hsr->prune_timer, jiffies + msecs_to_jiffies(PRUNE_PERIOD)); - res = hsr_debugfs_init(hsr); + res = hsr_debugfs_init(hsr, hsr_dev); if (res) goto fail; diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h index 6cd4dff58727..96fac696a1e1 100644 --- a/net/hsr/hsr_main.h +++ b/net/hsr/hsr_main.h @@ -184,10 +184,11 @@ static inline u16 hsr_get_skb_sequence_nr(struct sk_buff *skb) } #if IS_ENABLED(CONFIG_DEBUG_FS) -int hsr_debugfs_init(struct hsr_priv *priv); +int hsr_debugfs_init(struct hsr_priv *priv, struct net_device *hsr_dev); void hsr_debugfs_term(struct hsr_priv *priv); #else -static inline int hsr_debugfs_init(struct hsr_priv *priv) +static inline int hsr_debugfs_init(struct hsr_priv *priv, + struct net_device *hsr_dev) { return 0; } From patchwork Fri Apr 12 20:13:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 162136 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1060699jan; Fri, 12 Apr 2019 13:10:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAfXuXgIcNsvqJkNwrABsR/tsHfo7cgeFkC18kZQ2w43l5AChVfH2uvPMqAMzLGC63gizz X-Received: by 2002:a63:4c:: with SMTP id 73mr18505890pga.210.1555099857855; Fri, 12 Apr 2019 13:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555099857; cv=none; d=google.com; s=arc-20160816; b=fVyGgOVkXowOhsj37WgGmNfiTc7VwOnCaYaN+ZnDl/0nSawIEvFKAHtU3Gaw2jUoOs sXD5rEaTAk7c2syyrbHIYG/Nybawe7HF3RqEsa+Ewgj1ndtoLGlbPKh2thNOzl4UXQXX QJD8HH8DP+uOqqrn00s/gxamfqurrjiCz+USQW/24//VpqjJtGyQW0ObQP3qQcE8Cz8S aYpxDIHQ8M/HTECdcCGlt1SfcADR78sDfnG83VlOdsNbL6GNiuPbKCSXRkSeRcwJ34r4 ZsMPZQDGaHeZilBTliaC7FB3MkZ3O+++VFs4H59Lo84Kv86rTiS/y5dcz1GNenjZcc5r QEhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=EAvJM+1EU/QG0m4JwiiIzc1wldZz6WE80DMpMCcZNIU=; b=AwcgR9ET8yLy0irwkop2KPZPc+zVyKEwut1x1v5z7SleZ42zMkN0i61AXbcH4J6ZI/ /jpeSG+9gcqqZGKR6M9ohlU8t0g3aTxEf13NvtlcGlYK2VQ5OwS5sKodgJaw2+5CEtQ5 aR/fNQ++0VZAQi+HAbqKEdPJ9pbYlAQZdCM7D+jzVBUlf3dMPNaK0SDUsaKziy0LTULb onFcgDeK2QC2GwXxWyz68X8EW0UvWRdQxF3w2DvcI8hsXS86jj0Xs81zXKrTZ8AGkuxR 7IHnczGnPq0qHyM8urb6DnzXo38uvgw+QnlsCWzyfNIRyJYQ2OvzBK/fS4G8hQufI/YP uVhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fe2Ros6B; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3si32983443pgt.35.2019.04.12.13.10.55; Fri, 12 Apr 2019 13:10:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fe2Ros6B; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727104AbfDLUKy (ORCPT + 31 others); Fri, 12 Apr 2019 16:10:54 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:60420 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726815AbfDLUKy (ORCPT ); Fri, 12 Apr 2019 16:10:54 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x3CKAosm009664; Fri, 12 Apr 2019 15:10:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1555099850; bh=EAvJM+1EU/QG0m4JwiiIzc1wldZz6WE80DMpMCcZNIU=; h=From:To:Subject:Date:In-Reply-To:References; b=fe2Ros6B7q2mEA/UFrgQ6uvrNeGDwX+z9qrJcC8qQQNcN1BaBARBN0Hn1i61NLj9Z o9bn9O8Giq4QS/aq3EIXlEBJNpxcDkwJpoGWXEiYSeAYn6bHxz/w5msMYEpTAcliCy 3W3Chxs/Zt/fWFFPoKAy/WfTAAOe5kn0NLrVLMm0= Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x3CKAogh031264 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 12 Apr 2019 15:10:50 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Fri, 12 Apr 2019 15:10:50 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Fri, 12 Apr 2019 15:10:50 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id x3CKAnc9059487; Fri, 12 Apr 2019 15:10:50 -0500 From: Murali Karicheri To: , , , Subject: [net-next PATCH 3/3] net: hsr: add tx stats for master interface Date: Fri, 12 Apr 2019 16:13:25 -0400 Message-ID: <20190412201325.29001-4-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190412201325.29001-1-m-karicheri2@ti.com> References: <20190412201325.29001-1-m-karicheri2@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add tx stats to hsr interface. Without this ifconfig for hsr interface doesn't show tx packet stats. Signed-off-by: Murali Karicheri --- net/hsr/hsr_device.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.0 diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index 15c72065df79..f22902eac083 100644 --- a/net/hsr/hsr_device.c +++ b/net/hsr/hsr_device.c @@ -229,6 +229,8 @@ static int hsr_dev_xmit(struct sk_buff *skb, struct net_device *dev) master = hsr_port_get_hsr(hsr, HSR_PT_MASTER); skb->dev = master->dev; hsr_forward_skb(skb, master); + master->dev->stats.tx_packets++; + master->dev->stats.tx_bytes += skb->len; return NETDEV_TX_OK; }