From patchwork Thu Jan 11 22:13:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10158813 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 0887C60170 for ; Thu, 11 Jan 2018 22:30:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D891328820 for ; Thu, 11 Jan 2018 22:30:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D32B32890A; Thu, 11 Jan 2018 22:30:32 +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 40B0D28924 for ; Thu, 11 Jan 2018 22:30:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933348AbeAKWaV (ORCPT ); Thu, 11 Jan 2018 17:30:21 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:41550 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933287AbeAKWaU (ORCPT ); Thu, 11 Jan 2018 17:30:20 -0500 Received: by mail-wr0-f195.google.com with SMTP id o7so3666935wro.8 for ; Thu, 11 Jan 2018 14:30:20 -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=yaRj0ARcS+hTsQI7evW7A0lEOw/TBRZOZ12tdawppCU=; b=iFOssX6GO9oJJVRDPcS0zbimw36hHvN1NNcxyFCNWi2pP3hAcEFmlooIh1L/5VH7oh 51hVCOCVuqOiBjrCrwxCT2UGa7cOVo+Do9TNaEXzIZQzdbwATVQx5XJhfkYRS6C0cWDb q7K2imwZ65AGSc1vQacqjaoHHUnacfsZWcY3NX2Lx9iI1guzwdTT4zWrDyAamcjU/gcm Ag383LEl6+oReXU7t8ny/m9sjxJ+SlNG+gdMro+FgSUaL12QmPHoeyVphGzmV1l0v0fc 5nzKHCROZ/4dnscYpf9pVlj3fClDzGntWozHcl79UF70TIPfeCBgk70EkU6cTSKoYE2p Tp8w== 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=yaRj0ARcS+hTsQI7evW7A0lEOw/TBRZOZ12tdawppCU=; b=UekGpAFWH3mniM9sYXCMhWv2cLCSgJrP52qaVBh3hdnRq+EuhUHk2UcZ2rMGoaqfYi ecVUvpy1uAp3tIrIuL8Nk0BC/qhq4W7JwzcJarRY0tYxioC2+byk/NHRyPTEtFfefoYg As2iIK/o+wzIr6RsBLcNwm/q1ptWYvpvl3zk5tnAJc8HBPVSeUBIh4JBdULSQynzejOr z1fqR8CsELw5JpKi50v+yY+5BONs6NF+YlxiCAllndJtuQA6BN9NypFrmMFwgkdWbBHg pwCeA3/DUtEjhuGEN07s3trzTy9R6x11ru7bnJqX3SxqNHEDtzP6yYlFSf8jejvR/NGs gqgA== X-Gm-Message-State: AKwxyteWF/YbRC1vRP9PZAxUMktIZeS4GG2dcXH7oj+NNd7i7fDUJpnA j8R/H5AcrSw35MGGF/EqzEzp7D0EXlY= X-Google-Smtp-Source: ACJfBouetPnozyRavx1VByC9MmrDL1Ke3pB8G5yZbACL/1MWv+w+4C4SRu/4gHwnj3/4e5ZQjPA2Iw== X-Received: by 10.223.160.120 with SMTP id l53mr6383498wrl.59.1515709819223; Thu, 11 Jan 2018 14:30:19 -0800 (PST) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [70.74.179.152]) by smtp.gmail.com with ESMTPSA id p10sm12503980wrh.61.2018.01.11.14.30.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jan 2018 14:30:18 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eZl6Y-0000Ji-Vm; Thu, 11 Jan 2018 15:13:46 -0700 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 10/17] verbs: Use kernel uapi header for ibv_kern_wc and ibv_poll_cq_resp Date: Thu, 11 Jan 2018 15:13:33 -0700 Message-Id: <20180111221340.965-11-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 kern_wc is slightly different, and the kernel API version is missing a be32 (patch going to Linux separately) Signed-off-by: Jason Gunthorpe --- buildlib/fixup-include/rdma-ib_user_verbs.h | 2 +- libibverbs/cmd.c | 6 +++--- libibverbs/kern-abi.h | 24 ------------------------ 3 files changed, 4 insertions(+), 28 deletions(-) diff --git a/buildlib/fixup-include/rdma-ib_user_verbs.h b/buildlib/fixup-include/rdma-ib_user_verbs.h index 7e11bb8651b641..0573c0bb9fd059 100644 --- a/buildlib/fixup-include/rdma-ib_user_verbs.h +++ b/buildlib/fixup-include/rdma-ib_user_verbs.h @@ -449,7 +449,7 @@ struct ib_uverbs_wc { __u32 vendor_err; __u32 byte_len; union { - __u32 imm_data; + __be32 imm_data; __u32 invalidate_rkey; } ex; __u32 qp_num; diff --git a/libibverbs/cmd.c b/libibverbs/cmd.c index d7ca35b924a81c..62ac7df0dfc57b 100644 --- a/libibverbs/cmd.c +++ b/libibverbs/cmd.c @@ -562,12 +562,12 @@ int ibv_cmd_create_cq_ex(struct ibv_context *context, int ibv_cmd_poll_cq(struct ibv_cq *ibcq, int ne, struct ibv_wc *wc) { struct ibv_poll_cq cmd; - struct ibv_poll_cq_resp *resp; + struct ib_uverbs_poll_cq_resp *resp; int i; int rsize; int ret; - rsize = sizeof *resp + ne * sizeof(struct ibv_kern_wc); + rsize = sizeof *resp + ne * sizeof(struct ib_uverbs_wc); resp = malloc(rsize); if (!resp) return -1; @@ -589,7 +589,7 @@ int ibv_cmd_poll_cq(struct ibv_cq *ibcq, int ne, struct ibv_wc *wc) wc[i].opcode = resp->wc[i].opcode; wc[i].vendor_err = resp->wc[i].vendor_err; wc[i].byte_len = resp->wc[i].byte_len; - wc[i].imm_data = resp->wc[i].imm_data; + wc[i].imm_data = resp->wc[i].ex.imm_data; wc[i].qp_num = resp->wc[i].qp_num; wc[i].src_qp = resp->wc[i].src_qp; wc[i].wc_flags = resp->wc[i].wc_flags; diff --git a/libibverbs/kern-abi.h b/libibverbs/kern-abi.h index 96b98ebc229980..a9e6b5461abd83 100644 --- a/libibverbs/kern-abi.h +++ b/libibverbs/kern-abi.h @@ -240,24 +240,6 @@ struct ibv_create_cq_ex { __u32 reserved; }; -struct ibv_kern_wc { - __u64 wr_id; - __u32 status; - __u32 opcode; - __u32 vendor_err; - __u32 byte_len; - __be32 imm_data; - __u32 qp_num; - __u32 src_qp; - __u32 wc_flags; - __u16 pkey_index; - __u16 slid; - __u8 sl; - __u8 dlid_path_bits; - __u8 port_num; - __u8 reserved; -}; - struct ibv_poll_cq { __u32 command; __u16 in_words; @@ -267,12 +249,6 @@ struct ibv_poll_cq { __u32 ne; }; -struct ibv_poll_cq_resp { - __u32 count; - __u32 reserved; - struct ibv_kern_wc wc[0]; -}; - struct ibv_req_notify_cq { __u32 command; __u16 in_words;