From patchwork Sat Dec 13 15:00:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 5486691 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AD0A59F1CD for ; Sat, 13 Dec 2014 15:00:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1190920120 for ; Sat, 13 Dec 2014 15:00:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 743702014A for ; Sat, 13 Dec 2014 15:00:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966024AbaLMPAV (ORCPT ); Sat, 13 Dec 2014 10:00:21 -0500 Received: from mail-wi0-f180.google.com ([209.85.212.180]:64167 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965506AbaLMPAU (ORCPT ); Sat, 13 Dec 2014 10:00:20 -0500 Received: by mail-wi0-f180.google.com with SMTP id n3so5162197wiv.7 for ; Sat, 13 Dec 2014 07:00:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=Gj8CvLWYl1uEVdkghTMaqCHdJF3tS++sxbBNSPV/3PA=; b=PkbiIq35kmnOrDQQz6bmcoJKazwtN2TOsRTG4VADv0uehB6XElXAjDu7JFsi4GTvL7 xG+TyNlNZUNdjOuRRRMM/w/kkb1DSJ/PJRjXCYQZhO3VN6cjm2XVL5mheoRVSNh6N/tL Cv4JglQJbextMA7XjBy89cmgrh2jOpCrWiskcKBV8Q2r3kwEVAMM0qmeVCTeblyFo7AV f4dIeS6CU7X/Ds6NEGTyvVf1onbOGU6Huud6bB8kcQ2yXhHqzG2Od6f+0ceyAEDTtg6o alK+0sg+phn7p4a3hG5OpcrL56gf5/bxkE23Cl6dVLOBXv+bB3u4IGvuc+YjcVN6DULg B3oA== X-Gm-Message-State: ALoCoQl5DRO4zlBmrV9qO8rw6JeYw3sE518hEqHATqNi4qxxjhJ/4MslnDKg/36ph/VJuqIAHsUh X-Received: by 10.194.91.205 with SMTP id cg13mr37015018wjb.21.1418482819069; Sat, 13 Dec 2014 07:00:19 -0800 (PST) Received: from [192.168.1.102] (c-98-229-118-119.hsd1.ma.comcast.net. [98.229.118.119]) by mx.google.com with ESMTPSA id dv9sm4345934wib.14.2014.12.13.07.00.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 13 Dec 2014 07:00:18 -0800 (PST) Message-ID: <548C547A.4050309@dev.mellanox.co.il> Date: Sat, 13 Dec 2014 10:00:10 -0500 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: "linux-rdma (linux-rdma@vger.kernel.org)" , Qian Liu CC: "Chu, Al" Subject: [PATCH opensm] osm_congestion_control.c: Fix endian of node and port GUIDs in some log messages Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP based on obtaining these from cc_context where GUID endian is network rather than host endian Signed-off-by: Hal Rosenstock --- opensm/osm_congestion_control.c | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/opensm/osm_congestion_control.c b/opensm/osm_congestion_control.c index 11be555..c04ae07 100644 --- a/opensm/osm_congestion_control.c +++ b/opensm/osm_congestion_control.c @@ -448,16 +448,16 @@ static void cc_rcv_mad(void *context, void *data) ib_cc_mad_t *p_cc_mad; osm_madw_context_t *p_mad_context = &p_madw->context; ib_mad_t *p_mad = osm_madw_get_mad_ptr(p_madw); - uint64_t node_guid = p_mad_context->cc_context.node_guid; - uint64_t port_guid = p_mad_context->cc_context.port_guid; + ib_net64_t node_guid = p_mad_context->cc_context.node_guid; + ib_net64_t port_guid = p_mad_context->cc_context.port_guid; uint8_t port = p_mad_context->cc_context.port; osm_port_t *p_port; OSM_LOG_ENTER(p_cc->log); OSM_LOG(p_cc->log, OSM_LOG_VERBOSE, - "Processing received MAD status 0x%x context 0x%" - PRIx64 " port %u\n", p_mad->status, node_guid, port); + "Processing received MAD status 0x%x node 0x%" PRIx64 " port %u\n", + p_mad->status, cl_ntoh64(node_guid), port); p_cc_mad = osm_madw_get_cc_mad_ptr(p_madw); @@ -466,8 +466,8 @@ static void cc_rcv_mad(void *context, void *data) p_port = osm_get_port_by_guid(p_cc->subn, port_guid); if (!p_port) { OSM_LOG(p_cc->log, OSM_LOG_ERROR, "ERR C109: " - "Port GUID not in table 0x%" PRIx64 "\n", - port_guid); + "Port GUID 0x%" PRIx64 " not in table\n", + cl_ntoh64(port_guid)); cl_plock_release(&p_osm->lock); goto Exit; } @@ -539,7 +539,7 @@ wait: } else OSM_LOG(p_cc->log, OSM_LOG_ERROR, "ERR C104: " "send failed to node 0x%" PRIx64 "port %u\n", - mad_context.cc_context.node_guid, + cl_ntoh64(mad_context.cc_context.node_guid), mad_context.cc_context.port); } @@ -673,8 +673,8 @@ static void cc_mad_send_err_callback(void *bind_context, p_port = osm_get_port_by_guid(p_cc->subn, port_guid); if (!p_port) { OSM_LOG(p_cc->log, OSM_LOG_ERROR, "ERR C10B: " - "Port guid not in table 0x%" PRIx64 "\n", - port_guid); + "Port GUID 0x%" PRIx64 " not in table\n", + cl_ntoh64(port_guid)); cl_plock_release(&p_osm->lock); goto Exit; } @@ -693,7 +693,7 @@ static void cc_mad_send_err_callback(void *bind_context, ib_get_err_str(p_madw->status), p_madw->p_mad->attr_id, cl_ntoh16(p_madw->mad_addr.dest_lid), - node_guid, + cl_ntoh64(node_guid), port, cl_ntoh64(p_madw->p_mad->trans_id));