From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>,
linux-nfs@vger.kernel.org, jlayton@kernel.org, neilb@suse.de,
netdev@vger.kernel.org
Subject: Re: [PATCH v8 2/3] NFSD: introduce netlink rpc_status stubs
Date: Thu, 14 Sep 2023 13:20:43 +0200 [thread overview]
Message-ID: <ZQLsi7uJdIF4QZ41@lore-desk> (raw)
In-Reply-To: <ZP9wrLXKWtvMt4mZ@tissot.1015granger.net>
[-- Attachment #1: Type: text/plain, Size: 7214 bytes --]
> On Mon, Sep 11, 2023 at 02:49:45PM +0200, Lorenzo Bianconi wrote:
> > Generate empty netlink stubs and uAPI through nfsd_server.yaml specs:
> >
> > $./tools/net/ynl/ynl-gen-c.py --mode uapi \
> > --spec Documentation/netlink/specs/nfsd_server.yaml \
> > --header -o include/uapi/linux/nfsd_server.h
> > $./tools/net/ynl/ynl-gen-c.py --mode kernel \
> > --spec Documentation/netlink/specs/nfsd_server.yaml \
> > --header -o fs/nfsd/nfs_netlink_gen.h
> > $./tools/net/ynl/ynl-gen-c.py --mode kernel \
> > --spec Documentation/netlink/specs/nfsd_server.yaml \
> > --source -o fs/nfsd/nfs_netlink_gen.c
>
> Actually there's a tool that walks the whole kernel source tree
> and handles any files that contain the YNL-GEN tag:
>
> $ tools/net/ynl/ynl-regen.sh
>
>
> > Tested-by: Jeff Layton <jlayton@kernel.org>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> > fs/nfsd/Makefile | 3 +-
> > fs/nfsd/nfs_netlink_gen.c | 32 +++++++++++++++++++++
> > fs/nfsd/nfs_netlink_gen.h | 22 ++++++++++++++
> > fs/nfsd/nfsctl.c | 16 +++++++++++
> > include/uapi/linux/nfsd_server.h | 49 ++++++++++++++++++++++++++++++++
> > 5 files changed, 121 insertions(+), 1 deletion(-)
> > create mode 100644 fs/nfsd/nfs_netlink_gen.c
> > create mode 100644 fs/nfsd/nfs_netlink_gen.h
> > create mode 100644 include/uapi/linux/nfsd_server.h
> >
> > diff --git a/fs/nfsd/Makefile b/fs/nfsd/Makefile
> > index 6fffc8f03f74..6ae1d5450bf6 100644
> > --- a/fs/nfsd/Makefile
> > +++ b/fs/nfsd/Makefile
> > @@ -12,7 +12,8 @@ nfsd-y += trace.o
> >
> > nfsd-y += nfssvc.o nfsctl.o nfsfh.o vfs.o \
> > export.o auth.o lockd.o nfscache.o \
> > - stats.o filecache.o nfs3proc.o nfs3xdr.o
> > + stats.o filecache.o nfs3proc.o nfs3xdr.o \
> > + nfs_netlink_gen.o
> > nfsd-$(CONFIG_NFSD_V2) += nfsproc.o nfsxdr.o
> > nfsd-$(CONFIG_NFSD_V2_ACL) += nfs2acl.o
> > nfsd-$(CONFIG_NFSD_V3_ACL) += nfs3acl.o
> > diff --git a/fs/nfsd/nfs_netlink_gen.c b/fs/nfsd/nfs_netlink_gen.c
> > new file mode 100644
> > index 000000000000..4d71b80bf4a7
> > --- /dev/null
> > +++ b/fs/nfsd/nfs_netlink_gen.c
>
> I'd like a shorter file name. How about fs/nfsd/netlink.c
> (and below, netlink.h) ?
ack, fine
Regards,
Lorenzo
>
>
> > @@ -0,0 +1,32 @@
> > +// SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
> > +/* Do not edit directly, auto-generated from: */
> > +/* Documentation/netlink/specs/nfsd_server.yaml */
> > +/* YNL-GEN kernel source */
> > +
> > +#include <net/netlink.h>
> > +#include <net/genetlink.h>
> > +
> > +#include "nfs_netlink_gen.h"
> > +
> > +#include <uapi/linux/nfsd_server.h>
> > +
> > +/* Ops table for nfsd_server */
> > +static const struct genl_split_ops nfsd_server_nl_ops[] = {
> > + {
> > + .cmd = NFSD_CMD_RPC_STATUS_GET,
> > + .start = nfsd_server_nl_rpc_status_get_start,
> > + .dumpit = nfsd_server_nl_rpc_status_get_dumpit,
> > + .done = nfsd_server_nl_rpc_status_get_done,
> > + .flags = GENL_CMD_CAP_DUMP,
> > + },
> > +};
> > +
> > +struct genl_family nfsd_server_nl_family __ro_after_init = {
> > + .name = NFSD_SERVER_FAMILY_NAME,
> > + .version = NFSD_SERVER_FAMILY_VERSION,
> > + .netnsok = true,
> > + .parallel_ops = true,
> > + .module = THIS_MODULE,
> > + .split_ops = nfsd_server_nl_ops,
> > + .n_split_ops = ARRAY_SIZE(nfsd_server_nl_ops),
> > +};
> > diff --git a/fs/nfsd/nfs_netlink_gen.h b/fs/nfsd/nfs_netlink_gen.h
> > new file mode 100644
> > index 000000000000..f66b29e528c1
> > --- /dev/null
> > +++ b/fs/nfsd/nfs_netlink_gen.h
> > @@ -0,0 +1,22 @@
> > +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
> > +/* Do not edit directly, auto-generated from: */
> > +/* Documentation/netlink/specs/nfsd_server.yaml */
> > +/* YNL-GEN kernel header */
> > +
> > +#ifndef _LINUX_NFSD_SERVER_GEN_H
> > +#define _LINUX_NFSD_SERVER_GEN_H
> > +
> > +#include <net/netlink.h>
> > +#include <net/genetlink.h>
> > +
> > +#include <uapi/linux/nfsd_server.h>
> > +
> > +int nfsd_server_nl_rpc_status_get_start(struct netlink_callback *cb);
> > +int nfsd_server_nl_rpc_status_get_done(struct netlink_callback *cb);
> > +
> > +int nfsd_server_nl_rpc_status_get_dumpit(struct sk_buff *skb,
> > + struct netlink_callback *cb);
> > +
> > +extern struct genl_family nfsd_server_nl_family;
> > +
> > +#endif /* _LINUX_NFSD_SERVER_GEN_H */
> > diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
> > index 33f80d289d63..1be66088849c 100644
> > --- a/fs/nfsd/nfsctl.c
> > +++ b/fs/nfsd/nfsctl.c
> > @@ -1495,6 +1495,22 @@ static int create_proc_exports_entry(void)
> >
> > unsigned int nfsd_net_id;
> >
> > +int nfsd_server_nl_rpc_status_get_start(struct netlink_callback *cb)
> > +{
> > + return 0;
> > +}
> > +
> > +int nfsd_server_nl_rpc_status_get_done(struct netlink_callback *cb)
> > +{
> > + return 0;
> > +}
> > +
> > +int nfsd_server_nl_rpc_status_get_dumpit(struct sk_buff *skb,
> > + struct netlink_callback *cb)
> > +{
> > + return 0;
> > +}
> > +
> > /**
> > * nfsd_net_init - Prepare the nfsd_net portion of a new net namespace
> > * @net: a freshly-created network namespace
> > diff --git a/include/uapi/linux/nfsd_server.h b/include/uapi/linux/nfsd_server.h
> > new file mode 100644
> > index 000000000000..c9ee00ceca3b
> > --- /dev/null
> > +++ b/include/uapi/linux/nfsd_server.h
> > @@ -0,0 +1,49 @@
> > +/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
> > +/* Do not edit directly, auto-generated from: */
> > +/* Documentation/netlink/specs/nfsd_server.yaml */
> > +/* YNL-GEN uapi header */
> > +
> > +#ifndef _UAPI_LINUX_NFSD_SERVER_H
> > +#define _UAPI_LINUX_NFSD_SERVER_H
> > +
> > +#define NFSD_SERVER_FAMILY_NAME "nfsd_server"
> > +#define NFSD_SERVER_FAMILY_VERSION 1
> > +
> > +enum nfsd_rpc_status_comp_attr {
> > + NFSD_ATTR_RPC_STATUS_COMP_UNSPEC,
> > + NFSD_ATTR_RPC_STATUS_COMP_OP,
> > +
> > + __NFSD_ATTR_RPC_STATUS_COMP_MAX,
> > + NFSD_ATTR_RPC_STATUS_COMP_MAX = (__NFSD_ATTR_RPC_STATUS_COMP_MAX - 1)
> > +};
> > +
> > +enum nfsd_rpc_status_attr {
> > + NFSD_ATTR_RPC_STATUS_UNSPEC,
> > + NFSD_ATTR_RPC_STATUS_XID,
> > + NFSD_ATTR_RPC_STATUS_FLAGS,
> > + NFSD_ATTR_RPC_STATUS_PROG,
> > + NFSD_ATTR_RPC_STATUS_VERSION,
> > + NFSD_ATTR_RPC_STATUS_PROC,
> > + NFSD_ATTR_RPC_STATUS_SERVICE_TIME,
> > + NFSD_ATTR_RPC_STATUS_PAD,
> > + NFSD_ATTR_RPC_STATUS_SADDR4,
> > + NFSD_ATTR_RPC_STATUS_DADDR4,
> > + NFSD_ATTR_RPC_STATUS_SADDR6,
> > + NFSD_ATTR_RPC_STATUS_DADDR6,
> > + NFSD_ATTR_RPC_STATUS_SPORT,
> > + NFSD_ATTR_RPC_STATUS_DPORT,
> > + NFSD_ATTR_RPC_STATUS_COMPOND_OP,
> > +
> > + __NFSD_ATTR_RPC_STATUS_MAX,
> > + NFSD_ATTR_RPC_STATUS_MAX = (__NFSD_ATTR_RPC_STATUS_MAX - 1)
> > +};
> > +
> > +enum nfsd_commands {
> > + NFSD_CMD_UNSPEC,
> > + NFSD_CMD_RPC_STATUS_GET,
> > +
> > + __NFSD_CMD_MAX,
> > + NFSD_CMD_MAX = (__NFSD_CMD_MAX - 1)
> > +};
> > +
> > +#endif /* _UAPI_LINUX_NFSD_SERVER_H */
> > --
> > 2.41.0
> >
>
> --
> Chuck Lever
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2023-09-14 11:21 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-11 12:49 [PATCH v8 0/3] add rpc_status netlink support for NFSD Lorenzo Bianconi
2023-09-11 12:49 ` [PATCH v8 1/3] Documentation: netlink: add a YAML spec for nfsd_server Lorenzo Bianconi
2023-09-11 17:20 ` Jeff Layton
2023-09-11 18:10 ` Chuck Lever
2023-09-14 10:46 ` Lorenzo Bianconi
2023-10-03 17:55 ` Jakub Kicinski
2023-10-03 18:40 ` Chuck Lever III
2023-10-03 19:02 ` Jakub Kicinski
2023-10-03 23:00 ` Chuck Lever III
2023-10-04 0:24 ` Jakub Kicinski
2023-09-11 12:49 ` [PATCH v8 2/3] NFSD: introduce netlink rpc_status stubs Lorenzo Bianconi
2023-09-11 19:35 ` Jeff Layton
2023-09-11 19:55 ` Chuck Lever
2023-09-14 11:20 ` Lorenzo Bianconi [this message]
2023-09-12 15:07 ` Simon Horman
2023-09-14 11:25 ` Lorenzo Bianconi
2023-09-11 12:49 ` [PATCH v8 3/3] NFSD: add rpc_status netlink support Lorenzo Bianconi
2023-09-11 19:43 ` Jeff Layton
2023-09-12 15:13 ` Simon Horman
2023-09-14 11:41 ` Lorenzo Bianconi
2023-10-03 18:03 ` Jakub Kicinski
2023-10-04 10:14 ` Lorenzo Bianconi
2023-10-04 13:27 ` Chuck Lever III
2023-10-04 14:04 ` Lorenzo Bianconi
2023-12-11 18:56 ` Jeff Layton
2023-12-12 12:07 ` Jeff Layton
2023-09-15 19:24 ` [PATCH v8 0/3] add rpc_status netlink support for NFSD Chuck Lever
2023-09-15 21:30 ` Lorenzo Bianconi
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=ZQLsi7uJdIF4QZ41@lore-desk \
--to=lorenzo.bianconi@redhat.com \
--cc=chuck.lever@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=lorenzo@kernel.org \
--cc=neilb@suse.de \
--cc=netdev@vger.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.