RDMA: Mark imm_data as be32 in the verbs uapi header
authorJason Gunthorpe <jgg@mellanox.com>
Thu, 11 Jan 2018 21:43:05 +0000 (14:43 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 15 Jan 2018 22:33:21 +0000 (15:33 -0700)
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 <jgg@mellanox.com>
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/sw/rdmavt/cq.c
drivers/infiniband/sw/rxe/rxe_resp.c
include/uapi/rdma/ib_user_verbs.h

index c216d98bb816a0b0818c41d5cd839a0eb0cef9cd..4ddd61d905075c8b38a0a298e4b506e0e2e58e52 100644 (file)
@@ -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;
index 61fca14c2598be1d2c31738f5b20c9137c3ef71c..fb52b669bfce5ce4e9ee512902270197fb319632 100644 (file)
@@ -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;
index 4240866a5331921f887ffc351d1b385c4aea5760..f07324f2cde2077f8141f4c92cb020825de751c1 100644 (file)
@@ -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) {
index 7e11bb8651b6410e0be16615ebbb1985407bd61a..fd035641cf41ced8062d7b956f067e8e9fec4596 100644 (file)
@@ -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 {