[ofa-general] libibmad question forward

Sasha Khapyorsky sashak at voltaire.com
Thu Sep 20 09:16:15 PDT 2007


On 16:27 Wed 19 Sep     , Hal Rosenstock wrote:
> On Wed, 2007-09-19 at 16:10 -0700, Jeff Becker wrote:
> > I am trying to use libibmad library for initiating queries of Device
> > Management and other class types. While initializing, the
> > madrpc_init() call fails when I have IB_DEVICE_MGMT_CLASS included as
> > a part of mgmt_classes parameter. This is because mgmt_class_vers()
> > (which is called by mad_register_port_client()/ mad_register_client())
> > fails to return class version for Device Management Class.
> > 
> > I am able to make DM queries if mgmt_class_vers() is fixed i.e. just
> > add a case to return the version for IB_DEVICE_MGMT_CLASS. e.g.
> > 
> > static int
> > mgmt_class_vers(int mgmt_class)
> > 
> > {
> > 
> >        if ((mgmt_class >= IB_VENDOR_RANGE1_START_CLASS &&
> >             mgmt_class <= IB_VENDOR_RANGE1_END_CLASS) ||
> >            (mgmt_class >= IB_VENDOR_RANGE2_START_CLASS &&
> >             mgmt_class <= IB_VENDOR_RANGE2_END_CLASS))
> >               return 1;
> > 
> >         switch(mgmt_class) {
> >               case IB_SMI_CLASS:
> >               case IB_SMI_DIRECT_CLASS:
> >                      return 1;
> >               case IB_SA_CLASS:
> >                      return 2;
> >               case IB_PERFORMANCE_CLASS:
> >                      return 1;
> >               // Change START
> >               case IB_DEVICE_MGMT_CLASS:
> >                      return 1;
> >               // Change END
> >        }
> > 
> >        return 0;
> > 
> > I am wondering if this minor anomaly can be submitted as a bug to
> > broaden the usage of libibmad its usage for DM queries.
> 
> Yes, DM class (and perhaps some other missing GS classes) should be
> added there.

So, I'm going to apply this.

Sasha

>From 46ad958b33c456672e2af711f36b494d398316bb Mon Sep 17 00:00:00 2001
From: Jeff Becker <jeff.c.becker at gmail.com>
Date: Thu, 20 Sep 2007 17:48:55 +0200
Subject: [PATCH] libibmad: add support for IB_DEVICE_MGMT_CLASS

From: Jeff Becker <jeff.c.becker at gmail.com>

This adds IB_DEVICE_MGMT_CLASS to list of classes for which version is
returned.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 libibmad/src/register.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libibmad/src/register.c b/libibmad/src/register.c
index 3d1285a..d80fa14 100644
--- a/libibmad/src/register.c
+++ b/libibmad/src/register.c
@@ -95,6 +95,8 @@ mgmt_class_vers(int mgmt_class)
 			return 2;
 		case IB_PERFORMANCE_CLASS:
 			return 1;
+		case IB_DEVICE_MGMT_CLASS:
+			return 1;
 	}
 
 	return 0;
-- 
1.5.3.1.91.gd3392




More information about the general mailing list