All of lore.kernel.org
 help / color / mirror / Atom feed
From: "'J. Bruce Fields'" <bfields@fieldses.org>
To: Steve Wise <swise@opengridcomputing.com>
Cc: "'Chuck Lever'" <chuck.lever@oracle.com>,
	linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org
Subject: Re: [PATCH V2] svcrdma: Advertise the correct max payload
Date: Tue, 23 Sep 2014 15:48:25 -0400	[thread overview]
Message-ID: <20140923194825.GL29932@fieldses.org> (raw)
In-Reply-To: <00a701cfd766$855044e0$8ff0cea0$@opengridcomputing.com>

On Tue, Sep 23, 2014 at 02:42:34PM -0500, Steve Wise wrote:
> 
> > > diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h
> > > index c419498..a9cf5c3 100644
> > > --- a/net/sunrpc/xprtrdma/xprt_rdma.h
> > > +++ b/net/sunrpc/xprtrdma/xprt_rdma.h
> > > @@ -392,4 +392,8 @@ extern struct kmem_cache *svc_rdma_ctxt_cachep;
> > > /* Workqueue created in svc_rdma.c */
> > > extern struct workqueue_struct *svc_rdma_wq;
> > >
> > > +#define RPCSVC_MAXPAYLOAD_RDMA \
> > > +	(RPCSVC_MAXPAYLOAD < (RPCRDMA_MAX_DATA_SEGS << PAGE_SHIFT) ? \
> > > +	 RPCSVC_MAXPAYLOAD : (RPCRDMA_MAX_DATA_SEGS << PAGE_SHIFT))
> > > +
> > 
> > Couldn't you use:
> > 
> > #if RPCSVC_MAXPAYLOAD < (RPCRDMA_MAX_DATA_SEGS << PAGE_SHIFT)
> > #define RPCSVC_MAXPAYLOAD_RDMA RPC_MAXPAYLOAD
> > #else
> > #define RPCSVC_MAXPAYLOAD_RDMA (RPCRDMA_MAX_DATA_SEGS << PAGE_SHIFT)
> > #endif
> > 
> > That seems more idiomatic.
> 
> Sure.  That makes it easier to read in my opinion too.
> 
> I'll send out V3 with this change.

While we're bikeshedding, why not use min()?

--b.

WARNING: multiple messages have this Message-ID (diff)
From: "'J. Bruce Fields'" <bfields-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
To: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
Cc: 'Chuck Lever'
	<chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH V2] svcrdma: Advertise the correct max payload
Date: Tue, 23 Sep 2014 15:48:25 -0400	[thread overview]
Message-ID: <20140923194825.GL29932@fieldses.org> (raw)
In-Reply-To: <00a701cfd766$855044e0$8ff0cea0$@opengridcomputing.com>

On Tue, Sep 23, 2014 at 02:42:34PM -0500, Steve Wise wrote:
> 
> > > diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h
> > > index c419498..a9cf5c3 100644
> > > --- a/net/sunrpc/xprtrdma/xprt_rdma.h
> > > +++ b/net/sunrpc/xprtrdma/xprt_rdma.h
> > > @@ -392,4 +392,8 @@ extern struct kmem_cache *svc_rdma_ctxt_cachep;
> > > /* Workqueue created in svc_rdma.c */
> > > extern struct workqueue_struct *svc_rdma_wq;
> > >
> > > +#define RPCSVC_MAXPAYLOAD_RDMA \
> > > +	(RPCSVC_MAXPAYLOAD < (RPCRDMA_MAX_DATA_SEGS << PAGE_SHIFT) ? \
> > > +	 RPCSVC_MAXPAYLOAD : (RPCRDMA_MAX_DATA_SEGS << PAGE_SHIFT))
> > > +
> > 
> > Couldn't you use:
> > 
> > #if RPCSVC_MAXPAYLOAD < (RPCRDMA_MAX_DATA_SEGS << PAGE_SHIFT)
> > #define RPCSVC_MAXPAYLOAD_RDMA RPC_MAXPAYLOAD
> > #else
> > #define RPCSVC_MAXPAYLOAD_RDMA (RPCRDMA_MAX_DATA_SEGS << PAGE_SHIFT)
> > #endif
> > 
> > That seems more idiomatic.
> 
> Sure.  That makes it easier to read in my opinion too.
> 
> I'll send out V3 with this change.

While we're bikeshedding, why not use min()?

--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2014-09-23 19:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-22 20:05 [PATCH V2] svcrdma: Advertise the correct max payload Steve Wise
2014-09-22 20:05 ` Steve Wise
     [not found] ` <465554E1-802A-4D37-8032-4E99B96B8BFB@oracle.com>
2014-09-23 19:42   ` Steve Wise
2014-09-23 19:42     ` Steve Wise
2014-09-23 19:48     ` 'J. Bruce Fields' [this message]
2014-09-23 19:48       ` 'J. Bruce Fields'
2014-09-23 19:53       ` Steve Wise
2014-09-23 19:53         ` Steve Wise
2014-09-23 19:55         ` 'J. Bruce Fields'
2014-09-23 19:55           ` '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=20140923194825.GL29932@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=swise@opengridcomputing.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.