Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* SDP: test bug 2027 and new error
From: Andrea Gozzelino @ 2010-04-28 14:00 UTC (permalink / raw)
  To: Amir Vadai
  Cc: swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <4BD6C9C3.6070905-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>

On Apr 27, 2010 01:25 PM, Amir Vadai <amirv-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org> wrote:

> Andrea Hi,
> 
> I am sorry - the commit missed the 24.4.2010 build which I asked you
> to
> test.
> Please test this build (the latest): OFED-1.5.2-20100426-0600
> 
> - Amir
> 
> 
> On 04/27/2010 01:34 PM, Andrea Gozzelino wrote:
> > Hi Amir, 
> > I have checked the bug solution with OFED-1.5.2-20100425-0600
> > version
> > without success. 
> >
> > TEST LOG:
> > client machine
> > export LD_PRELOAD=/usr/lib64/libsdp.so
> > netperf -H address -c -C -l 60 -- -m 65536
> > tail -f /var/log/libsdp.log 
> >
> > OUTPUT
> > Tue Apr 27 10:08:38 2010 netperf[19051] libsdp Error connect: failed
> > for
> > SDP
> > fd:6 with error:Cannot allocate memory
> > Tue Apr 27 11:47:55 2010 netperf[19081] libsdp Error connect: failed
> > for
> > SDP
> > fd:6 with error:Cannot allocate memory
> >
> > dmesg
> >
> > OUTPUT
> > client_script[13876]: segfault at 00007fffef8de000 rip
> > 000000387d07ad8a
> > rsp
> > 00007fffef8d5648 error 6
> > C_copiato[20437]: segfault at 00007ffff0257b3c rip 00000000004009e3
> > rsp
> > 00007ffff0257b30 error 6
> > client_20[1539]: segfault at 00007fffa2acd85c rip 0000000000400a80
> > rsp
> > 00007fffa2acd850 error 6
> > sdp_init_qp:95 sdp_sock( 2100:2 55190:0): recv sge's. capability: 4
> > needed: 9
> > sdp_init_qp:95 sdp_sock( 2100:2 41003:0): recv sge's. capability: 4
> > needed: 9
> > sdp_init_qp:95 sdp_sock( 2100:2 55192:0): recv sge's. capability: 4
> > needed: 9
> > sdp_init_qp:95 sdp_sock( 2100:2 38542:0): recv sge's. capability: 4
> > needed: 9
> >
> > ------------------
> >
> > server machine
> > export LD_PRELOAD=/usr/lib64/libsdp.so
> > netserver 
> >     Starting netserver at port 12865
> > Starting netserver at hostname 0.0.0.0 port 12865 and family
> > AF_UNSPEC
> >
> > ------------------
> > Amir, I think that bug 2028 is also involved in NE020 SDP working. 
> > Steve, is it possible? 
> > If yes, I will check the bug 2027 and 2028 solutions in July 2010. 
> > Is it correct?
> >
> > I reopen the bug 2027 because I don't see any changes.
> > Please consider that the bug 2027 could be connected with the 2028
> > one
> > in Bugzilla.
> >
> > Keep in touch.
> > Thank you very much.
> > Regards,
> > Andrea
> >
> >
> >
> >
> > Andrea Gozzelino
> >
> > INFN - Laboratori Nazionali di Legnaro	(LNL)
> > Viale dell'Universita' 2
> > I-35020 - Legnaro (PD)- ITALIA
> > Tel: +39 049 8068346
> > Fax: +39 049 641925
> > Mail: andrea.gozzelino-PK20h7lG/Rc1GQ1Ptb7lUw@public.gmane.org			
> >   
> 

Hi Amir,

I have tested your solution of bug 2027 with OFED-1.5.2-20100426-0600.
Netserver/netperf does not work with Socket Direct Protocol SDP.

Now the error in the log file is:
libsdp error connect: failed for SDP fd with error No such device
sdp_init_qp:105 SDP not available on device nes0

I have a look in sdp_cma.c file: I see the message text near the
previous one about # SGE capability.

Amir, could you please comment these error?

Probably I can close the bug 2027 because the solution is OK and I will
open another one about "SDP not available on device nes0".

Steve, is there a connession with the Fast Memory Region (bug 2028)?

At the end, #SGE capability is now OK but SDP on NE020 cards - driver
iw_nes does not work yet properly.
I will wait your suggestions.

Regards,
Andrea


Andrea Gozzelino

INFN - Laboratori Nazionali di Legnaro	(LNL)
Viale dell'Universita' 2
I-35020 - Legnaro (PD)- ITALIA
Tel: +39 049 8068346
Fax: +39 049 641925
Mail: andrea.gozzelino-PK20h7lG/Rc1GQ1Ptb7lUw@public.gmane.org			

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* open-iscsi-generic compile dies on RHEL6
From: Justin Clift @ 2010-04-28  4:24 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hi all,

Getting a simple compilation failure for open-iscsi-generic (from OFED 
1.5.1 release) on RHEL6:

**********************************************************************
...
cc -O2 -g -Wall -Wstrict-prototypes -I../include -DLinux 
-DNETLINK_ISCSI=8 -D_GNU_SOURCE   -c -o iscsistart.o iscsistart.c
cc -O2 -g -Wall -Wstrict-prototypes -I../include -DLinux 
-DNETLINK_ISCSI=8 -D_GNU_SOURCE   -c -o statics.o statics.c
cc -O2 -g -Wall -Wstrict-prototypes -I../include -DLinux 
-DNETLINK_ISCSI=8 -D_GNU_SOURCE -static netlink.o util.o io.o auth.o 
login.o log.o md5.o sha1.o iscsi_sysfs.o idbm.o initiator.o queue.o 
actor.o mgmt_ipc.o isns.o transport.o iscsistart.o statics.o -o iscsistart
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
make: *** [iscsistart] Error 1
+ echo 'Failed to build open-iscsi userspace code, cleaning up...'

**********************************************************************

Seems pretty basic, and generally I'd think this box is missing a -devel 
library, but the glibc-devel libraries (i686 and x86_64) are installed.

Anyone have any ideas?  This isn't urgent for me, as I'm not using 
iSCSI/iSER atm, more mentioning in case anyone has suggestions as I'm 
willing to try them. :)

Regards and best wishes,

Justin Clift

-- 
Salasaga  -  Open Source eLearning IDE
               http://www.salasaga.org
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Initial patch for OFED 1.5.x to work on RHEL 6
From: Justin Clift @ 2010-04-28  4:13 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hi all,

Taking a look at the RHEL6 beta at the moment.  It was failing 
compilation of OFED 1.5.1 release on the main ofa kernel rpm, giving the 
same error reported by Jeremy Enos back in Aug 2009 on Fedora 10.

Thankfully the problem turned out to be a bug in the scripting in the 
rpm's spec file, easily fixed, which let's this now compile fine:

**********************************************************

--- ofa_kernel.spec_orig	2010-04-28 13:01:43.505217495 +1000
+++ ofa_kernel.spec	2010-04-28 13:52:44.386217393 +1000
@@ -188,6 +188,7 @@
  if [ -n "$modsyms" ]; then
  	for modsym in $modsyms
  	do
+		mkdir -p $RPM_BUILD_ROOT/%{_prefix}/src/%{_name}
  	        cat $modsym >> 
$RPM_BUILD_ROOT/%{_prefix}/src/%{_name}/Module.symvers
  	done
  else
@@ -800,9 +801,7 @@
  %files -n kernel-ib-devel
  %defattr(-,root,root,-)
  %dir %{_prefix}/src
-%{_prefix}/src/%{_name}-%{_version}
  %{_prefix}/src/%{_name}
-%{_prefix}/src/openib
  %endif

  # END Files

**********************************************************

The "mkdir -p" is the important part that needed adding, and should be 
safe to add on all the platforms.

Near the end however, it needed the removal of two directories not built 
on RHEL 6.  Not sure if they do get built on other platforms though. 
Vladimir Sokolovsky would probably know. :)

Hope that helps.

Regards and best wishes,

Justin Clift

-- 
Salasaga  -  Open Source eLearning IDE
               http://www.salasaga.org
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* RoCE supplement to IB Spec
From: Pradeep Satyanarayana @ 2010-04-28  0:31 UTC (permalink / raw)
  To: linux-rdma, EWG

Is it the intent that the RoCE implementation in OFED-1.5.1 corresponds to the RoCE supplement to the IB spec dated April 6th 2010,
excepting bugs of course? Or are there known deviations from the spec?

Pradeep

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: When will the Wiki be update-able?
From: Jeff Becker @ 2010-04-27 16:07 UTC (permalink / raw)
  To: Justin Clift
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Jeffrey Scott,
	Bill Boas, jim.ryan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
In-Reply-To: <4BD702A8.7000707-oNuxUQfTmABg9hUCZPvPmw@public.gmane.org>

Hi Justin

Justin Clift wrote:
> Does anyone know when the wiki will be open to updates?
>   

Jeff Scott said he would look into this as I don't have spare cycles
right now. Jeff do you have any status? Thanks.

-jeff
> Having been doing a lot of work in the last few days with SRP on 
> RHEL/Centos 5.4, and am looking for some place to write up the steps to 
> get it working.
>
> There seems to be lots of pitfalls if things aren't done in a specific 
> order, so thinking this might be useful for others.
>
> However, with the wiki being closed to updates, that's not going to work.
>
> Alternatively, is there a better place for putting the info?
>
> Regards and best wishes,
>
> Justin Clift
>
>   

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* When will the Wiki be update-able?
From: Justin Clift @ 2010-04-27 15:28 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Does anyone know when the wiki will be open to updates?

Having been doing a lot of work in the last few days with SRP on 
RHEL/Centos 5.4, and am looking for some place to write up the steps to 
get it working.

There seems to be lots of pitfalls if things aren't done in a specific 
order, so thinking this might be useful for others.

However, with the wiki being closed to updates, that's not going to work.

Alternatively, is there a better place for putting the info?

Regards and best wishes,

Justin Clift

-- 
Salasaga  -  Open Source eLearning IDE
               http://www.salasaga.org
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* libibnetdisc: Add grouping for Voltaire's ISR4700 switch
From: sebastien dugue @ 2010-04-27 12:35 UTC (permalink / raw)
  To: Sasha Khapyorsky; +Cc: linux-rdma, Yair Goldel, OF EWG


  The ISR4700 features 3 kind of boards:
    
  - sLB-4018 line board with a single 36 port asic
  - sFB-4700 fabric board with a single 36 port asic
  - sFB-4700X2 double density fabric board with 2 36 port asics
    
  The double density fabric board (sFB-4700X2) features external 12X
connectors that are only an aggregation of 3 4X ports, therefore
ext_portnum is set to match the number printed on the faceplate.
    
Signed-off-by: Sebastien Dugue <sebastien.dugue-6ktuUTfB/bM@public.gmane.org>

diff --git a/infiniband-diags/libibnetdisc/include/infiniband/ibnetdisc.h b/infiniband-diags/libibnetdisc/include/infiniband/ibnetdisc.h
index 136282c..2735224 100644
--- a/infiniband-diags/libibnetdisc/include/infiniband/ibnetdisc.h
+++ b/infiniband-diags/libibnetdisc/include/infiniband/ibnetdisc.h
@@ -121,7 +121,7 @@ typedef struct ibnd_chassis {
 	ibnd_node_t *nodes;
 
 	/* specific to voltaire type nodes */
-#define SPINES_MAX_NUM 12
+#define SPINES_MAX_NUM 18
 #define LINES_MAX_NUM 36
 	ibnd_node_t *spinenode[SPINES_MAX_NUM + 1];
 	ibnd_node_t *linenode[LINES_MAX_NUM + 1];
diff --git a/infiniband-diags/libibnetdisc/src/chassis.c b/infiniband-diags/libibnetdisc/src/chassis.c
index 80e034b..cd2113f 100644
--- a/infiniband-diags/libibnetdisc/src/chassis.c
+++ b/infiniband-diags/libibnetdisc/src/chassis.c
@@ -49,8 +49,8 @@
 #include "internal.h"
 #include "chassis.h"
 
-static char *ChassisTypeStr[5] =
-    { "", "ISR9288", "ISR9096", "ISR2012", "ISR2004" };
+static char *ChassisTypeStr[6] =
+{ "", "ISR9288", "ISR9096", "ISR2012", "ISR2004", "ISR4700" };
 static char *ChassisSlotTypeStr[4] = { "", "Line", "Spine", "SRBD" };
 
 typedef struct chassis_scan {
@@ -71,7 +71,7 @@ char *ibnd_get_chassis_type(ibnd_node_t * node)
 		return NULL;
 	if (!node->chassis)
 		return NULL;
-	if (node->ch_type == UNRESOLVED_CT || node->ch_type > ISR2004_CT)
+	if (node->ch_type == UNRESOLVED_CT || node->ch_type > ISR4700_CT)
 		return NULL;
 	return ChassisTypeStr[node->ch_type];
 }
@@ -273,10 +273,23 @@ static int is_spine_2012(ibnd_node_t * n)
 	return (devid == VTR_DEVID_SFB2012);
 }
 
+static int is_spine_4700(ibnd_node_t * n)
+{
+	uint32_t devid = mad_get_field(n->info, 0, IB_NODE_DEVID_F);
+	return (devid == VTR_DEVID_SFB4700);
+}
+
+static int is_spine_4700x2(ibnd_node_t * n)
+{
+	uint32_t devid = mad_get_field(n->info, 0, IB_NODE_DEVID_F);
+	return (devid == VTR_DEVID_SFB4700X2);
+}
+
 static int is_spine(ibnd_node_t * n)
 {
 	return (is_spine_9096(n) || is_spine_9288(n) ||
-		is_spine_2004(n) || is_spine_2012(n));
+		is_spine_2004(n) || is_spine_2012(n) ||
+		is_spine_4700(n) || is_spine_4700x2(n));
 }
 
 static int is_line_24(ibnd_node_t * n)
@@ -298,9 +311,16 @@ static int is_line_2024(ibnd_node_t * n)
 	return (devid == VTR_DEVID_SLB2024);
 }
 
+static int is_line_4700(ibnd_node_t * n)
+{
+	uint32_t devid = mad_get_field(n->info, 0, IB_NODE_DEVID_F);
+	return (devid == VTR_DEVID_SLB4018);
+}
+
 static int is_line(ibnd_node_t * n)
 {
-	return (is_line_24(n) || is_line_8(n) || is_line_2024(n));
+	return (is_line_24(n) || is_line_8(n) ||
+		is_line_2024(n) || is_line_4700(n));
 }
 
 int is_chassis_switch(ibnd_node_t * n)
@@ -309,52 +329,100 @@ int is_chassis_switch(ibnd_node_t * n)
 }
 
 /* these structs help find Line (Anafa) slot number while using spine portnum */
-char line_slot_2_sfb4[25] = {
-	0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4,
-	4
+char line_slot_2_sfb4[37] = {
+	0,
+	1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3,
+	4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+char anafa_line_slot_2_sfb4[37] = {
+	0,
+	1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2,
+	1, 1, 1, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
-char anafa_line_slot_2_sfb4[25] = {
-	0, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2,
-	2
+char line_slot_2_sfb12[37] = {
+	0,
+	1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,
+	10, 10, 11, 11, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+char anafa_line_slot_2_sfb12[37] = {
+	0,
+	1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2,
+	1, 2, 1, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
-char line_slot_2_sfb12[25] = {
-	0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
-	12, 12
+/* LB slot = table[spine port] */
+char line_slot_2_sfb18[37] = {
+	0,
+	1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,
+	10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18};
+/* LB asic num = table[spine port] */
+char anafa_line_slot_2_sfb18[37] = {
+	0,
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
 };
 
-char anafa_line_slot_2_sfb12[25] = {
-	0, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1,
-	2
+/* LB slot = table[spine port] */
+char line_slot_2_sfb18x2[37] = {
+	0,
+	1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
+	0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0,  0,  0,  0,  0,  0,  0};
+/* LB asic num = table[spine port] */
+char anafa_line_slot_2_sfb18x2[37] = {
+	0,
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
 /* IPR FCR modules connectivity while using sFB4 port as reference */
-char ipr_slot_2_sfb4_port[25] = {
-	0, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2,
-	1
+char ipr_slot_2_sfb4_port[37] = {
+	0,
+	3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1,
+	3, 2, 1, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
 /* these structs help find Spine (Anafa) slot number while using spine portnum */
-char spine12_slot_2_slb[25] = {
-	0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0
+char spine12_slot_2_slb[37] = {
+	0,
+	1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
-
-char anafa_spine12_slot_2_slb[25] = {
-	0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0
+char anafa_spine12_slot_2_slb[37] = {
+	0,
+	1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
-char spine4_slot_2_slb[25] = {
-	0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0
+char spine4_slot_2_slb[37] = {
+	0,
+	1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+char anafa_spine4_slot_2_slb[37] = {
+	0,
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
 
-char anafa_spine4_slot_2_slb[25] = {
-	0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0
+/* FB slot = table[line port] */
+char spine18_slot_2_slb[37] = {
+	0,
+	1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+/* FB asic = table[line port] */
+char anafa_spine18_slot_2_slb[37] = {
+	0,
+	1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
 };
+char anafa_spine18x2_slot_2_slb[37] = {
+	0,
+	2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
 
 /*	reference                     { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 }; */
 
@@ -377,6 +445,14 @@ static int get_sfb_slot(ibnd_node_t * n, ibnd_port_t * lineport)
 		n->ch_type = ISR2004_CT;
 		n->ch_slotnum = spine4_slot_2_slb[lineport->portnum];
 		n->ch_anafanum = anafa_spine4_slot_2_slb[lineport->portnum];
+	} else if (is_spine_4700(n)) {
+		n->ch_type = ISR4700_CT;
+		n->ch_slotnum = spine18_slot_2_slb[lineport->portnum];
+		n->ch_anafanum = anafa_spine18_slot_2_slb[lineport->portnum];
+	} else if (is_spine_4700x2(n)) {
+		n->ch_type = ISR4700_CT;
+		n->ch_slotnum = spine18_slot_2_slb[lineport->portnum];
+		n->ch_anafanum = anafa_spine18x2_slot_2_slb[lineport->portnum];
 	} else {
 		IBND_ERROR("Unexpected node found: guid 0x%016" PRIx64 "\n",
 			   n->guid);
@@ -445,6 +521,14 @@ static int get_slb_slot(ibnd_node_t * n, ibnd_port_t * spineport)
 		n->ch_type = ISR2004_CT;
 		n->ch_slotnum = line_slot_2_sfb4[spineport->portnum];
 		n->ch_anafanum = anafa_line_slot_2_sfb4[spineport->portnum];
+	} else if (is_spine_4700(spineport->node)) {
+		n->ch_type = ISR4700_CT;
+		n->ch_slotnum = line_slot_2_sfb18[spineport->portnum];
+		n->ch_anafanum = anafa_line_slot_2_sfb18[spineport->portnum];
+	} else if (is_spine_4700x2(spineport->node)) {
+		n->ch_type = ISR4700_CT;
+		n->ch_slotnum = line_slot_2_sfb18x2[spineport->portnum];
+		n->ch_anafanum = anafa_line_slot_2_sfb18x2[spineport->portnum];
 	} else {
 		IBND_ERROR("Unexpected node found: guid 0x%016" PRIx64 "\n",
 			   spineport->node->guid);
@@ -479,11 +563,22 @@ static int fill_voltaire_chassis_record(ibnd_node_t * node)
 			port = node->ports[p];
 			if (port && is_spine(port->remoteport->node))
 				get_router_slot(node, port->remoteport);
-	} else if (is_spine(node))
+		}
+	else if (is_spine(node)) {
+		int is_4700x2 = is_spine_4700x2(node);
+
 		for (p = 1; p <= node->numports; p++) {
 			port = node->ports[p];
 			if (!port || !port->remoteport)
 				continue;
+
+			/*
+			 * Skip ISR4700 double density fabric boards ports 19-36
+			 * as they are chassis external ports
+			 */
+			if (is_4700x2 && (port->portnum > 18))
+				continue;
+
 			remnode = port->remoteport->node;
 			if (remnode->type != IB_NODE_SWITCH) {
 				if (!remnode->ch_found)
@@ -498,16 +593,24 @@ static int fill_voltaire_chassis_record(ibnd_node_t * node)
 			/* we could break here, but need to find if more routers connected */
 		}
 
-	else if (is_line(node))
+	} else if (is_line(node)) {
+		int is_4700_line = is_line_4700(node);
+
 		for (p = 1; p <= node->numports; p++) {
 			port = node->ports[p];
-			if (!port || port->portnum > 12 || !port->remoteport)
+			if (!port || !port->remoteport)
+				continue;
+
+			if ((is_4700_line && (port->portnum > 18)) ||
+			    (!is_4700_line && (port->portnum > 12)))
 				continue;
+
 			/* we assume here that remoteport belongs to spine */
 			if (get_slb_slot(node, port->remoteport))
 				return -1;
 			break;
 		}
+	}
 
 	/* for each port of this node, map external ports */
 	for (p = 1; p <= node->numports; p++) {
@@ -522,9 +625,15 @@ static int fill_voltaire_chassis_record(ibnd_node_t * node)
 
 static int get_line_index(ibnd_node_t * node)
 {
-	int retval = 3 * (node->ch_slotnum - 1) + node->ch_anafanum;
+	int retval;
+
+	if (is_line_4700(node))
+		retval = node->ch_slotnum;
+	else
+		retval = 3 * (node->ch_slotnum - 1) + node->ch_anafanum;
 
 	if (retval > LINES_MAX_NUM || retval < 1) {
+		printf("%s: retval = %d\n", __FUNCTION__, retval);
 		IBND_ERROR("Internal error\n");
 		return -1;
 	}
@@ -537,6 +646,8 @@ static int get_spine_index(ibnd_node_t * node)
 
 	if (is_spine_9288(node) || is_spine_2012(node))
 		retval = 3 * (node->ch_slotnum - 1) + node->ch_anafanum;
+	else if (is_spine_4700(node) || is_spine_4700x2(node))
+		retval = 2 * (node->ch_slotnum - 1) + node->ch_anafanum;
 	else
 		retval = node->ch_slotnum;
 
@@ -584,14 +695,23 @@ static int pass_on_lines_catch_spines(ibnd_chassis_t * chassis)
 	int i, p;
 
 	for (i = 1; i <= LINES_MAX_NUM; i++) {
+		int is_4700_line;
+
 		node = chassis->linenode[i];
 
 		if (!(node && is_line(node)))
 			continue;	/* empty slot or router */
 
+		is_4700_line = is_line_4700(node);
+
 		for (p = 1; p <= node->numports; p++) {
+
 			port = node->ports[p];
-			if (!port || port->portnum > 12 || !port->remoteport)
+			if (!port || !port->remoteport)
+				continue;
+
+			if ((is_4700_line && (port->portnum > 18)) ||
+			    (!is_4700_line && (port->portnum > 12)))
 				continue;
 
 			remnode = port->remoteport->node;
@@ -612,17 +732,31 @@ static int pass_on_spines_catch_lines(ibnd_chassis_t * chassis)
 	int i, p;
 
 	for (i = 1; i <= SPINES_MAX_NUM; i++) {
+		int is_4700x2;
+
 		node = chassis->spinenode[i];
 		if (!node)
 			continue;	/* empty slot */
+
+		is_4700x2 = is_spine_4700x2(node);
+
 		for (p = 1; p <= node->numports; p++) {
 			port = node->ports[p];
 			if (!port || !port->remoteport)
 				continue;
+
+			/*
+			 * ISR4700 double density fabric board ports 19-36 are
+			 * chassis external ports, so skip them
+			 */
+			if (is_4700x2 && (port->portnum > 18))
+				continue;
+
 			remnode = port->remoteport->node;
 
 			if (!remnode->ch_found)
 				continue;	/* some error - line/router not initialized ? FIXME */
+
 			if (insert_line_router(remnode, chassis))
 				return -1;
 		}
@@ -667,9 +801,18 @@ static int build_chassis(ibnd_node_t * node, ibnd_chassis_t * chassis)
 
 	/* loop: pass on all ports of node */
 	for (p = 1; p <= node->numports; p++) {
+
 		port = node->ports[p];
 		if (!port || !port->remoteport)
 			continue;
+
+		/*
+		 * ISR4700 double density fabric board ports 19-36 are
+		 * chassis external ports, so skip them
+		 */
+		if (is_spine_4700x2(node) && (port->portnum > 18))
+			continue;
+
 		remnode = port->remoteport->node;
 
 		if (!remnode->ch_found)
@@ -738,6 +881,21 @@ ext port | 1 2 3 4 5 6 7 8 9 10 11 12
 A2 int port| 13 14 15 16 17 18 19 20 21 22 23 24
 ---------------------------------------------------
 
+Module : sLB-4018
+
+int port | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
+ext port |  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18
+---------------------------------------------------
+
+Module : sFB-4700X2
+
+  12X port -> 3 x 4X ports:
+
+A1 int port | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
+   ext port |  7  7  7  8  8  8  9  9  9 10 10 10 11 11 11 12 12 12
+A2 int port | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
+   ext port |  1  1  1  2  2  2  3  3  3  4  4  4  5  5  5  6  6  6
+
 */
 
 int int2ext_map_slb24[2][25] = {
@@ -761,6 +919,21 @@ int int2ext_map_slb2024[2][25] = {
 	 11, 12}
 };
 
+int int2ext_map_slb4018[37] = {
+	0,
+	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18
+};
+
+int int2ext_map_sfb4700x2[2][37] = {
+	{0,
+	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 12},
+	{0,
+	 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+	 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6}
+};
+
 /*	reference			{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 }; */
 
 /* map internal ports to external ports if appropriate */
@@ -769,12 +942,22 @@ static void voltaire_portmap(ibnd_port_t * port)
 	int portnum = port->portnum;
 	int chipnum = 0;
 	ibnd_node_t *node = port->node;
+	int is_4700_line = is_line_4700(node);
+	int is_4700x2_spine = is_spine_4700x2(node);
 
-	if (!node->ch_found || !is_line(node) || (portnum < 13 || portnum > 24)) {
+	if (!node->ch_found || (!is_line(node) && !is_4700x2_spine)) {
 		port->ext_portnum = 0;
 		return;
 	}
 
+	if (((is_4700_line || is_4700x2_spine) &&
+	     (portnum < 19 || portnum > 36)) ||
+	    ((!is_4700_line && !is_4700x2_spine) &&
+	     (portnum < 13 || portnum > 24))) {
+			port->ext_portnum = 0;
+		return;
+	}
+
 	if (port->node->ch_anafanum < 1 || port->node->ch_anafanum > 2) {
 		port->ext_portnum = 0;
 		return;
@@ -786,6 +969,12 @@ static void voltaire_portmap(ibnd_port_t * port)
 		port->ext_portnum = int2ext_map_slb24[chipnum][portnum];
 	else if (is_line_2024(node))
 		port->ext_portnum = int2ext_map_slb2024[chipnum][portnum];
+	/* sLB-4018: Only one asic per LB */
+	else if (is_4700_line)
+		port->ext_portnum = int2ext_map_slb4018[portnum];
+	/* sFB-4700X2 4X port */
+	else if (is_4700x2_spine)
+		port->ext_portnum = int2ext_map_sfb4700x2[chipnum][portnum];
 	else
 		port->ext_portnum = int2ext_map_slb8[chipnum][portnum];
 }
diff --git a/infiniband-diags/libibnetdisc/src/chassis.h b/infiniband-diags/libibnetdisc/src/chassis.h
index 2191046..f8e0ee2 100644
--- a/infiniband-diags/libibnetdisc/src/chassis.h
+++ b/infiniband-diags/libibnetdisc/src/chassis.h
@@ -70,6 +70,9 @@
 #define VTR_DEVID_SFB2004		0x5a40
 #define VTR_DEVID_ISR2004		0x5a41
 #define VTR_DEVID_SRB2004		0x5a42
+#define VTR_DEVID_SLB4018		0x5a5b
+#define VTR_DEVID_SFB4700		0x5a5c
+#define VTR_DEVID_SFB4700X2		0x5a5d
 
 /* Vendor IDs (for chassis based systems) */
 #define VTR_VENDOR_ID			0x8f1	/* Voltaire */
@@ -78,7 +81,8 @@
 #define XS_VENDOR_ID			0x1397	/* Xsigo */
 
 enum ibnd_chassis_type {
-	UNRESOLVED_CT, ISR9288_CT, ISR9096_CT, ISR2012_CT, ISR2004_CT
+	UNRESOLVED_CT, ISR9288_CT, ISR9096_CT, ISR2012_CT, ISR2004_CT,
+	ISR4700_CT
 };
 enum ibnd_chassis_slot_type { UNRESOLVED_CS, LINE_CS, SPINE_CS, SRBD_CS };

^ permalink raw reply related

* Re: failed test on bug 2027
From: Amir Vadai @ 2010-04-27 11:25 UTC (permalink / raw)
  To: Andrea Gozzelino
  Cc: swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <5464727.1272364442704.SLOX.WebMail.wwwrun-XDIR3SKYeFbgKi2NxijLtw@public.gmane.org>

Andrea Hi,

I am sorry - the commit missed the 24.4.2010 build which I asked you to
test.
Please test this build (the latest): OFED-1.5.2-20100426-0600

- Amir


On 04/27/2010 01:34 PM, Andrea Gozzelino wrote:
> Hi Amir, 
> I have checked the bug solution with OFED-1.5.2-20100425-0600 version
> without success. 
>
> TEST LOG:
> client machine
> export LD_PRELOAD=/usr/lib64/libsdp.so
> netperf -H address -c -C -l 60 -- -m 65536
> tail -f /var/log/libsdp.log 
>
> OUTPUT
> Tue Apr 27 10:08:38 2010 netperf[19051] libsdp Error connect: failed for
> SDP
> fd:6 with error:Cannot allocate memory
> Tue Apr 27 11:47:55 2010 netperf[19081] libsdp Error connect: failed for
> SDP
> fd:6 with error:Cannot allocate memory
>
> dmesg
>
> OUTPUT
> client_script[13876]: segfault at 00007fffef8de000 rip 000000387d07ad8a
> rsp
> 00007fffef8d5648 error 6
> C_copiato[20437]: segfault at 00007ffff0257b3c rip 00000000004009e3 rsp
> 00007ffff0257b30 error 6
> client_20[1539]: segfault at 00007fffa2acd85c rip 0000000000400a80 rsp
> 00007fffa2acd850 error 6
> sdp_init_qp:95 sdp_sock( 2100:2 55190:0): recv sge's. capability: 4
> needed: 9
> sdp_init_qp:95 sdp_sock( 2100:2 41003:0): recv sge's. capability: 4
> needed: 9
> sdp_init_qp:95 sdp_sock( 2100:2 55192:0): recv sge's. capability: 4
> needed: 9
> sdp_init_qp:95 sdp_sock( 2100:2 38542:0): recv sge's. capability: 4
> needed: 9
>
> ------------------
>
> server machine
> export LD_PRELOAD=/usr/lib64/libsdp.so
> netserver 
>     Starting netserver at port 12865
> Starting netserver at hostname 0.0.0.0 port 12865 and family AF_UNSPEC
>
> ------------------
> Amir, I think that bug 2028 is also involved in NE020 SDP working. 
> Steve, is it possible? 
> If yes, I will check the bug 2027 and 2028 solutions in July 2010. 
> Is it correct?
>
> I reopen the bug 2027 because I don't see any changes.
> Please consider that the bug 2027 could be connected with the 2028 one
> in Bugzilla.
>
> Keep in touch.
> Thank you very much.
> Regards,
> Andrea
>
>
>
>
> Andrea Gozzelino
>
> INFN - Laboratori Nazionali di Legnaro	(LNL)
> Viale dell'Universita' 2
> I-35020 - Legnaro (PD)- ITALIA
> Tel: +39 049 8068346
> Fax: +39 049 641925
> Mail: andrea.gozzelino-PK20h7lG/Rc1GQ1Ptb7lUw@public.gmane.org			
>   
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* failed test on bug 2027
From: Andrea Gozzelino @ 2010-04-27 10:34 UTC (permalink / raw)
  To: amirv-VPRAkNaXOzVS1MOuV/RT9w
  Cc: swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1908 bytes --]

Hi Amir, 
I have checked the bug solution with OFED-1.5.2-20100425-0600 version
without success. 

TEST LOG:
client machine
export LD_PRELOAD=/usr/lib64/libsdp.so
netperf -H address -c -C -l 60 -- -m 65536
tail -f /var/log/libsdp.log 

OUTPUT
Tue Apr 27 10:08:38 2010 netperf[19051] libsdp Error connect: failed for
SDP
fd:6 with error:Cannot allocate memory
Tue Apr 27 11:47:55 2010 netperf[19081] libsdp Error connect: failed for
SDP
fd:6 with error:Cannot allocate memory

dmesg

OUTPUT
client_script[13876]: segfault at 00007fffef8de000 rip 000000387d07ad8a
rsp
00007fffef8d5648 error 6
C_copiato[20437]: segfault at 00007ffff0257b3c rip 00000000004009e3 rsp
00007ffff0257b30 error 6
client_20[1539]: segfault at 00007fffa2acd85c rip 0000000000400a80 rsp
00007fffa2acd850 error 6
sdp_init_qp:95 sdp_sock( 2100:2 55190:0): recv sge's. capability: 4
needed: 9
sdp_init_qp:95 sdp_sock( 2100:2 41003:0): recv sge's. capability: 4
needed: 9
sdp_init_qp:95 sdp_sock( 2100:2 55192:0): recv sge's. capability: 4
needed: 9
sdp_init_qp:95 sdp_sock( 2100:2 38542:0): recv sge's. capability: 4
needed: 9

------------------

server machine
export LD_PRELOAD=/usr/lib64/libsdp.so
netserver 
    Starting netserver at port 12865
Starting netserver at hostname 0.0.0.0 port 12865 and family AF_UNSPEC

------------------
Amir, I think that bug 2028 is also involved in NE020 SDP working. 
Steve, is it possible? 
If yes, I will check the bug 2027 and 2028 solutions in July 2010. 
Is it correct?

I reopen the bug 2027 because I don't see any changes.
Please consider that the bug 2027 could be connected with the 2028 one
in Bugzilla.

Keep in touch.
Thank you very much.
Regards,
Andrea




Andrea Gozzelino

INFN - Laboratori Nazionali di Legnaro	(LNL)
Viale dell'Universita' 2
I-35020 - Legnaro (PD)- ITALIA
Tel: +39 049 8068346
Fax: +39 049 641925
Mail: andrea.gozzelino-PK20h7lG/Rc1GQ1Ptb7lUw@public.gmane.org			

[-- Attachment #2: test.txt --]
[-- Type: text/plain, Size: 1207 bytes --]

client machine
export LD_PRELOAD=/usr/lib64/libsdp.so
netperf -H address -c -C -l 60 -- -m 65536
tail -f /var/log/libsdp.log 

OUTPUT
Tue Apr 27 10:08:38 2010 netperf[19051] libsdp Error connect: failed for SDP fd:6 with error:Cannot allocate memory
Tue Apr 27 11:47:55 2010 netperf[19081] libsdp Error connect: failed for SDP fd:6 with error:Cannot allocate memory

dmesg

OUTPUT
client_script[13876]: segfault at 00007fffef8de000 rip 000000387d07ad8a rsp 00007fffef8d5648 error 6
C_copiato[20437]: segfault at 00007ffff0257b3c rip 00000000004009e3 rsp 00007ffff0257b30 error 6
client_20[1539]: segfault at 00007fffa2acd85c rip 0000000000400a80 rsp 00007fffa2acd850 error 6
sdp_init_qp:95 sdp_sock( 2100:2 55190:0): recv sge's. capability: 4 needed: 9
sdp_init_qp:95 sdp_sock( 2100:2 41003:0): recv sge's. capability: 4 needed: 9
sdp_init_qp:95 sdp_sock( 2100:2 55192:0): recv sge's. capability: 4 needed: 9
sdp_init_qp:95 sdp_sock( 2100:2 38542:0): recv sge's. capability: 4 needed: 9

------------------

server machine
export LD_PRELOAD=/usr/lib64/libsdp.so
netserver 
    Starting netserver at port 12865
    Starting netserver at hostname 0.0.0.0 port 12865 and family AF_UNSPEC

------------------



^ permalink raw reply

* email list for sale
From: Bridgette W Dillon @ 2010-04-27  2:33 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA, gunther.isbarn-mMoM9khtwMk,
	roller-boyd13-rN3PHIWzTs1Jm/Hvfsr4+Q,
	buenodad-Re5JQEeQqe8AvxtiuMwx3w

I have many good quality American Contact Lists at much lower prices than most sites. Contact me here:  successtools-KK0ffGbhmjU@public.gmane.org for a complete catalogue of what we have.

Best Regards


Renee Foster
 
  


Send us an email to  we will discontinue from the list
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [infiniband-diags] [4/4] support --filterdownports in iblinkinfo
From: Al Chu @ 2010-04-26 21:39 UTC (permalink / raw)
  To: Sasha Khapyorsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

[-- Attachment #1: Type: text/plain, Size: 660 bytes --]

Hi Sasha,

This patch supports a new option called --filterdownports.  The option
will remove downports from the output if they were previously listed as
down in a cache.

This option is useful for clusters that have unpopulated switch ports.
Many system administrators look for the word "Down" in the iblinkinfo
output, however, that ability is limited when so many of the ports are
down all the time b/c of unpopulated ports.  This option attempts to
remove that limitation for clusters with unpopulated ports.

Al

-- 
Albert Chu
chu11-i2BcT+NCU+M@public.gmane.org
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory

[-- Attachment #2: 0004-support-filterdownports-in-iblinkinfo.patch --]
[-- Type: message/rfc822, Size: 4431 bytes --]

From: Albert Chu <chu11-i2BcT+NCU+M@public.gmane.org>
Subject: [PATCH] support --filterdownports in iblinkinfo
Date: Wed, 21 Apr 2010 17:04:02 -0700
Message-ID: <1272317488.29737.29.camel-X2zTWyBD0EhliZ7u+bvwcg@public.gmane.org>


Signed-off-by: Albert Chu <chu11-i2BcT+NCU+M@public.gmane.org>
---
 infiniband-diags/man/iblinkinfo.8 |    9 ++++++++
 infiniband-diags/src/iblinkinfo.c |   40 +++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/infiniband-diags/man/iblinkinfo.8 b/infiniband-diags/man/iblinkinfo.8
index 65ea919..940d008 100644
--- a/infiniband-diags/man/iblinkinfo.8
+++ b/infiniband-diags/man/iblinkinfo.8
@@ -66,6 +66,15 @@ Comma separate multiple diff check key(s).  The available diff checks
 are:\fIport\fR = port connections, \fIstate\fR = port state, \fIlid\fR = lids,
 \fInodedesc\fR = node descriptions.  If \fIport\fR is specified alongside \fIlid\fR
 or \fInodedesc\fR, remote port lids and node descriptions will also be compared.
+.TP
+\fB\-\-filterdownports\fR <filename>
+Filter downports indicated in a ibnetdiscover cache.  If a port was previously
+indicated as down in the specified cache, and is still down, do not output it in the
+resulting output.  This option may be particularly useful for environments
+where switches are not fully populated, thus much of the default iblinkinfo
+info is considered unuseful.  See
+.B ibnetdiscover
+for information on caching ibnetdiscover output.
 
 .SH AUTHOR
 .TP
diff --git a/infiniband-diags/src/iblinkinfo.c b/infiniband-diags/src/iblinkinfo.c
index 19adc20..4b8616e 100644
--- a/infiniband-diags/src/iblinkinfo.c
+++ b/infiniband-diags/src/iblinkinfo.c
@@ -65,6 +65,8 @@ static nn_map_t *node_name_map = NULL;
 static char *load_cache_file = NULL;
 static char *diff_cache_file = NULL;
 static unsigned diffcheck_flags = DIFF_FLAG_DEFAULT;
+static char *filterdownports_cache_file = NULL;
+static ibnd_fabric_t *filterdownports_fabric = NULL;
 
 static uint64_t guid = 0;
 static char *guid_str = NULL;
@@ -116,6 +118,30 @@ void get_msg(char *width_msg, char *speed_msg, int msg_size, ibnd_port_t * port)
 				      buf, 64, &max_speed));
 }
 
+int filterdownport_check(ibnd_node_t * node, ibnd_port_t * port)
+{
+	ibnd_node_t *fsw;
+	ibnd_port_t *fport;
+	int fistate;
+
+	fsw = ibnd_find_node_guid(filterdownports_fabric, node->guid);
+
+	if (!fsw)
+		return 0;
+
+	if (port->portnum > fsw->numports)
+		return 0;
+
+	fport = fsw->ports[port->portnum];
+
+	if (!fport)
+		return 0;
+
+	fistate = mad_get_field(fport->info, 0, IB_PORT_STATE_F);
+
+	return (fistate == IB_LINK_DOWN) ? 1 : 0;
+}
+
 void print_port(ibnd_node_t * node, ibnd_port_t * port, char *out_prefix)
 {
 	char width[64], speed[64], state[64], physstate[64];
@@ -142,6 +168,11 @@ void print_port(ibnd_node_t * node, ibnd_port_t * port, char *out_prefix)
 	width_msg[0] = '\0';
 	speed_msg[0] = '\0';
 
+	if (istate == IB_LINK_DOWN
+	    && filterdownports_fabric
+	    && filterdownport_check(node,port))
+		return;
+
 	/* C14-24.2.1 states that a down port allows for invalid data to be
 	 * returned for all PortInfo components except PortState and
 	 * PortPhysicalState */
@@ -467,6 +498,9 @@ static int process_opt(void *context, int ch, char *optarg)
 			p = strtok(NULL, ",");
 		}
 		break;
+	case 5:
+		filterdownports_cache_file = strdup(optarg);
+		break;
 	case 'S':
 		guid_str = optarg;
 		guid = (uint64_t) strtoull(guid_str, 0, 0);
@@ -539,6 +573,8 @@ int main(int argc, char **argv)
 		 "filename of ibnetdiscover cache to diff"},
 		{"diffcheck", 4, 1, "<key(s)>",
 		 "specify checks to execute for --diff"},
+		{"filterdownports", 5, 1, "<file>",
+		 "filename of ibnetdiscover cache to filter downports"},
 		{"outstanding_smps", 'o', 1, NULL,
 		 "specify the number of outstanding SMP's which should be "
 		 "issued during the scan"},
@@ -591,6 +627,10 @@ int main(int argc, char **argv)
 	    !(diff_fabric = ibnd_load_fabric(diff_cache_file, 0)))
 		IBERROR("loading cached fabric for diff failed\n");
 
+	if (filterdownports_cache_file &&
+	    !(filterdownports_fabric = ibnd_load_fabric(filterdownports_cache_file, 0)))
+		IBERROR("loading cached fabric for filterdownports failed\n");
+
 	if (load_cache_file) {
 		if ((fabric = ibnd_load_fabric(load_cache_file, 0)) == NULL) {
 			fprintf(stderr, "loading cached fabric failed\n");
-- 
1.5.4.5


^ permalink raw reply related

* [infiniband-diags] [3/4] Add lid and node description diff options for --diffcheck in iblinkinfo
From: Al Chu @ 2010-04-26 21:39 UTC (permalink / raw)
  To: Sasha Khapyorsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

[-- Attachment #1: Type: text/plain, Size: 329 bytes --]

Hi Sasha,

This patch supports additional lid and node description diffing options
in iblinkinfo.  This is similar to the lid and nodescription --diffcheck
options in ibnetdiscover.

Al

-- 
Albert Chu
chu11-i2BcT+NCU+M@public.gmane.org
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory

[-- Attachment #2: 0003-Add-lid-and-node-description-diff-options-for-diff.patch --]
[-- Type: message/rfc822, Size: 6214 bytes --]

From: Albert Chu <chu11-i2BcT+NCU+M@public.gmane.org>
Subject: [PATCH] Add lid and node description diff options for --diffcheck in iblinkinfo
Date: Tue, 20 Apr 2010 10:13:05 -0700
Message-ID: <1272317488.29737.35.camel-X2zTWyBD0EhliZ7u+bvwcg@public.gmane.org>


Signed-off-by: Albert Chu <chu11-i2BcT+NCU+M@public.gmane.org>
---
 infiniband-diags/man/iblinkinfo.8 |    7 +++-
 infiniband-diags/src/iblinkinfo.c |   53 ++++++++++++++++++++++++++++++++-----
 2 files changed, 51 insertions(+), 9 deletions(-)

diff --git a/infiniband-diags/man/iblinkinfo.8 b/infiniband-diags/man/iblinkinfo.8
index 431ab0e..65ea919 100644
--- a/infiniband-diags/man/iblinkinfo.8
+++ b/infiniband-diags/man/iblinkinfo.8
@@ -55,14 +55,17 @@ for information on caching ibnetdiscover output.
 Load cached ibnetdiscover data and do a diff comparison to the current
 network or another cache.  A special diff output for iblinkinfo
 output will be displayed showing differences between the old and current
-fabric links.  See
+fabric links.  Be default, the following are compared for differences:
+port connections and port state.  See
 .B ibnetdiscover
 for information on caching ibnetdiscover output.
 .TP
 \fB\-\-diffcheck\fR <key(s)>
 Specify what diff checks should be done in the \fB\-\-diff\fR option above.
 Comma separate multiple diff check key(s).  The available diff checks
-are:\fIport\fR = port connections, \fIstate\fR = port state.
+are:\fIport\fR = port connections, \fIstate\fR = port state, \fIlid\fR = lids,
+\fInodedesc\fR = node descriptions.  If \fIport\fR is specified alongside \fIlid\fR
+or \fInodedesc\fR, remote port lids and node descriptions will also be compared.
 
 .SH AUTHOR
 .TP
diff --git a/infiniband-diags/src/iblinkinfo.c b/infiniband-diags/src/iblinkinfo.c
index a4a8e49..19adc20 100644
--- a/infiniband-diags/src/iblinkinfo.c
+++ b/infiniband-diags/src/iblinkinfo.c
@@ -55,6 +55,8 @@
 
 #define DIFF_FLAG_PORT_CONNECTION  0x01
 #define DIFF_FLAG_PORT_STATE       0x02
+#define DIFF_FLAG_LID              0x04
+#define DIFF_FLAG_NODE_DESCRIPTION 0x08
 
 #define DIFF_FLAG_DEFAULT (DIFF_FLAG_PORT_CONNECTION | DIFF_FLAG_PORT_STATE)
 
@@ -224,7 +226,7 @@ void print_port(ibnd_node_t * node, ibnd_port_t * port, char *out_prefix)
 
 void print_switch_header(ibnd_node_t *node, int *out_header_flag, char *out_prefix)
 {
-	if (!(*out_header_flag) && !line_mode) {
+	if ((!out_header_flag || !(*out_header_flag)) && !line_mode) {
 		char *remap =
 			remap_node_name(node_name_map, node->guid, node->nodedesc);
 		printf("%sSwitch 0x%016" PRIx64 " %s:\n",
@@ -308,9 +310,25 @@ void diff_switch_ports(ibnd_node_t * fabric1_node, ibnd_node_t * fabric2_node,
 				output_diff++;
 		}
 
+		if (data->diff_flags & DIFF_FLAG_PORT_CONNECTION
+		    && data->diff_flags & DIFF_FLAG_LID
+		    && fabric1_port && fabric2_port
+		    && fabric1_port->remoteport && fabric2_port->remoteport
+		    && fabric1_port->remoteport->base_lid != fabric2_port->remoteport->base_lid)
+			output_diff++;
+
+		if (data->diff_flags & DIFF_FLAG_PORT_CONNECTION
+		    && data->diff_flags & DIFF_FLAG_NODE_DESCRIPTION
+		    && fabric1_port && fabric2_port
+		    && fabric1_port->remoteport && fabric2_port->remoteport
+		    && memcmp(fabric1_port->remoteport->node->nodedesc,
+			      fabric2_port->remoteport->node->nodedesc,
+			      IB_SMP_DATA_SIZE))
+			output_diff++;
+
 		if (output_diff && fabric1_port) {
 			print_switch_header(fabric1_node,
-					    &head_print,
+					    head_print,
 					    NULL);
 			print_port(fabric1_node,
 				   fabric1_port,
@@ -319,7 +337,7 @@ void diff_switch_ports(ibnd_node_t * fabric1_node, ibnd_node_t * fabric2_node,
 
 		if (output_diff && fabric2_port) {
 			print_switch_header(fabric1_node,
-					    &head_print,
+					    head_print,
 					    NULL);
 			print_port(fabric2_node,
 				   fabric2_port,
@@ -340,7 +358,22 @@ void diff_switch_iter(ibnd_node_t * fabric1_node, void *iter_user_data)
 	if (!fabric2_node)
 		print_switch(fabric1_node, data->fabric1_prefix);
 	else if (data->diff_flags &
-		 (DIFF_FLAG_PORT_CONNECTION | DIFF_FLAG_PORT_STATE)) {
+		 (DIFF_FLAG_PORT_CONNECTION | DIFF_FLAG_PORT_STATE
+		  | DIFF_FLAG_LID | DIFF_FLAG_NODE_DESCRIPTION)) {
+
+		if ((data->diff_flags & DIFF_FLAG_LID
+		     && fabric1_node->smalid != fabric2_node->smalid) ||
+		    (data->diff_flags & DIFF_FLAG_NODE_DESCRIPTION
+		     && memcmp(fabric1_node->nodedesc, fabric2_node->nodedesc,
+			       IB_SMP_DATA_SIZE))) {
+			print_switch_header(fabric1_node,
+					    NULL,
+					    data->fabric1_prefix);
+			print_switch_header(fabric2_node,
+					    NULL,
+					    data->fabric2_prefix);
+			head_print++;
+		}
 
 		if (fabric1_node->numports != fabric2_node->numports) {
 			print_switch_header(fabric1_node,
@@ -377,13 +410,15 @@ int diff_switch(ibnd_node_t * node, ibnd_fabric_t * orig_fabric,
 	/* Do opposite diff to find existence of node types
 	 * in new_fabric but not in orig_fabric.
 	 *
-	 * In this diff, we don't need to check port connections
-	 * or port state since it has already been done (i.e.
-	 * checks are only done when guid exists on both
+	 * In this diff, we don't need to check port connections,
+	 * port state, lids, or node descriptions since it has already
+	 * been done (i.e. checks are only done when guid exists on both
 	 * orig and new).
 	 */
 	iter_diff_data.diff_flags = diffcheck_flags & ~DIFF_FLAG_PORT_CONNECTION;
 	iter_diff_data.diff_flags &= ~DIFF_FLAG_PORT_STATE;
+	iter_diff_data.diff_flags &= ~DIFF_FLAG_LID;
+	iter_diff_data.diff_flags &= ~DIFF_FLAG_NODE_DESCRIPTION;
 	iter_diff_data.fabric1 = new_fabric;
 	iter_diff_data.fabric2 = orig_fabric;
 	iter_diff_data.fabric1_prefix = "> ";
@@ -420,6 +455,10 @@ static int process_opt(void *context, int ch, char *optarg)
 				diffcheck_flags |= DIFF_FLAG_PORT_CONNECTION;
 			else if (!strcasecmp(p, "state"))
 				diffcheck_flags |= DIFF_FLAG_PORT_STATE;
+			else if (!strcasecmp(p, "lid"))
+				diffcheck_flags |= DIFF_FLAG_LID;
+			else if (!strcasecmp(p, "nodedesc"))
+				diffcheck_flags |= DIFF_FLAG_NODE_DESCRIPTION;
 			else {
 				fprintf(stderr, "invalid diff check key: %s\n",
 					p);
-- 
1.5.4.5


^ permalink raw reply related

* [infiniband-diags] [2/4] support --diffcheck in iblinkinfo
From: Al Chu @ 2010-04-26 21:39 UTC (permalink / raw)
  To: Sasha Khapyorsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

[-- Attachment #1: Type: text/plain, Size: 239 bytes --]

Hi Sasha,

Similar to ibnetdiscover, this patch support a --diffcheck option in
iblinkinfo.

Al

-- 
Albert Chu
chu11-i2BcT+NCU+M@public.gmane.org
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory

[-- Attachment #2: 0002-support-diffcheck-in-iblinkinfo.patch --]
[-- Type: message/rfc822, Size: 2602 bytes --]

From: Albert Chu <chu11-i2BcT+NCU+M@public.gmane.org>
Subject: [PATCH] support --diffcheck in iblinkinfo
Date: Tue, 20 Apr 2010 09:53:53 -0700
Message-ID: <1272317488.29737.31.camel-X2zTWyBD0EhliZ7u+bvwcg@public.gmane.org>


Signed-off-by: Albert Chu <chu11-i2BcT+NCU+M@public.gmane.org>
---
 infiniband-diags/man/iblinkinfo.8 |    5 +++++
 infiniband-diags/src/iblinkinfo.c |   20 ++++++++++++++++++++
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/infiniband-diags/man/iblinkinfo.8 b/infiniband-diags/man/iblinkinfo.8
index b91afbd..431ab0e 100644
--- a/infiniband-diags/man/iblinkinfo.8
+++ b/infiniband-diags/man/iblinkinfo.8
@@ -58,6 +58,11 @@ output will be displayed showing differences between the old and current
 fabric links.  See
 .B ibnetdiscover
 for information on caching ibnetdiscover output.
+.TP
+\fB\-\-diffcheck\fR <key(s)>
+Specify what diff checks should be done in the \fB\-\-diff\fR option above.
+Comma separate multiple diff check key(s).  The available diff checks
+are:\fIport\fR = port connections, \fIstate\fR = port state.
 
 .SH AUTHOR
 .TP
diff --git a/infiniband-diags/src/iblinkinfo.c b/infiniband-diags/src/iblinkinfo.c
index c6092f9..a4a8e49 100644
--- a/infiniband-diags/src/iblinkinfo.c
+++ b/infiniband-diags/src/iblinkinfo.c
@@ -400,6 +400,8 @@ int diff_switch(ibnd_node_t * node, ibnd_fabric_t * orig_fabric,
 static int process_opt(void *context, int ch, char *optarg)
 {
 	struct ibnd_config *cfg = context;
+	char *p;
+
 	switch (ch) {
 	case 1:
 		node_name_map_file = strdup(optarg);
@@ -410,6 +412,22 @@ static int process_opt(void *context, int ch, char *optarg)
 	case 3:
 		diff_cache_file = strdup(optarg);
 		break;
+	case 4:
+		diffcheck_flags = 0;
+		p = strtok(optarg, ",");
+		while (p) {
+			if (!strcasecmp(p, "port"))
+				diffcheck_flags |= DIFF_FLAG_PORT_CONNECTION;
+			else if (!strcasecmp(p, "state"))
+				diffcheck_flags |= DIFF_FLAG_PORT_STATE;
+			else {
+				fprintf(stderr, "invalid diff check key: %s\n",
+					p);
+				return -1;
+			}
+			p = strtok(NULL, ",");
+		}
+		break;
 	case 'S':
 		guid_str = optarg;
 		guid = (uint64_t) strtoull(guid_str, 0, 0);
@@ -480,6 +498,8 @@ int main(int argc, char **argv)
 		 "filename of ibnetdiscover cache to load"},
 		{"diff", 3, 1, "<file>",
 		 "filename of ibnetdiscover cache to diff"},
+		{"diffcheck", 4, 1, "<key(s)>",
+		 "specify checks to execute for --diff"},
 		{"outstanding_smps", 'o', 1, NULL,
 		 "specify the number of outstanding SMP's which should be "
 		 "issued during the scan"},
-- 
1.5.4.5


^ permalink raw reply related

* [infiniband-diags] [1/4] add --diff support to iblinkinfo
From: Al Chu @ 2010-04-26 21:39 UTC (permalink / raw)
  To: Sasha Khapyorsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

[-- Attachment #1: Type: text/plain, Size: 234 bytes --]

Hi Sasha,

Similar to ibnetdiscover, this patch support a --diff option in
iblinkinfo.

Al

-- 
Albert Chu
chu11-i2BcT+NCU+M@public.gmane.org
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory

[-- Attachment #2: 0001-add-diff-support-to-iblinkinfo.patch --]
[-- Type: message/rfc822, Size: 10613 bytes --]

From: Albert Chu <chu11-i2BcT+NCU+M@public.gmane.org>
Subject: [PATCH] add --diff support to iblinkinfo
Date: Mon, 19 Apr 2010 10:36:54 -0700
Message-ID: <1272317488.29737.33.camel-X2zTWyBD0EhliZ7u+bvwcg@public.gmane.org>


Signed-off-by: Albert Chu <chu11-i2BcT+NCU+M@public.gmane.org>
---
 infiniband-diags/man/iblinkinfo.8 |    8 ++
 infiniband-diags/src/iblinkinfo.c |  221 +++++++++++++++++++++++++++++++++---
 2 files changed, 210 insertions(+), 19 deletions(-)

diff --git a/infiniband-diags/man/iblinkinfo.8 b/infiniband-diags/man/iblinkinfo.8
index f184edf..b91afbd 100644
--- a/infiniband-diags/man/iblinkinfo.8
+++ b/infiniband-diags/man/iblinkinfo.8
@@ -50,6 +50,14 @@ fabrics or a previous state of a fabric.  Cannot be used if user
 specifies a directo route path.  See
 .B ibnetdiscover
 for information on caching ibnetdiscover output.
+.TP
+\fB\-\-diff\fR <filename>
+Load cached ibnetdiscover data and do a diff comparison to the current
+network or another cache.  A special diff output for iblinkinfo
+output will be displayed showing differences between the old and current
+fabric links.  See
+.B ibnetdiscover
+for information on caching ibnetdiscover output.
 
 .SH AUTHOR
 .TP
diff --git a/infiniband-diags/src/iblinkinfo.c b/infiniband-diags/src/iblinkinfo.c
index 029573f..c6092f9 100644
--- a/infiniband-diags/src/iblinkinfo.c
+++ b/infiniband-diags/src/iblinkinfo.c
@@ -53,9 +53,16 @@
 
 #include "ibdiag_common.h"
 
+#define DIFF_FLAG_PORT_CONNECTION  0x01
+#define DIFF_FLAG_PORT_STATE       0x02
+
+#define DIFF_FLAG_DEFAULT (DIFF_FLAG_PORT_CONNECTION | DIFF_FLAG_PORT_STATE)
+
 static char *node_name_map_file = NULL;
 static nn_map_t *node_name_map = NULL;
 static char *load_cache_file = NULL;
+static char *diff_cache_file = NULL;
+static unsigned diffcheck_flags = DIFF_FLAG_DEFAULT;
 
 static uint64_t guid = 0;
 static char *guid_str = NULL;
@@ -107,7 +114,7 @@ void get_msg(char *width_msg, char *speed_msg, int msg_size, ibnd_port_t * port)
 				      buf, 64, &max_speed));
 }
 
-void print_port(ibnd_node_t * node, ibnd_port_t * port)
+void print_port(ibnd_node_t * node, ibnd_port_t * port, char *out_prefix)
 {
 	char width[64], speed[64], state[64], physstate[64];
 	char remote_guid_str[256];
@@ -204,21 +211,35 @@ void print_port(ibnd_node_t * node, ibnd_port_t * port)
 	if (line_mode) {
 		char *remap = remap_node_name(node_name_map, node->guid,
 					      node->nodedesc);
-		printf("0x%016" PRIx64 " \"%30s\" ", node->guid, remap);
+		printf("%s0x%016" PRIx64 " \"%30s\" ",
+		       out_prefix ? out_prefix : "",
+		       node->guid, remap);
 		free(remap);
 	} else
-		printf("      ");
+		printf("%s      ", out_prefix ? out_prefix : "");
 
 	printf("%6d %4d[%2s] ==%s==>  %s",
 	       node->smalid, port->portnum, ext_port_str, link_str, remote_str);
 }
 
+void print_switch_header(ibnd_node_t *node, int *out_header_flag, char *out_prefix)
+{
+	if (!(*out_header_flag) && !line_mode) {
+		char *remap =
+			remap_node_name(node_name_map, node->guid, node->nodedesc);
+		printf("%sSwitch 0x%016" PRIx64 " %s:\n",
+		       out_prefix ? out_prefix : "",
+		       node->guid, remap);
+		(*out_header_flag)++;
+		free(remap);
+	}
+}
+
 void print_switch(ibnd_node_t * node, void *user_data)
 {
 	int i = 0;
 	int head_print = 0;
-	char *remap =
-	    remap_node_name(node_name_map, node->guid, node->nodedesc);
+	char *out_prefix = (char *)user_data;
 
 	for (i = 1; i <= node->numports; i++) {
 		ibnd_port_t *port = node->ports[i];
@@ -227,15 +248,153 @@ void print_switch(ibnd_node_t * node, void *user_data)
 		if (!down_links_only ||
 		    mad_get_field(port->info, 0,
 				  IB_PORT_STATE_F) == IB_LINK_DOWN) {
-			if (!head_print && !line_mode) {
-				printf("Switch 0x%016" PRIx64 " %s:\n",
-				       node->guid, remap);
-				head_print = 1;
-			}
-			print_port(node, port);
+			print_switch_header(node, &head_print, out_prefix);
+			print_port(node, port, out_prefix);
+		}
+	}
+}
+
+struct iter_diff_data {
+        uint32_t diff_flags;
+        ibnd_fabric_t *fabric1;
+        ibnd_fabric_t *fabric2;
+        char *fabric1_prefix;
+        char *fabric2_prefix;
+};
+
+void diff_switch_ports(ibnd_node_t * fabric1_node, ibnd_node_t * fabric2_node,
+		       int *head_print, struct iter_diff_data *data)
+{
+	int i = 0;
+
+	for (i = 1; i <= fabric1_node->numports; i++) {
+		ibnd_port_t *fabric1_port, *fabric2_port;
+		int output_diff = 0;
+
+		fabric1_port = fabric1_node->ports[i];
+		fabric2_port = fabric2_node->ports[i];
+
+		if (!fabric1_port && !fabric2_port)
+			continue;
+
+		if (data->diff_flags & DIFF_FLAG_PORT_CONNECTION) {
+			if ((fabric1_port && !fabric2_port)
+			    || (!fabric1_port && fabric2_port)
+			    || (fabric1_port->remoteport
+				&& !fabric2_port->remoteport)
+			    || (!fabric1_port->remoteport
+				&& fabric2_port->remoteport)
+			    || (fabric1_port->remoteport
+				&& fabric2_port->remoteport
+				&& fabric1_port->remoteport->guid !=
+				fabric2_port->remoteport->guid))
+				output_diff++;
+		}
+
+		/* if either fabric1_port or fabric2_port NULL, should be
+		 * handled by port connection diff code
+		 */
+		if (data->diff_flags & DIFF_FLAG_PORT_STATE
+		    && fabric1_port
+		    && fabric2_port) {
+			int state1, state2;
+
+			state1 = mad_get_field(fabric1_port->info, 0,
+					       IB_PORT_STATE_F);
+			state2 = mad_get_field(fabric2_port->info, 0,
+					       IB_PORT_STATE_F);
+
+			if (state1 != state2)
+				output_diff++;
+		}
+
+		if (output_diff && fabric1_port) {
+			print_switch_header(fabric1_node,
+					    &head_print,
+					    NULL);
+			print_port(fabric1_node,
+				   fabric1_port,
+				   data->fabric1_prefix);
+		}
+
+		if (output_diff && fabric2_port) {
+			print_switch_header(fabric1_node,
+					    &head_print,
+					    NULL);
+			print_port(fabric2_node,
+				   fabric2_port,
+				   data->fabric2_prefix);
 		}
 	}
-	free(remap);
+}
+
+void diff_switch_iter(ibnd_node_t * fabric1_node, void *iter_user_data)
+{
+	struct iter_diff_data *data = iter_user_data;
+	ibnd_node_t *fabric2_node;
+	int head_print = 0;
+
+	DEBUG("DEBUG: fabric1_node %p\n", fabric1_node);
+
+	fabric2_node = ibnd_find_node_guid(data->fabric2, fabric1_node->guid);
+	if (!fabric2_node)
+		print_switch(fabric1_node, data->fabric1_prefix);
+	else if (data->diff_flags &
+		 (DIFF_FLAG_PORT_CONNECTION | DIFF_FLAG_PORT_STATE)) {
+
+		if (fabric1_node->numports != fabric2_node->numports) {
+			print_switch_header(fabric1_node,
+					    &head_print,
+					    NULL);
+			printf("%snumports = %d\n", data->fabric1_prefix,
+			       fabric1_node->numports);
+			printf("%snumports = %d\n", data->fabric2_prefix,
+			       fabric2_node->numports);
+			return;
+		}
+
+		diff_switch_ports(fabric1_node, fabric2_node,
+				  &head_print, data);
+	}
+}
+
+int diff_switch(ibnd_node_t * node, ibnd_fabric_t * orig_fabric,
+		ibnd_fabric_t * new_fabric)
+{
+	struct iter_diff_data iter_diff_data;
+
+	iter_diff_data.diff_flags = diffcheck_flags;
+	iter_diff_data.fabric1 = orig_fabric;
+	iter_diff_data.fabric2 = new_fabric;
+	iter_diff_data.fabric1_prefix = "< ";
+	iter_diff_data.fabric2_prefix = "> ";
+	if (node)
+		diff_switch_iter(node, &iter_diff_data);
+	else
+		ibnd_iter_nodes_type(orig_fabric, diff_switch_iter,
+				     IB_NODE_SWITCH, &iter_diff_data);
+
+	/* Do opposite diff to find existence of node types
+	 * in new_fabric but not in orig_fabric.
+	 *
+	 * In this diff, we don't need to check port connections
+	 * or port state since it has already been done (i.e.
+	 * checks are only done when guid exists on both
+	 * orig and new).
+	 */
+	iter_diff_data.diff_flags = diffcheck_flags & ~DIFF_FLAG_PORT_CONNECTION;
+	iter_diff_data.diff_flags &= ~DIFF_FLAG_PORT_STATE;
+	iter_diff_data.fabric1 = new_fabric;
+	iter_diff_data.fabric2 = orig_fabric;
+	iter_diff_data.fabric1_prefix = "> ";
+	iter_diff_data.fabric2_prefix = "< ";
+	if (node)
+		diff_switch_iter(node, &iter_diff_data);
+	else
+		ibnd_iter_nodes_type(new_fabric, diff_switch_iter,
+				     IB_NODE_SWITCH, &iter_diff_data);
+	
+	return 0;
 }
 
 static int process_opt(void *context, int ch, char *optarg)
@@ -248,6 +407,9 @@ static int process_opt(void *context, int ch, char *optarg)
 	case 2:
 		load_cache_file = strdup(optarg);
 		break;
+	case 3:
+		diff_cache_file = strdup(optarg);
+		break;
 	case 'S':
 		guid_str = optarg;
 		guid = (uint64_t) strtoull(guid_str, 0, 0);
@@ -291,6 +453,7 @@ int main(int argc, char **argv)
 	int rc = 0;
 	int resolved = -1;
 	ibnd_fabric_t *fabric = NULL;
+	ibnd_fabric_t *diff_fabric = NULL;
 	struct ibmad_port *ibmad_port;
 	ib_portid_t port_id = { 0 };
 	int mgmt_classes[3] =
@@ -315,6 +478,8 @@ int main(int argc, char **argv)
 		 "print port guids instead of node guids"},
 		{"load-cache", 2, 1, "<file>",
 		 "filename of ibnetdiscover cache to load"},
+		{"diff", 3, 1, "<file>",
+		 "filename of ibnetdiscover cache to diff"},
 		{"outstanding_smps", 'o', 1, NULL,
 		 "specify the number of outstanding SMP's which should be "
 		 "issued during the scan"},
@@ -363,6 +528,10 @@ int main(int argc, char **argv)
 			       guid_str);
 	}
 
+	if (diff_cache_file &&
+	    !(diff_fabric = ibnd_load_fabric(diff_cache_file, 0)))
+		IBERROR("loading cached fabric for diff failed\n");
+
 	if (load_cache_file) {
 		if ((fabric = ibnd_load_fabric(load_cache_file, 0)) == NULL) {
 			fprintf(stderr, "loading cached fabric failed\n");
@@ -385,8 +554,12 @@ int main(int argc, char **argv)
 
 	if (!all && guid_str) {
 		ibnd_node_t *sw = ibnd_find_node_guid(fabric, guid);
-		if (sw)
-			print_switch(sw, NULL);
+		if (sw) {
+			if (diff_fabric)
+				diff_switch(sw, diff_fabric, fabric);
+			else
+				print_switch(sw, NULL);
+		}
 		else
 			fprintf(stderr, "Failed to find switch: %s\n",
 				guid_str);
@@ -400,15 +573,25 @@ int main(int argc, char **argv)
 		mad_decode_field(ni, IB_NODE_GUID_F, &(guid));
 
 		sw = ibnd_find_node_guid(fabric, guid);
-		if (sw)
-			print_switch(sw, NULL);
+		if (sw) {
+			if (diff_fabric)
+				diff_switch(sw, diff_fabric, fabric);
+			else
+				print_switch(sw, NULL);
+		}
 		else
 			fprintf(stderr, "Failed to find switch: %s\n", dr_path);
-	} else
-		ibnd_iter_nodes_type(fabric, print_switch, IB_NODE_SWITCH,
-				     NULL);
+	} else {
+		if (diff_fabric)
+			diff_switch(NULL, diff_fabric, fabric);
+		else
+			ibnd_iter_nodes_type(fabric, print_switch,
+					     IB_NODE_SWITCH, NULL);
+	}
 
 	ibnd_destroy_fabric(fabric);
+	if (diff_fabric)
+		ibnd_destroy_fabric(diff_fabric);
 
 close_port:
 	close_node_name_map(node_name_map);
-- 
1.5.4.5


^ permalink raw reply related

* Re: SDP bugs 2027 and 2028
From: Steve Wise @ 2010-04-26 18:27 UTC (permalink / raw)
  To: Amir Vadai
  Cc: Andrea Gozzelino, Tung, Chien Tin,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org,
	peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
	pavel-+ZI9xUNit7I@public.gmane.org,
	mingo-X9Un+BFzKDI@public.gmane.org, Eric B Munson
In-Reply-To: <4BD3F0A9.4080306-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>


Amir Vadai wrote:
> I have a fix for 2027 (number of SGE's issue) read.
> I'm busy with other things - but hopefully will succeed testing it and
> pushing it today.
>
> As to 2028 (No FMR support) - I need pushed a fix to only disable ZCopy
> when no FMR facility.
> I don't have time right now to add support for fast memory registeration
> when FMR is not available - but Steve said he'll help with implementing it.
>
> - Amir
>
>   
(I removed this from the linux-kernel list)

I probably won't get to adding fast memory registration until July/August.


Steve.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH v3 05/10] iw_cxgb4: Add connection management functions.
From: Roland Dreier @ 2010-04-26 16:22 UTC (permalink / raw)
  To: Steve Wise; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <4BD5A98C.8030700-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>

 >  > +int c4iw_ep_redirect(void *ctx, struct dst_entry *old, struct dst_entry *new,

 > > As far as I can see this function is not called or otherwise referenced
 > > anywhere else (except for a declaration in a header).  Can we drop it?

 > Yes.

OK, I rolled the following up into the big "merge iw_cxgb4" patch I have queued:

diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index e1c1ee0..b602438 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -2260,24 +2260,6 @@ int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp)
 	return ret;
 }
 
-int c4iw_ep_redirect(void *ctx, struct dst_entry *old, struct dst_entry *new,
-		     struct l2t_entry *l2t)
-{
-	struct c4iw_ep *ep = ctx;
-
-	if (ep->dst != old)
-		return 0;
-
-	PDBG("%s ep %p redirect to dst %p l2t %p\n", __func__, ep, new,
-	     l2t);
-	dst_hold(new);
-	cxgb4_l2t_release(ep->l2t);
-	ep->l2t = l2t;
-	dst_release(old);
-	ep->dst = new;
-	return 1;
-}
-
 /*
  * All the CM events are handled on a work queue to have a safe context.
  */

-- 
Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: [PATCH v3 05/10] iw_cxgb4: Add connection management functions.
From: Steve Wise @ 2010-04-26 14:56 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <adask6oo2d4.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>

Roland Dreier wrote:
> Thanks, all this looks pretty clean and small so I added it (as one big
> patch).  One tiny issue that we can fix with a follow-up patch:
>
>  > +int c4iw_ep_redirect(void *ctx, struct dst_entry *old, struct dst_entry *new,
>  > +		     struct l2t_entry *l2t)
>  > +{
>  > +	struct c4iw_ep *ep = ctx;
>  > +
>  > +	if (ep->dst != old)
>  > +		return 0;
>  > +
>  > +	PDBG("%s ep %p redirect to dst %p l2t %p\n", __func__, ep, new,
>  > +	     l2t);
>  > +	dst_hold(new);
>  > +	cxgb4_l2t_release(ep->l2t);
>  > +	ep->l2t = l2t;
>  > +	dst_release(old);
>  > +	ep->dst = new;
>  > +	return 1;
>  > +}
>
> As far as I can see this function is not called or otherwise referenced
> anywhere else (except for a declaration in a header).  Can we drop it?
>   

Yes.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH v2] opensm/osm_lid_mgr: fix couple of duplicate LIDs bugs
From: Sasha Khapyorsky @ 2010-04-26 13:02 UTC (permalink / raw)
  To: linux-rdma; +Cc: Eli Dorfman, Alex Netes
In-Reply-To: <20100426121647.GU23994@me>


Fix couple of cases where duplicated LID generation is possible:

1) When guid2lid db is reloaded after standby or disconnected SM port
state (discovering) it must be validated, so content of used_lids[]
array (used as reference during LID assignment) will be consistent with
loaded guid2lid db.

2) When port for which LIDs were assigned exists in guid2lid db already
its record should be updated due to possibly changed LIDs, LMC, etc..

There still be more potential cases where LIDs could be duplicated. So
this patch fixes just part of them. I'm continuing an investigation.

Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
 opensm/opensm/osm_lid_mgr.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

v2: With guid2lid db reset (osm_db_clear()) clean also user_lids[]
array.

diff --git a/opensm/opensm/osm_lid_mgr.c b/opensm/opensm/osm_lid_mgr.c
index 84f3508..7da4eb0 100644
--- a/opensm/opensm/osm_lid_mgr.c
+++ b/opensm/opensm/osm_lid_mgr.c
@@ -306,11 +306,11 @@ static int lid_mgr_init_sweep(IN osm_lid_mgr_t * p_mgr)
 	   need to honor this file. */
 	if (p_mgr->p_subn->first_time_master_sweep == TRUE) {
 		osm_db_clear(p_mgr->p_g2l);
-		if (p_mgr->p_subn->opt.honor_guid2lid_file == FALSE) {
+		memset(p_mgr->used_lids, 0, sizeof(p_mgr->used_lids));
+		if (p_mgr->p_subn->opt.honor_guid2lid_file == FALSE)
 			OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,
 				"Ignore guid2lid file when coming out of standby\n");
-			memset(p_mgr->used_lids, 0, sizeof(p_mgr->used_lids));
-		} else {
+		else {
 			OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,
 				"Honor current guid2lid file when coming out "
 				"of standby\n");
@@ -319,6 +319,7 @@ static int lid_mgr_init_sweep(IN osm_lid_mgr_t * p_mgr)
 					"ERR 0306: "
 					"Error restoring Guid-to-Lid "
 					"persistent database. Ignoring it\n");
+			lid_mgr_validate_db(p_mgr);
 		}
 	}
 
@@ -710,7 +711,7 @@ static int lid_mgr_get_port_lid(IN osm_lid_mgr_t * p_mgr,
 			/* we still need to send the setting to the target port */
 			lid_changed = 1;
 		}
-		goto Exit;
+		goto NewLidSet;
 	} else
 		OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,
 			"0x%016" PRIx64 " has no persistent lid assigned\n",
@@ -764,7 +765,6 @@ NewLidSet:
 	for (lid = *p_min_lid; lid <= *p_max_lid; lid++)
 		p_mgr->used_lids[lid] = 1;
 
-Exit:
 	/* make sure the assigned lids are marked in port_lid_tbl */
 	for (lid = *p_min_lid; lid <= *p_max_lid; lid++)
 		cl_ptr_vector_set(&p_mgr->p_subn->port_lid_tbl, lid, p_port);
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH] opensm/osm_lid_mgr: fix couple of duplicate LIDs bugs
From: Sasha Khapyorsky @ 2010-04-26 12:16 UTC (permalink / raw)
  To: linux-rdma; +Cc: Eli Dorfman, Alex Netes
In-Reply-To: <20100426104838.GS23994@me>


Fix couple of cases where duplicated LID generation is possible:

1) When guid2lid db is reloaded after standby or disconnected SM port
state (discovering) it must be validated, so content of used_lids[]
array (used as reference during LID assignment) will be consistent with
loaded guid2lid db.

2) When port for which LIDs were assigned exists in guid2lid db already
its record should be updated due to possibly changed LIDs, LMC, etc..

There still be more potential cases where LIDs could be duplicated. So
this patch fixes just part of them. I'm continuing an investigation.

Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
 opensm/opensm/osm_lid_mgr.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/opensm/opensm/osm_lid_mgr.c b/opensm/opensm/osm_lid_mgr.c
index 84f3508..08d54f0 100644
--- a/opensm/opensm/osm_lid_mgr.c
+++ b/opensm/opensm/osm_lid_mgr.c
@@ -319,6 +319,7 @@ static int lid_mgr_init_sweep(IN osm_lid_mgr_t * p_mgr)
 					"ERR 0306: "
 					"Error restoring Guid-to-Lid "
 					"persistent database. Ignoring it\n");
+			lid_mgr_validate_db(p_mgr);
 		}
 	}
 
@@ -710,7 +711,7 @@ static int lid_mgr_get_port_lid(IN osm_lid_mgr_t * p_mgr,
 			/* we still need to send the setting to the target port */
 			lid_changed = 1;
 		}
-		goto Exit;
+		goto NewLidSet;
 	} else
 		OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,
 			"0x%016" PRIx64 " has no persistent lid assigned\n",
@@ -764,7 +765,6 @@ NewLidSet:
 	for (lid = *p_min_lid; lid <= *p_max_lid; lid++)
 		p_mgr->used_lids[lid] = 1;
 
-Exit:
 	/* make sure the assigned lids are marked in port_lid_tbl */
 	for (lid = *p_min_lid; lid <= *p_max_lid; lid++)
 		cl_ptr_vector_set(&p_mgr->p_subn->port_lid_tbl, lid, p_port);
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH] opensm/osm_lid_mgr: use 'first_time_master_sweep' flag
From: Sasha Khapyorsky @ 2010-04-26 10:48 UTC (permalink / raw)
  To: linux-rdma; +Cc: Eli Dorfman, Alex Netes


Use 'first_time_master_sweep' as initial sweep indication instead of
'coming_out_of_standby'. The last flag will be set only when OpenSM
previously was in standby state, this doesn't cover some other cases
such as temporary SM port disconnection.

Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
 opensm/opensm/osm_lid_mgr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/opensm/opensm/osm_lid_mgr.c b/opensm/opensm/osm_lid_mgr.c
index 0fd3b20..84f3508 100644
--- a/opensm/opensm/osm_lid_mgr.c
+++ b/opensm/opensm/osm_lid_mgr.c
@@ -304,7 +304,7 @@ static int lid_mgr_init_sweep(IN osm_lid_mgr_t * p_mgr)
 	   info we might have.
 	   Do this only if the honor_guid2lid_file option is FALSE. If not, then
 	   need to honor this file. */
-	if (p_mgr->p_subn->coming_out_of_standby == TRUE) {
+	if (p_mgr->p_subn->first_time_master_sweep == TRUE) {
 		osm_db_clear(p_mgr->p_g2l);
 		if (p_mgr->p_subn->opt.honor_guid2lid_file == FALSE) {
 			OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG,
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH] opensm: conversion to osm_get_port_by_lid()
From: Sasha Khapyorsky @ 2010-04-25 18:45 UTC (permalink / raw)
  To: linux-rdma


Simplify many obvious flows by using osm_get_port_by_lid*() helpers.

This also introduces osm_get_port_by_lid_ho() helper where lid parameter
is used in host byte order - this is in order to prevent double byte
order conversion in routing engines code.

Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
 opensm/include/opensm/osm_subnet.h     |   33 +++++++++++++-
 opensm/opensm/osm_console.c            |    4 +-
 opensm/opensm/osm_dump.c               |    6 +-
 opensm/opensm/osm_inform.c             |    5 +-
 opensm/opensm/osm_link_mgr.c           |    9 +---
 opensm/opensm/osm_sa_informinfo.c      |    2 +-
 opensm/opensm/osm_sa_path_record.c     |   75 ++++++++++++--------------------
 opensm/opensm/osm_sa_portinfo_record.c |   37 +++-------------
 opensm/opensm/osm_subnet.c             |   23 ++--------
 opensm/opensm/osm_trap_rcv.c           |   51 ++++++---------------
 opensm/opensm/osm_ucast_ftree.c        |    4 +-
 opensm/opensm/osm_ucast_lash.c         |    2 +-
 opensm/opensm/osm_ucast_updn.c         |   18 +++----
 13 files changed, 106 insertions(+), 163 deletions(-)

diff --git a/opensm/include/opensm/osm_subnet.h b/opensm/include/opensm/osm_subnet.h
index 8a7c0d9..d79ed8f 100644
--- a/opensm/include/opensm/osm_subnet.h
+++ b/opensm/include/opensm/osm_subnet.h
@@ -958,6 +958,31 @@ struct osm_port *osm_get_port_by_guid(IN osm_subn_t const *p_subn,
 *	osm_port_t
 *********/
 
+/****f* OpenSM: Port/osm_get_port_by_lid_ho
+* NAME
+*	osm_get_port_by_lid_ho
+*
+* DESCRIPTION
+*	Returns a pointer of the port object for given lid value.
+*
+* SYNOPSIS
+*/
+struct osm_port *osm_get_port_by_lid_ho(const osm_subn_t * subn, uint16_t lid);
+/*
+* PARAMETERS
+*	subn
+*		[in] Pointer to the subnet data structure.
+*
+*	lid
+*		[in] LID requested in hot byte order.
+*
+* RETURN VALUES
+*	The port structure pointer if found. NULL otherwise.
+*
+* SEE ALSO
+*       Subnet object, osm_port_t
+*********/
+
 /****f* OpenSM: Port/osm_get_port_by_lid
 * NAME
 *	osm_get_port_by_lid
@@ -967,14 +992,18 @@ struct osm_port *osm_get_port_by_guid(IN osm_subn_t const *p_subn,
 *
 * SYNOPSIS
 */
-struct osm_port *osm_get_port_by_lid(const osm_subn_t * subn, ib_net16_t lid);
+static inline struct osm_port *osm_get_port_by_lid(IN osm_subn_t const * subn,
+						   IN ib_net16_t lid)
+{
+	return osm_get_port_by_lid_ho(subn, cl_ntoh16(lid));
+}
 /*
 * PARAMETERS
 *	subn
 *		[in] Pointer to the subnet data structure.
 *
 *	lid
-*		[in] LID requested.
+*		[in] LID requested in network byte order.
 *
 * RETURN VALUES
 *	The port structure pointer if found. NULL otherwise.
diff --git a/opensm/opensm/osm_console.c b/opensm/opensm/osm_console.c
index a27bee3..968486e 100644
--- a/opensm/opensm/osm_console.c
+++ b/opensm/opensm/osm_console.c
@@ -515,9 +515,7 @@ static void querylid_parse(char **p_last, osm_opensm_t * p_osm, FILE * out)
 
 	lid = (uint16_t) strtoul(p_cmd, NULL, 0);
 	cl_plock_acquire(&p_osm->lock);
-	if (lid > cl_ptr_vector_get_capacity(&(p_osm->subn.port_lid_tbl)))
-		goto invalid_lid;
-	p_port = cl_ptr_vector_get(&(p_osm->subn.port_lid_tbl), lid);
+	p_port = osm_get_port_by_lid_ho(&p_osm->subn, lid);
 	if (!p_port)
 		goto invalid_lid;
 
diff --git a/opensm/opensm/osm_dump.c b/opensm/opensm/osm_dump.c
index 86e9c00..fe2c3bc 100644
--- a/opensm/opensm/osm_dump.c
+++ b/opensm/opensm/osm_dump.c
@@ -140,7 +140,7 @@ static void dump_ucast_routes(cl_map_item_t * item, FILE * file, void *cxt)
 	for (lid_ho = 1; lid_ho <= max_lid_ho; lid_ho++) {
 		fprintf(file, "0x%04X : ", lid_ho);
 
-		p_port = cl_ptr_vector_get(&p_osm->subn.port_lid_tbl, lid_ho);
+		p_port = osm_get_port_by_lid_ho(&p_osm->subn, lid_ho);
 		if (!p_port) {
 			fprintf(file, "UNREACHABLE\n");
 			continue;
@@ -313,7 +313,7 @@ static void dump_lid_matrix(cl_map_item_t * item, FILE * file, void *cxt)
 		for (port = 0; port < max_port; port++)
 			fprintf(file, " %02x",
 				osm_switch_get_hop_count(p_sw, lid, port));
-		p_port = cl_ptr_vector_get(&p_osm->subn.port_lid_tbl, lid);
+		p_port = osm_get_port_by_lid_ho(&p_osm->subn, lid);
 		if (p_port)
 			fprintf(file, " # portguid 0x016%" PRIx64,
 				cl_ntoh64(osm_port_get_guid(p_port)));
@@ -344,7 +344,7 @@ static void dump_ucast_lfts(cl_map_item_t * item, FILE * file, void *cxt)
 
 		fprintf(file, "0x%04x %03u # ", lid, port);
 
-		p_port = cl_ptr_vector_get(&p_osm->subn.port_lid_tbl, lid);
+		p_port = osm_get_port_by_lid_ho(&p_osm->subn, lid);
 		if (p_port) {
 			p_node = p_port->p_node;
 			fprintf(file, "%s portguid 0x%016" PRIx64 ": \'%s\'",
diff --git a/opensm/opensm/osm_inform.c b/opensm/opensm/osm_inform.c
index 8108213..46aa835 100644
--- a/opensm/opensm/osm_inform.c
+++ b/opensm/opensm/osm_inform.c
@@ -485,9 +485,8 @@ static void match_notice_to_inf_rec(IN cl_list_item_t * p_list_item,
 		goto Exit;
 	}
 
-	p_dest_port =
-	    cl_ptr_vector_get(&p_subn->port_lid_tbl,
-			      cl_ntoh16(p_infr_rec->report_addr.dest_lid));
+	p_dest_port = osm_get_port_by_lid(p_subn,
+					  p_infr_rec->report_addr.dest_lid);
 	if (!p_dest_port) {
 		OSM_LOG(p_log, OSM_LOG_INFO,
 			"Cannot find destination port with LID:%u\n",
diff --git a/opensm/opensm/osm_link_mgr.c b/opensm/opensm/osm_link_mgr.c
index 03a585b..e6c9b3b 100644
--- a/opensm/opensm/osm_link_mgr.c
+++ b/opensm/opensm/osm_link_mgr.c
@@ -59,7 +59,7 @@ static uint8_t link_mgr_get_smsl(IN osm_sm_t * sm, IN osm_physp_t * p_physp)
 {
 	osm_opensm_t *p_osm = sm->p_subn->p_osm;
 	const osm_port_t *p_sm_port, *p_src_port;
-	ib_net16_t slid, smlid;
+	ib_net16_t slid;
 	uint8_t sl;
 
 	OSM_LOG_ENTER(sm->p_log);
@@ -72,13 +72,10 @@ static uint8_t link_mgr_get_smsl(IN osm_sm_t * sm, IN osm_physp_t * p_physp)
 	}
 
 	/* Find osm_port of the SM itself = dest_port */
-	smlid = sm->p_subn->sm_base_lid;
-	p_sm_port =
-	    cl_ptr_vector_get(&sm->p_subn->port_lid_tbl, cl_ntoh16(smlid));
+	p_sm_port = osm_get_port_by_lid(sm->p_subn, sm->p_subn->sm_base_lid);
 
 	/* Find osm_port of the source = p_physp */
-	p_src_port =
-	    cl_ptr_vector_get(&sm->p_subn->port_lid_tbl, cl_ntoh16(slid));
+	p_src_port = osm_get_port_by_lid(sm->p_subn, slid);
 
 	/* Call lash to find proper SL */
 	sl = osm_get_lash_sl(p_osm, p_src_port, p_sm_port);
diff --git a/opensm/opensm/osm_sa_informinfo.c b/opensm/opensm/osm_sa_informinfo.c
index 9fb3608..be7aba7 100644
--- a/opensm/opensm/osm_sa_informinfo.c
+++ b/opensm/opensm/osm_sa_informinfo.c
@@ -158,7 +158,7 @@ static boolean_t validate_ports_access_rights(IN osm_sa_t * sa,
 		/* go over all defined lids within the range and make sure that the
 		   requester port can access them according to current partitioning. */
 		for (lid = lid_range_begin; lid <= lid_range_end; lid++) {
-			p_port = osm_get_port_by_lid(sa->p_subn, cl_hton16(lid));
+			p_port = osm_get_port_by_lid_ho(sa->p_subn, lid);
 			if (p_port == NULL)
 				continue;
 
diff --git a/opensm/opensm/osm_sa_path_record.c b/opensm/opensm/osm_sa_path_record.c
index 62102f4..9fa0c1e 100644
--- a/opensm/opensm/osm_sa_path_record.c
+++ b/opensm/opensm/osm_sa_path_record.c
@@ -1149,7 +1149,6 @@ static ib_net16_t pr_rcv_get_end_points(IN osm_sa_t * sa,
 	const ib_path_rec_t *p_pr = ib_sa_mad_get_payload_ptr(sa_mad);
 	ib_net64_t comp_mask = sa_mad->comp_mask;
 	ib_net64_t dest_guid;
-	ib_api_status_t status;
 	ib_net16_t sa_status = IB_SA_MAD_STATUS_SUCCESS;
 
 	OSM_LOG_ENTER(sa->p_log);
@@ -1177,7 +1176,6 @@ static ib_net16_t pr_rcv_get_end_points(IN osm_sa_t * sa,
 					"Non local SGID subnet prefix 0x%016"
 					PRIx64 "\n",
 					cl_ntoh64(p_pr->sgid.unicast.prefix));
-
 				sa_status = IB_SA_MAD_STATUS_INVALID_GID;
 				goto Exit;
 			}
@@ -1195,32 +1193,24 @@ static ib_net16_t pr_rcv_get_end_points(IN osm_sa_t * sa,
 			OSM_LOG(sa->p_log, OSM_LOG_VERBOSE,
 				"No source port with GUID 0x%016" PRIx64 "\n",
 				cl_ntoh64(p_pr->sgid.unicast.interface_id));
-
 			sa_status = IB_SA_MAD_STATUS_INVALID_GID;
 			goto Exit;
 		}
-	} else {
-		*pp_src_port = 0;
-		if (comp_mask & IB_PR_COMPMASK_SLID) {
-			status = cl_ptr_vector_at(&sa->p_subn->port_lid_tbl,
-						  cl_ntoh16(p_pr->slid),
-						  (void **)pp_src_port);
-
-			if ((status != CL_SUCCESS) || (*pp_src_port == NULL)) {
-				/*
-				   This 'error' is the client's fault (bad lid) so
-				   don't enter it as an error in our own log.
-				   Return an error response to the client.
-				 */
-				OSM_LOG(sa->p_log, OSM_LOG_VERBOSE,
-					"No source port with LID %u\n",
-					cl_ntoh16(p_pr->slid));
-
-				sa_status = IB_SA_MAD_STATUS_NO_RECORDS;
-				goto Exit;
-			}
+	} else if (comp_mask & IB_PR_COMPMASK_SLID) {
+		*pp_src_port = osm_get_port_by_lid(sa->p_subn, p_pr->slid);
+		if (!*pp_src_port) {
+			/*
+			   This 'error' is the client's fault (bad lid) so
+			   don't enter it as an error in our own log.
+			   Return an error response to the client.
+			 */
+			OSM_LOG(sa->p_log, OSM_LOG_VERBOSE, "No source port "
+				"with LID %u\n", cl_ntoh16(p_pr->slid));
+			sa_status = IB_SA_MAD_STATUS_NO_RECORDS;
+			goto Exit;
 		}
-	}
+	} else
+		*pp_src_port = NULL;
 
 	if (comp_mask & IB_PR_COMPMASK_DGID) {
 		if (!ib_gid_is_link_local(&p_pr->dgid) &&
@@ -1253,32 +1243,24 @@ static ib_net16_t pr_rcv_get_end_points(IN osm_sa_t * sa,
 			OSM_LOG(sa->p_log, OSM_LOG_VERBOSE,
 				"No dest port with GUID 0x%016" PRIx64 "\n",
 				cl_ntoh64(dest_guid));
-
 			sa_status = IB_SA_MAD_STATUS_INVALID_GID;
 			goto Exit;
 		}
-	} else {
-		*pp_dest_port = 0;
-		if (comp_mask & IB_PR_COMPMASK_DLID) {
-			status = cl_ptr_vector_at(&sa->p_subn->port_lid_tbl,
-						  cl_ntoh16(p_pr->dlid),
-						  (void **)pp_dest_port);
-
-			if ((status != CL_SUCCESS) || (*pp_dest_port == NULL)) {
-				/*
-				   This 'error' is the client's fault (bad lid)
-				   so don't enter it as an error in our own log.
-				   Return an error response to the client.
-				 */
-				OSM_LOG(sa->p_log, OSM_LOG_VERBOSE,
-					"No dest port with LID %u\n",
-					cl_ntoh16(p_pr->dlid));
-
-				sa_status = IB_SA_MAD_STATUS_NO_RECORDS;
-				goto Exit;
-			}
+	} else if (comp_mask & IB_PR_COMPMASK_DLID) {
+		*pp_dest_port = osm_get_port_by_lid(sa->p_subn, p_pr->dlid);
+		if (!*pp_dest_port) {
+			/*
+			   This 'error' is the client's fault (bad lid)
+			   so don't enter it as an error in our own log.
+			   Return an error response to the client.
+			 */
+			OSM_LOG(sa->p_log, OSM_LOG_VERBOSE, "No dest port "
+				"with LID %u\n", cl_ntoh16(p_pr->dlid));
+			sa_status = IB_SA_MAD_STATUS_NO_RECORDS;
+			goto Exit;
 		}
-	}
+	} else
+		*pp_dest_port = NULL;
 
 Exit:
 	OSM_LOG_EXIT(sa->p_log);
@@ -1594,7 +1576,6 @@ void osm_pr_rcv_process(IN void *context, IN void *data)
 	if (pr_rcv_get_end_points(sa, p_sa_mad, &p_src_port, &p_dest_port,
 				  &p_dgid) != IB_SA_MAD_STATUS_SUCCESS)
 		goto Unlock;
-
 	/*
 	   What happens next depends on the type of endpoint information
 	   that was specified....
diff --git a/opensm/opensm/osm_sa_portinfo_record.c b/opensm/opensm/osm_sa_portinfo_record.c
index 72b976c..c5b88b8 100644
--- a/opensm/opensm/osm_sa_portinfo_record.c
+++ b/opensm/opensm/osm_sa_portinfo_record.c
@@ -442,12 +442,10 @@ void osm_pir_rcv_process(IN void *ctx, IN void *data)
 	osm_madw_t *p_madw = data;
 	const ib_sa_mad_t *p_rcvd_mad;
 	const ib_portinfo_record_t *p_rcvd_rec;
-	const cl_ptr_vector_t *p_tbl;
 	const osm_port_t *p_port = NULL;
 	const ib_port_info_t *p_pi;
 	cl_qlist_t rec_list;
 	osm_pir_search_ctxt_t context;
-	ib_api_status_t status = IB_SUCCESS;
 	ib_net64_t comp_mask;
 	osm_physp_t *p_req_physp;
 
@@ -487,7 +485,6 @@ void osm_pir_rcv_process(IN void *ctx, IN void *data)
 	if (osm_log_is_active(sa->p_log, OSM_LOG_DEBUG))
 		osm_dump_portinfo_record(sa->p_log, p_rcvd_rec, OSM_LOG_DEBUG);
 
-	p_tbl = &sa->p_subn->port_lid_tbl;
 	p_pi = &p_rcvd_rec->port_info;
 
 	cl_qlist_init(&rec_list);
@@ -502,41 +499,21 @@ void osm_pir_rcv_process(IN void *ctx, IN void *data)
 
 	cl_plock_acquire(sa->p_lock);
 
-	CL_ASSERT(cl_ptr_vector_get_size(p_tbl) < 0x10000);
-
 	/*
 	   If the user specified a LID, it obviously narrows our
 	   work load, since we don't have to search every port
 	 */
-	if (comp_mask & IB_PIR_COMPMASK_LID) {
+	if (comp_mask & (IB_PIR_COMPMASK_LID | IB_PIR_COMPMASK_BASELID)) {
 		p_port = osm_get_port_by_lid(sa->p_subn, p_rcvd_rec->lid);
-		if (!p_port) {
-			status = IB_NOT_FOUND;
-			OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 2109: "
-				"No port found with LID %u\n",
-				cl_ntoh16(p_rcvd_rec->lid));
-		}
-	} else if (comp_mask & IB_PIR_COMPMASK_BASELID) {
-		if ((uint16_t) cl_ptr_vector_get_size(p_tbl) >
-		    cl_ntoh16(p_pi->base_lid))
-			p_port = cl_ptr_vector_get(p_tbl,
-						   cl_ntoh16(p_pi->base_lid));
-		else {
-			status = IB_NOT_FOUND;
-			OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 2103: "
-				"Given LID (%u) is out of range:%u\n",
-				cl_ntoh16(p_pi->base_lid),
-				cl_ptr_vector_get_size(p_tbl));
-		}
-	}
-
-	if (status == IB_SUCCESS) {
 		if (p_port)
 			sa_pir_by_comp_mask(sa, p_port->p_node, &context);
 		else
-			cl_qmap_apply_func(&sa->p_subn->node_guid_tbl,
-					   sa_pir_by_comp_mask_cb, &context);
-	}
+			OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 2109: "
+				"No port found with LID %u\n",
+				cl_ntoh16(p_rcvd_rec->lid));
+	} else
+		cl_qmap_apply_func(&sa->p_subn->node_guid_tbl,
+				   sa_pir_by_comp_mask_cb, &context);
 
 	cl_plock_release(sa->p_lock);
 
diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c
index 6acf4bc..ac8cb37 100644
--- a/opensm/opensm/osm_subnet.c
+++ b/opensm/opensm/osm_subnet.c
@@ -539,27 +539,13 @@ osm_port_t *osm_get_port_by_mad_addr(IN osm_log_t * p_log,
 				     IN const osm_subn_t * p_subn,
 				     IN osm_mad_addr_t * p_mad_addr)
 {
-	const cl_ptr_vector_t *p_port_lid_tbl;
-	osm_port_t *p_port = NULL;
-
-	/* Find the port gid of the request in the subnet */
-	p_port_lid_tbl = &p_subn->port_lid_tbl;
-
-	CL_ASSERT(cl_ptr_vector_get_size(p_port_lid_tbl) < 0x10000);
-
-	if ((uint16_t) cl_ptr_vector_get_size(p_port_lid_tbl) >
-	    cl_ntoh16(p_mad_addr->dest_lid)) {
-		p_port =
-		    cl_ptr_vector_get(p_port_lid_tbl,
-				      cl_ntoh16(p_mad_addr->dest_lid));
-	} else {
-		/* The dest_lid is not in the subnet table - this is an error */
+	osm_port_t *port = osm_get_port_by_lid(p_subn, p_mad_addr->dest_lid);
+	if (!port)
 		OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 7504: "
 			"Lid is out of range: %u\n",
 			cl_ntoh16(p_mad_addr->dest_lid));
-	}
 
-	return p_port;
+	return port;
 }
 
 ib_api_status_t osm_get_gid_by_mad_addr(IN osm_log_t * p_log,
@@ -629,9 +615,8 @@ osm_port_t *osm_get_port_by_guid(IN osm_subn_t const *p_subn, IN ib_net64_t guid
 	return p_port;
 }
 
-osm_port_t *osm_get_port_by_lid(IN osm_subn_t const * subn, IN ib_net16_t lid)
+osm_port_t *osm_get_port_by_lid_ho(IN osm_subn_t const * subn, IN uint16_t lid)
 {
-	lid = cl_ntoh16(lid);
 	if (lid < cl_ptr_vector_get_size(&subn->port_lid_tbl))
 		return cl_ptr_vector_get(&subn->port_lid_tbl, lid);
 	return NULL;
diff --git a/opensm/opensm/osm_trap_rcv.c b/opensm/opensm/osm_trap_rcv.c
index 52f8832..bf13239 100644
--- a/opensm/opensm/osm_trap_rcv.c
+++ b/opensm/opensm/osm_trap_rcv.c
@@ -81,16 +81,10 @@ extern void osm_req_get_node_desc(IN osm_sm_t * sm, osm_physp_t *p_physp);
  *
  **********************************************************************/
 
-static osm_physp_t *get_physp_by_lid_and_num(IN osm_sm_t * sm, IN uint16_t lid,
-					     IN uint8_t num)
+static osm_physp_t *get_physp_by_lid_and_num(IN osm_sm_t * sm,
+					     IN ib_net16_t lid, IN uint8_t num)
 {
-	cl_ptr_vector_t *p_vec = &(sm->p_subn->port_lid_tbl);
-	osm_port_t *p_port;
-
-	if (lid > cl_ptr_vector_get_size(p_vec))
-		return NULL;
-
-	p_port = (osm_port_t *) cl_ptr_vector_get(p_vec, lid);
+	osm_port_t *p_port = osm_get_port_by_lid(sm->p_subn, lid);
 	if (!p_port)
 		return NULL;
 
@@ -104,7 +98,7 @@ static uint64_t aging_tracker_callback(IN uint64_t key, IN uint32_t num_regs,
 				       IN void *context)
 {
 	osm_sm_t *sm = context;
-	uint16_t lid;
+	ib_net16_t lid;
 	uint8_t port_num;
 	osm_physp_t *p_physp;
 
@@ -114,20 +108,20 @@ static uint64_t aging_tracker_callback(IN uint64_t key, IN uint32_t num_regs,
 		/* We got an exit flag - do nothing */
 		return 0;
 
-	lid = cl_ntoh16((uint16_t) ((key & 0x0000FFFF00000000ULL) >> 32));
+	lid = (ib_net16_t) ((key & 0x0000FFFF00000000ULL) >> 32);
 	port_num = (uint8_t) ((key & 0x00FF000000000000ULL) >> 48);
 
 	p_physp = get_physp_by_lid_and_num(sm, lid, port_num);
 	if (!p_physp)
 		OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
 			"Cannot find port num:%u with lid:%u\n",
-			port_num, lid);
+			port_num, cl_ntoh16(lid));
 	/* make sure the physp is still valid */
 	/* If the health port was false - set it to true */
 	else if (!osm_physp_is_healthy(p_physp)) {
 		OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
 			"Clearing health bit of port num:%u with lid:%u\n",
-			port_num, lid);
+			port_num, cl_ntoh16(lid));
 
 		/* Clear its health bit */
 		osm_physp_set_health(p_physp, TRUE);
@@ -282,14 +276,14 @@ static void log_trap_info(osm_log_t *p_log, ib_mad_notice_attr_t *p_ntci,
 			cl_ntoh16(source_lid), cl_ntoh64(trans_id));
 }
 
-static int shutup_noisy_port(osm_sm_t *sm, uint16_t lid, uint8_t port,
+static int shutup_noisy_port(osm_sm_t *sm, ib_net16_t lid, uint8_t port,
 			     unsigned num)
 {
 	osm_physp_t *p = get_physp_by_lid_and_num(sm, lid, port);
 	if (!p) {
 		OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3805: "
 			"Failed to find physical port by lid:%u num:%u\n",
-			lid, port);
+			cl_ntoh16(lid), port);
 		return -1;
 	}
 
@@ -299,7 +293,8 @@ static int shutup_noisy_port(osm_sm_t *sm, uint16_t lid, uint8_t port,
 		OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
 			"Disabling noisy physical port 0x%016" PRIx64
 			": lid %u, num %u\n",
-			cl_ntoh64(osm_physp_get_port_guid(p)), lid, port);
+			cl_ntoh64(osm_physp_get_port_guid(p)),
+			cl_ntoh16(lid), port);
 		if (disable_port(sm, p))
 			OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3811: "
 				"Failed to disable.\n");
@@ -312,7 +307,7 @@ static int shutup_noisy_port(osm_sm_t *sm, uint16_t lid, uint8_t port,
 	if (osm_physp_is_healthy(p)) {
 		OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
 			"Marking unhealthy physical port by lid:%u num:%u\n",
-			lid, port);
+			cl_ntoh16(lid), port);
 		osm_physp_set_health(p, FALSE);
 		return 2;
 	}
@@ -330,7 +325,6 @@ static void trap_rcv_process_request(IN osm_sm_t * sm,
 	uint64_t trap_key;
 	uint32_t num_received;
 	osm_physp_t *p_physp;
-	cl_ptr_vector_t *p_tbl;
 	osm_port_t *p_port;
 	ib_net16_t source_lid = 0;
 	boolean_t is_gsi = TRUE;
@@ -462,8 +456,7 @@ static void trap_rcv_process_request(IN osm_sm_t * sm,
 			 * we mark it as unhealthy.
 			 */
 			if (physp_change_trap == TRUE) {
-				int ret = shutup_noisy_port(sm,
-							    cl_ntoh16(source_lid),
+				int ret = shutup_noisy_port(sm, source_lid,
 							    port_num,
 							    num_received);
 				if (ret == 1) /* port disabled */
@@ -562,22 +555,8 @@ check_sweep:
 		       sizeof(ib_gid_t));
 	} else {
 		/* Need to use the IssuerLID */
-		p_tbl = &sm->p_subn->port_lid_tbl;
-
-		CL_ASSERT(cl_ptr_vector_get_size(p_tbl) < 0x10000);
-
-		if ((uint16_t) cl_ptr_vector_get_size(p_tbl) <=
-		    cl_ntoh16(source_lid)) {
-			/*  the source lid is out of range */
-			OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
-				"source lid is out of range:%u\n",
-				cl_ntoh16(source_lid));
-
-			goto Exit;
-		}
-		p_port = cl_ptr_vector_get(p_tbl, cl_ntoh16(source_lid));
-		if (p_port == 0) {
-			/* We have the lid - but no corresponding port */
+		p_port = osm_get_port_by_lid(sm->p_subn, source_lid);
+		if (!p_port) {
 			OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
 				"Cannot find port corresponding to lid:%u\n",
 				cl_ntoh16(source_lid));
diff --git a/opensm/opensm/osm_ucast_ftree.c b/opensm/opensm/osm_ucast_ftree.c
index 39268eb..88ea344 100644
--- a/opensm/opensm/osm_ucast_ftree.c
+++ b/opensm/opensm/osm_ucast_ftree.c
@@ -2994,8 +2994,8 @@ static void fabric_route_roots(IN ftree_fabric_t * p_ftree)
 			    p_leaf_sw->hops[lid] == OSM_NO_PATH)
 				continue;
 
-			p_port = cl_ptr_vector_get(
-				&p_ftree->p_osm->subn.port_lid_tbl, lid);
+			p_port = osm_get_port_by_lid_ho(&p_ftree->p_osm->subn,
+							lid);
 
 			/* we're interested only in switches */
 			if (!p_port || !p_port->p_node->sw)
diff --git a/opensm/opensm/osm_ucast_lash.c b/opensm/opensm/osm_ucast_lash.c
index 3054a56..4669946 100644
--- a/opensm/opensm/osm_ucast_lash.c
+++ b/opensm/opensm/osm_ucast_lash.c
@@ -1008,7 +1008,7 @@ static void populate_fwd_tbls(lash_t * p_lash)
 		memset(p_sw->new_lft, OSM_NO_PATH, p_sw->lft_size);
 
 		for (lid = 1; lid <= max_lid_ho; lid++) {
-			port = cl_ptr_vector_get(&p_subn->port_lid_tbl, lid);
+			port = osm_get_port_by_lid_ho(p_subn, lid);
 			if (!port)
 				continue;
 
diff --git a/opensm/opensm/osm_ucast_updn.c b/opensm/opensm/osm_ucast_updn.c
index 01e40eb..164c6f4 100644
--- a/opensm/opensm/osm_ucast_updn.c
+++ b/opensm/opensm/osm_ucast_updn.c
@@ -280,20 +280,18 @@ static int updn_subn_rank(IN updn_t * p_updn)
 }
 
 /* hack: preserve min hops entries to any other root switches */
-static void updn_clear_non_root_hops(updn_t * p_updn, osm_switch_t * p_sw)
+static void updn_clear_non_root_hops(updn_t * updn, osm_switch_t * sw)
 {
-	osm_port_t *p_port;
+	osm_port_t *port;
 	unsigned i;
 
-	for (i = 0; i < p_sw->num_hops; i++)
-		if (p_sw->hops[i]) {
-			p_port =
-			    cl_ptr_vector_get(&p_updn->p_osm->subn.port_lid_tbl,
-					      i);
-			if (!p_port || !p_port->p_node->sw
-			    || ((struct updn_node *)p_port->p_node->sw->priv)->
+	for (i = 0; i < sw->num_hops; i++)
+		if (sw->hops[i]) {
+			port = osm_get_port_by_lid_ho(&updn->p_osm->subn, i);
+			if (!port || !port->p_node->sw
+			    || ((struct updn_node *)port->p_node->sw->priv)->
 			    rank != 0)
-				memset(p_sw->hops[i], 0xff, p_sw->num_ports);
+				memset(sw->hops[i], 0xff, sw->num_ports);
 		}
 }
 
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH] opensm/osm_lid_mgr.c: fix memory leak
From: Sasha Khapyorsky @ 2010-04-25 14:06 UTC (permalink / raw)
  To: linux-rdma


When during LIDs assignment process free lid range is consumed its
memory should be freed (as well as removing from free ranges list).

Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
 opensm/opensm/osm_lid_mgr.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/opensm/opensm/osm_lid_mgr.c b/opensm/opensm/osm_lid_mgr.c
index f14d377..9896196 100644
--- a/opensm/opensm/osm_lid_mgr.c
+++ b/opensm/opensm/osm_lid_mgr.c
@@ -636,11 +636,12 @@ static void lid_mgr_find_free_lid_range(IN osm_lid_mgr_t * p_mgr,
 		/* but we can be out of the range */
 		if (lid + num_lids - 1 <= p_range->max_lid) {
 			/* ok let us use that range */
-			if (lid + num_lids - 1 == p_range->max_lid)
+			if (lid + num_lids - 1 == p_range->max_lid) {
 				/* we consumed the entire range */
 				cl_qlist_remove_item(&p_mgr->free_ranges,
 						     p_item);
-			else
+				free(p_item);
+			} else
 				/* only update the available range */
 				p_range->min_lid = lid + num_lids;
 
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH] opensm: Always set enabled speed and width
From: Eli Dorfman (Voltaire) @ 2010-04-25 11:04 UTC (permalink / raw)
  To: linux-rdma; +Cc: Sasha Khapyorsky, Erez Cohen

Initialize default link speed and width to "No State Change" and
always set in SubnSet(PortInfo)

Signed-off-by: Eli Dorfman <elid-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
 infiniband-diags/src/ibportstate.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/infiniband-diags/src/ibportstate.c b/infiniband-diags/src/ibportstate.c
index 66f069e..b99c0e1 100644
--- a/infiniband-diags/src/ibportstate.c
+++ b/infiniband-diags/src/ibportstate.c
@@ -64,13 +64,13 @@ enum port_ops {
 };
 
 struct ibmad_port *srcport;
-int speed = 15;
-int width = 255;
+int speed = 0; /* no state change */
+int width = 0; /* no state change */
 int lid;
 int smlid;
 int lmc;
 int mtu;
-int vls;
+int vls = 0; /* no state change */
 
 struct {
 	const char *name;
@@ -394,12 +394,11 @@ int main(int argc, char **argv)
 			mad_set_field(data, 0, IB_PORT_STATE_F, 4);
 			break;
 		}
-		if (port_args[SPEED].set)
-			mad_set_field(data, 0, IB_PORT_LINK_SPEED_ENABLED_F,
-				      speed);
-		if (port_args[WIDTH].set)
-			mad_set_field(data, 0, IB_PORT_LINK_WIDTH_ENABLED_F,
-				      width);
+
+		/* always set enabled speed/width - defaults to NOP */
+		mad_set_field(data, 0, IB_PORT_LINK_SPEED_ENABLED_F, speed);
+		mad_set_field(data, 0, IB_PORT_LINK_WIDTH_ENABLED_F, width);
+
 		if (port_args[VLS].set)
 			mad_set_field(data, 0, IB_PORT_OPER_VLS_F, vls);
 		if (port_args[MTU].set)
-- 
1.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: SDP bugs 2027 and 2028
From: Amir Vadai @ 2010-04-25  7:35 UTC (permalink / raw)
  To: Andrea Gozzelino
  Cc: Tung, Chien Tin, Steve Wise,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org,
	peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
	pavel-+ZI9xUNit7I@public.gmane.org,
	mingo-X9Un+BFzKDI@public.gmane.org, Eric B Munson
In-Reply-To: <484607.1272033291418.SLOX.WebMail.wwwrun-XDIR3SKYeFbgKi2NxijLtw@public.gmane.org>

I have a fix for 2027 (number of SGE's issue) read.
I'm busy with other things - but hopefully will succeed testing it and
pushing it today.

As to 2028 (No FMR support) - I need pushed a fix to only disable ZCopy
when no FMR facility.
I don't have time right now to add support for fast memory registeration
when FMR is not available - but Steve said he'll help with implementing it.

- Amir

On 04/23/2010 05:34 PM, Andrea Gozzelino wrote:
> Hi Amir, 
>
> have you any news about bug 2027 and 2028 (SDP)?
>
> Take care and keep in touch.
> Thamk you very much,
> Andrea
>
>
> On Apr 21, 2010 02:01 PM, Amir Vadai <amirv-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org> wrote:
>
>   
>> Hi Andrea,
>>
>> I am preparing the fix right now.
>>
>> - Amir
>>
>> On 04/20/2010 04:53 PM, Andrea Gozzelino wrote:
>>     
>>> Hi Amir,
>>>
>>> have you any news about bugs 2027 "SDP not respecting # SGEs as
>>> reported
>>> from HW" and 2028 "SDP should support fastreg mrs"?
>>>
>>> When those bugs will be fixed, I will test the NE020 cards
>>> performance
>>> with SDP protocol and I will compare SDP and TCP.
>>>
>>> Keep in touch,
>>>
>>> Andrea Gozzelino
>>>
>>> INFN - Laboratori Nazionali di Legnaro	(LNL)
>>> Viale dell'Universita' 2
>>> I-35020 - Legnaro (PD)- ITALIA
>>> Tel: +39 049 8068346
>>> Fax: +39 049 641925
>>> Mail: andrea.gozzelino-PK20h7lG/Rc1GQ1Ptb7lUw@public.gmane.org
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Apr 15, 2010 10:38 AM, Amir Vadai <amirv-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org> wrote:
>>>
>>>   
>>>       
>>>> It should be a simple fix and I plan to do soon - just add yourself
>>>> as
>>>> CC in bugzilla  - that way I won't forget to notify you.
>>>>
>>>> - amir
>>>>
>>>> On 04/15/2010 10:07 AM, Andrea Gozzelino wrote:
>>>>     
>>>>         
>>>>> On Apr 15, 2010 08:24 AM, Amir Vadai <amirv-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org> wrote:
>>>>>
>>>>>   
>>>>>       
>>>>>           
>>>>>> I hope to have a fix next week for the first one.
>>>>>>
>>>>>> Thanks,
>>>>>> Amir
>>>>>>
>>>>>> On 04/14/2010 09:48 PM, Tung, Chien Tin wrote:
>>>>>>     
>>>>>>         
>>>>>>             
>>>>>>>> Tung, Chien Tin wrote:
>>>>>>>>     
>>>>>>>>         
>>>>>>>>             
>>>>>>>>                 
>>>>>>>>>> One more thing - Please open a bug regarding the num_sge
>>>>>>>>>> limitation at:
>>>>>>>>>> https://bugs.openfabrics.org/
>>>>>>>>>>
>>>>>>>>>>         
>>>>>>>>>>             
>>>>>>>>>>                 
>>>>>>>>>>                     
>>>>>>>>> Done, Bug 2027.
>>>>>>>>>
>>>>>>>>> Chien
>>>>>>>>>
>>>>>>>>>       
>>>>>>>>>           
>>>>>>>>>               
>>>>>>>>>                   
>>>>>>>> And 2028 opened to request fastreg support.
>>>>>>>>
>>>>>>>>     
>>>>>>>>         
>>>>>>>>             
>>>>>>>>                 
>>>>>>> I am open to test fixes for these two bugs.
>>>>>>>
>>>>>>> Chien
>>>>>>>
>>>>>>>   
>>>>>>>       
>>>>>>>           
>>>>>>>               
>>>>>>     
>>>>>>         
>>>>>>             
>>>>> Hi Amir, 
>>>>> Hi Chien,
>>>>>
>>>>> I understand that the bug 2027 could be solved next week, so I
>>>>> will
>>>>> test
>>>>> SDP protocol performance on NE020 cards.
>>>>> Is it correct? 
>>>>> If yes, could you point out the code modifies?
>>>>>
>>>>> Keep in touch and take care.
>>>>> Regards,
>>>>> Andrea
>>>>>
>>>>>
>>>>> Andrea Gozzelino
>>>>>
>>>>> INFN - Laboratori Nazionali di Legnaro	(LNL)
>>>>> Viale dell'Universita' 2
>>>>> I-35020 - Legnaro (PD)- ITALIA
>>>>> Tel: +39 049 8068346
>>>>> Fax: +39 049 641925
>>>>> Mail: andrea.gozzelino-PK20h7lG/Rc1GQ1Ptb7lUw@public.gmane.org			
>>>>>
>>>>>
>>>>>   
>>>>>       
>>>>>           
>>>>     
>>>>         
>>> 		
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe
>>> linux-rdma" in
>>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>   
>>>       
>>     
>
>
>
>   
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: Socket Direct Protocol: help (2)
From: Andrea Gozzelino @ 2010-04-23 14:35 UTC (permalink / raw)
  To: Amir Vadai
  Cc: Andrea Gozzelino, Tung, Chien Tin, Steve Wise,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org,
	peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org,
	pavel-+ZI9xUNit7I@public.gmane.org,
	mingo-X9Un+BFzKDI@public.gmane.org, Eric B Munson
In-Reply-To: <4BCEE8FE.6050805-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>

Hi Amir, 

have you any news about bugs 2027 and 2028 (SDP)?

Take care and keep in touch.
Thamk you very much,
Andrea



On Apr 21, 2010 02:01 PM, Amir Vadai <amirv-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org> wrote:

> Hi Andrea,
> 
> I am preparing the fix right now.
> 
> - Amir
> 
> On 04/20/2010 04:53 PM, Andrea Gozzelino wrote:
> > Hi Amir,
> >
> > have you any news about bugs 2027 "SDP not respecting # SGEs as
> > reported
> > from HW" and 2028 "SDP should support fastreg mrs"?
> >
> > When those bugs will be fixed, I will test the NE020 cards
> > performance
> > with SDP protocol and I will compare SDP and TCP.
> >
> > Keep in touch,
> >
> > Andrea Gozzelino
> >
> > INFN - Laboratori Nazionali di Legnaro	(LNL)
> > Viale dell'Universita' 2
> > I-35020 - Legnaro (PD)- ITALIA
> > Tel: +39 049 8068346
> > Fax: +39 049 641925
> > Mail: andrea.gozzelino-PK20h7lG/Rc1GQ1Ptb7lUw@public.gmane.org
> >
> >
> >
> >
> >
> >
> >
> > On Apr 15, 2010 10:38 AM, Amir Vadai <amirv-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org> wrote:
> >
> >   
> >> It should be a simple fix and I plan to do soon - just add yourself
> >> as
> >> CC in bugzilla  - that way I won't forget to notify you.
> >>
> >> - amir
> >>
> >> On 04/15/2010 10:07 AM, Andrea Gozzelino wrote:
> >>     
> >>> On Apr 15, 2010 08:24 AM, Amir Vadai <amirv-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org> wrote:
> >>>
> >>>   
> >>>       
> >>>> I hope to have a fix next week for the first one.
> >>>>
> >>>> Thanks,
> >>>> Amir
> >>>>
> >>>> On 04/14/2010 09:48 PM, Tung, Chien Tin wrote:
> >>>>     
> >>>>         
> >>>>>> Tung, Chien Tin wrote:
> >>>>>>     
> >>>>>>         
> >>>>>>             
> >>>>>>>> One more thing - Please open a bug regarding the num_sge
> >>>>>>>> limitation at:
> >>>>>>>> https://bugs.openfabrics.org/
> >>>>>>>>
> >>>>>>>>         
> >>>>>>>>             
> >>>>>>>>                 
> >>>>>>> Done, Bug 2027.
> >>>>>>>
> >>>>>>> Chien
> >>>>>>>
> >>>>>>>       
> >>>>>>>           
> >>>>>>>               
> >>>>>> And 2028 opened to request fastreg support.
> >>>>>>
> >>>>>>     
> >>>>>>         
> >>>>>>             
> >>>>> I am open to test fixes for these two bugs.
> >>>>>
> >>>>> Chien
> >>>>>
> >>>>>   
> >>>>>       
> >>>>>           
> >>>>     
> >>>>         
> >>> Hi Amir, 
> >>> Hi Chien,
> >>>
> >>> I understand that the bug 2027 could be solved next week, so I
> >>> will
> >>> test
> >>> SDP protocol performance on NE020 cards.
> >>> Is it correct? 
> >>> If yes, could you point out the code modifies?
> >>>
> >>> Keep in touch and take care.
> >>> Regards,
> >>> Andrea
> >>>
> >>>
> >>> Andrea Gozzelino
> >>>
> >>> INFN - Laboratori Nazionali di Legnaro	(LNL)
> >>> Viale dell'Universita' 2
> >>> I-35020 - Legnaro (PD)- ITALIA
> >>> Tel: +39 049 8068346
> >>> Fax: +39 049 641925
> >>> Mail: andrea.gozzelino-PK20h7lG/Rc1GQ1Ptb7lUw@public.gmane.org			
> >>>
> >>>
> >>>   
> >>>       
> >>     
> >
> > 		
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe
> > linux-rdma" in
> > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >   
> 


Andrea Gozzelino

INFN - Laboratori Nazionali di Legnaro	(LNL)
Viale dell'Universita' 2
I-35020 - Legnaro (PD)- ITALIA
Tel: +39 049 8068346
Fax: +39 049 641925
Mail: andrea.gozzelino-PK20h7lG/Rc1GQ1Ptb7lUw@public.gmane.org			

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox