All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH rdma-core stable-v15] verbs: Do not block QP attr_masks used by older kernels
@ 2017-11-14 14:40 Nicolas Morey-Chaisemartin
       [not found] ` <636b5412-e41e-40ed-46da-a0e83bd5b049-l3A5Bk7waGM@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Morey-Chaisemartin @ 2017-11-14 14:40 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Jason Gunthorpe

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-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
Signed-off-by: Jason Gunthorpe <jgunthorpe-uk2M96/98Pc@public.gmane.org>
---

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(-)

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);
-- 
2.15.0.169.g3d3eebb67.dirty

--
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

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

end of thread, other threads:[~2017-11-14 18:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-14 14:40 [PATCH rdma-core stable-v15] verbs: Do not block QP attr_masks used by older kernels Nicolas Morey-Chaisemartin
     [not found] ` <636b5412-e41e-40ed-46da-a0e83bd5b049-l3A5Bk7waGM@public.gmane.org>
2017-11-14 18:04   ` Leon Romanovsky
     [not found]     ` <20171114180451.GB18825-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-11-14 18:49       ` Jason Gunthorpe
     [not found]         ` <20171114184912.GD4263-uk2M96/98Pc@public.gmane.org>
2017-11-14 18:50           ` Nicolas Morey-Chaisemartin
     [not found]             ` <0a24c63b-c108-3301-e78f-7e38d58f5bdb-l3A5Bk7waGM@public.gmane.org>
2017-11-14 18:58               ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.