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] [thread-next>] [day] [month] [year] [list]
Message-ID: <fc701e7bbc63491cb8dec5c7bc86e4e7@amazon.com>
Date: Tue, 25 Feb 2025 17:52:10 +0000
From: "Arinzon, David" <darinzon@...zon.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: David Miller <davem@...emloft.net>, "netdev@...r.kernel.org"
	<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.co.uk>,
	"Machulsky, Zorik" <zorik@...zon.com>, "Matushevsky, Alexander"
	<matua@...zon.com>, "Bshara, Saeed" <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>, "Allen, Neil" <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

> > +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

Thanks Jakub, will change  in v8.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ