From patchwork Thu Jan 11 21:43:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10158639 X-Patchwork-Delegate: jgg@ziepe.ca 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 581CC60170 for ; Thu, 11 Jan 2018 21:43:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F27328682 for ; Thu, 11 Jan 2018 21:43:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 324B928716; Thu, 11 Jan 2018 21:43:27 +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 BF91628682 for ; Thu, 11 Jan 2018 21:43:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932714AbeAKVnZ (ORCPT ); Thu, 11 Jan 2018 16:43:25 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35255 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932472AbeAKVnZ (ORCPT ); Thu, 11 Jan 2018 16:43:25 -0500 Received: by mail-wm0-f68.google.com with SMTP id r78so8216071wme.0 for ; Thu, 11 Jan 2018 13:43:24 -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=IdgEaCjU6yraegyJetMCYR/7MbrV9gWixBybFwT6EV0=; b=duADG51SssZ/cNDQ4cIYledX1GaKSmtJVREdrXq/FriU5Bzc7t2z+y677Si0vEDD+b RVzzNpRI3zbYQB2rZCwQk9atMIUORo8MjI3l/wnLPYFYNWBgxbg6WJG+xgjAMWEleJIX mADMR+A2XJoCs5R3KALM/k4QsJevkcHcKwgsjnDLkHwnoe+eU7+KVSPUPlCEmE04pMzp xMt9/wdvaqeTOKpTMKZEioNK01Rd9XKCGh/gJibN6IudXEsk7DbYWB6PtWirCs543oVu MVzm3fjMBw5CxZcMH8tgYBdRjpy9b5QRr5Q1tfgtMqIEhLIFxa8S/hcVhKIO/LTWm/iT mg7w== 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=IdgEaCjU6yraegyJetMCYR/7MbrV9gWixBybFwT6EV0=; b=PTFac8GcGeBS3thb69NWVlc7LaPy6RGBXsuszQ0HixhUWNzx/GXucupVkHkXhBVdjF Few2G/HlcvKiZAYoGrtRRWThFXRYk8eoh/zpopGmtQjEhwkvoew6q/AwF+VillfSee8C Pmxwz/EmJLxYj/QN7C5smoF8FAiOsrdtw6pdzhQl0J82Ty5S0wmpC40kWqm5HB303h/Z sHRX4FxoNKz8DTwE6QTskaK1zFCdMEUvWXOvimszJEla/B9ucKXxiLkZK2aphPl0y5mC 7OjQmXFH3ljJDt/ZPhBaFa5Vz3oOAtHBCtMVDpWZ9dhUgkuSbuPs09VEyzyLm3EPJXGb F+ZA== X-Gm-Message-State: AKwxytf8k/CMMBhLfqxZ7kLvDfiJuQZAQl1j//90zAPf349Tsun93li3 RFJaYUSF5bFODPhfaqmJhyYvXFDbSCo= X-Google-Smtp-Source: ACJfBouqSZ17dF7DWBtXvCqQUbB5aN1SBw+YNiqfx2QagkIMux/ZM5lphZQo1af00orOLinLTxlk4w== X-Received: by 10.28.45.69 with SMTP id t66mr2430423wmt.120.1515707003604; Thu, 11 Jan 2018 13:43:23 -0800 (PST) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [70.74.179.152]) by smtp.gmail.com with ESMTPSA id p11sm7776240wrd.3.2018.01.11.13.43.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jan 2018 13:43:22 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eZkd6-0000AX-P8; Thu, 11 Jan 2018 14:43:20 -0700 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH 1/3] RDMA: Mark imm_data as be32 in the verbs uapi header Date: Thu, 11 Jan 2018 14:43:05 -0700 Message-Id: <20180111214307.501-2-jgg@ziepe.ca> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180111214307.501-1-jgg@ziepe.ca> References: <20180111214307.501-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 This matches what the userspace copy of this header has been doing for a while. imm_data is an opaque 4 byte array carried over the network, and invalidate_rkey is in CPU byte order. Signed-off-by: Jason Gunthorpe --- drivers/infiniband/core/uverbs_cmd.c | 2 +- drivers/infiniband/sw/rdmavt/cq.c | 3 +-- drivers/infiniband/sw/rxe/rxe_resp.c | 3 +-- include/uapi/rdma/ib_user_verbs.h | 4 ++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index c216d98bb816a0..4ddd61d905075c 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -1196,7 +1196,7 @@ static int copy_wc_to_user(struct ib_device *ib_dev, void __user *dest, tmp.opcode = wc->opcode; tmp.vendor_err = wc->vendor_err; tmp.byte_len = wc->byte_len; - tmp.ex.imm_data = (__u32 __force) wc->ex.imm_data; + tmp.ex.imm_data = wc->ex.imm_data; tmp.qp_num = wc->qp->qp_num; tmp.src_qp = wc->src_qp; tmp.wc_flags = wc->wc_flags; diff --git a/drivers/infiniband/sw/rdmavt/cq.c b/drivers/infiniband/sw/rdmavt/cq.c index 61fca14c2598be..fb52b669bfce5c 100644 --- a/drivers/infiniband/sw/rdmavt/cq.c +++ b/drivers/infiniband/sw/rdmavt/cq.c @@ -101,8 +101,7 @@ void rvt_cq_enter(struct rvt_cq *cq, struct ib_wc *entry, bool solicited) wc->uqueue[head].opcode = entry->opcode; wc->uqueue[head].vendor_err = entry->vendor_err; wc->uqueue[head].byte_len = entry->byte_len; - wc->uqueue[head].ex.imm_data = - (__u32 __force)entry->ex.imm_data; + wc->uqueue[head].ex.imm_data = entry->ex.imm_data; wc->uqueue[head].qp_num = entry->qp->qp_num; wc->uqueue[head].src_qp = entry->src_qp; wc->uqueue[head].wc_flags = entry->wc_flags; diff --git a/drivers/infiniband/sw/rxe/rxe_resp.c b/drivers/infiniband/sw/rxe/rxe_resp.c index 4240866a533192..f07324f2cde207 100644 --- a/drivers/infiniband/sw/rxe/rxe_resp.c +++ b/drivers/infiniband/sw/rxe/rxe_resp.c @@ -863,8 +863,7 @@ static enum resp_states do_complete(struct rxe_qp *qp, if (pkt->mask & RXE_IMMDT_MASK) { uwc->wc_flags |= IB_WC_WITH_IMM; - uwc->ex.imm_data = - (__u32 __force)immdt_imm(pkt); + uwc->ex.imm_data = immdt_imm(pkt); } if (pkt->mask & RXE_IETH_MASK) { diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h index 7e11bb8651b641..fd035641cf41ce 100644 --- a/include/uapi/rdma/ib_user_verbs.h +++ b/include/uapi/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; @@ -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 {