From patchwork Thu Apr 13 12:24:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 9679337 X-Patchwork-Delegate: ira.weiny@intel.com 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 0089160381 for ; Thu, 13 Apr 2017 12:24:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4F7E2862A for ; Thu, 13 Apr 2017 12:24:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9D4D28652; Thu, 13 Apr 2017 12:24:07 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 5DE0A2862A for ; Thu, 13 Apr 2017 12:24:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753373AbdDMMYG (ORCPT ); Thu, 13 Apr 2017 08:24:06 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:33146 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752908AbdDMMYF (ORCPT ); Thu, 13 Apr 2017 08:24:05 -0400 Received: by mail-wr0-f194.google.com with SMTP id l28so8388709wre.0 for ; Thu, 13 Apr 2017 05:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dev-mellanox-co-il.20150623.gappssmtp.com; s=20150623; h=to:cc:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=pnEgjSoMmpYbsOcXTzTIBCdJcggUBSfArfcopddxhN0=; b=g43z2Wq45c9FVUKfr0NDQNbsKkMXgcceFVqxVhYHps+tqn2Wy16NhVj9ZDJlWRbpIZ +94Vh6BNciY891fLaoz6di/632FN0vg4AYmSeaDYgrKwzI+omXx7HTYmgwWW5SBawVNf ABHroWKXmiB5BwFlsxYezpuuHwLgXmwStsHUpa77pesUo4hEn6TicceTKgSJf2/g3YvD ayA2L92YThCvddjZ8aMzhTtoCubMDnLuG/nKOhit6cSBdWHmJoYNw0lWy82MruqFmauV XKQI5gLoZy2eHosC2wfxw2TRe24SwnihHJD2WVUq5sQuBQHGKRG+i0jbi5ZM3hccKv5A GYPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=pnEgjSoMmpYbsOcXTzTIBCdJcggUBSfArfcopddxhN0=; b=Nq2kRWkkbUVpnsqANN5EgGBtoVtqJz6wftr1ai0zCwJXxtVjGeK2GnFYVgFw7K+pG/ lvQmavDwFg68BEolVvUbo4GAr7uWqM6+IKBsRa9ZpuEHlhLSRHJeFmhN0Kn36Z/ZJx+R cZfP700U6ADl3eJW53zfPln1R63Tx0iO2qwgHbrEMsFPWJQwCGkdF2X8q4ZdpXwMum6Y TShymeeqnhdneTZM1ovicysO+krFcZANXnxFNauEeauk/umjm0HHMlmbG6O3BP7tht4K FoGvZuDG724sKQx5D6cfv65RnqND8Z5nL76+T6N9r97oroPWsMkzxvxlooTqCRIW4M4a iN6Q== X-Gm-Message-State: AN3rC/7RjWJgMU4z+kq0D7F/P6YWyUmA+wVhdGkcdKYAeIfFrE6ZhM41 4JEhMuzDCUXdTw== X-Received: by 10.223.135.84 with SMTP id 20mr2486119wrz.199.1492086244412; Thu, 13 Apr 2017 05:24:04 -0700 (PDT) Received: from [192.168.1.183] (c-67-189-170-197.hsd1.ma.comcast.net. [67.189.170.197]) by smtp.googlemail.com with ESMTPSA id x1sm29288740wrd.63.2017.04.13.05.24.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Apr 2017 05:24:03 -0700 (PDT) To: "Weiny, Ira" Cc: "linux-rdma@vger.kernel.org" From: Hal Rosenstock Subject: [PATCH infiniband-diags] ibdiag_common.c: Fix endian conversion in resolve_self for umad_port GID prefix and GUID Message-ID: <976c8c54-4c09-a84b-7a3e-0b3340121985@dev.mellanox.co.il> Date: Thu, 13 Apr 2017 08:24:01 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 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 commit 96db7b90 to rdma-core libibumad: Annotate endianness of second umad_get_ca_portguids() argument annotated umad_port struct gid_prefix and port_guid fields as __be64 so proper conversion is cl_ntoh64 rather than cl_hton64. Signed-off-by: Hal Rosenstock --- -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/src/ibdiag_common.c b/src/ibdiag_common.c index 0fe2190..eda2901 100644 --- a/src/ibdiag_common.c +++ b/src/ibdiag_common.c @@ -608,8 +608,8 @@ int resolve_self(char *ca_name, uint8_t ca_port, ib_portid_t *portid, *portnum = port.portnum; if (gid) { memset(gid, 0, sizeof(*gid)); - prefix = cl_hton64(port.gid_prefix); - guid = cl_hton64(port.port_guid); + prefix = cl_ntoh64(port.gid_prefix); + guid = cl_ntoh64(port.port_guid); mad_encode_field(*gid, IB_GID_PREFIX_F, &prefix); mad_encode_field(*gid, IB_GID_GUID_F, &guid); }