lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250220180812.10b6de7e@kernel.org>
Date: Thu, 20 Feb 2025 18:08:12 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: David Arinzon <darinzon@...zon.com>
Cc: David Miller <davem@...emloft.net>, <netdev@...r.kernel.org>, Eric
 Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Simon
 Horman <horms@...nel.org>, "Richard Cochran" <richardcochran@...il.com>,
 "Woodhouse, David" <dwmw@...zon.com>, "Machulsky, Zorik"
 <zorik@...zon.com>, "Matushevsky, Alexander" <matua@...zon.com>, Saeed
 Bshara <saeedb@...zon.com>, "Wilson, Matt" <msw@...zon.com>, "Liguori,
 Anthony" <aliguori@...zon.com>, "Bshara, Nafea" <nafea@...zon.com>,
 "Schmeilin, Evgeny" <evgenys@...zon.com>, "Belgazal, Netanel"
 <netanel@...zon.com>, "Saidi, Ali" <alisaidi@...zon.com>, "Herrenschmidt,
 Benjamin" <benh@...zon.com>, "Kiyanovski, Arthur" <akiyano@...zon.com>,
 "Dagan, Noam" <ndagan@...zon.com>, "Bernstein, Amit" <amitbern@...zon.com>,
 "Agroskin, Shay" <shayagr@...zon.com>, "Abboud, Osama"
 <osamaabb@...zon.com>, "Ostrovsky, Evgeny" <evostrov@...zon.com>,
 "Tabachnik, Ofir" <ofirt@...zon.com>, "Machnikowski, Maciek"
 <maciek@...hnikowski.net>, Rahul Rameshbabu <rrameshbabu@...dia.com>, Gal
 Pressman <gal@...dia.com>, Vadim Fedorenko <vadim.fedorenko@...ux.dev>
Subject: Re: [PATCH v7 net-next 4/5] net: ena: PHC stats through sysfs

On Tue, 18 Feb 2025 20:39:47 +0200 David Arinzon wrote:
> +static ssize_t ena_phc_stats_show(struct device *dev,
> +				  struct device_attribute *attr,
> +				  char *buf)
> +{
> +	struct ena_adapter *adapter = dev_get_drvdata(dev);
> +	int i, rc, chars_written = 0;
> +
> +	if (!ena_phc_is_active(adapter))
> +		return 0;
> +
> +	for (i = 0; i < ena_stats_array_ena_com_phc_size; i++) {
> +		const struct ena_stats *ena_stats;
> +		u64 *ptr;
> +
> +		ena_stats = &ena_stats_ena_com_phc_strings[i];
> +		ptr = (u64 *)&adapter->ena_dev->phc.stats +
> +		      ena_stats->stat_offset;
> +		rc = snprintf(buf,
> +			      ETH_GSTRING_LEN + sizeof(u64),
> +			      "%s: %llu\n",
> +			      ena_stats->name,
> +			      *ptr);
> +
> +		buf += rc;
> +		chars_written += rc;
> +	}
> +
> +	return chars_written;
> +}
> +
> +static DEVICE_ATTR(phc_stats, S_IRUGO, ena_phc_stats_show, NULL);

In sysfs I'm afraid the rule is one value per file.
So the stats have to have individual files.
-- 
pw-bot: cr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ