From patchwork Tue Jul 31 16:04:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Netes X-Patchwork-Id: 1260941 X-Patchwork-Delegate: alexne@voltaire.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 70DF6DF26F for ; Tue, 31 Jul 2012 16:09:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755478Ab2GaQJK (ORCPT ); Tue, 31 Jul 2012 12:09:10 -0400 Received: from mail-vb0-f46.google.com ([209.85.212.46]:54893 "EHLO mail-vb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755443Ab2GaQJI (ORCPT ); Tue, 31 Jul 2012 12:09:08 -0400 Received: by mail-vb0-f46.google.com with SMTP id ff1so5920363vbb.19 for ; Tue, 31 Jul 2012 09:09:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=uPdxbVGtOp0u/CMAvwpbhVJToqbD4JR/osqQvKRtv0w=; b=EsFWT72MaFFRzQOvcjhMFolvXjj2wm1lYd6HV1ud1AmU6e9k7Gd4a4Q2m78pFNUSxA KuW310qVTU1SjbJx6NACpu29/xfWRzLxKVHc6UBKzcHbiSibNUr/4Nf4o9k0Cz1ksITY Cf4ZSYFwcYXw8Pm0ZJYX9S78VdVyksTUrUrZ9KkV8X+j22dQD+WITaXO15a42kYarx5p soxubVgibqEThGaYCs18NiVC2fBB9fkfs34hFXBbomCT2evNMVXLfH8GLsGD/Mbk4G6f i/7B/WcpUzb8WIpv4wN7Dui1miY6AW9P05VrMfCSTzQguUxDI8FnfO6rSywxhl5/mHlE 8MUQ== Received: by 10.52.22.50 with SMTP id a18mr12776966vdf.60.1343750948541; Tue, 31 Jul 2012 09:09:08 -0700 (PDT) Received: from localhost ([193.47.165.251]) by mx.google.com with ESMTPS id bd4sm419101vdb.20.2012.07.31.09.09.07 (version=SSLv3 cipher=OTHER); Tue, 31 Jul 2012 09:09:08 -0700 (PDT) From: Alex Netes To: linux-rdma@vger.kernel.org Cc: Hal Rosenstock , Alex Netes Subject: [PATCH 15/27] opensm/osm_sa_path_record.c: Add debug logging to pr_match_mgrp_attributes Date: Tue, 31 Jul 2012 19:04:43 +0300 Message-Id: <1343750695-28063-15-git-send-email-alexne@mellanox.com> X-Mailer: git-send-email 1.7.11.2 In-Reply-To: <1343750695-28063-1-git-send-email-alexne@mellanox.com> References: <1343750695-28063-1-git-send-email-alexne@mellanox.com> X-Gm-Message-State: ALoCoQmMx7f4qqltU2kVZX8dZE2d5IM6VaKj04vf5noYd7ASMdJT79n2Kzy3R2Z5EE+POfcXg8tA Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Hal Rosenstock Signed-off-by: Hal Rosenstock Signed-off-by: Alex Netes --- opensm/osm_sa_path_record.c | 59 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 9 deletions(-) diff --git a/opensm/osm_sa_path_record.c b/opensm/osm_sa_path_record.c index d37d35c..f06696d 100644 --- a/opensm/osm_sa_path_record.c +++ b/opensm/osm_sa_path_record.c @@ -1517,50 +1517,91 @@ static ib_api_status_t pr_match_mgrp_attributes(IN osm_sa_t * sa, OSM_LOG_ENTER(sa->p_log); /* check that MLID of the MC group matches the PathRecord DLID */ - if ((comp_mask & IB_PR_COMPMASK_DLID) && p_mgrp->mlid != p_pr->dlid) + if ((comp_mask & IB_PR_COMPMASK_DLID) && p_mgrp->mlid != p_pr->dlid) { + OSM_LOG(sa->p_log, OSM_LOG_DEBUG, + "DLID 0x%x is not MLID 0x%x for MC group\n", + cl_ntoh16(p_pr->dlid), cl_ntoh16(p_mgrp->mlid)); goto Exit; + } /* If SGID and/or SLID specified, should validate as member of MC group */ if (comp_mask & IB_PR_COMPMASK_SGID) { if (!osm_mgrp_get_mcm_alias_guid(p_mgrp, - p_pr->sgid.unicast.interface_id)) + p_pr->sgid.unicast.interface_id)) { + char gid_str[INET6_ADDRSTRLEN]; + OSM_LOG(sa->p_log, OSM_LOG_DEBUG, + "SGID %s is not a member of MC group\n", + inet_ntop(AF_INET6, p_pr->sgid.raw, + gid_str, sizeof gid_str)); goto Exit; + } } if (comp_mask & IB_PR_COMPMASK_SLID) { port = osm_get_port_by_lid(sa->p_subn, p_pr->slid); - if (!port || !osm_mgrp_get_mcm_port(p_mgrp, port->guid)) + if (!port || !osm_mgrp_get_mcm_port(p_mgrp, port->guid)) { + OSM_LOG(sa->p_log, OSM_LOG_DEBUG, + "Either no port with SLID %u found or " + "SLID not a member of MC group\n", + cl_ntoh16(p_pr->slid)); goto Exit; + } } /* Also, MTU, rate, packet lifetime, and raw traffic requested are not currently checked */ if ((comp_mask & IB_PR_COMPMASK_PKEY) && - p_pr->pkey != p_mgrp->mcmember_rec.pkey) + p_pr->pkey != p_mgrp->mcmember_rec.pkey) { + OSM_LOG(sa->p_log, OSM_LOG_DEBUG, + "Pkey 0x%x doesn't match MC group Pkey 0x%x\n", + cl_ntoh16(p_pr->pkey), + cl_ntoh16(p_mgrp->mcmember_rec.pkey)); goto Exit; + } ib_member_get_sl_flow_hop(p_mgrp->mcmember_rec.sl_flow_hop, &sl, &flow_label, &hop_limit); - if ((comp_mask & IB_PR_COMPMASK_SL) && ib_path_rec_sl(p_pr) != sl) + if ((comp_mask & IB_PR_COMPMASK_SL) && ib_path_rec_sl(p_pr) != sl) { + OSM_LOG(sa->p_log, OSM_LOG_DEBUG, + "SL %d doesn't match MC group SL %d\n", + ib_path_rec_sl(p_pr), sl); goto Exit; + } /* If SubnAdmGet, assume NumbPaths of 1 (1.2 erratum) */ if ((comp_mask & IB_PR_COMPMASK_NUMBPATH) && sa_mad->method != IB_MAD_METHOD_GET && - ib_path_rec_num_path(p_pr) == 0) + ib_path_rec_num_path(p_pr) == 0) { + OSM_LOG(sa->p_log, OSM_LOG_DEBUG, + "Number of paths requested is 0\n"); goto Exit; + } if ((comp_mask & IB_PR_COMPMASK_FLOWLABEL) && - ib_path_rec_flow_lbl(p_pr) != flow_label) + ib_path_rec_flow_lbl(p_pr) != flow_label) { + OSM_LOG(sa->p_log, OSM_LOG_DEBUG, + "Flow label 0x%x doesn't match MC group " + " flow label 0x%x\n", + ib_path_rec_flow_lbl(p_pr), flow_label); goto Exit; + } if ((comp_mask & IB_PR_COMPMASK_HOPLIMIT) && - ib_path_rec_hop_limit(p_pr) != hop_limit) + ib_path_rec_hop_limit(p_pr) != hop_limit) { + OSM_LOG(sa->p_log, OSM_LOG_DEBUG, + "Hop limit %u doesn't match MC group hop limit %u\n", + ib_path_rec_hop_limit(p_pr), hop_limit); goto Exit; + } + if ((comp_mask & IB_PR_COMPMASK_TCLASS) && - p_pr->tclass != p_mgrp->mcmember_rec.tclass) + p_pr->tclass != p_mgrp->mcmember_rec.tclass) { + OSM_LOG(sa->p_log, OSM_LOG_DEBUG, + "TClass 0x%02x doesn't match MC group TClass 0x%02x\n", + p_pr->tclass, p_mgrp->mcmember_rec.tclass); goto Exit; + } status = IB_SUCCESS;