From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH RFC 2/3] rdma core: Add rdma_rw_mr_payload()
Date: Fri, 18 Aug 2017 12:51:29 -0400 [thread overview]
Message-ID: <1503075089.2598.26.camel@redhat.com> (raw)
In-Reply-To: <20170801210707.15781.36464.stgit-Hs+gFlyCn65vLzlybtyyYzGyq/o6K9yX@public.gmane.org>
On Tue, 2017-08-01 at 17:07 -0400, Chuck Lever wrote:
> The amount of payload per MR depends on device capabilities and
> the memory registration mode in use. The new rdma_rw API hides both,
> making it difficult for ULPs to determine how large their transport
> send queues need to be.
>
> Expose the MR payload information via a new API.
>
> Signed-off-by: Chuck Lever <chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Acked-by: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
> drivers/infiniband/core/rw.c | 24 ++++++++++++++++++++++++
> include/rdma/rw.h | 2 ++
> 2 files changed, 26 insertions(+)
>
> diff --git a/drivers/infiniband/core/rw.c
> b/drivers/infiniband/core/rw.c
> index dbfd854..6ca607e 100644
> --- a/drivers/infiniband/core/rw.c
> +++ b/drivers/infiniband/core/rw.c
> @@ -643,6 +643,30 @@ void rdma_rw_ctx_destroy_signature(struct
> rdma_rw_ctx *ctx, struct ib_qp *qp,
> }
> EXPORT_SYMBOL(rdma_rw_ctx_destroy_signature);
>
> +/**
> + * rdma_rw_mr_factor - return number of MRs required for a payload
> + * @device: device handling the connection
> + * @port_num: port num to which the connection is bound
> + * @maxpages: maximum payload pages per rdma_rw_ctx
> + *
> + * Returns the number of MRs the device requires to move @maxpayload
> + * bytes. The returned value is used during transport creation to
> + * compute max_rdma_ctxts and the size of the transport's Send and
> + * Send Completion Queues.
> + */
> +unsigned int rdma_rw_mr_factor(struct ib_device *device, u8
> port_num,
> + unsigned int maxpages)
> +{
> + unsigned int mr_pages;
> +
> + if (rdma_rw_can_use_mr(device, port_num))
> + mr_pages = rdma_rw_fr_page_list_len(device);
> + else
> + mr_pages = device->attrs.max_sge_rd;
> + return DIV_ROUND_UP(maxpages, mr_pages);
> +}
> +EXPORT_SYMBOL(rdma_rw_mr_factor);
> +
> void rdma_rw_init_qp(struct ib_device *dev, struct ib_qp_init_attr
> *attr)
> {
> u32 factor;
> diff --git a/include/rdma/rw.h b/include/rdma/rw.h
> index 377d865..a3cbbc7 100644
> --- a/include/rdma/rw.h
> +++ b/include/rdma/rw.h
> @@ -81,6 +81,8 @@ struct ib_send_wr *rdma_rw_ctx_wrs(struct
> rdma_rw_ctx *ctx, struct ib_qp *qp,
> int rdma_rw_ctx_post(struct rdma_rw_ctx *ctx, struct ib_qp *qp, u8
> port_num,
> struct ib_cqe *cqe, struct ib_send_wr *chain_wr);
>
> +unsigned int rdma_rw_mr_factor(struct ib_device *device, u8
> port_num,
> + unsigned int maxpages);
> void rdma_rw_init_qp(struct ib_device *dev, struct ib_qp_init_attr
> *attr);
> int rdma_rw_init_mrs(struct ib_qp *qp, struct ib_qp_init_attr
> *attr);
> void rdma_rw_cleanup_mrs(struct ib_qp *qp);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma"
> in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-08-18 16:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-01 21:06 [PATCH RFC 0/3] Proposal for exposing rdma_rw MR factor Chuck Lever
[not found] ` <20170801205334.15781.18761.stgit-Hs+gFlyCn65vLzlybtyyYzGyq/o6K9yX@public.gmane.org>
2017-08-01 21:06 ` [PATCH RFC 1/3] svcrdma: Limit RQ depth Chuck Lever
2017-08-01 21:07 ` [PATCH RFC 2/3] rdma core: Add rdma_rw_mr_payload() Chuck Lever
[not found] ` <20170801210707.15781.36464.stgit-Hs+gFlyCn65vLzlybtyyYzGyq/o6K9yX@public.gmane.org>
2017-08-18 16:51 ` Doug Ledford [this message]
2017-08-01 21:07 ` [PATCH RFC 3/3] svcrdma: Estimate Send Queue depth properly Chuck Lever
2017-08-02 7:20 ` [PATCH RFC 0/3] Proposal for exposing rdma_rw MR factor Leon Romanovsky
[not found] ` <20170802072043.GZ13672-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-08-02 18:06 ` Chuck Lever
2017-08-08 18:28 ` Chuck Lever
[not found] ` <D8576C0A-6588-49D1-A2F9-AD39FB2E5FCE-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-08-16 15:50 ` Chuck Lever
[not found] ` <6EAEEE15-819E-4CE2-8C67-997A244919FB-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-08-18 16:52 ` Doug Ledford
[not found] ` <1503075123.2598.27.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-08-18 16:53 ` Chuck Lever
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=1503075089.2598.26.camel@redhat.com \
--to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=chuck.lever-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox