linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Trond Myklebust <trond@netapp.com>, linux-nfs@vger.kernel.org
Subject: backchannel transport
Date: Wed, 1 Dec 2010 12:53:49 -0500	[thread overview]
Message-ID: <20101201175348.GF6832@fieldses.org> (raw)

This is just a small question about the nfsd-side backchannel code that
touches the rpc client code:

There's nothing preventing multiple backchannels from sharing the same
tcp connection, either simultaneously or over time; from rfc 5661
section 2.10.3.1:

	A connection's association with a session is not exclusive.  A
	connection associated with the channel(s) of one session may be
	simultaneously associated with the channel(s) of other sessions
	including sessions associated with other client IDs.

The current code creates a new rpc_xprt every time an rpc client is
created for a backchannel.

But that's wrong: if two sessions share a backchannel, then they don't
necessarily want to share the same rpc_client, but they *do* need to
share the same rpc_xprt, to prevent xid reuse at least.

So I think we should create one rpc_xprt the first time we use a
connection for a backchannel, and then keep it around as long as the
connection is open (in case the client reassociates it with a
backchannel again).

rpc_clone_client() allows clients to share an rpc_xprt.  I could use
that for example by keeping an nfsd-level data structure allowing me to
look up rpc_client's by connection.

However, the server- and client- side xprt's already reference each
other--the client's pointer to the server is used to send requests, and
the server's pointer to the client is used to match incoming replies
with requests.

So it would seem simplest to use the already existing pointer from the
svc_xprt back to the rpc_xprt.

So, that would mean:

	- Allowing nfsd to create a client with the already-existing
	  rpc_xprt--maybe export rpc_new_client()?  Or allow the
	  xprt->setup method to find an already-existing transport?
	- Keeping any backchannel rpc_xprt around somehow as long as the
	  connection is open.  Maybe let svc_xprt keep a reference on
	  the client xprt until svc_delete_xprt()??

--b.

             reply	other threads:[~2010-12-01 17:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-01 17:53 J. Bruce Fields [this message]
2010-12-11  0:20 ` backchannel transport J. Bruce Fields
2010-12-17 20:38   ` J. Bruce Fields
2010-12-17 20:39     ` J. Bruce Fields

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=20101201175348.GF6832@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond@netapp.com \
    /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;
as well as URLs for NNTP newsgroup(s).