From patchwork Tue Nov 14 14:40:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Morey-Chaisemartin X-Patchwork-Id: 10057795 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BD6816023A for ; Tue, 14 Nov 2017 14:40:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B24FC2927E for ; Tue, 14 Nov 2017 14:40:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6CC52943B; Tue, 14 Nov 2017 14:40:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 191222927E for ; Tue, 14 Nov 2017 14:40:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752856AbdKNOk1 (ORCPT ); Tue, 14 Nov 2017 09:40:27 -0500 Received: from mx2.suse.de ([195.135.220.15]:44539 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752360AbdKNOk1 (ORCPT ); Tue, 14 Nov 2017 09:40:27 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 315C6AD64; Tue, 14 Nov 2017 14:40:26 +0000 (UTC) From: Nicolas Morey-Chaisemartin Subject: [PATCH rdma-core stable-v15] verbs: Do not block QP attr_masks used by older kernels To: linux-rdma@vger.kernel.org, Jason Gunthorpe Openpgp: preference=signencrypt Message-ID: <636b5412-e41e-40ed-46da-a0e83bd5b049@suse.de> Date: Tue, 14 Nov 2017 15:40:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Thunderbird/57.0 MIME-Version: 1.0 Content-Language: fr-xx-classique+reforme1990 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Jason Gunthorpe Reviewed-by: Leon Romanovsky --- 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);