From patchwork Thu Jan 11 21:43:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10158643 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 D24D1605F8 for ; Thu, 11 Jan 2018 21:43:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2B8B28682 for ; Thu, 11 Jan 2018 21:43:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B74B0286EF; Thu, 11 Jan 2018 21:43:30 +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 557B52874F for ; Thu, 11 Jan 2018 21:43:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932472AbeAKVn3 (ORCPT ); Thu, 11 Jan 2018 16:43:29 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:39012 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932720AbeAKVn2 (ORCPT ); Thu, 11 Jan 2018 16:43:28 -0500 Received: by mail-wr0-f193.google.com with SMTP id z48so3575430wrz.6 for ; Thu, 11 Jan 2018 13:43:27 -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=8fAQfzIfBedyFGpc9Z/gyAWp2kOIKG86KaM2kGtKhkw=; b=Q2UILLimCiMMcv4LImSo7wkvDVuwN2tg7zgwbD59l+ILOPaVmup7B1/pfQFoRjPeAh nPorUXZfdVZr0xHrW5c/qbQCNSFAqlwINgZKDR30LL6b283C+F9VfH1XIaj80vlAa/z1 FP7ZkUOigB4bQMVxegHvpVBYh0RpdTZ4bWmmWF1LpHJz4+rdK1nwfl++UbU6WHgM0Tau OdGlAgLM5+bX2WE3klbVYBzG3tTGKX0mAHigHXUeQxFKRrpleefEALz4xkRxK4ZAhSYO HcIjfKCZY40tTLkg1/qKN5qUv4b5oPsoHIvls8q5kQdz/mciVaYJdOeiUF/MSTcFJCqr JMfw== 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=8fAQfzIfBedyFGpc9Z/gyAWp2kOIKG86KaM2kGtKhkw=; b=Q13CQspxpoh6z70fgRPeb2EyL5mjO1nKMAtQIZZJdy8eEG+3HKvd//kw46gYKgnVDh 3c/JJBN1US9RYzKvDwoo2TjXd3px4qKGVzo/DgAsRZaUdSRuFweQQqxwkD+1v118etSR aul2UP1AYXW49N8hmuCl0lpx9INZrXFfxqYWjpxiTu8A6xZDrF/YBUUgZmog/QKPTTqe ONc+XUYFxZ0xaVK5ciN8jDrdPiyJ5mzsgu37TIjPcQXKY1MnOP70fHZwtJrFg/txv9rI yp61o7nRbNkL4oXz9bfgIGQmRPxIyWu8Bre3a+pZJFYVNTzcThD3syxR42DqkL9LQEmQ C+Wg== X-Gm-Message-State: AKGB3mJP4vLKet1jylZ3unbPgfr1jdnCsvP+ZNA6ARx197DaIuLEQDlf yPKbM4EY/qerPq555doeJsgIBdMYUAo= X-Google-Smtp-Source: ACJfBovUItTZQfZaa+GRdIGoIThfVzVbfYbN1hoQjXx5fX7YGV3SKdXFoocV5L9o+5XuoBkZMZlMXA== X-Received: by 10.223.163.198 with SMTP id m6mr20971544wrb.49.1515707006743; Thu, 11 Jan 2018 13:43:26 -0800 (PST) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [70.74.179.152]) by smtp.gmail.com with ESMTPSA id c53sm37863779wrg.10.2018.01.11.13.43.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jan 2018 13:43:26 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.86_2) (envelope-from ) id 1eZkd9-0000Aq-No; Thu, 11 Jan 2018 14:43:23 -0700 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe , Ram Amrani , Michal Kalderon Subject: [PATCH 3/3] RDMA/qedr: Fix endian problems around imm_data Date: Thu, 11 Jan 2018 14:43:07 -0700 Message-Id: <20180111214307.501-4-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 The double swap matches what user space rdma-core does to imm_data. wc->imm_data is not used in the kernel so this change has no practical impact. Signed-off-by: Jason Gunthorpe Acked-by: Michal Kalderon --- drivers/infiniband/hw/qedr/verbs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c index 3b9c89848d6698..5551120ac6ea52 100644 --- a/drivers/infiniband/hw/qedr/verbs.c +++ b/drivers/infiniband/hw/qedr/verbs.c @@ -3039,7 +3039,7 @@ static int __qedr_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, swqe->wqe_size = 2; swqe2 = qed_chain_produce(&qp->sq.pbl); - swqe->inv_key_or_imm_data = cpu_to_le32(wr->ex.imm_data); + swqe->inv_key_or_imm_data = cpu_to_le32(be32_to_cpu(wr->ex.imm_data)); length = qedr_prepare_sq_send_data(dev, qp, swqe, swqe2, wr, bad_wr); swqe->length = cpu_to_le32(length); @@ -3590,7 +3590,7 @@ static inline int qedr_set_ok_cqe_resp_wc(struct rdma_cqe_responder *resp, wc->byte_len = le32_to_cpu(resp->length); if (resp->flags & QEDR_RESP_IMM) { - wc->ex.imm_data = le32_to_cpu(resp->imm_data_or_inv_r_Key); + wc->ex.imm_data = cpu_to_be32(le32_to_cpu(resp->imm_data_or_inv_r_Key)); wc->wc_flags |= IB_WC_WITH_IMM; if (resp->flags & QEDR_RESP_RDMA)