From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v3 0/9] consolidate sysfs access
Date: Mon, 14 Sep 2026 10:36:13 -0700 [thread overview]
Message-ID: <20260914173700.2795983-1-stephen@networkplumber.org> (raw)
In-Reply-To: <20260912063319.4117869-1-stephen@networkplumber.org>
After reviewing lots of drivers and seeing sloppy string handling
resorted to AI assistance to unify and consolidate the parsing
of sysfs values. Many drivers open code this with similar pattern
but lacked any coherent error handling. The kernel API is
consistent and won't give bad data, but it make sense to
check for garbage.
Add one set of routines in EAL that build the path from a printf
style format and convert with strtoul()/strtol(), then convert the
existing callers.
Since the new routines are Linux only, a driver that uses sysfs while
advertising support on FreeBSD or Windows now fails to link. Two such
cases turned up and are fixed here: the eal_fs test and common/ionic.
Note: existing eal_parse_sysfs_value() goes away with this.
It was exported as a stable symbol, which was a mistake:
the eal_ prefix and the private eal_filesystem.h both say it is internal,
and nothing outside the tree should have been calling it.
The new rte_sysfs_parse_XXX routines are exported, but marked
as internal use only.
v3 - fix doxygen comments
Stephen Hemminger (9):
eal: add common sysfs value routines
dma/idxd: use common sysfs routines
common/ionic: use common sysfs routines
bus/vmbus: use common sysfs routines
power: use common sysfs routines
drivers/bus: remove duplicate sysfs string helpers
common/mlx5: use common sysfs routines
net/mlx5: use common sysfs routines
net/mana: use common sysfs routines
app/test/test_eal_fs.c | 148 ++++++++++----
drivers/bus/auxiliary/linux/auxiliary.c | 13 +-
drivers/bus/cdx/cdx.c | 7 +-
drivers/bus/pci/linux/pci.c | 44 ++--
drivers/bus/platform/platform.c | 43 +---
drivers/bus/vmbus/linux/vmbus_bus.c | 64 ++----
drivers/bus/vmbus/linux/vmbus_uio.c | 24 +--
drivers/common/cnxk/roc_model.c | 40 +---
drivers/common/cnxk/roc_platform.h | 3 +-
drivers/common/ionic/ionic_common_uio.c | 102 +++++-----
.../common/mlx5/linux/mlx5_common_auxiliary.c | 13 +-
drivers/common/mlx5/linux/mlx5_common_os.c | 39 ++--
drivers/dma/idxd/idxd_bus.c | 80 ++------
drivers/net/af_xdp/rte_eth_af_xdp.c | 13 +-
drivers/net/mana/mana.c | 14 +-
drivers/net/mlx5/linux/mlx5_ethdev_os.c | 17 +-
drivers/net/mlx5/linux/mlx5_os.c | 13 +-
drivers/power/acpi/acpi_cpufreq.c | 21 +-
drivers/power/amd_pstate/amd_pstate_cpufreq.c | 63 +-----
drivers/power/cppc/cppc_cpufreq.c | 69 +------
.../power/intel_pstate/intel_pstate_cpufreq.c | 99 ++-------
drivers/power/intel_uncore/intel_uncore.c | 32 +--
lib/eal/common/eal_filesystem.h | 4 +-
lib/eal/include/meson.build | 1 +
lib/eal/include/rte_sysfs.h | 125 ++++++++++++
lib/eal/linux/eal_hugepage_info.c | 33 +--
lib/eal/linux/eal_lcore.c | 18 +-
lib/eal/linux/eal_sysfs.c | 188 ++++++++++++++++++
lib/eal/linux/meson.build | 1 +
lib/eal/unix/eal_filesystem.c | 31 ---
lib/power/power_common.c | 52 +++--
lib/power/power_common.h | 6 +
lib/power/rte_power_qos.c | 29 +--
33 files changed, 694 insertions(+), 755 deletions(-)
create mode 100644 lib/eal/include/rte_sysfs.h
create mode 100644 lib/eal/linux/eal_sysfs.c
--
2.53.0
next prev parent reply other threads:[~2026-09-14 17:37 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-12 6:30 [PATCH 0/9] consolidate sysfs access Stephen Hemminger
2026-09-12 6:30 ` [PATCH 1/9] eal: add common sysfs value routines Stephen Hemminger
2026-09-12 6:30 ` [PATCH 2/9] dma/idxd: use common sysfs routines Stephen Hemminger
2026-09-12 6:30 ` [PATCH 3/9] common/ionic: " Stephen Hemminger
2026-09-12 6:30 ` [PATCH 4/9] bus/vmbus: " Stephen Hemminger
2026-09-12 6:30 ` [PATCH 5/9] power: " Stephen Hemminger
2026-09-12 6:30 ` [PATCH 6/9] drivers/bus: remove duplicate sysfs string helpers Stephen Hemminger
2026-09-12 6:30 ` [PATCH 7/9] common/mlx5: use common sysfs routines Stephen Hemminger
2026-09-12 6:30 ` [PATCH 8/9] net/mlx5: " Stephen Hemminger
2026-09-12 6:30 ` [PATCH 9/9] net/mana: " Stephen Hemminger
2026-09-12 17:02 ` [PATCH v2 0/9] consolidate sysfs access Stephen Hemminger
2026-09-12 17:02 ` [PATCH v2 1/9] eal: add common sysfs value routines Stephen Hemminger
2026-09-12 17:02 ` [PATCH v2 2/9] dma/idxd: use common sysfs routines Stephen Hemminger
2026-09-12 17:02 ` [PATCH v2 3/9] common/ionic: " Stephen Hemminger
2026-09-12 17:02 ` [PATCH v2 4/9] bus/vmbus: " Stephen Hemminger
2026-09-12 17:02 ` [PATCH v2 5/9] power: " Stephen Hemminger
2026-09-12 17:02 ` [PATCH v2 6/9] drivers/bus: remove duplicate sysfs string helpers Stephen Hemminger
2026-09-12 17:02 ` [PATCH v2 7/9] common/mlx5: use common sysfs routines Stephen Hemminger
2026-09-12 17:02 ` [PATCH v2 8/9] net/mlx5: " Stephen Hemminger
2026-09-12 17:02 ` [PATCH v2 9/9] net/mana: " Stephen Hemminger
2026-09-14 13:59 ` [PATCH v2 0/9] consolidate sysfs access Bruce Richardson
2026-09-14 17:36 ` Stephen Hemminger [this message]
2026-09-14 17:36 ` [PATCH v3 1/9] eal: add common sysfs value routines Stephen Hemminger
2026-09-14 17:36 ` [PATCH v3 2/9] dma/idxd: use common sysfs routines Stephen Hemminger
2026-09-14 17:36 ` [PATCH v3 3/9] common/ionic: " Stephen Hemminger
2026-09-14 17:36 ` [PATCH v3 4/9] bus/vmbus: " Stephen Hemminger
2026-09-16 6:52 ` [EXTERNAL] " Wei Hu
2026-09-14 17:36 ` [PATCH v3 5/9] power: " Stephen Hemminger
2026-09-14 17:36 ` [PATCH v3 6/9] drivers/bus: remove duplicate sysfs string helpers Stephen Hemminger
2026-09-14 17:36 ` [PATCH v3 7/9] common/mlx5: use common sysfs routines Stephen Hemminger
2026-09-14 17:36 ` [PATCH v3 8/9] net/mlx5: " Stephen Hemminger
2026-09-14 17:36 ` [PATCH v3 9/9] net/mana: " Stephen Hemminger
2026-09-15 14:39 ` [PATCH v3 0/9] consolidate sysfs access Bruce Richardson
2026-09-15 15:08 ` David Marchand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260914173700.2795983-1-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.