diff mbox

[rdma-core,stable-v15] verbs: Do not block QP attr_masks used by older kernels

Message ID 636b5412-e41e-40ed-46da-a0e83bd5b049@suse.de (mailing list archive)
State Accepted
Headers show

Commit Message

Nicolas Morey-Chaisemartin Nov. 14, 2017, 2:40 p.m. UTC
At least the RDMA CM in 4.3 will give user space structs with these bits
set. Those kernels require user space to pass those set bits back to the
kernel. Blocking them causes RDMA CM to be unusable on older kernels.

Stable-fix: Drop changes to verbs.h of the original fix,
 that are not needed for the fix itself.

Fixes: 3ca7a1031486 ("ibverbs: Add support for packet pacing")
Commit-id: ce88cef301b ("verbs: Do not block QP attr_masks used by older kernels")
Reported-by: Ram Amrani <Ram.Amrani@cavium.com>
Signed-off-by: Jason Gunthorpe <jgunthorpe@ziepe.ca>
---

Backport from Jason's patch without the verbs.h changes to not modify the API.

 libibverbs/cmd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Leon Romanovsky Nov. 14, 2017, 6:04 p.m. UTC | #1
On Tue, Nov 14, 2017 at 03:40:25PM +0100, Nicolas Morey-Chaisemartin wrote:
> At least the RDMA CM in 4.3 will give user space structs with these bits
> set. Those kernels require user space to pass those set bits back to the
> kernel. Blocking them causes RDMA CM to be unusable on older kernels.
>
> Stable-fix: Drop changes to verbs.h of the original fix,
>  that are not needed for the fix itself.
>
> Fixes: 3ca7a1031486 ("ibverbs: Add support for packet pacing")
> Commit-id: ce88cef301b ("verbs: Do not block QP attr_masks used by older kernels")
> Reported-by: Ram Amrani <Ram.Amrani@cavium.com>
> Signed-off-by: Jason Gunthorpe <jgunthorpe@ziepe.ca>
> ---
>

You need to add your Signed-off-by.

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Jason Gunthorpe Nov. 14, 2017, 6:49 p.m. UTC | #2
On Tue, Nov 14, 2017 at 08:04:51PM +0200, Leon Romanovsky wrote:
> On Tue, Nov 14, 2017 at 03:40:25PM +0100, Nicolas Morey-Chaisemartin wrote:
> > At least the RDMA CM in 4.3 will give user space structs with these bits
> > set. Those kernels require user space to pass those set bits back to the
> > kernel. Blocking them causes RDMA CM to be unusable on older kernels.
> >
> > Stable-fix: Drop changes to verbs.h of the original fix,
> >  that are not needed for the fix itself.
> >
> > Fixes: 3ca7a1031486 ("ibverbs: Add support for packet pacing")
> > Commit-id: ce88cef301b ("verbs: Do not block QP attr_masks used by older kernels")
> > Reported-by: Ram Amrani <Ram.Amrani@cavium.com>
> > Signed-off-by: Jason Gunthorpe <jgunthorpe@ziepe.ca>
> >
> 
> You need to add your Signed-off-by.

And please add something like

    commit 9276717b9e297a62d1151a43d1cd286213f68eb7 upstream.

after the subject line for all patches ...

Edits look fine to me

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nicolas Morey-Chaisemartin Nov. 14, 2017, 6:50 p.m. UTC | #3
Le 14/11/2017 à 19:49, Jason Gunthorpe a écrit :
> On Tue, Nov 14, 2017 at 08:04:51PM +0200, Leon Romanovsky wrote:
>> On Tue, Nov 14, 2017 at 03:40:25PM +0100, Nicolas Morey-Chaisemartin wrote:
>>> At least the RDMA CM in 4.3 will give user space structs with these bits
>>> set. Those kernels require user space to pass those set bits back to the
>>> kernel. Blocking them causes RDMA CM to be unusable on older kernels.
>>>
>>> Stable-fix: Drop changes to verbs.h of the original fix,
>>>  that are not needed for the fix itself.
>>>
>>> Fixes: 3ca7a1031486 ("ibverbs: Add support for packet pacing")
>>> Commit-id: ce88cef301b ("verbs: Do not block QP attr_masks used by older kernels")
>>> Reported-by: Ram Amrani <Ram.Amrani@cavium.com>
>>> Signed-off-by: Jason Gunthorpe <jgunthorpe@ziepe.ca>
>>>
>> You need to add your Signed-off-by.
Yep. Will do when applying.

> And please add something like
>
>     commit 9276717b9e297a62d1151a43d1cd286213f68eb7 upstream.
>
> after the subject line for all patches ...

That's what the Commit-id is for :)
Do you prefer Upstream-commit-id ?

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Gunthorpe Nov. 14, 2017, 6:58 p.m. UTC | #4
On Tue, Nov 14, 2017 at 07:50:45PM +0100, Nicolas Morey-Chaisemartin wrote:
> 
> 
> Le 14/11/2017 à 19:49, Jason Gunthorpe a écrit :
> > On Tue, Nov 14, 2017 at 08:04:51PM +0200, Leon Romanovsky wrote:
> >> On Tue, Nov 14, 2017 at 03:40:25PM +0100, Nicolas Morey-Chaisemartin wrote:
> >>> At least the RDMA CM in 4.3 will give user space structs with these bits
> >>> set. Those kernels require user space to pass those set bits back to the
> >>> kernel. Blocking them causes RDMA CM to be unusable on older kernels.
> >>>
> >>> Stable-fix: Drop changes to verbs.h of the original fix,
> >>>  that are not needed for the fix itself.
> >>>
> >>> Fixes: 3ca7a1031486 ("ibverbs: Add support for packet pacing")
> >>> Commit-id: ce88cef301b ("verbs: Do not block QP attr_masks used by older kernels")
> >>> Reported-by: Ram Amrani <Ram.Amrani@cavium.com>
> >>> Signed-off-by: Jason Gunthorpe <jgunthorpe@ziepe.ca>
> >>>
> >> You need to add your Signed-off-by.
> Yep. Will do when applying.
> 
> > And please add something like
> >
> >     commit 9276717b9e297a62d1151a43d1cd286213f68eb7 upstream.
> >
> > after the subject line for all patches ...
> 
> That's what the Commit-id is for :)
> Do you prefer Upstream-commit-id ?

Oh! Yes, that seems fine as is then

Jason


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/libibverbs/cmd.c b/libibverbs/cmd.c
index 9d2140fb..77aba334 100644
--- a/libibverbs/cmd.c
+++ b/libibverbs/cmd.c
@@ -1154,10 +1154,10 @@  int ibv_cmd_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
 	struct ibv_query_qp_resp resp;
 
 	/*
-	 * Masks over IBV_QP_DEST_QPN are not supported by
-	 * that not extended command.
+	 * Starting with IBV_QP_RATE_LIMIT the attribute must go through the
+	 * _ex path.
 	 */
-	if (attr_mask & ~((IBV_QP_DEST_QPN << 1) - 1))
+	if (attr_mask & ~(IBV_QP_RATE_LIMIT - 1))
 		return EOPNOTSUPP;
 
 	IBV_INIT_CMD_RESP(cmd, cmd_size, QUERY_QP, &resp, sizeof resp);
@@ -1324,10 +1324,10 @@  int ibv_cmd_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr,
 		      struct ibv_modify_qp *cmd, size_t cmd_size)
 {
 	/*
-	 * Masks over IBV_QP_DEST_QPN are only supported by
-	 * ibv_cmd_modify_qp_ex.
+	 * Starting with IBV_QP_RATE_LIMIT the attribute must go through the
+	 * _ex path.
 	 */
-	if (attr_mask & ~((IBV_QP_DEST_QPN << 1) - 1))
+	if (attr_mask & ~(IBV_QP_RATE_LIMIT - 1))
 		return EOPNOTSUPP;
 
 	IBV_INIT_CMD(cmd, cmd_size, MODIFY_QP);