From: Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>
To: Eli Cohen <eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Cc: "Hefty,
Sean" <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
"cait-DpaxOq6QOWMAvxtiuMwx3w@public.gmane.org"
<cait-DpaxOq6QOWMAvxtiuMwx3w@public.gmane.org>,
"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: rdma_create_qp() and max_send_wr
Date: Thu, 19 May 2011 18:59:23 +0200 [thread overview]
Message-ID: <1305824364.2359.37.camel@deela.quest-ce.net> (raw)
In-Reply-To: <20110519154650.GD2659@mtldesk30>
Le jeudi 19 mai 2011 à 18:46 +0300, Eli Cohen a écrit :
> On Thu, May 19, 2011 at 05:03:45PM +0200, Yann Droneaud wrote:
> >
> > To sum up:
> >
> > - ibv_qp_init_attr.max_recv_wr can be set to ibv_device_attr.max_qp_wr,
> > 16384 in my case,
> >
> > - ibv_qp_init_attr.max_send_wr *cannot* be set to
> > ibv_device_attr.max_qp_wr, but it can be set to 16351.
> >
> Thanks for investigating this. We'll check and send a fix. Meanwhile
> you can workaround this in your code.
I understand the problem (which is probably not really a problem):
In libmlx4/src/verbs.c:mlx4_create_qp()
mlx4_calc_sq_wqe_size(&attr->cap, attr->qp_type, qp);
/*
* We need to leave 2 KB + 1 WQE of headroom in the SQ to
* allow HW to prefetch.
*/
qp->sq_spare_wqes = (2048 >> qp->sq.wqe_shift) + 1;
qp->sq.wqe_cnt = align_queue_size(attr->cap.max_send_wr +
qp->sq_spare_wqes);
qp->rq.wqe_cnt = align_queue_size(attr->cap.max_recv_wr);
For a requested SQ length of 1:
qp->sq.wge_shift : 6
qp->sq_spare_wges : 33
attr->cap.max_send_wr : 1
qp->sq_wge_cnt : 64
For a requested SQ length of 16351:
qp->sq.wge_shift : 6
qp->sq_spare_wges : 33
attr->cap.max_send_wr : 16351
qp->sq_wge_cnt : 16384
For a requested SQ length of 16384:
qp->sq.wge_shift : 6
qp->sq_spare_wges : 33
attr->cap.max_send_wr : 16384
qp->sq_wge_cnt : 32768
32768 is clearly above the ibv_device_attr.max_qp_wr limit, so the
creation of the QP failed later:
ret = ibv_cmd_create_qp(pd, &qp->ibv_qp, attr, &cmd.ibv_cmd,
sizeof cmd,
&resp, sizeof resp);
ibv_cmd_create_qp() fails and returns 22.
If spare WQEs are taken in account here, it should be taken in account
in the data reported by ibv_query_device().
Regards.
--
Yann Droneaud
OPTEYA
--
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:[~2011-05-19 16:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20110421115323.48b52fb35c6f209c51bccbb9807b6df0.f623dc4952.wbe@email17.secureserver.net>
[not found] ` <20110421115323.48b52fb35c6f209c51bccbb9807b6df0.f623dc4952.wbe-L1BP6xego3TShzhksYgB+AejPw4fNl8p@public.gmane.org>
2011-04-22 10:20 ` rdma_create_qp() and max_send_wr Yann Droneaud
[not found] ` <1303467645.2243.47.camel-H/AUWmsJYVeqvyCYKW+Xr6xOck334EZe@public.gmane.org>
2011-04-22 10:37 ` Yann Droneaud
2011-05-19 6:07 ` Eli Cohen
2011-05-19 9:17 ` Yann Droneaud
[not found] ` <1305796637.2359.6.camel-H/AUWmsJYVeqvyCYKW+Xr6xOck334EZe@public.gmane.org>
2011-05-19 9:34 ` Eli Cohen
2011-05-19 10:50 ` Yann Droneaud
[not found] ` <1305802216.2359.11.camel-H/AUWmsJYVeqvyCYKW+Xr6xOck334EZe@public.gmane.org>
2011-05-19 14:25 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A82373FE8B-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2011-05-19 14:45 ` Yann Droneaud
[not found] ` <1305816321.2359.15.camel-H/AUWmsJYVeqvyCYKW+Xr6xOck334EZe@public.gmane.org>
2011-05-19 15:03 ` Yann Droneaud
[not found] ` <1305817426.2359.23.camel-H/AUWmsJYVeqvyCYKW+Xr6xOck334EZe@public.gmane.org>
2011-05-19 15:46 ` Eli Cohen
2011-05-19 16:59 ` Yann Droneaud [this message]
[not found] ` <1305824364.2359.37.camel-H/AUWmsJYVeqvyCYKW+Xr6xOck334EZe@public.gmane.org>
2011-05-19 17:13 ` Yann Droneaud
2011-05-19 18:06 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A82373FF57-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2011-05-19 19:37 ` Eli Cohen
2011-04-21 16:44 Yann Droneaud
[not found] ` <1303404264.2243.19.camel-H/AUWmsJYVeqvyCYKW+Xr6xOck334EZe@public.gmane.org>
2011-04-21 18:35 ` Roland Dreier
[not found] ` <BANLkTikUOv3mtgb3x_vbbk845_36fu1QhA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-22 6:46 ` Or Gerlitz
[not found] ` <4DD8B13D.4070802-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2011-05-22 8:21 ` Eli Cohen
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=1305824364.2359.37.camel@deela.quest-ce.net \
--to=ydroneaud-rly5vtjfyj3qt0dzr+alfa@public.gmane.org \
--cc=cait-DpaxOq6QOWMAvxtiuMwx3w@public.gmane.org \
--cc=eli-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@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