From patchwork Wed Apr 21 18:19:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Chu X-Patchwork-Id: 93912 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3LIJ96x016980 for ; Wed, 21 Apr 2010 18:19:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754579Ab0DUSTp (ORCPT ); Wed, 21 Apr 2010 14:19:45 -0400 Received: from nspiron-1.llnl.gov ([128.115.41.81]:56272 "EHLO nspiron-1.llnl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753990Ab0DUSTo (ORCPT ); Wed, 21 Apr 2010 14:19:44 -0400 X-Attachments: 0001-support-diffing-lids-and-nodedesc-on-remoteports-in.patch Received: from auk31.llnl.gov (HELO [134.9.93.159]) ([134.9.93.159]) by nspiron-1.llnl.gov with ESMTP; 21 Apr 2010 11:19:44 -0700 Subject: Re: [infiniband-diags] support diffing lids and nodedesc on remoteports in ibnetdiscover From: Al Chu To: Sasha Khapyorsky Cc: "linux-rdma@vger.kernel.org" In-Reply-To: <1271802640.17987.230.camel@auk31.llnl.gov> References: <1271802640.17987.230.camel@auk31.llnl.gov> Date: Wed, 21 Apr 2010 11:19:44 -0700 Message-Id: <1271873984.17987.244.camel@auk31.llnl.gov> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-19.el5) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 21 Apr 2010 18:19:46 +0000 (UTC) diff --git a/infiniband-diags/man/ibnetdiscover.8 b/infiniband-diags/man/ibnetdiscover.8 index 76cfbc8..3beb70b 100644 --- a/infiniband-diags/man/ibnetdiscover.8 +++ b/infiniband-diags/man/ibnetdiscover.8 @@ -71,7 +71,10 @@ are: \fIsw\fR = switches, \fIca\fR = channel adapters, \fIrouter\fR = routers, \fIport\fR = port connections, \fIlid\fR = lids, \fInodedesc\fR = node descriptions. Note that \fIport\fR, \fIlid\fR, and \fInodedesc\fR are checked only for the node types that are specified (e.g. \fIsw\fR, -\fIca\fR, \fIrouter\fR). +\fIca\fR, \fIrouter\fR). If \fIport\fR is specified alongside \fIlid\fR +or \fInodedesc\fR, remote port lids and node descriptions will also be compared. + + .TP \fB\-p\fR, \fB\-\-ports\fR Obtain a ports report which is a diff --git a/infiniband-diags/src/ibnetdiscover.c b/infiniband-diags/src/ibnetdiscover.c index 57f9625..23e6dd4 100644 --- a/infiniband-diags/src/ibnetdiscover.c +++ b/infiniband-diags/src/ibnetdiscover.c @@ -720,6 +720,26 @@ static void diff_ports(ibnd_node_t * fabric1_node, ibnd_node_t * fabric2_node, fabric2_out++; } + if (data->diff_flags & DIFF_FLAG_PORT_CONNECTION + && data->diff_flags & DIFF_FLAG_NODE_DESCRIPTION + && fabric1_port && fabric2_port + && fabric1_port->remoteport && fabric2_port->remoteport + && memcmp(fabric1_port->remoteport->node->nodedesc, + fabric2_port->remoteport->node->nodedesc, + IB_SMP_DATA_SIZE)) { + fabric1_out++; + fabric2_out++; + } + + if (data->diff_flags & DIFF_FLAG_PORT_CONNECTION + && data->diff_flags & DIFF_FLAG_LID + && fabric1_port && fabric2_port + && fabric1_port->remoteport && fabric2_port->remoteport + && fabric1_port->remoteport->base_lid != fabric2_port->remoteport->base_lid) { + fabric1_out++; + fabric2_out++; + } + if (fabric1_out) { diff_iter_out_header(fabric1_node, data, out_header_flag);