Skip to contentSkip to conversation

infiniband-diags: fix ibidsverify portguid validation.

PATCH New Ira Weiny 1 participant 1 message May 4, 2012 InfiniBand

lore
Share & tools
lore

Ira Weiny

author
#0 lore raw

PATCH 1/1 infiniband-diags: fix ibidsverify portguid validation.

PortGUID may be equal to the NodeGUID of it's own node for 1 port. Duplicate PortGUID's on that node will be detected in insert_portguid

---
 scripts/ibidsverify.pl |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
scripts/ibidsverify.pl +8 -9
index 2552a7b..6f3d309 100755
@@ -136,12 +136,11 @@ sub insert_nodeguid
 sub validate_portguid
 {
 	my ($portguid)  = shift(@_);
-	my ($firstport) = shift(@_);
+	my ($nodeguid)  = shift(@_);
 
-	if (defined($insert_nodeguid::nodeguids{$portguid})
-		&& ($firstport ne "yes"))
-	{
-		print "PortGUID $portguid is invalid duplicate of a NodeGUID\n";
+	if (($nodeguid ne $portguid)
+		&& defined($insert_nodeguid::nodeguids{$portguid})) {
+		print "PortGUID $portguid is an invalid duplicate of a NodeGUID\n";
 	}
 }
 
@@ -150,7 +149,7 @@ sub insert_portguid
 	my ($lid)       = shift(@_);
 	my ($portguid)  = shift(@_);
 	my ($nodetype)  = shift(@_);
-	my ($firstport) = shift(@_);
+	my ($nodeguid)  = shift(@_);
 	my $rec         = undef;
 	my $status      = "";
 
@@ -162,7 +161,7 @@ sub insert_portguid
 		} else {
 			$rec = {lid => $lid, portguid => $portguid};
 			$insert_portguid::portguids{$portguid} = $rec;
-			validate_portguid($portguid, $firstport);
+			validate_portguid($portguid, $nodeguid);
 		}
 	}
 }
@@ -208,7 +207,7 @@ sub main
 			insert_lid($lid, $nodeguid, $nodetype);
 			insert_nodeguid($lid, $nodeguid, $nodetype);
 			if ($portguid ne "") {
-				insert_portguid($lid, $portguid, $nodetype, $firstport);
+				insert_portguid($lid, $portguid, $nodetype, $nodeguid);
 			}
 		}
 		if ($line =~ /^Ca.*/) {
@@ -247,7 +246,7 @@ sub main
 			}
 			if ($line =~ /^\[(\d+)\]\((.*)\)/) {
 				$portguid = "0x" . $2;
-				insert_portguid($lid, $portguid, $nodetype, $firstport);
+				insert_portguid($lid, $portguid, $nodetype, $nodeguid);
 			}
 		}
 
Signature · 6 lines
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html