Linux NFS development
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>,
	linux-nfs@vger.kernel.org,  lorenzo.bianconi@redhat.com,
	neilb@suse.de, netdev@vger.kernel.org,  kuba@kernel.org
Subject: Re: [PATCH v5 3/3] NFSD: convert write_ports to netlink command
Date: Thu, 30 Nov 2023 13:01:14 -0500	[thread overview]
Message-ID: <0eaec872db97e1b7366fc2b673484358312404b0.camel@kernel.org> (raw)
In-Reply-To: <ZWjI6ppENVu2FPIo@tissot.1015granger.net>

On Thu, 2023-11-30 at 12:39 -0500, Chuck Lever wrote:
> On Thu, Nov 30, 2023 at 11:55:29AM -0500, Jeff Layton wrote:
> > On Thu, 2023-11-30 at 11:22 -0500, Jeff Layton wrote:
> > > On Thu, 2023-11-30 at 10:57 +0100, Lorenzo Bianconi wrote:
> > > > > > 
> > > > > > +/* ============== NFSD_CMD_LISTENER_START ============== */
> > > > > > +/* NFSD_CMD_LISTENER_START - do */
> > > > > > +struct nfsd_listener_start_req {
> > > > > > +	struct {
> > > > > > +		__u32 transport_name_len;
> > > > > > +		__u32 port:1;
> > > > > > +	} _present;
> > > > > > +
> > > > > > +	char *transport_name;
> > > > > > +	__u32 port;
> > > > > > +};
> > > > > 
> > > > > How do you deconfigure a listener with this interface? i.e. suppose I
> > > > > want to stop nfsd from listening on a particular port? I think this too
> > > > > is a place where a declarative interface would be better:
> > > > 
> > > > Is it possible with current APIs? as for 2/3 so far I have just added netlink
> > > > counter for current implementation but I am fine to change the logic here to
> > > > better APIs.
> > > > 
> > > > > 
> > > 
> > > No, I don't think you can do this with the current API at all. I
> > > consider it a major deficiency. I don't think we want to repeat that
> > > mistake in the new interface.
> > > 
> > > > > Have userland send down a list of the ports that we should currently be
> > > > > listening on, and let the kernel do the work to match the request. Again
> > > > > too, an empty list could mean "close everything".
> > 
> > Another thought: should this interface also report and allow you to
> > specify the address to listen on?
> > 
> > When the write_ports interface was first created, it lacked a field for
> > the address to listen on. Later we added a way to just hand off a socket
> > to the kernel to pass that info.
> > 
> > I think it's possible today to send down a socket that only listens on a
> > particular address, and you have no real way to tell that with the
> > current "ports" file.
> 
> All agreed, but listening on a particular address isn't something we
> need today. (Or is it?)
> 

It is for TCP/UDP -- see the -H option to rpc.nfsd.

> Does the socket-passing thing work for non socket-based transports
> like RDMA? I would think that mechanism is legacy.
> 

To the contrary actually. rpc.nfsd almost always does this today unless
you're configuring rdma. But, that was just a convenient way to do this
with a fd based interface.

I think with netlink, we just want to send down a list of
(transport_name, sockaddr) pairs and let the kernel open and close the
appropriate sockets. For RDMA, we can just fill out the sa_port field
and ignore the rest.

> 
> > Should we instead plumb a complete struct sockaddr_storage (or some
> > other suitable address structure) into this interface?
> 
> How difficult would it be to add this later, when we actually have a
> specific use case?


I think we have one now. rpc.nfsd passes down sockets to the kernel for
TCP and UDP listeners, so we need a way to send down a complete sockaddr
for the listeners.
-- 
Jeff Layton <jlayton@kernel.org>

  reply	other threads:[~2023-11-30 18:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-29 17:12 [PATCH v5 0/3] convert write_threads, write_version and write_ports to netlink commands Lorenzo Bianconi
2023-11-29 17:12 ` [PATCH v5 1/3] NFSD: convert write_threads to netlink command Lorenzo Bianconi
2023-11-29 18:13   ` Jeff Layton
2023-11-29 18:31     ` Chuck Lever
2023-11-30  0:32       ` Jakub Kicinski
2023-11-29 17:12 ` [PATCH v5 2/3] NFSD: convert write_version " Lorenzo Bianconi
2023-11-29 18:23   ` Jeff Layton
2023-11-30  9:45     ` Lorenzo Bianconi
2023-11-30 16:17       ` Jeff Layton
2023-11-30 16:11     ` Chuck Lever
2023-11-30 16:25       ` Lorenzo Bianconi
2023-11-30 16:29         ` Chuck Lever
2023-11-30 16:32           ` Lorenzo Bianconi
2023-11-30  0:28   ` Jakub Kicinski
2023-11-30 10:32     ` Lorenzo Bianconi
2023-12-01  7:28       ` Jakub Kicinski
2023-12-05 20:33   ` Simon Horman
2023-11-29 17:12 ` [PATCH v5 3/3] NFSD: convert write_ports " Lorenzo Bianconi
2023-11-29 18:28   ` Jeff Layton
2023-11-30  9:57     ` Lorenzo Bianconi
2023-11-30 16:22       ` Jeff Layton
2023-11-30 16:55         ` Jeff Layton
2023-11-30 17:39           ` Chuck Lever
2023-11-30 18:01             ` Jeff Layton [this message]
2023-11-30 18:34               ` Chuck Lever
2023-12-05 20:37   ` Simon Horman

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=0eaec872db97e1b7366fc2b673484358312404b0.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=kuba@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox