All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>,
	Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>,
	Steve Wise
	<swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>,
	Parav Pandit
	<pandit.parav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Laurence Oberman
	<loberman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	"Nicholas A. Bellinger"
	<nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v4 2/5] IB/core, RDMA RW API: Do not exceed QP SGE send limit
Date: Wed, 27 Jul 2016 15:42:17 +0300	[thread overview]
Message-ID: <20160727124217.GJ4628@leon.nu> (raw)
In-Reply-To: <c71ece34-36e2-86da-5032-2fc946ff0073-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2135 bytes --]

On Thu, Jul 21, 2016 at 01:03:30PM -0700, Bart Van Assche wrote:
> Compute the SGE limit for RDMA READ and WRITE requests in
> ib_create_qp(). Use that limit in the RDMA RW API implementation.
> 
> Signed-off-by: Bart Van Assche <bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
> Cc: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
> Cc: Sagi Grimberg <sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
> Cc: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
> Cc: Parav Pandit <pandit.parav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Cc: Nicholas Bellinger <nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org>
> Cc: Laurence Oberman <loberman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Cc: <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> #v4.7+
> ---
>  drivers/infiniband/core/rw.c    | 10 ++--------
>  drivers/infiniband/core/verbs.c |  9 +++++++++
>  include/rdma/ib_verbs.h         |  6 ++++++
>  3 files changed, 17 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/infiniband/core/rw.c b/drivers/infiniband/core/rw.c
> index 1ad2baa..dbfd854 100644
> --- a/drivers/infiniband/core/rw.c
> +++ b/drivers/infiniband/core/rw.c
> @@ -58,13 +58,6 @@ static inline bool rdma_rw_io_needs_mr(struct ib_device *dev, u8 port_num,
>  	return false;
>  }
>  
> -static inline u32 rdma_rw_max_sge(struct ib_device *dev,
> -		enum dma_data_direction dir)
> -{
> -	return dir == DMA_TO_DEVICE ?
> -		dev->attrs.max_sge : dev->attrs.max_sge_rd;
> -}
> -
>  static inline u32 rdma_rw_fr_page_list_len(struct ib_device *dev)
>  {
>  	/* arbitrary limit to avoid allocating gigantic resources */
> @@ -186,7 +179,8 @@ static int rdma_rw_init_map_wrs(struct rdma_rw_ctx *ctx, struct ib_qp *qp,
>  		u64 remote_addr, u32 rkey, enum dma_data_direction dir)
>  {
>  	struct ib_device *dev = qp->pd->device;
> -	u32 max_sge = rdma_rw_max_sge(dev, dir);
> +	u32 max_sge = dir == DMA_TO_DEVICE ? qp->max_write_sge :
> +		      qp->max_read_sge;

Bart,
I'm sure that I missed something.

Can "dir" be DMA_BIDIRECTIONAL?
If yes, mxa_sge will be min(max_write_sge, max_read_sge).

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2016-07-27 12:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21 20:02 [PATCH v4 0/5] Reduce RDMA RW API SGE limit Bart Van Assche
     [not found] ` <75fc8647-16a6-5a89-400f-f5f418a8d6eb-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-07-21 20:03   ` [PATCH v4 1/5] IB/core: Make rdma_rw_ctx_init() initialize all used fields Bart Van Assche
2016-07-21 20:03   ` [PATCH v4 2/5] IB/core, RDMA RW API: Do not exceed QP SGE send limit Bart Van Assche
     [not found]     ` <c71ece34-36e2-86da-5032-2fc946ff0073-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-07-27 12:42       ` Leon Romanovsky [this message]
     [not found]         ` <20160727124217.GJ4628-2ukJVAZIZ/Y@public.gmane.org>
2016-07-27 15:24           ` Bart Van Assche
     [not found]             ` <8604bcdc-3ab4-28df-0eff-b1c0b6865c71-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-07-27 16:23               ` Leon Romanovsky
2016-08-01 10:56       ` Christoph Hellwig
2016-07-21 20:03   ` [PATCH v4 3/5] IB/srpt: Limit the number of SG elements per work request Bart Van Assche
     [not found]     ` <446e3039-ec25-89d8-2583-5e60dd2bfc88-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-08-01 10:57       ` Christoph Hellwig
2016-07-21 20:04   ` [PATCH v4 4/5] IB/srpt: Simplify srpt_queue_response() Bart Van Assche
2016-07-21 20:04   ` [PATCH v4 5/5] IB/isert: Remove an unused member variable Bart Van Assche
2016-08-02 16:05   ` [PATCH v4 0/5] Reduce RDMA RW API SGE limit Doug Ledford

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=20160727124217.GJ4628@leon.nu \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=bart.vanassche-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=hch-jcswGhMUV9g@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=loberman-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=nab-IzHhD5pYlfBP7FQvKIMDCQ@public.gmane.org \
    --cc=pandit.parav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org \
    --cc=swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.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 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.