From patchwork Tue Apr 9 13:11:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Gunthorpe X-Patchwork-Id: 10891267 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC19E17EF for ; Tue, 9 Apr 2019 13:37:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A810F28893 for ; Tue, 9 Apr 2019 13:37:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C2E82889B; Tue, 9 Apr 2019 13:37:04 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 43A5428893 for ; Tue, 9 Apr 2019 13:37:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726461AbfDINhD (ORCPT ); Tue, 9 Apr 2019 09:37:03 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:37973 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726129AbfDINhD (ORCPT ); Tue, 9 Apr 2019 09:37:03 -0400 Received: by mail-qt1-f196.google.com with SMTP id d13so19742270qth.5 for ; Tue, 09 Apr 2019 06:37:02 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=kYZcf8Eg9MsFMrpid6RxiKOTLqQksn7dSM/GxioXWe4=; b=n+5DNPEoMidXQzrbA7gk2/yotzR/topLSmU26Ym+iO6NwMH3DyUZPnHelimqWEUzGR 9ick7O6S/OJM+QCSbDhuSi8igYv0MC+aYeKZ5/kBS9IPGUYg71tGLMzdBLziYUmlUzEz CaQZqUG6Qw6sPAFP3FG9Fr+1Iiil+cawcNNQhDw9DVs9GN7vweIBuRDT1rx/sEWCawp6 gVXh8JxTvvS5wq79KqtgNFaN+hTNhIZkV37NSfSJAi5DBWOwMFE3AQ50QjXIsnCuPBGU zIOWeSnrHNSkxb2JS7ysv5T25FPsx+1RGIJdjQo6B65JSi6vys4IryGwBk3/UerXvq+b wlzQ== 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:mime-version:content-transfer-encoding; bh=kYZcf8Eg9MsFMrpid6RxiKOTLqQksn7dSM/GxioXWe4=; b=Yoll1MBzdVC5e0g2EKB+4rBbe/7UNZ1mspVqjhY2Iz/UNsjK0gXI1eTDRQt/iasBoY Rw2IhiV9BnCVUFmSZGTgJu/+Q6mFL/Vr5NzPaOnM/Q5rPWYEekVS/Dj0NWmKjGmivCvf IrMo07s/E3RTtHESG/ck49Twuvo0fUYi7jci1GMhj9BXKgbcTJ9yRb8gj7oA/GR5zkM+ KWq1p6EUEOAAcuWkHcRzLy2X/6Px+UuIof9KY8L7tMEXKXYPDWv95EY9hRqQ1d+8cteF cxHqKkHP/A/MM/cqwJhdL/q05jtrjxn/OMMwP9gzdfuCM3W+XrWv5IjgYDbkRftNJxr7 5l8Q== X-Gm-Message-State: APjAAAWTSLswiEHg91EVrM7aApffaDzXYofo1rLz6r9VYlXE8SMo48kt ZDdb86dzJ4TKW3FMIU0WOLn1TI0C4Wg= X-Google-Smtp-Source: APXvYqxDkq47kg8kXaoIbcsLG47Gr8Jibd1SFlia9b3Jk7UDUkEEAton6mSpgxTUQeYM7RFp27ln8w== X-Received: by 2002:ac8:91b:: with SMTP id t27mr29414057qth.107.1554817021988; Tue, 09 Apr 2019 06:37:01 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-49-251.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.49.251]) by smtp.gmail.com with ESMTPSA id q50sm22430664qtq.34.2019.04.09.06.37.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2019 06:37:01 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1hDqXI-0004Ez-2H; Tue, 09 Apr 2019 10:11:36 -0300 From: Jason Gunthorpe To: linux-rdma@vger.kernel.org Cc: Jason Gunthorpe Subject: [PATCH ibdiags 12/16] ibdiags: Fix reversed endian swap direction Date: Tue, 9 Apr 2019 10:11:29 -0300 Message-Id: <20190409131133.16140-13-jgg@ziepe.ca> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190409131133.16140-1-jgg@ziepe.ca> References: <20190409131133.16140-1-jgg@ziepe.ca> MIME-Version: 1.0 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 Found by sparse Signed-off-by: Jason Gunthorpe --- src/ibsendtrap.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ibsendtrap.c b/src/ibsendtrap.c index 14db04a0e9130a..8a3a3e6fd0449d 100644 --- a/src/ibsendtrap.c +++ b/src/ibsendtrap.c @@ -129,9 +129,9 @@ static void build_trap256_local(ib_mad_notice_attr_t * n, ib_portid_t * port) n->data_details.ntc_256.lid = n->issuer_lid; n->data_details.ntc_256.dr_slid = 0xffff; n->data_details.ntc_256.method = 1; - n->data_details.ntc_256.attr_id = be16toh(0x15); - n->data_details.ntc_256.attr_mod = be32toh(0x12); - n->data_details.ntc_256.mkey = be64toh(0x1234567812345678); + n->data_details.ntc_256.attr_id = htobe16(0x15); + n->data_details.ntc_256.attr_mod = htobe32(0x12); + n->data_details.ntc_256.mkey = htobe64(0x1234567812345678); } static void build_trap256_lid(ib_mad_notice_attr_t * n, ib_portid_t * port) @@ -162,10 +162,10 @@ static void build_trap257_258(ib_mad_notice_attr_t * n, ib_portid_t * port, n->data_details.ntc_257_258.key = htobe32(0x12345678); n->data_details.ntc_257_258.qp1 = htobe32(0x010101); n->data_details.ntc_257_258.qp2 = htobe32(0x020202); - n->data_details.ntc_257_258.gid1.unicast.prefix = be64toh(0xf8c0000000000001); - n->data_details.ntc_257_258.gid1.unicast.interface_id = be64toh(0x1111222233334444); - n->data_details.ntc_257_258.gid2.unicast.prefix = be64toh(0xf8c0000000000001); - n->data_details.ntc_257_258.gid2.unicast.interface_id = be64toh(0x5678567812341234); + n->data_details.ntc_257_258.gid1.unicast.prefix = htobe64(0xf8c0000000000001); + n->data_details.ntc_257_258.gid1.unicast.interface_id = htobe64(0x1111222233334444); + n->data_details.ntc_257_258.gid2.unicast.prefix = htobe64(0xf8c0000000000001); + n->data_details.ntc_257_258.gid2.unicast.interface_id = htobe64(0x5678567812341234); } static void build_trap257(ib_mad_notice_attr_t * n, ib_portid_t * port)