From patchwork Thu Jan 11 22:13:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10158757 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 450E3601A1 for ; Thu, 11 Jan 2018 22:14:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 33DB42850D for ; Thu, 11 Jan 2018 22:14:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 287BC28567; Thu, 11 Jan 2018 22:14:00 +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 B709E2850D for ; Thu, 11 Jan 2018 22:13:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933377AbeAKWN5 (ORCPT ); Thu, 11 Jan 2018 17:13:57 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:45136 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933147AbeAKWNy (ORCPT ); Thu, 11 Jan 2018 17:13:54 -0500 Received: by mail-wm0-f65.google.com with SMTP id i186so8397396wmi.4 for ; Thu, 11 Jan 2018 14:13:53 -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=pDwVfBtMc2ki8onbbWxNTIH3+CyGNwLR6QHjPgW4s64=; b=Mf41Ay/M8Anv4U5HYiSvlO6w/puKalbN8nre6rjSzoFbPdCaLKRjsWBMQtPWS6fEuq VF6mMWk5ivu49waAC+09JqFsonWbfR/iBNpKFxfxo6yh2nAPKn7VXrF3N4WCkxTWJ3dX AZbC0w5MiEBZ0oHRc+IcHqMneMBwulRAsOvRp9siypf58uJMUI+bP2rEcsjZsrwHOULG Hwc6U6N6m5SJTN+uZZ+qtSqvUNnzKKn+6f5DnnJsWWlPfZ4o6y0u5cwwf86ztGwG2BVw ezTSO4NDnw1MggdRxYOvPGsqGtG4oVc76MMoOzjQxwnjpVPEtnFXhSI47y4NRLYGiSaZ UHpg== 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=pDwVfBtMc2ki8onbbWxNTIH3+CyGNwLR6QHjPgW4s64=; b=FuPOvygGJRJMnxhZz3RUCr0JlDvyMn/bWn2AHqgb/mv3YDmDjkmeA8y6TkrWrRCUwW gRwsVr3LI/ojdknS/Wgw7oNXwNeAKQsc065UgYTLztDJSfo0vez44CkRK5oXOYT1EsOC HuOvWFV8bObhZkhqYbUkLLIYmIjOn/3wLk7XGxcONpU4B2cm+ubmbBhTpukLqFLj/B/Q mpP6uSGn0xhswEQPwJe4MhrcCsHRI/puGmnnquYbDwAB55KWd0VGJcLkYKX/+N5wyPbl /kYzZFknYoDiAI4rg0PazFWxoUR3xpzB2bX9Tgjlnveo8r2iVUznoTsJZ7nOVxAo0A+J 3eJw== X-Gm-Message-State: AKwxytduOhUYSvs1KHfHF4CX/LVlC9cgLBXkIYXUQi8unuREc2wSFPVc wYiKiyS78DtXyfawdJBlPPtHuBKYI1o= X-Google-Smtp-Source: ACJfBovwYfRbmfb8ZUSj9NPNgnaRQyIgpY0ZhQFNUtKQmYylpV9+FdU7sX00OUfl0DFfglNZMlNO5g== X-Received: by 10.28.131.17 with SMTP id f17mr2312789wmd.139.1515708832821; Thu, 11 Jan 2018 14:13:52 -0800 (PST) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [70.74.179.152]) by smtp.gmail.com with ESMTPSA id t51sm274459wrc.21.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 1eZl6Z-0000Jx-2X; Thu, 11 Jan 2018 15:13:47 -0700 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH rdma-core 12/17] verbs: Use kernel uapi header for ibv_kern_send_wr Date: Thu, 11 Jan 2018 15:13:35 -0700 Message-Id: <20180111221340.965-13-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) The unused and curious qp_type.xrc.remote_srqn is deleted. Signed-off-by: Jason Gunthorpe --- buildlib/fixup-include/rdma-ib_user_verbs.h | 2 +- libibverbs/cmd.c | 6 ++--- libibverbs/kern-abi.h | 35 +---------------------------- 3 files changed, 5 insertions(+), 38 deletions(-) diff --git a/buildlib/fixup-include/rdma-ib_user_verbs.h b/buildlib/fixup-include/rdma-ib_user_verbs.h index 0573c0bb9fd059..fd035641cf41ce 100644 --- a/buildlib/fixup-include/rdma-ib_user_verbs.h +++ b/buildlib/fixup-include/rdma-ib_user_verbs.h @@ -765,7 +765,7 @@ struct ib_uverbs_send_wr { __u32 opcode; __u32 send_flags; union { - __u32 imm_data; + __be32 imm_data; __u32 invalidate_rkey; } ex; union { diff --git a/libibverbs/cmd.c b/libibverbs/cmd.c index 51366f05cfc9c5..99e94233f320d1 100644 --- a/libibverbs/cmd.c +++ b/libibverbs/cmd.c @@ -1413,7 +1413,7 @@ int ibv_cmd_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, struct ibv_post_send *cmd; struct ib_uverbs_post_send_resp resp; struct ibv_send_wr *i; - struct ibv_kern_send_wr *n, *tmp; + struct ib_uverbs_send_wr *n, *tmp; struct ibv_sge *s; unsigned wr_count = 0; unsigned sge_count = 0; @@ -1434,7 +1434,7 @@ int ibv_cmd_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, cmd->sge_count = sge_count; cmd->wqe_size = sizeof *n; - n = (struct ibv_kern_send_wr *) ((void *) cmd + sizeof *cmd); + n = (struct ib_uverbs_send_wr *) ((void *) cmd + sizeof *cmd); s = (struct ibv_sge *) (n + wr_count); tmp = n; @@ -1443,7 +1443,7 @@ int ibv_cmd_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, tmp->num_sge = i->num_sge; tmp->opcode = i->opcode; tmp->send_flags = i->send_flags; - tmp->imm_data = i->imm_data; + tmp->ex.imm_data = i->imm_data; if (ibqp->qp_type == IBV_QPT_UD) { tmp->wr.ud.ah = i->wr.ud.ah->handle; tmp->wr.ud.remote_qpn = i->wr.ud.remote_qpn; diff --git a/libibverbs/kern-abi.h b/libibverbs/kern-abi.h index 5d332f7b22c3f7..6284d0e45e9784 100644 --- a/libibverbs/kern-abi.h +++ b/libibverbs/kern-abi.h @@ -395,39 +395,6 @@ struct ibv_destroy_qp { __u32 reserved; }; -struct ibv_kern_send_wr { - __u64 wr_id; - __u32 num_sge; - __u32 opcode; - __u32 send_flags; - __be32 imm_data; - union { - struct { - __u64 remote_addr; - __u32 rkey; - __u32 reserved; - } rdma; - struct { - __u64 remote_addr; - __u64 compare_add; - __u64 swap; - __u32 rkey; - __u32 reserved; - } atomic; - struct { - __u32 ah; - __u32 remote_qpn; - __u32 remote_qkey; - __u32 reserved; - } ud; - } wr; - union { - struct { - __u32 remote_srqn; - } xrc; - } qp_type; -}; - struct ibv_kern_spec_eth { __u32 type; __u16 size; @@ -522,7 +489,7 @@ struct ibv_post_send { __u32 wr_count; __u32 sge_count; __u32 wqe_size; - struct ibv_kern_send_wr send_wr[0]; + struct ib_uverbs_send_wr send_wr[0]; }; struct ibv_post_recv {