IB/srpt: Set srq_type to IB_SRQT_BASIC
Subsystems (2)
PATCH 1/1 IB/srpt: Set srq_type to IB_SRQT_BASIC
From: Roland Dreier <[email protected]>
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)
---
I'll send this on to Linus shortly...
drivers/infiniband/ulp/srpt/ib_srpt.c | 1 + 1 file changed, 1 insertion(+)
drivers/infiniband/ulp/srpt/ib_srpt.c +1 -0
@@ -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))
Signature · 1 line
1.7.9.5
Quoted 25 lines · Roland Dreier
From: Roland Dreier <[email protected]>
Since commit
96104eda0169("RDMA/core: Add SRQ type field"), kernel users of SRQs need to specifysrq_type=IB_SRQT_BASICin structib_srq_init_attr, or else most low-level drivers will fail in whensrpt_add_one()callsib_create_srq()and gets-ENOSYS.(
mlx4_ibworks OK nearly all of the time, because it just needssrq_type!=IB_SRQT_XRC. And apparently nearly everyone usingib_srptis using mlx4 hardware)Reported-by Alexey Shvetsov <[email protected]>Cc <[email protected]>Signed-off-by Roland Dreier <[email protected]>---
I'll send this on to Linus shortly...drivers/infiniband/ulp/srpt/ib_srpt.c | 1 + 1 file changed, 1 insertion(+)drivers/infiniband/ulp/srpt/ib_srpt.c +0
-0
drivers/infiniband/ulp/srpt/ib_srpt.c static void srpt_add_one(struct ib_device *device) · line 3238
Quoted 7 lines
drivers/infiniband/ulp/srpt/ib_srpt.c +1
-0@@ -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