From patchwork Thu Dec 3 14:27:15 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Line.Holen@Sun.COM X-Patchwork-Id: 64559 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB3ERjER007776 for ; Thu, 3 Dec 2009 14:27:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755394AbZLCO1i (ORCPT ); Thu, 3 Dec 2009 09:27:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755482AbZLCO1i (ORCPT ); Thu, 3 Dec 2009 09:27:38 -0500 Received: from gmp-eb-inf-1.sun.com ([192.18.6.21]:43697 "EHLO gmp-eb-inf-1.sun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755394AbZLCO1h (ORCPT ); Thu, 3 Dec 2009 09:27:37 -0500 Received: from fe-emea-10.sun.com (gmp-eb-lb-1-fe1.eu.sun.com [192.18.6.7] (may be forged)) by gmp-eb-inf-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id nB3ERh49012566 for ; Thu, 3 Dec 2009 14:27:43 GMT MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from conversion-daemon.fe-emea-10.sun.com by fe-emea-10.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) id <0KU200F00XARVW00@fe-emea-10.sun.com> for linux-rdma@vger.kernel.org; Thu, 03 Dec 2009 14:27:32 +0000 (GMT) Received: from [129.159.138.141] ([unknown] [129.159.138.141]) by fe-emea-10.sun.com (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul 2 2009)) with ESMTPSA id <0KU2003PZYTF0Y10@fe-emea-10.sun.com>; Thu, 03 Dec 2009 14:27:16 +0000 (GMT) Date: Thu, 03 Dec 2009 15:27:15 +0100 From: Line Holen Subject: [PATCH v2] opensm/osm_sm_mad_ctrl.c Changes to some error messages To: sashak@voltaire.com Cc: linux-rdma@vger.kernel.org Message-id: <4B17CAC3.7070507@Sun.COM> User-Agent: Thunderbird 2.0.0.23 (X11/20090910) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/opensm/opensm/osm_sm_mad_ctrl.c b/opensm/opensm/osm_sm_mad_ctrl.c index 74beb1c..c4c5032 100644 --- a/opensm/opensm/osm_sm_mad_ctrl.c +++ b/opensm/opensm/osm_sm_mad_ctrl.c @@ -3,6 +3,7 @@ * Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved. * Copyright (c) 1996-2003 Intel Corporation. All rights reserved. * Copyright (c) 2009 HNR Consulting. All rights reserved. + * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -567,6 +568,44 @@ static void sm_mad_ctrl_process_trap_repress(IN osm_sm_mad_ctrl_t * p_ctrl, OSM_LOG_EXIT(p_ctrl->p_log); } +static void log_rcv_cb_error(osm_log_t *p_log, ib_smp_t *p_smp, ib_net16_t status) +{ + char buf[BUF_SIZE]; + char ipath[BUF_SIZE], rpath[BUF_SIZE]; + char tmp[10]; + uint32_t i; + + if (p_smp->mgmt_class == IB_MCLASS_SUBN_DIR) { + + for (i = 0; i <= p_smp->hop_count; i++) { + if (i == 0) { + sprintf(ipath, "%d", p_smp->initial_path[i]); + sprintf(rpath, "%d", p_smp->return_path[i]); + } else { + sprintf(tmp, ",%d", p_smp->initial_path[i]); + strcat(ipath, tmp); + sprintf(tmp, ",%d", p_smp->return_path[i]); + strcat(rpath, tmp); + } + } + sprintf(buf, "\n\t\t\tInitial path: "); + strcat(buf, ipath); + strcat(buf, " Return path: "); + strcat(buf, rpath); + } + + OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 3111: " + "Received MAD with error status = 0x%X\n" + "\t\t\t%s(%s), attr_mod 0x%x, TID 0x%" PRIx64 "%s\n", + cl_ntoh16(status), ib_get_sm_method_str(p_smp->method), + ib_get_sm_attr_str(p_smp->attr_id), + cl_ntoh32(p_smp->attr_mod), + cl_ntoh64(p_smp->trans_id), + p_smp->mgmt_class == IB_MCLASS_SUBN_DIR ? buf : ""); + + osm_dump_dr_smp(p_log, p_smp, OSM_LOG_VERBOSE); +} + /* * PARAMETERS * @@ -635,11 +674,8 @@ static void sm_mad_ctrl_rcv_callback(IN osm_madw_t * p_madw, else status = p_smp->status; - if (status != 0) { - OSM_LOG(p_ctrl->p_log, OSM_LOG_ERROR, "ERR 3111: " - "Error status = 0x%X\n", cl_ntoh16(status)); - osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_ERROR); - } + if (status != 0) + log_rcv_cb_error(p_ctrl->p_log, p_smp, status); switch (p_smp->method) { case IB_MAD_METHOD_GET_RESP: @@ -708,9 +744,15 @@ static void sm_mad_ctrl_send_err_cb(IN void *context, IN osm_madw_t * p_madw) CL_ASSERT(p_madw); + p_smp = osm_madw_get_smp_ptr(p_madw); OSM_LOG(p_ctrl->p_log, OSM_LOG_ERROR, "ERR 3113: " - "MAD completed in error (%s)\n", - ib_get_err_str(p_madw->status)); + "MAD completed in error (%s): " + "%s(%s), attr_mod 0x%x, TID 0x%" PRIx64 "\n", + ib_get_err_str(p_madw->status), + ib_get_sm_method_str(p_smp->method), + ib_get_sm_attr_str(p_smp->attr_id), + cl_ntoh32(p_smp->attr_mod), + cl_ntoh64(p_smp->trans_id)); /* If this was a SubnSet MAD, then this error might indicate a problem @@ -718,7 +760,6 @@ static void sm_mad_ctrl_send_err_cb(IN void *context, IN osm_madw_t * p_madw) such a problem. The subnet will not be up, and the next sweep should be a heavy sweep as well. */ - p_smp = osm_madw_get_smp_ptr(p_madw); if (p_smp->method == IB_MAD_METHOD_SET && (p_smp->attr_id == IB_MAD_ATTR_PORT_INFO || p_smp->attr_id == IB_MAD_ATTR_MCAST_FWD_TBL || @@ -734,6 +775,8 @@ static void sm_mad_ctrl_send_err_cb(IN void *context, IN osm_madw_t * p_madw) p_ctrl->p_subn->subnet_initialization_error = TRUE; } + osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_VERBOSE); + /* Since we did not get any response we suspect the DR path used for the target port. @@ -764,10 +807,6 @@ static void sm_mad_ctrl_send_err_cb(IN void *context, IN osm_madw_t * p_madw) An error occurred. No response was received to a request MAD. Retire the original request MAD. */ - - osm_dump_dr_smp(p_ctrl->p_log, osm_madw_get_smp_ptr(p_madw), - OSM_LOG_ERROR); - sm_mad_ctrl_update_wire_stats(p_ctrl); if (osm_madw_get_err_msg(p_madw) != CL_DISP_MSGID_NONE) {