From: Jeff Layton <jlayton@kernel.org>
To: NeilBrown <neil@brown.name>,
Olga Kornievskaia <okorniev@redhat.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
Chuck Lever <cel@kernel.org>
Cc: Trond Myklebust <trondmy@kernel.org>,
Anna Schumaker <anna@kernel.org>,
Steve Dickson <steved@redhat.com>,
linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
Jeff Layton <jlayton@kernel.org>
Subject: [PATCH v7 0/6] nfsd/sunrpc: convert nfsstat server-side interfaces to use netlink
Date: Fri, 17 Jul 2026 07:08:52 -0400 [thread overview]
Message-ID: <20260717-exportd-netlink-v7-0-b7ce17b83b60@kernel.org> (raw)
I last sent this series about a month ago, and dropped the ball on
sending out a newer version afterward. This version fixes some minor
issues that Chuck and Sashiko pointed out in review.
The nfsstat tool currently scrapes /proc/net/rpc/nfsd for server
statistics. This procfs interface has several limitations: the
counters are global (not network-namespace-aware), the format is
fragile to parse, and it cannot be extended without breaking
existing parsers.
This series adds per-network-namespace procedure call counts to
the sunrpc layer and exposes them through a new netlink handler
in the nfsd generic netlink family, allowing nfsstat to retrieve
server statistics via netlink with a procfs fallback for older
kernels. The nfs-utils patch for that part is already merged.
Additionally, this version adds tracking of callback operation counts.
Ideally, I'd like to see this go into v7.3.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Changes in v7:
- Skip never-called operations in the server-stats netlink dump instead
of emitting a zero-count entry for every opcode
- Link to v6: https://lore.kernel.org/r/20260619-exportd-netlink-v6-0-ddef3499793c@kernel.org
Changes in v6:
- Emit the entire server-stats object in a single netlink dump message
- Count CB_SEQUENCE on v4.1+ callbacks, for parity with the forechannel SEQUENCE count
- Fix a use-after-free in nfsd4_run_cb() by snapshotting the opcode, net, and minorversion
- Link to v5: https://lore.kernel.org/r/20260618-exportd-netlink-v5-0-e9aef947af3d@kernel.org
Changes in v5:
- Add NFSv4 callback call counts to nfsstat upcall
- Link to v4: https://lore.kernel.org/r/20260616-exportd-netlink-v4-0-03505aee3883@kernel.org
Changes in v4:
- Ensure error is returned when nla_put_*() calls fail
- Link to v3: https://lore.kernel.org/r/20260609-exportd-netlink-v3-0-aa5508a5bb1d@kernel.org
Changes in v3:
- Only increment per-net stats for the "primary" program
- Link to v2: https://lore.kernel.org/r/20260525-exportd-netlink-v2-0-40003fed450c@kernel.org
---
Jeff Layton (6):
sunrpc: add per-netns per-procedure call counts to svc_stat
sunrpc: use per-net counts in svc_seq_show()
nfsd: implement server-stats-get netlink handler
sunrpc: remove unused svc_version vs_count field
nfsd: count NFSv4 callback operations per netns
nfsd: export NFSv4 callback op stats via netlink
Documentation/netlink/specs/nfsd.yaml | 111 ++++++++++++++
fs/lockd/svc4proc.c | 4 -
fs/lockd/svcproc.c | 7 -
fs/nfs/callback_xdr.c | 6 -
fs/nfsd/localio.c | 3 -
fs/nfsd/netlink.c | 5 +
fs/nfsd/netlink.h | 2 +
fs/nfsd/netns.h | 12 +-
fs/nfsd/nfs2acl.c | 3 -
fs/nfsd/nfs3acl.c | 3 -
fs/nfsd/nfs3proc.c | 3 -
fs/nfsd/nfs4callback.c | 22 ++-
fs/nfsd/nfs4proc.c | 3 -
fs/nfsd/nfs4state.c | 2 -
fs/nfsd/nfsctl.c | 271 +++++++++++++++++++++++++++++++++-
fs/nfsd/nfsproc.c | 3 -
fs/nfsd/stats.c | 2 +-
fs/nfsd/stats.h | 5 +-
include/linux/sunrpc/stats.h | 6 +
include/linux/sunrpc/svc.h | 1 -
include/uapi/linux/nfsd_netlink.h | 36 +++++
net/sunrpc/stats.c | 2 +-
net/sunrpc/svc.c | 63 +++++++-
23 files changed, 528 insertions(+), 47 deletions(-)
---
base-commit: 4f30ae575e0541214c6b5afe5ee29068b6fab9e1
change-id: 20260316-exportd-netlink-1c9fb52536e3
Best regards,
--
Jeff Layton <jlayton@kernel.org>
next reply other threads:[~2026-07-17 11:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 11:08 Jeff Layton [this message]
2026-07-17 11:08 ` [PATCH v7 1/6] sunrpc: add per-netns per-procedure call counts to svc_stat Jeff Layton
2026-07-17 11:08 ` [PATCH v7 2/6] sunrpc: use per-net counts in svc_seq_show() Jeff Layton
2026-07-17 11:08 ` [PATCH v7 3/6] nfsd: implement server-stats-get netlink handler Jeff Layton
2026-07-17 11:08 ` [PATCH v7 4/6] sunrpc: remove unused svc_version vs_count field Jeff Layton
2026-07-17 11:08 ` [PATCH v7 5/6] nfsd: count NFSv4 callback operations per netns Jeff Layton
2026-07-17 11:08 ` [PATCH v7 6/6] nfsd: export NFSv4 callback op stats via netlink Jeff Layton
2026-07-17 13:30 ` [PATCH v7 0/6] nfsd/sunrpc: convert nfsstat server-side interfaces to use netlink Chuck Lever
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=20260717-exportd-netlink-v7-0-b7ce17b83b60@kernel.org \
--to=jlayton@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=anna@kernel.org \
--cc=cel@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=steved@redhat.com \
--cc=tom@talpey.com \
--cc=trondmy@kernel.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.