From patchwork Mon Apr 15 15:36:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 162198 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3069053jan; Mon, 15 Apr 2019 08:33:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5vMjOY6qQxqYZZaJwDdOLX10Q8k13uPuU6x+gon8DYEJ3KFCJJbK/m/TUMYUgsk/Cl20V X-Received: by 2002:a63:c145:: with SMTP id p5mr68562997pgi.339.1555342417820; Mon, 15 Apr 2019 08:33:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555342417; cv=none; d=google.com; s=arc-20160816; b=lhERRbqOfvNyTbSEv/2CQRL14bBAytSH0X6fsAhi6zKzsXIK+IY2/FZtytxQ2q2aq2 WeU40CX9ZPWjrkDDBQnOfMnjzV8CT6gCy+KG/QVEkJ0SXIVt8Ng+DJNQfXbq9U7sBzfV rn1L3o9GwN6dIYc/YujHeQIVsisnF+Cna2NT7SXDqEVrJzEy5J3yadBN90eydMLF1KRG ff19Ycsi2tTqZDqdi0ItXWbok0FVspsT0JJ7QLiO9lpV4ZCZQ7wuhlcyLGc3ymtxsjJP kjMN2UqakG6v/oJpHjoEKJW8TWFCOKoD7fgNkdL5j1DzQJJqIRjTwZK75C4+40/5jkFf 4mRA== 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=vOiE1bIdzEjfYVQxnjJIJXT5wG5N/usXZ08XXkVX+eqFkBhTspDLyjPWoqFwfo6zVd b1qi2QfWMQFlGg3Y2x2DxfK4lGUOwZaaGbWVC6XC8MAoBQa+Z3pgejdciXepj6rxwGdA fi/Uqh6JKuv33Gj+PaNqQ6vxhnrGZrwuZ0l5L60A9siqbHrXGQoZf0v6qitRR9Jt417H WfcTRpFPOu/PUTARcyJ71DzdJTKGJlK22jzMS1XbENwBTBLTGheR7176IoA2FEX4fXmZ U6WqZEdkcCs3mBBTXFs9Ho7h8DU4xsyk0lnnfSmV3tvJdjoL3eAOPeuPndrmWqXZ45lK v10Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=DhIn4tW3; 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 h65si48932564pfd.232.2019.04.15.08.33.37; Mon, 15 Apr 2019 08:33:37 -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=DhIn4tW3; 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 S1727794AbfDOPdf (ORCPT + 30 others); Mon, 15 Apr 2019 11:33:35 -0400 Received: from lelv0143.ext.ti.com ([198.47.23.248]:56044 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726147AbfDOPde (ORCPT ); Mon, 15 Apr 2019 11:33:34 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id x3FFXUVa094542; Mon, 15 Apr 2019 10:33:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1555342410; bh=naeODMw2JTB2zvbveGzI7NZUxJdvIvz0O8ekQwSm0jY=; h=From:To:Subject:Date:In-Reply-To:References; b=DhIn4tW3t84/PBawJYFsVdiHhhbOXQfWgeU54U7DarPjNfBBKKBNHWm3RmeONt0k6 kO7FyYm6t6xfpK47tzCw74CnQWASV+h7Y095axfkkzKb4qs8nfRr1WSbtFOVT4NZuO KpCev5vTA9jgs++NLuhMLXaXNkLMDJsa5yokvZlE= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x3FFXUpn017049 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 15 Apr 2019 10:33:30 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 15 Apr 2019 10:33:29 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE111.ent.ti.com (10.64.6.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; Mon, 15 Apr 2019 10:33:29 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x3FFXTjW041063; Mon, 15 Apr 2019 10:33:29 -0500 From: Murali Karicheri To: , , , Subject: [net-next PATCH v2 1/3] net: hsr: fix naming of file and functions Date: Mon, 15 Apr 2019 11:36:01 -0400 Message-ID: <20190415153603.23110-2-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190415153603.23110-1-m-karicheri2@ti.com> References: <20190415153603.23110-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 Mon Apr 15 15:36:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 162199 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3069233jan; Mon, 15 Apr 2019 08:33:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpk2Lc9HI97VqEnahJ1oMUjPBWa5uh33aZjh47BZxLTqVOIlbUsHX1RaYQW4dGyzAQhTPg X-Received: by 2002:a17:902:442:: with SMTP id 60mr76803905ple.107.1555342427541; Mon, 15 Apr 2019 08:33:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555342427; cv=none; d=google.com; s=arc-20160816; b=PwhpgC0ZBv8oQnpkQUNx3QiNkc1kG4gb3yFv5UOE5HL62Hux1N5RvGI1sBsK1jRGjd 0ObyKjd2+CGjrAECH7WqE3DKky/IupbUaSv5YAcwXrraagX154LPdQNovWo91ZLLCFZm 5IJBV3oAr52mQdVmfvT8fCH0ztG9EAm3jD2Nh0jhBPr8hLTCWK2qEBA6S7QpnutJw0up xYj6cA9GrT/ItmMuJTBAKgtL8cO8AxV8rd9Lhr9S8HbT8rJfLzKLY1rda/Cmj1lfRQVB beP8oTiB+uqId32kzkIdgyul+CCkiqPwB/QP6s4apOLZ2hPP6yjKQYGOoRl1/0bgDgeV 5kxQ== 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=JYCPapVRsYy+Go9MyDsnBovq+J9aW7z4Z/VZqO0tinW02Zl42wT6FEANLutJhJyYea VD7FlTUWwYjxxT7ZiqbzcjmzNDekONPb9xablivKZlCXIkws+lvSlfhciEX5LdCcz/Br 11RHh/Z7lwLbL6AEZIsQ3oy/hd+lcekWKw/bQJ4W1K8NybPWzV/IC5Mfi4oCXWcXstaX gUfKypOlzTd7k/LswEXUDE7hp3uuHgEErjgFE5GCgDEqktAU8TVXQEtAB/2lGp/H+jmo DBY3qqS2cvwn0pcIk2i01asMDENihIRqrom2boDYDf5uEWGBp+jndfYUBXa3zFhMCVi4 Kclw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=RYe7n41C; 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 h65si48932564pfd.232.2019.04.15.08.33.47; Mon, 15 Apr 2019 08:33:47 -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=RYe7n41C; 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 S1727829AbfDOPdq (ORCPT + 30 others); Mon, 15 Apr 2019 11:33:46 -0400 Received: from lelv0142.ext.ti.com ([198.47.23.249]:60098 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726785AbfDOPdf (ORCPT ); Mon, 15 Apr 2019 11:33:35 -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 x3FFXUhm072095; Mon, 15 Apr 2019 10:33:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1555342410; bh=H3LKlIrfRwgmq5pVnhzc/VGMX7Hhbcyy0jI90TfgWyU=; h=From:To:Subject:Date:In-Reply-To:References; b=RYe7n41CHmQDCfJ5hdwGGNCs083Bghsc67sOIz/XGMhAkoNM83GfMBDOOsjYmUjak 6eNogfD+IwsCnFsLdqFxU14bwdnEqevjVlAB1R5q743Ueaw1uSuC2SPltWeASwb4BP F3a8eRSSfWSUb8VRGR6o9DhPzUXwgs/kaJjxX8Wk= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x3FFXUOC017074 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 15 Apr 2019 10:33:30 -0500 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 15 Apr 2019 10:33:30 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE102.ent.ti.com (10.64.6.23) 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; Mon, 15 Apr 2019 10:33:30 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x3FFXTjX041063; Mon, 15 Apr 2019 10:33:30 -0500 From: Murali Karicheri To: , , , Subject: [net-next PATCH v2 2/3] net: hsr: fix debugfs path to support multiple interfaces Date: Mon, 15 Apr 2019 11:36:02 -0400 Message-ID: <20190415153603.23110-3-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190415153603.23110-1-m-karicheri2@ti.com> References: <20190415153603.23110-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 Mon Apr 15 15:36:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Murali Karicheri X-Patchwork-Id: 162197 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp3069028jan; Mon, 15 Apr 2019 08:33:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwf0BiI+eDNNgrYAEq1Zrint7kKZYsLtVsuiCYfMKSS+DguMJFBw9u6F6o3xDPOp0xk9gn5 X-Received: by 2002:a17:902:2aa8:: with SMTP id j37mr12897110plb.164.1555342416595; Mon, 15 Apr 2019 08:33:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555342416; cv=none; d=google.com; s=arc-20160816; b=IF4H3npIOxWNP/2+2UBd6BsneU72YpeC9HmHKElREB+S/j7AuNc9cBOov39qCx4mxr nTTRmJQCm/YCFh/QH4QuGoV9H15kTCsaGlEfc0UkKdK64Z/spX+tB2WiTyVt8OODVfHW Q59h6duoDCmS8u1S/AThB0KEt+05Xzi4lNmu1gBz3YN7bT7MMXNsel7kJy9KDwSOXJxa d2CedjR+x8Tw3Ujt0O1VCVMuC7EeRAxd31eJXXxuT5fJoIf68r1OJopwbU6kqALXpnXB nwdCVIz4q2iTmel9D9UK6wFHr+oohMO0JGdxHIZC8uYx6XvZQ8gJO783dnL6IlwUOHIs rSbg== 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=o3AHcBA70TtrgcXTvaec3S4QIqbkcPzZypbqJaXtdTU=; b=mAAq2zGo9OT4ObIr/QjuGm7GyLGOOmlDNhcqoFEd96/w5YtvdmU5Gwvystq0R4d2RC 4+VavOjZDGos8MK1sruujlS8LdQdW1qsSa4TMmiAxVy+dnmwe49RDW1yrkTqikF9Pprb LEVOsATzPNh35PKbjJ23HT5gr3oREqC8aXo31ywbqtbmYmm+jIN3z4mKhKehioCF2WCM ne1s369GLc+OgwvJgcLQPp5l+Sy4yIgWTZjL15H62shQVrIXzImvVoXjvCEgKUmTmCXR /ceKAvxW6xz3vXSveiLXk/SV1ju7fGz8gCrSdTgD+5W6flt/vP6t7+auaft7IiN8VU49 twXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=aZ+v0R1Y; 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 k186si41593058pgd.206.2019.04.15.08.33.36; Mon, 15 Apr 2019 08:33:36 -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=aZ+v0R1Y; 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 S1727779AbfDOPdf (ORCPT + 30 others); Mon, 15 Apr 2019 11:33:35 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:47042 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726522AbfDOPde (ORCPT ); Mon, 15 Apr 2019 11:33:34 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x3FFXVCt019996; Mon, 15 Apr 2019 10:33:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1555342411; bh=o3AHcBA70TtrgcXTvaec3S4QIqbkcPzZypbqJaXtdTU=; h=From:To:Subject:Date:In-Reply-To:References; b=aZ+v0R1YGYrGfmqrVLrnH86aoPTqGDk0uA2W28iTmxk9RQdiA5AEXALaTb/ycAX8U CpqqCkZM1nbU4kYOnQkOGp9DO/LoP5C1z1iCFv/hCFz2++ZrJJVvl1okzT9aR44Rd3 IX4EOEYYwX2JvbQPAebJE/Ewy1P1CwhYsXhbTMpA= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x3FFXV1p090596 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 15 Apr 2019 10:33:31 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 15 Apr 2019 10:33:30 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE108.ent.ti.com (157.170.170.38) 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; Mon, 15 Apr 2019 10:33:30 -0500 Received: from uda0868495.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x3FFXTjY041063; Mon, 15 Apr 2019 10:33:30 -0500 From: Murali Karicheri To: , , , Subject: [net-next PATCH v2 3/3] net: hsr: add tx stats for master interface Date: Mon, 15 Apr 2019 11:36:03 -0400 Message-ID: <20190415153603.23110-4-m-karicheri2@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20190415153603.23110-1-m-karicheri2@ti.com> References: <20190415153603.23110-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_forward.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.17.0 diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index 0cac992192d0..ddd9605bad04 100644 --- a/net/hsr/hsr_forward.c +++ b/net/hsr/hsr_forward.c @@ -359,6 +359,13 @@ void hsr_forward_skb(struct sk_buff *skb, struct hsr_port *port) goto out_drop; hsr_register_frame_in(frame.node_src, port, frame.sequence_nr); hsr_forward_do(&frame); + /* Gets called for ingress frames as well as egress from master port. + * So check and increment stats for master port only here. + */ + if (port->type == HSR_PT_MASTER) { + port->dev->stats.tx_packets++; + port->dev->stats.tx_bytes += skb->len; + } if (frame.skb_hsr) kfree_skb(frame.skb_hsr);