All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Rao Shoaib <rao.shoaib@oracle.com>
Cc: monis@mellanox.com, dledford@redhat.com, sean.hefty@intel.com,
	hal.rosenstock@gmail.com, linux-rdma@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] Introduce maximum WQE size to check limits
Date: Tue, 19 Nov 2019 19:13:34 -0400	[thread overview]
Message-ID: <20191119231334.GO4991@ziepe.ca> (raw)
In-Reply-To: <44d1242a-fc32-9918-dd53-cd27ebf61811@oracle.com>

On Tue, Nov 19, 2019 at 02:38:23PM -0800, Rao Shoaib wrote:
> 
> On 11/19/19 12:31 PM, Jason Gunthorpe wrote:
> > On Mon, Nov 18, 2019 at 11:54:38AM -0800, rao Shoaib wrote:
> > > From: Rao Shoaib <rao.shoaib@oracle.com>
> > > 
> > > Introduce maximum WQE size to impose limits on max SGE's and inline data
> > > 
> > > Signed-off-by: Rao Shoaib <rao.shoaib@oracle.com>
> > >   drivers/infiniband/sw/rxe/rxe_param.h | 3 ++-
> > >   drivers/infiniband/sw/rxe/rxe_qp.c    | 7 +++++--
> > >   2 files changed, 7 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/infiniband/sw/rxe/rxe_param.h b/drivers/infiniband/sw/rxe/rxe_param.h
> > > index 1b596fb..31fb5c7 100644
> > > +++ b/drivers/infiniband/sw/rxe/rxe_param.h
> > > @@ -68,7 +68,6 @@ enum rxe_device_param {
> > >   	RXE_HW_VER			= 0,
> > >   	RXE_MAX_QP			= 0x10000,
> > >   	RXE_MAX_QP_WR			= 0x4000,
> > > -	RXE_MAX_INLINE_DATA		= 400,
> > >   	RXE_DEVICE_CAP_FLAGS		= IB_DEVICE_BAD_PKEY_CNTR
> > >   					| IB_DEVICE_BAD_QKEY_CNTR
> > >   					| IB_DEVICE_AUTO_PATH_MIG
> > > @@ -79,7 +78,9 @@ enum rxe_device_param {
> > >   					| IB_DEVICE_RC_RNR_NAK_GEN
> > >   					| IB_DEVICE_SRQ_RESIZE
> > >   					| IB_DEVICE_MEM_MGT_EXTENSIONS,
> > > +	RXE_MAX_WQE_SIZE		= 0x2d0, /* For RXE_MAX_SGE */
> > This shouldn't just be a random constant, I think you are trying to
> > say:
> > 
> >    RXE_MAX_WQE_SIZE = sizeof(struct rxe_send_wqe) + sizeof(struct ib_sge)*RXE_MAX_SGE

> I thought you wanted this value to be independent of RXE_MAX_SGE, else why
> are defining it.

Then define 

   RXE_MAX_SGE = (RXE_MAX_WQE_SIZE - sizeof(rxe_send_wqe))/sizeof(rxe_sge)

And drive everything off RXE_MAX_WQE_SIZE, which sounds good

> > Just say that
> > 
> > >   	RXE_MAX_SGE			= 32,
> > > +	RXE_MAX_INLINE_DATA		= RXE_MAX_WQE_SIZE,
> > This is mixed up now, it should be
> > 
> >    RXE_MAX_INLINE_DATA = RXE_MAX_WQE_SIZE - sizeof(rxe_send_wqe)
> 
> I agree to what you are suggesting, it will make the current patch better.
> However, In my previous patch I had
> 
> RXE_MAX_INLINE_DATA		= RXE_MAX_SGE * sizeof(struct ib_sge)
> 
> IMHO that conveys the intent much better. I do not see the reason for
> defining RXE_MAX_WQE_SIZE, ib_device_attr does not even have an entry for it
> and hence the value is not used anywhere by rxe or by any other relevant
> driver.

Because WQE_SIZE is what you are actually concerned with here, using
MAX_SGE as a proxy for the max WQE is confusing

Jason

  reply	other threads:[~2019-11-19 23:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18 19:54 [PATCH v2 0/2] rxe should use same buffer size for SGE's and inline data rao Shoaib
2019-11-18 19:54 ` [PATCH v2 1/2] Introduce maximum WQE size to check limits rao Shoaib
2019-11-19 20:31   ` Jason Gunthorpe
2019-11-19 22:38     ` Rao Shoaib
2019-11-19 23:13       ` Jason Gunthorpe [this message]
2019-11-19 23:55         ` Rao Shoaib
2019-11-20  0:08           ` Jason Gunthorpe
2019-12-17 19:38             ` Rao Shoaib
2019-12-19 18:25               ` Jason Gunthorpe
2019-12-19 18:37                 ` Rao Shoaib
2020-01-13 18:35                 ` Rao Shoaib
2020-01-13 18:47                   ` Jason Gunthorpe
2020-01-13 19:16                     ` Rao Shoaib
2019-11-18 19:54 ` [PATCH v2 2/2] SGE buffer and max_inline data must have same size rao Shoaib

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=20191119231334.GO4991@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=dledford@redhat.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=monis@mellanox.com \
    --cc=rao.shoaib@oracle.com \
    --cc=sean.hefty@intel.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.