All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olga Kornievskaia <olga.kornievskaia@gmail.com>
To: Chuck Lever III <chuck.lever@oracle.com>
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anna Schumaker <anna.schumaker@netapp.com>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v2 1/3] SUNRPC query xprt switch for number of active transports
Date: Thu, 10 Jun 2021 10:50:56 -0400	[thread overview]
Message-ID: <CAN-5tyHgwnEFWdzLG7b8N6G84cTiHMpdDxLe7V=QD7Jd993QHw@mail.gmail.com> (raw)
In-Reply-To: <91214898-F21A-4604-9FCB-9E9884F177B3@oracle.com>

On Thu, Jun 10, 2021 at 9:34 AM Chuck Lever III <chuck.lever@oracle.com> wrote:
>
>
>
> > On Jun 9, 2021, at 5:53 PM, Olga Kornievskaia <olga.kornievskaia@gmail.com> wrote:
> >
> > From: Olga Kornievskaia <kolga@netapp.com>
> >
> > To keep track of how many transports have already been added, add
> > ability to query the number.
>
> Just a random thought: Would it make more sense to plug the
> maximum allowed transports value into the struct rpc_clnt,
> and then rpc_clnt_test_and_add_xprt() could prevent the
> addition of the new xprt if the maximum would be exceeded?

Sure that could be done. Then the value of maximum allowed transports
should be defined at the RPC layer and not NFS? I currently check for
upper bounds during the parsing of the mount option, would I be not
doing that or exposing the RPC value to the NFS layer?

Actually I think it might be nice to add some kind of warning in the
log that a trunking transport wasn't created because the limit was
reached but if we move things to the RPC, we can't distinguish between
nconnect and trunking transports.

> > Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
> > ---
> > include/linux/sunrpc/clnt.h |  2 ++
> > net/sunrpc/clnt.c           | 13 +++++++++++++
> > 2 files changed, 15 insertions(+)
> >
> > diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
> > index 02e7a5863d28..27042f1e581f 100644
> > --- a/include/linux/sunrpc/clnt.h
> > +++ b/include/linux/sunrpc/clnt.h
> > @@ -234,6 +234,8 @@ void rpc_clnt_xprt_switch_put(struct rpc_clnt *);
> > void rpc_clnt_xprt_switch_add_xprt(struct rpc_clnt *, struct rpc_xprt *);
> > bool rpc_clnt_xprt_switch_has_addr(struct rpc_clnt *clnt,
> >                       const struct sockaddr *sap);
> > +size_t rpc_clnt_xprt_switch_nactive(struct rpc_clnt *);
> > +
> > void rpc_cleanup_clids(void);
> >
> > static inline int rpc_reply_expected(struct rpc_task *task)
> > diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
> > index 42623d6b8f0e..b46262ffcf72 100644
> > --- a/net/sunrpc/clnt.c
> > +++ b/net/sunrpc/clnt.c
> > @@ -2959,6 +2959,19 @@ bool rpc_clnt_xprt_switch_has_addr(struct rpc_clnt *clnt,
> > }
> > EXPORT_SYMBOL_GPL(rpc_clnt_xprt_switch_has_addr);
> >
> > +size_t rpc_clnt_xprt_switch_nactive(struct rpc_clnt *clnt)
> > +{
> > +     struct rpc_xprt_switch *xps;
> > +     size_t num;
> > +
> > +     rcu_read_lock();
> > +     xps = rcu_dereference(clnt->cl_xpi.xpi_xpswitch);
> > +     num = xps->xps_nactive;
> > +     rcu_read_unlock();
> > +     return num;
> > +}
> > +EXPORT_SYMBOL_GPL(rpc_clnt_xprt_switch_nactive);
> > +
> > #if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
> > static void rpc_show_header(void)
> > {
> > --
> > 2.27.0
> >
>
> --
> Chuck Lever
>
>
>

  reply	other threads:[~2021-06-10 14:52 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 21:53 [PATCH v2 0/3] don't collapse transports for the trunkable Olga Kornievskaia
2021-06-09 21:53 ` [PATCH v2 1/3] SUNRPC query xprt switch for number of active transports Olga Kornievskaia
2021-06-10 13:34   ` Chuck Lever III
2021-06-10 14:50     ` Olga Kornievskaia [this message]
2021-06-10 14:55       ` Chuck Lever III
2021-06-09 21:53 ` [PATCH v2 2/3] NFSv4 introduce max_connect mount options Olga Kornievskaia
2021-06-10  1:49   ` Wang Yugui
2021-06-10  2:22     ` Wang Yugui
2021-06-10 13:30   ` Chuck Lever III
2021-06-10 13:34     ` Trond Myklebust
2021-06-10 13:56       ` Chuck Lever III
2021-06-10 14:13         ` Trond Myklebust
2021-06-10 14:31           ` Olga Kornievskaia
2021-06-10 14:55             ` Trond Myklebust
2021-06-10 16:14               ` Olga Kornievskaia
2021-06-10 16:36                 ` Trond Myklebust
2021-06-10 17:30                   ` Olga Kornievskaia
2021-06-10 22:17                     ` Olga Kornievskaia
2021-06-10 14:38           ` Chuck Lever III
2021-06-10 14:29         ` Olga Kornievskaia
2021-06-10 14:51           ` Chuck Lever III
2021-06-10 15:01             ` Olga Kornievskaia
2021-06-10 15:30               ` Trond Myklebust
2021-06-09 21:53 ` [PATCH v2 3/3] NFSv4.1+ add trunking when server trunking detected Olga Kornievskaia
2021-06-09 22:27 ` [PATCH v2 0/3] don't collapse transports for the trunkable Olga Kornievskaia
2021-06-10 13:32 ` Steve Dickson
2021-06-10 17:33   ` Olga Kornievskaia
2021-06-10 17:39     ` Olga Kornievskaia

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='CAN-5tyHgwnEFWdzLG7b8N6G84cTiHMpdDxLe7V=QD7Jd993QHw@mail.gmail.com' \
    --to=olga.kornievskaia@gmail.com \
    --cc=anna.schumaker@netapp.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@hammerspace.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 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.