[openib-general] Re: [OpenSM] SA database query tool

Eitan Zahavi eitan at mellanox.co.il
Wed Nov 9 12:26:23 PST 2005


To query for service record using a particular service ID:
(when the IB cable connected to port 1)
Make sure the port it up using ibstat

EXAMPLE 1
# simple example to show all the fields of the required service ID:
Unix > ibis -port_num 1
% sacServiceQuery configure -service_id 0x00000000643c909d
% set sids [sacServiceQuery getTable $IB_SR_COMPMASK_SID]
% foreach sid $sids {sacServiceRec s -this $sid; puts [s dump]; rename s
""}
-service_id 0x00000000643c909d -service_gid
0x0000000000000000:0x0003c8010ab1d192 -service_pkey 0 -resv 0
-service_lease 4294967295 -service_key  -service_name
osmt.srvc.1681692777.1996 ID=643c909d
 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
0x00000000 0x00000000 0x00000000 0x00000000 0x0000000000000000
0x0000000000000000 
% exit

EXAMPLE 2
# making a script of it (assuming you provide service Id as parameter
(attach to the first active port)
cat > getServiceIdRecords <<EOF
#!/bin/sh
# This file invokes the IBADM In-Band-Bus-Server \\
 exec ibis "\$0" "\$@"
set sid [lindex \$argv 0]

ibis_init
ibis_set_port [lindex [lindex [ibis_get_local_ports_info] 0] 0]
sacServiceQuery configure -service_id \$sid
set sids [sacServiceQuery getTable \$IB_SR_COMPMASK_SID]
set getCmds [info commands sacServiceRec_*_get]
foreach sid \$sids {
   puts
"-----------------------------------------------------------------------
--------------"
   puts "Service Record:"
   foreach c \$getCmds {
       puts "\$c -> [\$c \$sid]"
  }
}
exit
EOF
chmod 755 ./getServiceIdRecords
./getServiceIdRecords 0x643c499e
------------------------------------------------------------------------
-------------
Service Record:
sacServiceRec_service_key_get -> 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
sacServiceRec_service_data8_get -> 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 
sacServiceRec_service_data32_get -> 0x00000000 0x00000000 0x00000000
0x00000000 
sacServiceRec_service_gid_get -> 0x0000000000000000:0x0002c902000017a1
sacServiceRec_service_pkey_get -> 0
sacServiceRec_service_data16_get -> 0x0000 0x0000 0x0000 0x0000 0x0000
0x0000 0x0000 0x0000 
sacServiceRec_service_lease_get -> 4294967295
sacServiceRec_resv_get -> 0
sacServiceRec_service_id_get -> 0x00000000643c499e
sacServiceRec_service_name_get -> osmt.srvc.1681692775.20169
sacServiceRec_service_data64_get -> 0x0000000000000000
0x0000000000000000

MORE DATA
# More options:
Unix > ibis -port_num 1
% # to see all possible fields:
% sacServiceQuery configure
{ -service_id -service_gid -service_pkey -resv -service_lease
-service_key -service_name -service_data8 -service_data16
-service_data32 -service_data64  }
% # to set the service id:
% sacServiceQuery configure -service_id 0x1234567812345678
%# The list of component masks:
IB_SR_COMPMASK_RES1
IB_SR_COMPMASK_SDATA64_0
IB_SR_COMPMASK_SDATA64_1
IB_SR_COMPMASK_SPKEY
IB_SR_COMPMASK_SGID
IB_SR_COMPMASK_SLEASE
IB_SR_COMPMASK_SKEY
IB_SR_COMPMASK_SNAME
IB_SR_COMPMASK_SDATA16_0
IB_SR_COMPMASK_SDATA16_1
IB_SR_COMPMASK_SDATA16_2
IB_SR_COMPMASK_SDATA16_3
IB_SR_COMPMASK_SDATA16_4
IB_SR_COMPMASK_SDATA16_5
IB_SR_COMPMASK_SDATA16_6
IB_SR_COMPMASK_SDATA16_7
IB_SR_COMPMASK_SID
IB_SR_COMPMASK_SDATA8_10
IB_SR_COMPMASK_SDATA8_11
IB_SR_COMPMASK_SDATA8_12
IB_SR_COMPMASK_SDATA8_13
IB_SR_COMPMASK_SDATA8_14
IB_SR_COMPMASK_SDATA8_15
IB_SR_COMPMASK_SDATA32_0
IB_SR_COMPMASK_SDATA32_1
IB_SR_COMPMASK_SDATA32_2
IB_SR_COMPMASK_SDATA8_0
IB_SR_COMPMASK_SDATA32_3
IB_SR_COMPMASK_SDATA8_1
IB_SR_COMPMASK_SDATA8_2
IB_SR_COMPMASK_SDATA8_3
IB_SR_COMPMASK_SDATA8_4
IB_SR_COMPMASK_SDATA8_5
IB_SR_COMPMASK_SDATA8_6
IB_SR_COMPMASK_SDATA8_7
IB_SR_COMPMASK_SDATA8_8
IB_SR_COMPMASK_SDATA8_9


Eitan Zahavi
Design Technology Director
Mellanox Technologies LTD
Tel:+972-4-9097208
Fax:+972-4-9593245
P.O. Box 586 Yokneam 20692 ISRAEL


> -----Original Message-----
> From: James Lentini [mailto:jlentini at netapp.com]
> Sent: Wednesday, November 09, 2005 7:43 PM
> To: Eitan Zahavi
> Cc: openib-general
> Subject: RE: [openib-general] Re: [OpenSM] SA database query tool
> 
> 
> 
> On Wed, 2 Nov 2005, Eitan Zahavi wrote:
> 
> > Hi Again,
> >
> > Ibis is currently under:
> > https://openib.org/svn/gen2/utils/src/linux-user/ibis
> > A doc regarding how to write SA client queries is available in the
file:
> > doc/ibis_wrap.html
> >
> > If you will need more info or examples I will be happy to provide
them.
> 
> I'll take you up on that offer.
> 
> Using IBIS, how would you query for all the SA service records for a
> particular service id?
> 
> james



More information about the general mailing list