[ofa-general] [PATCH 1/2] infiniband-diags/set_mthca_nodedesc.sh: change to work for all HCA's

Ira Weiny weiny2 at llnl.gov
Thu Aug 9 19:03:31 PDT 2007


>From 3abf9ac10ee90f7272969486704c2989d254a2ac Mon Sep 17 00:00:00 2001
From: Ira K. Weiny <weiny2 at llnl.gov>
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 <weiny2 at llnl.gov>
---
 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Modify-set_mthca_nodedesc-to-set-the-node_desc-for-a.patch
Type: application/octet-stream
Size: 1239 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20070809/eda4a548/attachment.obj>


More information about the general mailing list