From patchwork Thu Apr 13 14:48:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 9679503 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 5B9C760381 for ; Thu, 13 Apr 2017 14:48:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C9C928666 for ; Thu, 13 Apr 2017 14:48:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4145B28676; Thu, 13 Apr 2017 14:48:48 +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 62F5628666 for ; Thu, 13 Apr 2017 14:48:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754139AbdDMOsp (ORCPT ); Thu, 13 Apr 2017 10:48:45 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:34397 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753737AbdDMOso (ORCPT ); Thu, 13 Apr 2017 10:48:44 -0400 Received: by mail-wr0-f195.google.com with SMTP id u18so8954280wrc.1 for ; Thu, 13 Apr 2017 07:48:43 -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=Uhb6K4ikVZvif7xtLOANxNnMaf1FQVYdZnOPDktDAkM=; b=FlQ0KyB1HVZVrODjSPb3FtGkb9dh6UPYokE3f3JhFJcnRU7Pf1k0OnyTka6s02oInE Ycnd3AY74pzz1azrTzzvaT3v2Vhj9YPq6opdmdBB+n+nx6cGOMX4aMQXgVeTUd/brUeW U2W40IpTBnNIAc6l+BeB7JRM2Kcx9KAn94iH43B03JkY9a6nzM93F+MuFeNNKYS9/v3E Qeh/+amBgeM62au+l6uBeUHE/LUNtCQ1HkzMdW4+OWhRMIL0qeMdS0N20hK+0ZPxENVC lHwZ1NoTca31uve7P7jwsSPuyoq+9dQEZsTD2W7arCZrNVLBZe0WVc+WpM6vBr5GDdtW aMVw== 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=Uhb6K4ikVZvif7xtLOANxNnMaf1FQVYdZnOPDktDAkM=; b=lvlSkNDYaIZS8MxobkgiketaWATf0jXvkiaVWduaVdxKENz/6d+My5L3Q/1DGIKqf3 /xwt5IzoDAYlCcwrWIA6WSwsxGHzLpDRRSLUu6cddcccnBAoxDoWP/pJRctaLwlgHsA5 9quIO+Iq/r+mjPBV0SAcJsihKYaRmKWUmXIQiZ4maHmvK/Ozisb0fENTxaSPXjMl8aC8 8F9Rc7luvxXYap6wJ0lcsHeq2WvPYfYWyfXes46s4FigyP3TjYBiY1o4EskRegpT7MCD pZa2oQ0dI6LNbg826cfbkMbwwOX7Xq3VFtndeqn88KvtHjdhTsVc6I8Z+8x1UBc191/G 19bg== X-Gm-Message-State: AN3rC/4JAgw5dKj3uX1EjbfPePV2vn8oJmg6uAljVvM7epYeuiQ2j8D+ 7vwsto63CB4oZQ== X-Received: by 10.223.160.59 with SMTP id k56mr3636524wrk.0.1492094922469; Thu, 13 Apr 2017 07:48:42 -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 f135sm10863449wmd.7.2017.04.13.07.48.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Apr 2017 07:48:41 -0700 (PDT) To: Doug Ledford Cc: Honggang LI , Bart Van Assche , "linux-rdma@vger.kernel.org" From: Hal Rosenstock Subject: [PATCH rdma-core 3/3] srp_daemon: Use consistent format when printing LID Message-ID: Date: Thu, 13 Apr 2017 10:48:40 -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 %d is not good as LIDs above 32K print as negative numbers. %#x seems to be the right choice here; %u was used by IB management tools for unicast LID printing. Signed-off-by: Hal Rosenstock --- srp_daemon/srp_daemon.c | 12 ++++++------ srp_daemon/srp_handle_traps.c | 4 ++-- srp_daemon/srp_sync.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/srp_daemon/srp_daemon.c b/srp_daemon/srp_daemon.c index 59a6137..4d8476e 100644 --- a/srp_daemon/srp_daemon.c +++ b/srp_daemon/srp_daemon.c @@ -632,7 +632,7 @@ recv: ret = umad_status(in_mad); if (ret) { pr_err( - "bad MAD status (%u) from lid %d\n", + "bad MAD status (%u) from lid %#x\n", ret, (uint16_t) be16toh(out_mad->hdr.addr.lid)); return -ret; } @@ -935,7 +935,7 @@ static int do_port(struct resources *res, uint16_t pkey, uint16_t dlid, ret = get_iou_info(umad_res, dlid, &iou_info); if (ret < 0) { - pr_err("failed to get iou info for dlid %x\n", dlid); + pr_err("failed to get iou info for dlid %#x\n", dlid); goto out; } @@ -1214,7 +1214,7 @@ static int do_dm_port_list(struct resources *res) num_pkeys = get_shared_pkeys(res, be16toh(port_info->endport_lid), pkeys); if (num_pkeys < 0) { - pr_err("failed to get shared P_Keys with LID %x\n", + pr_err("failed to get shared P_Keys with LID %#x\n", be16toh(port_info->endport_lid)); free(in_mad_buf); return num_pkeys; @@ -1235,7 +1235,7 @@ void handle_port(struct resources *res, uint16_t pkey, uint16_t lid, uint64_t h_ uint64_t subnet_prefix; int isdm; - pr_debug("enter handle_port for lid %d\n", lid); + pr_debug("enter handle_port for lid %#x\n", lid); if (get_port_info(umad_res, lid, &subnet_prefix, &isdm)) return; @@ -1292,7 +1292,7 @@ static int do_full_port_list(struct resources *res) num_pkeys = get_shared_pkeys(res, be16toh(node->lid), pkeys); if (num_pkeys < 0) { - pr_err("failed to get shared P_Keys with LID %x\n", + pr_err("failed to get shared P_Keys with LID %#x\n", be16toh(node->lid)); free(in_mad_buf); return num_pkeys; @@ -2188,7 +2188,7 @@ catas_start: /* unexpected error - do a full rescan */ schedule_rescan(res->sync_res, 0); else { - pr_debug("lid is %d\n", lid); + pr_debug("lid is %#x\n", lid); srp_sleep(0, 100); handle_port(res, pkey, lid, diff --git a/srp_daemon/srp_handle_traps.c b/srp_daemon/srp_handle_traps.c index f219702..6d94634 100644 --- a/srp_daemon/srp_handle_traps.c +++ b/srp_daemon/srp_handle_traps.c @@ -561,9 +561,9 @@ static int register_to_trap(struct sync_resources *sync_res, static uint64_t trans_id = 0x0000FFFF; if (subscribe) - pr_debug("Registering to trap:%d (sm in %d)\n", trap_num, dest_lid); + pr_debug("Registering to trap:%d (sm in %#x)\n", trap_num, dest_lid); else - pr_debug("Deregistering from trap:%d (sm in %d)\n", trap_num, dest_lid); + pr_debug("Deregistering from trap:%d (sm in %#x)\n", trap_num, dest_lid); memset(res->send_buf, 0, SEND_SIZE); diff --git a/srp_daemon/srp_sync.c b/srp_daemon/srp_sync.c index 72c41f0..036fbe5 100644 --- a/srp_daemon/srp_sync.c +++ b/srp_daemon/srp_sync.c @@ -171,7 +171,7 @@ void push_lid_to_list(struct sync_resources *res, uint16_t lid, uint16_t pkey) for (i=0; i < res->next_task; ++i) if (res->tasks[i].lid == lid && res->tasks[i].pkey == pkey) { - pr_debug("lid %d is already in task list\n", lid); + pr_debug("lid %#x is already in task list\n", lid); pthread_mutex_unlock(&res->mutex); return; }