>From 3abf9ac10ee90f7272969486704c2989d254a2ac Mon Sep 17 00:00:00 2001
From: Ira K. Weiny <[EMAIL PROTECTED]>
Date: Thu, 9 Aug 2007 16:07:38 -0700
Subject: [PATCH] Modify set_mthca_nodedesc to set the node_desc for any hca 
type found in sysfs.

This has been tested for the MLX4 and mthca cards but not others.

Signed-off-by: Ira K. Weiny <[EMAIL PROTECTED]>
---
 infiniband-diags/scripts/set_mthca_nodedesc.sh |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/infiniband-diags/scripts/set_mthca_nodedesc.sh 
b/infiniband-diags/scripts/set_mthca_nodedesc.sh
index 618373f..4613de6 100755
--- a/infiniband-diags/scripts/set_mthca_nodedesc.sh
+++ b/infiniband-diags/scripts/set_mthca_nodedesc.sh
@@ -1,9 +1,18 @@
 #!/bin/sh
 
-# set the node_desc field in the mthca to the hostname
+# set the node_desc field of any hca found to the defined hostname
 
 . /etc/sysconfig/network
 
-echo -n "$HOSTNAME" >> /sys/class/infiniband/mthca0/node_desc
+ib_sysfs="/sys/class/infiniband"
+
+for hca in `ls $ib_sysfs`; do
+   if [ -f $ib_sysfs/$hca/node_desc ]; then
+      echo -n "$HOSTNAME" >> $ib_sysfs/$hca/node_desc
+   else
+      logger -s "Failed to set node_desc for : $hca"
+   fi
+done
 
 exit 0
+
-- 
1.5.2

Attachment: 0001-Modify-set_mthca_nodedesc-to-set-the-node_desc-for-a.patch
Description: Binary data

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to