From patchwork Thu Jan 11 22:13:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10158763 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 AA269601A1 for ; Thu, 11 Jan 2018 22:14:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98B772850D for ; Thu, 11 Jan 2018 22:14:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D95328565; Thu, 11 Jan 2018 22:14:03 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 1608E285C6 for ; Thu, 11 Jan 2018 22:14:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933390AbeAKWOB (ORCPT ); Thu, 11 Jan 2018 17:14:01 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:36860 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933341AbeAKWN5 (ORCPT ); Thu, 11 Jan 2018 17:13:57 -0500 Received: by mail-wm0-f68.google.com with SMTP id b76so8307880wmg.1 for ; Thu, 11 Jan 2018 14:13:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=4u+CpzikgEbBXup+RSVfLiBt+V1ShtTBHglB+Bd7WiA=; b=OwTET8IZX2kcFoMAx0E/dq3C1WUh+96aszajdvdWZ6xRwZG1d8AIeadTlXpLxYqSBx HTdxR/asTyRZ1dV2IrYSD9G6WuWVetHp7cDGmUeM1GRoSVkG/vCKOP4EQ8jsShp3be5l lKScl1QvviGzNcnILxOB/aRvDnTmynIYBk9VupPgY/VDx0K76cX+jEYUjdg/4RdZDkR/ X6E7g0SbwTLPPBSsD+rlJ/YeEs9tY4/EtVZGB0DmSxPs2rJIZTzIljBvioTIqQtiX+lS c35H1zt7fgViy050wVnmsBWOFqOFZxBJD7skhvzilKODIc2wIRkS77f7mRwS0IqoQV3F haXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4u+CpzikgEbBXup+RSVfLiBt+V1ShtTBHglB+Bd7WiA=; b=M3fFAWrHuC7aC7xLkgBuYc9AEcodwAPy/QEG12zwDa88y7ddmcmXl1OOBE3jeZZzky LjQeDqNQ10GsUXydbrwD/dmdaDmsmdVW40K/3adWoTp1X/nEPe+hGF6Wt+amyN9+xSTQ RTb/eySIzFdqhRdiLpMHVjuN2Cx4+OY1yj4DZbzsEG3MLpilI5lOKAGrdgg4BHMw2Ah5 7yV4IWxJjaZI4FKBtOJKmo6Tf+sOAQRNciq+74bOZ+EAX7+GNKNBv61ddZvkwVe08uWk zDGTy+Yb0ne2iM0KcyKpgP4nkUww7JS3plynPZM2a+36jKfbLkS8C7S+0Y9HmBcbRKHD 5Byw== X-Gm-Message-State: AKwxytet8WkmfaDPZskXPmJRSpkWrkuEcIOrCd+k2OROt+UP2CvWZIU6 5bX3x0n9CTpLwoxskq0DF8jqrC1bJic= X-Google-Smtp-Source: ACJfBovi+BSRaKyNYR+yLRqaSvyksYWsO+F/jPPlE9dsLafJcN1rLv9yYRWJu3Ee+Q+waRwa3K+vdQ== X-Received: by 10.28.18.78 with SMTP id 75mr2524603wms.58.1515708835930; Thu, 11 Jan 2018 14:13:55 -0800 (PST) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [70.74.179.152]) by smtp.gmail.com with ESMTPSA id z99sm1895103wrb.79.2018.01.11.14.13.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jan 2018 14:13:50 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eZl6Y-0000Ir-Kv; Thu, 11 Jan 2018 15:13:46 -0700 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 03/17] verbs: Delete extended command definitions from kern-abi.h Date: Thu, 11 Jan 2018 15:13:26 -0700 Message-Id: <20180111221340.965-4-jgg@ziepe.ca> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180111221340.965-1-jgg@ziepe.ca> References: <20180111221340.965-1-jgg@ziepe.ca> 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 From: Jason Gunthorpe The kernel definition is not quite the same, the names are slightly different and the kernel enum does not include the flags bit. Revise IBV_INIT_CMD_RESP_EX_V to use the kernel name and include the flag bits. Signed-off-by: Jason Gunthorpe --- libibverbs/cmd.c | 8 ++++---- libibverbs/ibverbs.h | 10 +++++++++- libibverbs/kern-abi.h | 26 -------------------------- 3 files changed, 13 insertions(+), 31 deletions(-) diff --git a/libibverbs/cmd.c b/libibverbs/cmd.c index bcec94f5b0ce72..fc58de768d0011 100644 --- a/libibverbs/cmd.c +++ b/libibverbs/cmd.c @@ -156,7 +156,7 @@ int ibv_cmd_query_device_ex(struct ibv_context *context, return EINVAL; IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, - QUERY_DEVICE_EX, resp, resp_core_size, + QUERY_DEVICE, resp, resp_core_size, resp_size); cmd->comp_mask = 0; cmd->reserved = 0; @@ -527,7 +527,7 @@ int ibv_cmd_create_cq_ex(struct ibv_context *context, int err; memset(cmd, 0, cmd_core_size); - IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, CREATE_CQ_EX, resp, + IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, CREATE_CQ, resp, resp_core_size, resp_size); if (cq_attr->comp_mask & ~(IBV_CQ_INIT_ATTR_MASK_RESERVED - 1)) @@ -993,7 +993,7 @@ int ibv_cmd_create_qp_ex2(struct ibv_context *context, memset(cmd, 0, cmd_core_size); - IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, CREATE_QP_EX, resp, + IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, CREATE_QP, resp, resp_core_size, resp_size); err = create_qp_ex_common(qp, qp_attr, vxrcd, &cmd->base); @@ -1389,7 +1389,7 @@ int ibv_cmd_modify_qp_ex(struct ibv_qp *qp, struct ibv_qp_attr *attr, response_length) + sizeof(resp->response_length)) return EINVAL; - IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, MODIFY_QP_EX, + IBV_INIT_CMD_RESP_EX_V(cmd, cmd_core_size, cmd_size, MODIFY_QP, resp, resp_core_size, resp_size); copy_modify_qp_fields(qp, attr, attr_mask, &cmd->base); diff --git a/libibverbs/ibverbs.h b/libibverbs/ibverbs.h index 2da44967c4f1c0..97d3a4b8dbab91 100644 --- a/libibverbs/ibverbs.h +++ b/libibverbs/ibverbs.h @@ -83,12 +83,20 @@ struct verbs_ex_private { (cmd)->response = (uintptr_t) (out); \ } while (0) +static inline uint32_t _cmd_ex(uint32_t cmd) +{ + return (IB_USER_VERBS_CMD_FLAG_EXTENDED + << IB_USER_VERBS_CMD_FLAGS_SHIFT) | + cmd; +} + #define IBV_INIT_CMD_RESP_EX_V(cmd, cmd_size, size, opcode, out, resp_size,\ outsize) \ do { \ size_t c_size = cmd_size - sizeof(struct ex_hdr); \ if (abi_ver > 2) \ - (cmd)->hdr.command = IB_USER_VERBS_CMD_##opcode; \ + (cmd)->hdr.command = \ + _cmd_ex(IB_USER_VERBS_EX_CMD_##opcode); \ else \ (cmd)->hdr.command = \ IB_USER_VERBS_CMD_##opcode##_V2; \ diff --git a/libibverbs/kern-abi.h b/libibverbs/kern-abi.h index d7acdaa9a4bca9..f67ddb10548880 100644 --- a/libibverbs/kern-abi.h +++ b/libibverbs/kern-abi.h @@ -53,32 +53,6 @@ #define IB_USER_VERBS_MIN_ABI_VERSION 3 #define IB_USER_VERBS_MAX_ABI_VERSION 6 -/* use this mask for creating extended commands */ -#define IB_USER_VERBS_CMD_EXTENDED_MASK \ - (IB_USER_VERBS_CMD_FLAG_EXTENDED << \ - IB_USER_VERBS_CMD_FLAGS_SHIFT) - - -enum { - IB_USER_VERBS_CMD_QUERY_DEVICE_EX = IB_USER_VERBS_CMD_EXTENDED_MASK | - IB_USER_VERBS_CMD_QUERY_DEVICE, - IB_USER_VERBS_CMD_CREATE_QP_EX = IB_USER_VERBS_CMD_EXTENDED_MASK | - IB_USER_VERBS_CMD_CREATE_QP, - IB_USER_VERBS_CMD_CREATE_CQ_EX = IB_USER_VERBS_CMD_EXTENDED_MASK | - IB_USER_VERBS_CMD_CREATE_CQ, - IB_USER_VERBS_CMD_MODIFY_QP_EX = IB_USER_VERBS_CMD_EXTENDED_MASK | - IB_USER_VERBS_CMD_MODIFY_QP, - IB_USER_VERBS_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_EXTENDED_MASK + - IB_USER_VERBS_CMD_THRESHOLD, - IB_USER_VERBS_CMD_DESTROY_FLOW, - IB_USER_VERBS_CMD_CREATE_WQ, - IB_USER_VERBS_CMD_MODIFY_WQ, - IB_USER_VERBS_CMD_DESTROY_WQ, - IB_USER_VERBS_CMD_CREATE_RWQ_IND_TBL, - IB_USER_VERBS_CMD_DESTROY_RWQ_IND_TBL, - IB_USER_VERBS_CMD_MODIFY_CQ, -}; - /* * Make sure that all structs defined in this file remain laid out so * that they pack the same way on 32-bit and 64-bit architectures (to