[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240228083115.01d4c93e@hermes.local>
Date: Wed, 28 Feb 2024 08:31:15 -0800
From: Stephen Hemminger <stephen@...workplumber.org>
To: Lukasz Majewski <lukma@...x.de>
Cc: Oleksij Rempel <o.rempel@...gutronix.de>, Andrew Lunn <andrew@...n.ch>,
Eric Dumazet <edumazet@...gle.com>, Florian Fainelli
<f.fainelli@...il.com>, Vladimir Oltean <olteanv@...il.com>, "David S.
Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
netdev@...r.kernel.org, Tristram.Ha@...rochip.com, Sebastian Andrzej
Siewior <bigeasy@...utronix.de>, Paolo Abeni <pabeni@...hat.com>, Ravi
Gunasekaran <r-gunasekaran@...com>, Simon Horman <horms@...nel.org>,
Wojciech Drewek <wojciech.drewek@...el.com>, Nikita Zhandarovich
<n.zhandarovich@...tech.ru>, Murali Karicheri <m-karicheri2@...com>, Dan
Carpenter <dan.carpenter@...aro.org>, Ziyang Xuan
<william.xuanziyang@...wei.com>, Kristian Overskeid <koverskeid@...il.com>,
Matthieu Baerts <matttbe@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [RFC] net: hsr: Provide RedBox support
On Wed, 28 Feb 2024 16:07:35 +0100
Lukasz Majewski <lukma@...x.de> wrote:
>
> +/* hsr_proxy_node_table_show - Formats and prints proxy node_table entries */
> +static int
> +hsr_proxy_node_table_show(struct seq_file *sfp, void *data)
> +{
> + struct hsr_priv *priv = (struct hsr_priv *)sfp->private;
> + struct hsr_node *node;
> +
> + seq_printf(sfp, "Proxy Node Table entries for HSR device\n");
> + seq_puts(sfp, "MAC-Address-SAN, time_in\n");
> + rcu_read_lock();
> + list_for_each_entry_rcu(node, &priv->proxy_node_db, mac_list) {
> + seq_printf(sfp, "%pM ", &node->macaddress_A[0]);
> + seq_printf(sfp, "%10lx\n", node->time_in[HSR_PT_INTERLINK]);
> + }
> + rcu_read_unlock();
> + return 0;
> +}
> +
> DEFINE_SHOW_ATTRIBUTE(hsr_node_table);
> +DEFINE_SHOW_ATTRIBUTE(hsr_proxy_node_table);
NAK
Do not abuse sysfs to be a debug proc style output.
Sysfs is supposed to be one value per file (or not used at all).
Formatting belongs in the user space program.
Powered by blists - more mailing lists