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

Ira Weiny weiny2 at llnl.gov
Fri Aug 10 09:00:19 PDT 2007


On Thu, 9 Aug 2007 23:10:54 -0400
"Hal Rosenstock" <hal.rosenstock at gmail.com> wrote:

> On 8/9/07, Ira Weiny <weiny2 at llnl.gov> wrote:
> > >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.
> 
> I think the iPath driver may need some change to make this work.

I see the following in ipath_modify_device (OFED 1.2)

	if (device_modify_mask & IB_DEVICE_MODIFY_NODE_DESC)
		memcpy(device->node_desc, device_modify->node_desc, 64);

So I hope this will work?  But like I said it is not tested...

Ira

> 
> >
> > 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
> >
> >
> > _______________________________________________
> > general mailing list
> > general at lists.openfabrics.org
> > http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
> >
> > To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
> >
> >



More information about the general mailing list