public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IB/srpt: Set srq_type to IB_SRQT_BASIC
@ 2012-04-12 15:04 Roland Dreier
  2012-04-13  3:05 ` Nicholas A. Bellinger
  0 siblings, 1 reply; 2+ messages in thread
From: Roland Dreier @ 2012-04-12 15:04 UTC (permalink / raw)
  To: linux-rdma, target-devel

From: Roland Dreier <roland@purestorage.com>

Since commit 96104eda0169 ("RDMA/core: Add SRQ type field"), kernel
users of SRQs need to specify srq_type = IB_SRQT_BASIC in struct
ib_srq_init_attr, or else most low-level drivers will fail in
when srpt_add_one() calls ib_create_srq() and gets -ENOSYS.

(mlx4_ib works OK nearly all of the time, because it just needs
srq_type != IB_SRQT_XRC.  And apparently nearly everyone using
ib_srpt is using mlx4 hardware)

Reported-by: Alexey Shvetsov <alexxy@gentoo.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Roland Dreier <roland@purestorage.com>
---
I'll send this on to Linus shortly...

 drivers/infiniband/ulp/srpt/ib_srpt.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 69e2ad0..daf21b8 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -3232,6 +3232,7 @@ static void srpt_add_one(struct ib_device *device)
 	srq_attr.attr.max_wr = sdev->srq_size;
 	srq_attr.attr.max_sge = 1;
 	srq_attr.attr.srq_limit = 0;
+	srq_attr.srq_type = IB_SRQT_BASIC;
 
 	sdev->srq = ib_create_srq(sdev->pd, &srq_attr);
 	if (IS_ERR(sdev->srq))
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] IB/srpt: Set srq_type to IB_SRQT_BASIC
  2012-04-12 15:04 [PATCH] IB/srpt: Set srq_type to IB_SRQT_BASIC Roland Dreier
@ 2012-04-13  3:05 ` Nicholas A. Bellinger
  0 siblings, 0 replies; 2+ messages in thread
From: Nicholas A. Bellinger @ 2012-04-13  3:05 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma, target-devel

On Thu, 2012-04-12 at 08:04 -0700, Roland Dreier wrote:
> From: Roland Dreier <roland@purestorage.com>
> 
> Since commit 96104eda0169 ("RDMA/core: Add SRQ type field"), kernel
> users of SRQs need to specify srq_type = IB_SRQT_BASIC in struct
> ib_srq_init_attr, or else most low-level drivers will fail in
> when srpt_add_one() calls ib_create_srq() and gets -ENOSYS.
> 
> (mlx4_ib works OK nearly all of the time, because it just needs
> srq_type != IB_SRQT_XRC.  And apparently nearly everyone using
> ib_srpt is using mlx4 hardware)
> 
> Reported-by: Alexey Shvetsov <alexxy@gentoo.org>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Roland Dreier <roland@purestorage.com>
> ---
> I'll send this on to Linus shortly...
> 
>  drivers/infiniband/ulp/srpt/ib_srpt.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
> index 69e2ad0..daf21b8 100644
> --- a/drivers/infiniband/ulp/srpt/ib_srpt.c
> +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
> @@ -3232,6 +3232,7 @@ static void srpt_add_one(struct ib_device *device)
>  	srq_attr.attr.max_wr = sdev->srq_size;
>  	srq_attr.attr.max_sge = 1;
>  	srq_attr.attr.srq_limit = 0;
> +	srq_attr.srq_type = IB_SRQT_BASIC;
>  
>  	sdev->srq = ib_create_srq(sdev->pd, &srq_attr);
>  	if (IS_ERR(sdev->srq))

<nod>, unfortunately I've only been able to run this on mlx4 HCAs so
far..  Pulled into lio-core/master.

Thanks alot for the patch Roland!

--nab

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-04-13  3:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-12 15:04 [PATCH] IB/srpt: Set srq_type to IB_SRQT_BASIC Roland Dreier
2012-04-13  3:05 ` Nicholas A. Bellinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox