From patchwork Mon Oct 7 20:35:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2999141 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 92CCF9F1E1 for ; Mon, 7 Oct 2013 20:35:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A94482021B for ; Mon, 7 Oct 2013 20:35:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 73F272021E for ; Mon, 7 Oct 2013 20:35:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754721Ab3JGUfm (ORCPT ); Mon, 7 Oct 2013 16:35:42 -0400 Received: from mail-we0-f171.google.com ([74.125.82.171]:57164 "EHLO mail-we0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752693Ab3JGUfm (ORCPT ); Mon, 7 Oct 2013 16:35:42 -0400 Received: by mail-we0-f171.google.com with SMTP id t60so2166325wes.2 for ; Mon, 07 Oct 2013 13:35:41 -0700 (PDT) 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 :subject:content-type:content-transfer-encoding; bh=S+1FxjZNIX3bByg75y+GBS3+BJMh7jcDCMr9GjIen/Q=; b=fIB6EJkJZEN0GJcR4YdO933ZZ6Q1ZQwf6nELrmcip4Xvr91xmlbvD9OOBBNWUWdZzu dn3JBERfJp51vTMGs1tK4b8YUV9usUvQbO9VlXrAtWJSb885adsIQgjHUPjBmrs1OkjY +YkgbOay0aBczEKfgoOszgUR9rirQQAk6Vqglpo/s+1+1THg6K3THV382seXidBOvraG 9fW9wk5i2GPWpq5+iVKu/OFqkkLFbna75UzbzFceh36KgmWbjtIvPcjtm6W87xhQd0hd eiDoyKJxZCcdFo+fWE2pqKg5m5GMZkRQXlfjGtfyrPpN4itNvTzyjiSH8TUawPN4nVa6 tH5w== X-Gm-Message-State: ALoCoQlCCp9lYnopC9RruO12uQRxCY4DC+6v8zDXQhniyV5ZKblhRvgkN9HHkROR5coWmc+27mEb X-Received: by 10.180.39.134 with SMTP id p6mr21115384wik.9.1381178141298; Mon, 07 Oct 2013 13:35:41 -0700 (PDT) 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 j5sm488622wia.4.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 07 Oct 2013 13:35:40 -0700 (PDT) Message-ID: <52531B1C.4070702@dev.mellanox.co.il> Date: Mon, 07 Oct 2013 16:35:40 -0400 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)" Subject: [PATCH OpenSM] osm_trap_rcv.c: Log DR path to node when trap 128 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 So can see if any subsequent transaction timeouts are related 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/include/opensm/osm_helper.h b/include/opensm/osm_helper.h index bc4bad3..f7b92f6 100644 --- a/include/opensm/osm_helper.h +++ b/include/opensm/osm_helper.h @@ -622,6 +622,10 @@ void osm_dump_sa_mad(IN osm_log_t * p_log, IN const ib_sa_mad_t * p_smp, void osm_dump_sa_mad_v2(IN osm_log_t * p_log, IN const ib_sa_mad_t * p_smp, IN const int file_id, IN osm_log_level_t level); +void osm_dump_dr_path_as_buf(IN size_t max_len, IN const osm_dr_path_t * p_path, + OUT char* buf); + + /****f* IBA Base: Types/osm_get_sm_signal_str * NAME * osm_get_sm_signal_str diff --git a/opensm/libopensm.map b/opensm/libopensm.map index e75d424..721e0e8 100644 --- a/opensm/libopensm.map +++ b/opensm/libopensm.map @@ -65,6 +65,7 @@ OPENSM_1.5 { osm_dump_sa_mad_v2; osm_dump_dr_path; osm_dump_dr_path_v2; + osm_dump_dr_path_as_buf; osm_dump_smp_dr_path; osm_dump_smp_dr_path_v2; osm_dump_pkey_block; diff --git a/opensm/osm_helper.c b/opensm/osm_helper.c index aa40650..e3ea3a7 100644 --- a/opensm/osm_helper.c +++ b/opensm/osm_helper.c @@ -2875,6 +2875,13 @@ void osm_dump_smp_dr_path_v2(IN osm_log_t * p_log, IN const ib_smp_t * p_smp, } } +void osm_dump_dr_path_as_buf(IN size_t max_len, + IN const osm_dr_path_t * p_path, + OUT char* buf) +{ + sprint_uint8_arr(buf, max_len, p_path->path, p_path->hop_count + 1); +} + static const char *sm_signal_str[] = { "OSM_SIGNAL_NONE", /* 0 */ "OSM_SIGNAL_SWEEP", /* 1 */ diff --git a/opensm/osm_trap_rcv.c b/opensm/osm_trap_rcv.c index ae08012..9b1d271 100644 --- a/opensm/osm_trap_rcv.c +++ b/opensm/osm_trap_rcv.c @@ -364,6 +364,9 @@ static void trap_rcv_process_request(IN osm_sm_t * sm, boolean_t physp_change_trap = FALSE; uint64_t event_wheel_timeout = OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT; boolean_t run_heavy_sweep = FALSE; + char buf[1024]; + osm_dr_path_t *p_path; + unsigned n; OSM_LOG_ENTER(sm->p_log); @@ -555,6 +558,26 @@ static void trap_rcv_process_request(IN osm_sm_t * sm, } check_sweep: + if (osm_log_is_active_v2(sm->p_log, OSM_LOG_INFO, FILE_ID)) { + if (ib_notice_is_generic(p_ntci) && + cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == SM_LINK_STATE_CHANGED_TRAP) { + p_path = osm_physp_get_dr_path_ptr(p_physp); + if (p_path) { + n = sprintf(buf, "SM class trap %u: ", + cl_ntoh16(p_ntci->g_or_v.generic.trap_num)); + n += snprintf(buf + n, sizeof(buf) - n, + "Directed Path Dump of %u hop path: " + "Path = ", p_path->hop_count); + + osm_dump_dr_path_as_buf(sizeof(buf) - n, p_path, + buf + n); + + osm_log_v2(sm->p_log, OSM_LOG_INFO, FILE_ID, + "%s\n", buf); + } + } + } + /* do a sweep if we received a trap */ if (sm->p_subn->opt.sweep_on_trap) { /* if this is trap number 128 or run_heavy_sweep is TRUE -