[ofa-general] ibnetdiscover topology output

Sasha Khapyorsky sashak at voltaire.com
Mon Oct 1 10:01:29 PDT 2007


On 16:30 Tue 25 Sep     , Jeff Becker wrote:
> Hi Sasha. Thanks for the info. I did have the following problem when
> building against the 1.2 libibmad:
> 
> cc -Wall -g -fpic -I. -I../include -I/home/becker//include -c -o
> sim_mad.o sim_mad.c
> sim_mad.c: In function 'encode_trap144':
> sim_mad.c:1261: error: 'IB_NOTICE_DATA_144_LID_F' undeclared (first
> use in this function)
> sim_mad.c:1261: error: (Each undeclared identifier is reported only once
> sim_mad.c:1261: error: for each function it appears in.)
> sim_mad.c:1262: error: 'IB_NOTICE_DATA_144_CAPMASK_F' undeclared
> (first use in this function)
> make[1]: *** [sim_mad.o] Error 1
> make[1]: Leaving directory `/home/becker/ibrouting/ibsim/ibsim'

I guess you can revert this patch in order to build ibsim against
OFED-1.2:


commit b10a01708fb620b7bc4bad17ff51c1b82bda7968
Author: Sasha Khapyorsky <sashak at voltaire.com>
Date:   Wed Jun 6 02:59:07 2007 +0300

    ibsim: trap144 encoder
    
    Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>

diff --git a/ibsim/sim.h b/ibsim/sim.h
index 5a95d12..538e7d7 100644
--- a/ibsim/sim.h
+++ b/ibsim/sim.h
@@ -83,6 +83,7 @@ enum NODE_TYPES {
 
 enum TRAP_TYPE_ID {
 	TRAP_128,
+	TRAP_144,
 
 	TRAP_NUM_LAST
 };
diff --git a/ibsim/sim_mad.c b/ibsim/sim_mad.c
index 680d0e4..970d56e 100644
--- a/ibsim/sim_mad.c
+++ b/ibsim/sim_mad.c
@@ -60,6 +60,7 @@ static Smpfn do_nodeinfo, do_nodedesc, do_switchinfo, do_portinfo,
     do_pkeytbl, do_sl2vl, do_vlarb, do_guidinfo, do_nothing;
 
 static EncodeTrapfn encode_trap128;
+static EncodeTrapfn encode_trap144;
 
 Smpfn *attrs[IB_PERFORMANCE_CLASS + 1][0xff] = {
 	[IB_SMI_CLASS] {[IB_ATTR_NODE_DESC] do_nodedesc,
@@ -89,6 +90,7 @@ Smpfn *attrs[IB_PERFORMANCE_CLASS + 1][0xff] = {
 
 EncodeTrapfn *encodetrap[] = {
 	[TRAP_128] encode_trap128,
+	[TRAP_144] encode_trap144,
 
 	[TRAP_NUM_LAST] 0,
 
@@ -1241,6 +1243,28 @@ static int encode_trap128(Port * port, char *data)
 	return 0;
 }
 
+static int encode_trap144(Port * port, char *data)
+{
+	if (!port->lid || !port->smlid) {
+		VERB("switch trap 144 for lid %d with smlid %d",
+		     port->lid, port->smlid);
+		return -1;
+	}
+
+	mad_set_field(data, 0, IB_NOTICE_IS_GENERIC_F, 1);
+	mad_set_field(data, 0, IB_NOTICE_TYPE_F, 4);	// Informational
+	mad_set_field(data, 0, IB_NOTICE_PRODUCER_F, port->node->type);
+	mad_set_field(data, 0, IB_NOTICE_TRAP_NUMBER_F, 144);
+	mad_set_field(data, 0, IB_NOTICE_ISSUER_LID_F, port->lid);
+	mad_set_field(data, 0, IB_NOTICE_TOGGLE_F, 0);
+	mad_set_field(data, 0, IB_NOTICE_COUNT_F, 0);
+	mad_set_field(data, 0, IB_NOTICE_DATA_144_LID_F, port->lid);
+	mad_set_field(data, 0, IB_NOTICE_DATA_144_CAPMASK_F,
+		      mad_get_field(port->portinfo, 0, IB_PORT_CAPMASK_F));
+
+	return 0;
+}
+
 static int encode_trap_header(char *buf)
 {
 	mad_set_field(buf, 0, IB_MAD_CLASSVER_F, 0x1);	// Class


Sasha



More information about the general mailing list