[PATCH] opensm/osm_torus.c: Increase PORTGRP_MAX_PORTS define

2014-12-17 Thread Alex Netes
Torus-2QoS fails to configure fabric with more than 16 HCAs.
This patch extends PORTGRP_MAX_PORTS to be 34. Maximal practical ports
per switch - 2 reserved ports (minimal of needed ports for switch to
switch connections in 2D Torus).

Signed-off-by: Alex Netes 
---
 opensm/osm_torus.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/opensm/osm_torus.c b/opensm/osm_torus.c
index 330f55d..b01f69f 100644
--- a/opensm/osm_torus.c
+++ b/opensm/osm_torus.c
@@ -59,7 +59,7 @@
 #include 
 
 #define TORUS_MAX_DIM3
-#define PORTGRP_MAX_PORTS16
+#define PORTGRP_MAX_PORTS34
 #define SWITCH_MAX_PORTGRPS  (1 + 2 * TORUS_MAX_DIM)
 #define DEFAULT_MAX_CHANGES  32
 
-- 
1.7.1

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


RE: [PATCH] opensm/osm_torus.c: Increase PORTGRP_MAX_PORTS define

2014-12-17 Thread Alex Netes
> > Torus-2QoS fails to configure fabric with more than 16 HCAs.
> > This patch extends PORTGRP_MAX_PORTS to be 34. Maximal practical
> ports
> > per switch - 2 reserved ports (minimal of needed ports for switch to
> > switch connections in 2D Torus).
> >
> > Signed-off-by: Alex Netes 
> > ---
> >  opensm/osm_torus.c |2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/opensm/osm_torus.c b/opensm/osm_torus.c index
> > 330f55d..b01f69f 100644
> > --- a/opensm/osm_torus.c
> > +++ b/opensm/osm_torus.c
> > @@ -59,7 +59,7 @@
> >  #include 
> >
> >  #define TORUS_MAX_DIM3
> > -#define PORTGRP_MAX_PORTS16
> > +#define PORTGRP_MAX_PORTS34
> >  #define SWITCH_MAX_PORTGRPS  (1 + 2 * TORUS_MAX_DIM)  #define
> > DEFAULT_MAX_CHANGES  32
> >
> 
> There is portgroup_max_ports configuration parameter for torus to change
> this if needed.
> 
> man torus-2QoS.conf states:
>portgroup_max_ports max_ports
>   This keyword specifies the maximum  number  of  parallel  inter-
>   switch  links,  and  also  the  maximum number of host ports per
>   switch, that torus-2QoS can accommodate.  The default  value  is
>   16.   Torus-2QoS  will log an error message during topology dis-
>   covery if this parameter needs to be increased.  If this keyword
>   appears multiple times, the last instance prevails.
> 
>   Note  that  the  switch management port (switch port 0) gets put
>   into the same port group with the host ports, so if you have  16
>   host  ports  per switch, portgroup_max_ports would need to be at
>   least 17.
> 
> Is there really a need to change the default for this ?

No. Missed that. Please ignore.

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


[PATCH] opensm: MFT distribution improvement

2010-06-02 Thread Alex Netes
The patch reduces the number of MFT set MADs beeing send,
by sending only blocks that have been changed since the
last time same block was issued.

Signed-off-by: Alex Netes 
---
 opensm/include/opensm/osm_mcast_tbl.h |   49 ++-
 opensm/opensm/osm_dump.c  |2 +-
 opensm/opensm/osm_mcast_mgr.c |   15 +-
 opensm/opensm/osm_mcast_tbl.c |  104 -
 4 files changed, 124 insertions(+), 46 deletions(-)

diff --git a/opensm/include/opensm/osm_mcast_tbl.h 
b/opensm/include/opensm/osm_mcast_tbl.h
index 37e2c26..f1f12ad 100644
--- a/opensm/include/opensm/osm_mcast_tbl.h
+++ b/opensm/include/opensm/osm_mcast_tbl.h
@@ -76,7 +76,9 @@ typedef struct osm_mcast_fwdbl {
uint16_t num_entries;
uint16_t max_mlid_ho;
uint16_t mft_depth;
-   uint16_t(*p_mask_tbl)[][IB_MCAST_POSITION_MAX + 1];
+   uint16_t(*p_new_mask_tbl)[][IB_MCAST_BLOCK_SIZE*(IB_MCAST_POSITION_MAX 
+ 1)];
+   uint16_t(*p_mask_tbl)[][IB_MCAST_BLOCK_SIZE*(IB_MCAST_POSITION_MAX + 
1)];
+   uint16_t is_first_block[IB_MCAST_MAX_BLOCK_ID];
 } osm_mcast_tbl_t;
 /*
 * FIELDS
@@ -104,11 +106,20 @@ typedef struct osm_mcast_fwdbl {
 *  Number of MLIDs in the currently allocated multicast port mask
 *  table.
 *
-*  p_mask_tbl
-*  Pointer to a two dimensional array of port_masks for this 
switch.
-*  The first dimension is MLID offset, second dimension is mask 
position.
+*  p_new_mask_tbl
+*  Pointer to a two dimensional array of (IB_MCAST_POSITION_MAX + 
1)
+*  MFT blocks. The first dimensional is MFT block offset, second 
dimension
+*  is (IB_MCAST_POSITION_MAX + 1) MFT blocks of the same mlid 
offset.
 *  This pointer is null for switches that do not support multicast.
 *
+*  p_mask_tbl
+*  Pointer to a table, that is being filled when MFT table is 
recieved
+*  after applying the tables to the switches.
+*
+*  is_first_block
+*  Table that for each block indicates whether it's being issued 
for
+*  the first time.
+*
 * SEE ALSO
 */
 
@@ -482,5 +493,35 @@ osm_mcast_tbl_get_max_position(IN osm_mcast_tbl_t * p_tbl)
 * SEE ALSO
 */
 
+/f* OpenSM: Forwarding Table/osm_mcast_tbl_diff
+* NAME
+*  osm_mcast_cmpr_tbl_block
+*
+* DESCRIPTION
+*  Compares between two multicast forwarding table blocks.
+*
+* SYNOPSIS
+*/
+boolean_t osm_mcast_tbl_diff(IN osm_mcast_tbl_t * p_tbl,
+  IN int16_t block_num, IN uint8_t position);
+/*
+* PARAMETERS
+*  p_tbl
+*  [in] Pointer to an osm_mcast_tbl_t object.
+*
+*  p_block
+*  [in] Pointer to the Forwarding Table block.
+*
+*  block_num
+*  [in] Block number of this block.
+*
+* RETURN VALUES
+*  Returns TRUE if block is not idnetical in p_new_mask_tbl
+*  and p_mask_tbl. FALSE otherwise.
+*
+* NOTES
+*
+* SEE ALSO
+*/
 END_C_DECLS
 #endif /* _OSM_MCAST_TBL_H_ */
diff --git a/opensm/opensm/osm_dump.c b/opensm/opensm/osm_dump.c
index fe2c3bc..adad23c 100644
--- a/opensm/opensm/osm_dump.c
+++ b/opensm/opensm/osm_dump.c
@@ -263,7 +263,7 @@ static void dump_mcast_routes(cl_map_item_t * item, FILE * 
file, void *cxt)
while (position <= p_tbl->max_position) {
mask_entry =
cl_ntoh16((*p_tbl->
-  p_mask_tbl)[mlid_ho][position]);
+  
p_new_mask_tbl)[mlid_ho][position]);
if (mask_entry == 0) {
position++;
continue;
diff --git a/opensm/opensm/osm_mcast_mgr.c b/opensm/opensm/osm_mcast_mgr.c
index 322635d..d5a49bf 100644
--- a/opensm/opensm/osm_mcast_mgr.c
+++ b/opensm/opensm/osm_mcast_mgr.c
@@ -380,8 +380,20 @@ static int mcast_mgr_set_mft_block(osm_sm_t * sm, IN 
osm_switch_t * p_sw,
 
p_tbl = osm_switch_get_mcast_tbl_ptr(p_sw);
 
+   /*
+ Send MFT block only if one of the following persists:
+ 1) There is a connectiviry change in the switch.
+ 2) This is the first time, the block is sent.
+ 3) New block is different than the previous time the
+block was sent.
+*/
+
if (osm_mcast_tbl_get_block(p_tbl, (uint16_t) block_num,
-   (uint8_t) position, block)) {
+   (uint8_t) position, block) &&
+   p_sw->need_update != 0 ||
+   p_tbl->is_first_block[block_num] ||
+   osm_mcast_tbl_diff(p_tbl,
+  uint16_t) 
block_num,(uint8_t) position))) {

[PATCH] opensm: Fix crash during handover

2014-03-04 Thread Alex Netes
Another MASTER SM with lower priority sends HANDOVER to our SM,
before our SM *starts* polling it.

In sm_state_mgr_start_polling() there is no validation whether
p_polling_sm is valid.

Signed-off-by: Alex Netes 
---
 include/opensm/osm_sm.h   |2 +-
 opensm/osm_drop_mgr.c |6 +++---
 opensm/osm_sm_state_mgr.c |   12 ++--
 opensm/osm_sminfo_rcv.c   |2 +-
 opensm/osm_state_mgr.c|2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/include/opensm/osm_sm.h b/include/opensm/osm_sm.h
index e48c549..94d1831 100644
--- a/include/opensm/osm_sm.h
+++ b/include/opensm/osm_sm.h
@@ -116,7 +116,7 @@ typedef struct osm_sm {
unsigned master_sm_found;
uint32_t retry_number;
ib_net64_t master_sm_guid;
-   osm_remote_sm_t *p_polling_sm;
+   ib_net64_t polling_sm_guid;
osm_subn_t *p_subn;
osm_db_t *p_db;
osm_vendor_t *p_vendor;
diff --git a/opensm/osm_drop_mgr.c b/opensm/osm_drop_mgr.c
index ff6a81b..c1cdc0d 100644
--- a/opensm/osm_drop_mgr.c
+++ b/opensm/osm_drop_mgr.c
@@ -257,9 +257,9 @@ static void drop_mgr_remove_port(osm_sm_t * sm, IN 
osm_port_t * p_port)
OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
"Cleaned SM for port guid 0x%016" PRIx64 "\n",
cl_ntoh64(port_guid));
-   /* clean up the polling_sm pointer */
-   if (sm->p_polling_sm == p_sm)
-   sm->p_polling_sm = NULL;
+   /* clean up the polling_sm_guid */
+   if (sm->polling_sm_guid == p_sm->smi.guid)
+   sm->polling_sm_guid = 0;
free(p_sm);
}
 
diff --git a/opensm/osm_sm_state_mgr.c b/opensm/osm_sm_state_mgr.c
index 0660fb9..e5a11da 100644
--- a/opensm/osm_sm_state_mgr.c
+++ b/opensm/osm_sm_state_mgr.c
@@ -97,11 +97,11 @@ static boolean_t 
sm_state_mgr_send_master_sm_info_req(osm_sm_t * sm, uint8_t sm_
} else {
/*
 * We are not in STANDBY - this means we are in MASTER state -
-* so we need to poll the SM that is saved in p_polling_sm
+* so we need to poll the SM that is saved in polling_sm_guid
 * under sm.
 * Send a query of SubnGet(SMInfo) to that SM.
 */
-   guid = sm->p_polling_sm->smi.guid;
+   guid = sm->polling_sm_guid;
}
 
/* Verify that SM is not polling itself */
@@ -198,7 +198,7 @@ void osm_sm_state_mgr_polling_callback(IN void *context)
 * If we are not in one of these cases - don't need to restart the 
poller.
 */
if (!((sm_state == IB_SMINFO_STATE_MASTER &&
-  sm->p_polling_sm != NULL) ||
+  sm->polling_sm_guid != 0) ||
  sm_state == IB_SMINFO_STATE_STANDBY)) {
CL_PLOCK_RELEASE(sm->p_lock);
goto Exit;
@@ -426,7 +426,7 @@ ib_api_status_t osm_sm_state_mgr_process(osm_sm_t * sm,
 * We want to force a heavy sweep - hopefully this
 * occurred because the remote sm died, and we'll find
 * this out and configure the subnet after a heavy 
sweep.
-* We also want to clear the p_polling_sm object - since
+* We also want to clear the polling_sm_guid - since
 * we are done polling on that remote sm - we are
 * sweeping again.
 */
@@ -438,7 +438,7 @@ ib_api_status_t osm_sm_state_mgr_process(osm_sm_t * sm,
 * change, or we are in idle state - since we
 * recognized a master SM before - so we want to make a
 * heavy sweep and reconfigure the new subnet.
-* We also want to clear the p_polling_sm object - since
+* We also want to clear the polling_sm_guid - since
 * we are done polling on that remote sm - we got a
 * handover from it.
 */
@@ -449,7 +449,7 @@ ib_api_status_t osm_sm_state_mgr_process(osm_sm_t * sm,
 * SM may have configure/done on the fabric.
 */
sm->p_subn->set_client_rereg_on_sweep = TRUE;
-   sm->p_polling_sm = NULL;
+   sm->polling_sm_guid = 0;
sm->p_subn->force_heavy_sweep = TRUE;
osm_sm_signal(sm, OSM_SIGNAL_SWEEP);
break;
diff --git a/opensm/osm_sminfo_rcv.c b/opensm/osm_sminfo_rcv.c
index 66ad410..9f62f9f 100644
--- a/opensm/osm_sminfo_rcv.c
+++ b/opensm/osm_sminfo_rcv.c
@@ -392,7 +392,7 @@ static void smi_rcv_process_get_sm(IN osm_sm_t * sm,
 * as it m

[PATCH] opensm/osm_sminfo_rcv.c: send trap144 to a newly found MASTER SM when in MASTER state

2014-03-06 Thread Alex Netes
Before this patch, when SM in Master state finds other Master SM, it
sends trap144 to previously found Master SM/SM with higher priority when
it was in Discovering/Standby state.
This can lead to wrong behaviour in a multi-SM topolgy:

Setup: SM1 with priority 1, SM2 with priority 2, SM3 with priority 3.
Flow:
1. setting SM3 to ignore SMInfo MADs -> SM2 become master
2. setting SM2 to ignore SMInfo MADs -> SM1 become master
3. setting SM2 to accept SMInfo MADs
4. SM2 sends SMInfo to SM1 -> finds that SM1 is master
5. SM2 sends trap144 to SM3 instead of sending it to SM1

Signed-off-by: Alex Netes 
---
 opensm/osm_sminfo_rcv.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/opensm/osm_sminfo_rcv.c b/opensm/osm_sminfo_rcv.c
index 9f62f9f..100a82d 100644
--- a/opensm/osm_sminfo_rcv.c
+++ b/opensm/osm_sminfo_rcv.c
@@ -395,8 +395,13 @@ static void smi_rcv_process_get_sm(IN osm_sm_t * sm,
if (sm->polling_sm_guid) {
if (smi_rcv_remote_sm_is_higher(sm, p_smi))
sm->p_subn->force_heavy_sweep = TRUE;
-   else
+   else {
+   /* Update master_sm_guid to the GUID of 
the newly
+* found MASTER SM and send trap 144 to 
it.
+*/
+   sm->master_sm_guid = 
sm->polling_sm_guid;
osm_send_trap144(sm, 
TRAP_144_MASK_SM_PRIORITY_CHANGE);
+   }
osm_sm_state_mgr_signal_master_is_alive(sm);
} else {
/* This is a response we got while sweeping the 
subnet.
-- 
1.7.1

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


[PATCH] opensm: fix locking in osm_guid_mgr_process

2012-06-03 Thread Alex Netes
osm_guid_mgr_process() should take lock when processing alias_guid_list.

Signed-off-by: Alex Netes 
---
 opensm/osm_guid_mgr.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/opensm/osm_guid_mgr.c b/opensm/osm_guid_mgr.c
index 73a32ac..42c7794 100644
--- a/opensm/osm_guid_mgr.c
+++ b/opensm/osm_guid_mgr.c
@@ -129,6 +129,7 @@ void osm_guid_mgr_process(IN osm_sm_t * sm) {
 
OSM_LOG(sm->p_log, OSM_LOG_DEBUG, "Processing alias guid list\n");
 
+   CL_PLOCK_EXCL_ACQUIRE(sm->p_lock);
while (cl_qlist_count(&sm->p_subn->alias_guid_list)) {
p_obj = (osm_guidinfo_work_obj_t *) 
cl_qlist_remove_head(&sm->p_subn->alias_guid_list);
guidinfo_set(&sm->p_subn->p_osm->sa, p_obj->p_port,
@@ -136,5 +137,6 @@ void osm_guid_mgr_process(IN osm_sm_t * sm) {
osm_guid_work_obj_delete(p_obj);
}
 
+   CL_PLOCK_RELEASE(sm->p_lock);
OSM_LOG_EXIT(sm->p_log);
 }
-- 
1.7.10.2

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


Re: [PATCH][RESEND] opensm/osm_ucast_dfsssp.c: Use osm_log_is_active

2012-06-03 Thread Alex Netes
Hi Hal,

On 10:49 Wed 30 May , Hal Rosenstock wrote:
> 
> rather than osm_log_get_level to determine whether log level is active.
> Log level is bit mask so >= doesn't always work properly.
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH] opensm/osm_ucast_ftree.c: Add a couple of asserts

2012-06-03 Thread Alex Netes
Hi Hal,

On 10:33 Wed 30 May , Hal Rosenstock wrote:
> 
> Also, fix some commentary typos
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH][TRIVIAL] opensm/include/opensm/osm_log.h: Fix commentary cut 'n paste error

2012-06-03 Thread Alex Netes
Hi Hal,

On 10:42 Wed 30 May , Hal Rosenstock wrote:
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH][TRIVIAL] opensm/complib/cl_fleximap.h: Cosmetic changes

2012-06-03 Thread Alex Netes
Hi Hal,

On 10:43 Wed 30 May , Hal Rosenstock wrote:
> 
> Fix typo and some formatting changes
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH] opensm/opensm_release_notes-3.3.txt: Update Unsupported IB Compliance Statements

2012-06-03 Thread Alex Netes
Hi Hal,

On 11:26 Wed 30 May , Hal Rosenstock wrote:
> 
> GUIDInfo is now supported (alias GUID support)
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH] opensm/osm_subnet.c: Fixed ftree/updn configuration failure when root_guid_file points to non-existing file

2012-06-03 Thread Alex Netes
Hi Hal,

On 19:28 Wed 30 May , Hal Rosenstock wrote:
> 
> Signed-off-by: Ilya Nelkenbaum 
> Reviewed-by: Hal Rosenstock 
> ---

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


Re: [PATCH] opensm: Add partition manager configuration doc to docs

2012-06-13 Thread Alex Netes
Hi Hal,

On 13:04 Wed 06 Jun , Hal Rosenstock wrote:
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH 2/3] opensm: Cosmetic changes

2012-06-13 Thread Alex Netes
Hi Hal,

On 20:34 Wed 06 Jun , Hal Rosenstock wrote:
> From d3795beefe4a023f043ae522a7ac040d4f232dfb Mon Sep 17 00:00:00 2001
> From: Hal Rosenstock 
> Date: Thu, 7 Jun 2012 03:04:49 +0300
> Subject: [PATCH 2/3] opensm: Cosmetic changes
> 
> Fix some typos
> Fix some formatting (replaces spaces with tabs)
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH] opensm: Fix pthread_create() return value checks

2012-06-13 Thread Alex Netes
Hi Bart,

On 19:16 Thu 07 Jun , Bart Van Assche wrote:
> Just like other POSIX thread functions, pthread_create() either returns zero
> or a positive error code. Found this through source code review. See also
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_create.html
> 
> Signed-off-by: Bart Van Assche 
> ---

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


Re: [PATCHv3 1/3] opensm: Add per module logging support

2012-07-02 Thread Alex Netes
Hi Hal,

On 13:03 Thu 07 Jun , Hal Rosenstock wrote:
> Add _v2 APIs for osm_log, osm_log_is_active, and osm_log_msg_box
> Also, add these to libopensm.map
> 
> All of above pass additional parameter to identify module.
> Each module defines a unique FILE_ID from 0-255.
> FILE_ID must match index in osm_subnet.c:module_name_str
> table.
> 
> Modify OSM_LOG macros to use version 2 log APIs when FILE_ID
> is defined. Modify OpenSM client code to use version 2 log
> APIs when used log functions and not macros.
> 
> Added options to enable/disable per module logging and
> it's configuration file
> 
> Config file format
> Set of lines with module name and logging level as follows:
> 
> where:
> module name is file name including .c
> separator is either = , space, or tab
> logging level is the same levels as used in the coarse/overall logging
> as follows:
> 
>  BITLOG LEVEL ENABLED
>     -
>  0x01 - ERROR (error messages)
>  0x02 - INFO (basic messages, low volume)
>  0x04 - VERBOSE (interesting stuff, moderate volume)
>  0x08 - DEBUG (diagnostic, high volume)
>  0x10 - FUNCS (function entry/exit, very high volume)
>  0x20 - FRAMES (dumps all SMP and GMP frames)
>  0x40 - ROUTING (dump FDB routing information)
>  0x80 - SYS (syslog at LOG_INFO level in addition to OpenSM logging)
> 
> Add parsing of the configuration file into table of log levels
> indexed by FILE_ID
> 
> Added osm_get_log_per_module routine to obtain the configured info
> for a supplied module name. This is a new library function.
> 
> Signed-off-by: Hal Rosenstock 
> ---
> Changes since v2:
> Fixed find_module_name bug/typo
> Found and fixed by Ilya Nelkenbaum 
> 
> Changes since v1:
> Modify OSM_LOG macros to use version 2 log APIs when FILE_ID defined
> Eliminate magic numbers around per module logging table
> Based on comments from Jim Foraker 
> ---
> As this patch still is too large for email, please find this @
> https://www.openfabrics.org/~halr/0001-opensm-Add-per-module-logging-support.patch
> 
> --

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


Re: [PATCHv3 3/3] opensm: Add enum for FILE_ID for per module logging

2012-07-02 Thread Alex Netes
Hi Hal,

On 20:35 Wed 06 Jun , Hal Rosenstock wrote:
> From e1230ff977e5a3412a83e11d26c4fb2c0765ce31 Mon Sep 17 00:00:00 2001
> From: Hal Rosenstock 
> Date: Thu, 7 Jun 2012 03:19:15 +0300
> Subject: [PATCHv3 3/3] opensm: Add enum for FILE_ID for per module logging
> 
> An osm_file_ids_enum was added to new osm_file_ids_enum.h
> and a FILE_ID const definition to each source file.
> 
> Signed-off-by: Ilya Nelkenbaum 
> Signed-off-by: Hal Rosenstock 
> ---
> Changes since v2:
> Put osm_file_ids_enum into own header file rather than
> osm_sm.h
> 
> Changes since v1:
> opensm/osm_log.c: Use file_id rather than FILE_ID in
> osm_log_is_active_v2 call in osm_log_msg_box_v2 function
> ---

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


Re: [PATCH] opensm: Eliminate unneeded field in DR path structure

2012-07-02 Thread Alex Netes
Hi Hal,

On 06:31 Fri 15 Jun , Hal Rosenstock wrote:
> 
> h_bind is not needed as part of DR path
> 
> Found by Daniel Klein 
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH][TRIVIAL] opensm/osm_vendor_ibumad.c: Make binding log message clearer

2012-07-02 Thread Alex Netes
Hi Hal,

On 06:32 Fri 15 Jun , Hal Rosenstock wrote:
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH][TRIVIAL] opensm/osm_port.h: Fix commentary typo

2012-07-02 Thread Alex Netes
Hi Hal,

On 06:32 Fri 15 Jun , Hal Rosenstock wrote:
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH 4/3] opensm: Dump info functions update for per module logging

2012-07-02 Thread Alex Netes
Hi Hal,

On 06:13 Mon 18 Jun , Hal Rosenstock wrote:
> All information dump function calls were updated to _v2
> and those additional _v2 functions added to osm_helper.c.
> Log messages are generated by separate functions as well.
> 
> Signed-off-by: Ilya Nelkenbaum 
> Reviewed-by : Hal Rosenstock 
> ---

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


Re: [PATCH] opensm/osm_state_mgr.c: Force subn->need_update when coming out of STANDBY

2012-07-02 Thread Alex Netes
Hi Hal,

On 13:14 Mon 18 Jun , Hal Rosenstock wrote:
> When SM comes out of Standby, it might have data saved from the
> time it was previously MASTER. Because of that it might not send
> LFTs, pkeys and QoS configuration when it becomes MASTER again as
> it might see that there is no change in the configuration.
> But because we don't know what previous SM really configured, we
> must send LFTs, pkeys, and QoS configuration to all switches.
> 
> Signed-off-by: Daniel Klein 
> Signed-off-by: Vladimir Koushnir 
> Signed-off-by: Hal Rosenstock 
> Signed-off-by: Alex Netes 
> ---

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


Re: Patchwork back online

2012-07-10 Thread Alex Netes
Yey :)

On 10:08 Tue 10 Jul , Roland Dreier wrote:
> Not sure if everyone saw this, but thanks to the kernel.org crew,
> https://patchwork.kernel.org/project/linux-rdma/list/ is back online.
> 
> I've been delegating opensm patches to Alex Netes and diags
> patches to Ira Weiny.  Can someone refresh my memory about
> who looks after libibumad?  Is that Alex too?

I'm responsible for libibumad and Ira for libibmad.

> 
> Anyway, Alex and Ira, if you guys update patchwork when you
> apply or reject a patch, that would be great ... I'll try to avoid
> letting a big backlog of patches accumulate there too :)
> 

I see there only patches since 2012-07-02. Everything else is gone :(

> Thanks,
>   Roland
> --

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


[PATCH] opensm: fix part_enforce parameter parsing crash

2012-07-16 Thread Alex Netes
The default setting should use strdup, otherwise if set to different
value, opensm will crash on parsing.

Signed-off-by: Vladimir Koushnir 
Signed-off-by: Alex Netes 
---
 opensm/osm_subnet.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/opensm/osm_subnet.c b/opensm/osm_subnet.c
index 88b68d0..7372945 100644
--- a/opensm/osm_subnet.c
+++ b/opensm/osm_subnet.c
@@ -697,6 +697,7 @@ static void subn_opt_destroy(IN osm_subn_opt_t * p_opt)
free(p_opt->partition_config_file);
free(p_opt->qos_policy_file);
free(p_opt->dump_files_dir);
+   free(p_opt->part_enforce);
free(p_opt->lid_matrix_dump_file);
free(p_opt->lfts_file);
free(p_opt->root_guid_file);
@@ -1178,7 +1179,7 @@ void osm_subn_set_default_opt(IN osm_subn_opt_t * p_opt)
p_opt->log_max_size = 0;
p_opt->partition_config_file = 
strdup(OSM_DEFAULT_PARTITION_CONFIG_FILE);
p_opt->no_partition_enforcement = FALSE;
-   p_opt->part_enforce = OSM_PARTITION_ENFORCE_BOTH;
+   p_opt->part_enforce = strdup(OSM_PARTITION_ENFORCE_BOTH);
p_opt->allow_both_pkeys = FALSE;
p_opt->sm_assigned_guid = 0;
p_opt->qos = FALSE;
-- 
1.7.1

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


Re: [PATCH 5/8] opensm: Signal subnet init errors on SubnGet timeouts

2012-07-23 Thread Alex Netes
Hi Jim,

On 17:55 Mon 25 Jun , Jim Foraker wrote:
> A subnet should not be listed as cleanly initialized if CAs
> fail to respond to SubnGet requests.
> 
> Signed-off-by: Jim Foraker 
> ---
>  opensm/osm_sm_mad_ctrl.c |9 +
>  1 file changed, 9 insertions(+)
> 
> diff --git a/opensm/osm_sm_mad_ctrl.c b/opensm/osm_sm_mad_ctrl.c
> index f0bcff2..464b6b0 100644
> --- a/opensm/osm_sm_mad_ctrl.c
> +++ b/opensm/osm_sm_mad_ctrl.c
> @@ -741,6 +741,15 @@ static void sm_mad_ctrl_send_err_cb(IN void *context, IN 
> osm_madw_t * p_madw)
>   cl_ntoh16(p_smp->attr_id),
>   ib_get_sm_attr_str(p_smp->attr_id));
>   p_ctrl->p_subn->subnet_initialization_error = TRUE;
> + } else if (p_madw->status == IB_TIMEOUT &&
> +p_smp->method == IB_MAD_METHOD_GET) {

It's pretty common to see timeouts in fabrics without m_key support (e.g.
switch reboots) and it's not desirable to start another heavy sweep because
of that. So I guess it would be better if we could initiate heavy sweep only
when m_key is set and protection level is 2 or 3.

> + /* Timeouts on SubnGet may be an indication of an mkey
> +error at protection levels 2/3 */
> + OSM_LOG(p_ctrl->p_log, OSM_LOG_ERROR, "ERR 3120 "
> + "Timeout while getting attribute 0x%X (%s)\n",
> + cl_ntoh16(p_smp->attr_id),
> + ib_get_sm_attr_str(p_smp->attr_id));
> + p_ctrl->p_subn->subnet_initialization_error = TRUE;
>   }
>  
>   osm_dump_dr_smp(p_ctrl->p_log, p_smp, OSM_LOG_VERBOSE);
> -- 
> 1.7.9.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majord...@vger.kernel.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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH V1.1 1/8] opensm: Add guid2mkey cache file support

2012-07-23 Thread Alex Netes
Hi Jim,

On 17:25 Tue 03 Jul , Jim Foraker wrote:
> Adds support for a guid2mkey file, and uses the database
> to select which mkey to use in outgoing SMPs.

One thing that I notice that missing (and I'm not sure how common it's being 
used,
but still I see it as part of SUSE distro) is sldd.sh script found under
scripts. It distributes guid2lid between STANDBY SMs, so I think guid2mkey file
should be also redistributed between the STANDBY SMs.

> 
> Signed-off-by: Jim Foraker 
> ---
>  include/opensm/osm_db.h  |7 +-
>  include/opensm/osm_db_pack.h |  144 
> ++
>  include/opensm/osm_port.h|   23 ++-
>  include/opensm/osm_subnet.h  |2 +
>  opensm/osm_db_files.c|1 +
>  opensm/osm_db_pack.c |   73 +
>  opensm/osm_lid_mgr.c |   12 +++-
>  opensm/osm_link_mgr.c|   14 +++-
>  opensm/osm_opensm.c  |   10 +--
>  opensm/osm_port.c|   32 ++
>  opensm/osm_port_info_rcv.c   |6 +-
>  opensm/osm_req.c |1 +
>  opensm/osm_state_mgr.c   |4 ++
>  opensm/osm_subnet.c  |   77 ++
>  14 files changed, 377 insertions(+), 29 deletions(-)
> 
> diff --git a/include/opensm/osm_db.h b/include/opensm/osm_db.h
> index 7077347..d05bfa0 100644
> --- a/include/opensm/osm_db.h
> +++ b/include/opensm/osm_db.h
> @@ -43,7 +43,8 @@
>  
>  #include 
>  #include 
> -#include 
> +
> +struct osm_log;
>  
>  #ifdef __cplusplus
>  #  define BEGIN_C_DECLS extern "C" {
> @@ -118,7 +119,7 @@ typedef struct osm_db_domain {
>  */
>  typedef struct osm_db {
>   void *p_db_imp;
> - osm_log_t *p_log;
> + struct osm_log *p_log;
>   cl_list_t domains;
>  } osm_db_t;
>  /*
> @@ -185,7 +186,7 @@ void osm_db_destroy(IN osm_db_t * p_db);
>  *
>  * SYNOPSIS
>  */
> -int osm_db_init(IN osm_db_t * p_db, IN osm_log_t * p_log);
> +int osm_db_init(IN osm_db_t * p_db, IN struct osm_log * p_log);
>  /*
>  * PARAMETERS
>  *
> diff --git a/include/opensm/osm_db_pack.h b/include/opensm/osm_db_pack.h
> index 3d24926..25644df 100644
> --- a/include/opensm/osm_db_pack.h
> +++ b/include/opensm/osm_db_pack.h
> @@ -235,5 +235,149 @@ int osm_db_guid2lid_delete(IN osm_db_domain_t * p_g2l, 
> IN uint64_t guid);
>  * osm_db_guid2lid_get, osm_db_guid2lid_set
>  */
>  
> +/f* OpenSM: DB-Pack/osm_db_guid2mkey_init
> +* NAME
> +*osm_db_guid2mkey_init
> +*
> +* DESCRIPTION
> +*Initialize a domain for the guid2mkey table
> +*
> +* SYNOPSIS
> +*/
> +static inline osm_db_domain_t *osm_db_guid2mkey_init(IN osm_db_t * p_db)
> +{
> + return (osm_db_domain_init(p_db, "guid2mkey"));
> +}
> +
> +/*
> +* PARAMETERS
> +*p_db
> +*[in] Pointer to the database object to construct
> +*
> +* RETURN VALUES
> +*The pointer to the new allocated domain object or NULL.
> +*
> +* NOTE: DB domains are destroyed by the osm_db_destroy
> +*
> +* SEE ALSO
> +*Database, osm_db_init, osm_db_destroy
> +*/
> +
> +/f* OpenSM: DB-Pack/osm_db_guid2mkey_guids
> +* NAME
> +*osm_db_guid2mkey_guids
> +*
> +* DESCRIPTION
> +*Provides back a list of guid elements.
> +*
> +* SYNOPSIS
> +*/
> +int osm_db_guid2mkey_guids(IN osm_db_domain_t * p_g2m,
> +   OUT cl_qlist_t * p_guid_list);
> +/*
> +* PARAMETERS
> +*p_g2l
> +*[in] Pointer to the guid2mkey domain
> +*
> +*  p_guid_list
> +* [out] A quick list of guid elements of type osm_db_guid_elem_t
> +*
> +* RETURN VALUES
> +*0 if successful
> +*
> +* NOTE: the output qlist should be initialized and each item freed
> +*   by the caller, then destroyed.
> +*
> +* SEE ALSO
> +* osm_db_guid2mkey_init, osm_db_guid2mkey_guids, osm_db_guid2mkey_get
> +* osm_db_guid2mkey_set, osm_db_guid2mkey_delete
> +*/
> +
> +/f* OpenSM: DB-Pack/osm_db_guid2mkey_get
> +* NAME
> +*osm_db_guid2mkey_get
> +*
> +* DESCRIPTION
> +*Get the mkey for the given guid.
> +*
> +* SYNOPSIS
> +*/
> +int osm_db_guid2mkey_get(IN osm_db_domain_t * p_g2m, IN uint64_t guid,
> +  OUT uint64_t * p_mkey);
> +/*
> +* PARAMETERS
> +*p_g2m
> +*[in] Pointer to the guid2mkey domain
> +*
> +*  guid
> +* [in] The guid to look for
> +*
> +*  p_mkey
> +* [out] Pointer to the resulting mkey in host order.
> +*
> +* RETURN VALUES
> +*0 if successful. The lid will be set to 0 if not found.
> +*
> +* SEE ALSO
> +* osm_db_guid2mkey_init, osm_db_guid2mkey_guids
> +* osm_db_guid2mkey_set, osm_db_guid2mkey_delete
> +*/
> +
> +/f* OpenSM: DB-Pack/osm_db_guid2mkey_set
> +* NAME
> +*osm_db_guid2mkey_set
> +*
> +* DESCRIPTION
> +*Set the mkey for the given guid.
> +*
> +* SYNOPSIS
> +*/
> +int osm_db_guid2mkey_set(IN osm_db_domain_t * p_g2m, IN uint64_t guid,
> +  IN uint64_t mkey);
> +/*
> +* PARAMETERS
> +*p_g2m
> +*[in] Pointer to the guid2mkey domain
> +*
> +*  guid
> +* [in] The guid to

Re: [PATCH 0/8] opensm: Improved mkey support

2012-07-23 Thread Alex Netes
Hi Jim,

Can you please add short description of the improved M_Key mechanism into the
man page?

On 17:25 Tue 03 Jul , Jim Foraker wrote:
>  I'm sending new versions of patches 1 and 3 to the list, which
> correct merge/build issues introduced by other recently accepted
> patches.  They will be marked as "V1.1".
> 
>  Jim
> 
> On Mon, 2012-06-25 at 17:54 -0700, Jim Foraker wrote:
> > I'm about to post a set of patches intended to improve mkey support
> > in OpenSM.  These patches have been fairly rigorously tested on a small
> > fabric, and I believe are sufficiently stable for inclusion.  The
> > primary intent here is threefold:
> > 
> > 1) Fix a multitude of edge case issues with the existing
> > single-mkey-per-subnet support in OpenSM.  For instance, the current
> > implementation provides no way to change an established non-zero mkey
> > without rebooting or manually re-keying each CA on the entire subnet.
> > 
> > 2) Enable mkey protection across the fabric.  This involves not only
> > setting a non-zero protection level, but also providing the SM with a
> > sufficient information cache to initialize the subnet on restart without
> > having to wait for mkey lease timeouts (provided one is set).
> > 
> > 3) Provide a basis on which to build multiple-mkey systems for OpenSM
> > (be they per-host, KDF, or random) in the future.
> > 
> >  The patches add two new cache files: a port guid-to-mkey cache, and
> > a neighboring link (port guid to port guid) cache.
> >  The guid2mkey cache is used to provide a hint at the initial mkey
> > for a CA during initialization.  It is a hint only; the SM is capable of
> > dealing with cases where the guid2mkey cache is incorrect, although it
> > may require waiting for (potentially multiple) mkey lease timeouts at
> > non-zero mkey protection levels.  The guid2mkey cache is presented first
> > in the patch set, as it ends up ameliorating several corner cases in a
> > cleaner way than attacking them directly did.
> >  The neighbors cache file provides an initial hint to the SM of what
> > port guid we may expect at the opposite end of a link that is being
> > initialized.  This is necessary at mkey protection level 2, where we
> > cannot do the SubnGet necessary to determine the port guid to use in
> > looking up an mkey hint.
> >  The changes to the osm_req functions to support mkeys in patch 2
> > now require plock to be held when called.  This was generally already
> > the case, but there were a few spots where it was not.  In most of these
> > cases, the plock is still not technically necessary, as they occur
> > during hops 0/1 when DR path traversal is trivial.  I wrapped all of
> > these occurrences in locks in a separate patch (#3), in order to make
> > the changes more obvious and invite comment.
> > 
> >  Jim
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majord...@vger.kernel.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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 8/8] opensm: Ensure sweep interval/mkey lease are sensibly set

2012-07-24 Thread Alex Netes
Hi Jim,

On 17:55 Mon 25 Jun , Jim Foraker wrote:
> If mkeys are protected, sweep should always be enabled and
> set to an interval < the lease timeout, to ensure a missed trap
> doesn't lead to mkey exposure.

This is a minimal requirement, but it might not be enough to avoid mkey
exposure completely. In noisy fabrics, sweep duration may take more
time than sweep interval (and lease timeout), so theoretically we can still
get mkey exposure. However, I don't know how can we completely avoid this.

> 
> Signed-off-by: Jim Foraker 
> ---
>  opensm/osm_subnet.c |   20 
>  1 file changed, 20 insertions(+)
> 
> diff --git a/opensm/osm_subnet.c b/opensm/osm_subnet.c
> index ddee955..3f336d8 100644
> --- a/opensm/osm_subnet.c
> +++ b/opensm/osm_subnet.c
> @@ -1502,6 +1502,26 @@ int osm_subn_verify_config(IN osm_subn_opt_t * p_opts)
>  "instead\n", p_opts->m_key_protect_bits, 2);
>   p_opts->m_key_protect_bits = 2;
>   }
> + if (p_opts->m_key_protect_bits && p_opts->m_key_lease_period) {
> + if (!p_opts->sweep_interval) {
> + log_report(" Sweep disabled with protected mkey "
> +"leases in effect; re-enabling sweeping "
> +"with interval %u\n",
> +cl_ntoh16(p_opts->m_key_lease_period) - 1);
> + p_opts->sweep_interval =
> + cl_ntoh16(p_opts->m_key_lease_period) - 1;
> + }
> + if (p_opts->sweep_interval >=
> + cl_ntoh16(p_opts->m_key_lease_period)) {
> + log_report(" Sweep interval %u >= mkey lease period "
> +"%u. Setting lease period to %u\n",
> +p_opts->sweep_interval,
> +cl_ntoh16(p_opts->m_key_lease_period),
> +p_opts->sweep_interval + 1);
> + p_opts->m_key_lease_period =
> + cl_hton16(p_opts->sweep_interval + 1);
> + }
> + }
>  
>   if (p_opts->root_guid_file != NULL) {
>   FILE *root_file = fopen(p_opts->root_guid_file, "r");
> -- 
> 1.7.9.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majord...@vger.kernel.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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] opensm: Add initial congestion control configuration support

2012-07-24 Thread Alex Netes
Hi Albert

 
> > > +
> > > + p_tbl = &p_osm->subn.port_guid_tbl;
> > > + p_next = cl_qmap_head(p_tbl);
> > > + while (p_next != cl_qmap_end(p_tbl)) {
> > > + osm_port_t *p_port = (osm_port_t *) p_next;
> > > + osm_node_t *p_node = p_port->p_node;
> > > + ib_api_status_t status;
> > > +
> > > + p_next = cl_qmap_next(p_next);
> > > +
> > > + if (osm_node_get_type(p_node) == IB_NODE_TYPE_SWITCH) {
> > > + status = cc_send_sw_cong_setting(&p_osm->sm, 
> > > p_node);
> > > + if (status != IB_SUCCESS)
> > > + ret = -1;
> > > + } else if (osm_node_get_type(p_node) == IB_NODE_TYPE_CA) {
> > > + status = cc_send_ca_cong_setting(&p_osm->sm,
> > > +  p_node,
> > > +  p_port->p_physp);
> > > + if (status != IB_SUCCESS)
> > > + ret = -1;
> > > +
> > > + status = cc_send_cct(&p_osm->sm,
> > > +  p_node,
> > > +  p_port->p_physp);
> > 
> > SetCongestionControlTable may also apply to enhanced port 0 of the switch.
> 
> [AL] Got it.

This one can be postponed to a later patch. I'm not sure how much switches
support this mode.

> > > + p_opt->cc_cct.entries_len = 0;
> > > + p_opt->cc_cct.input_str = NULL;
> > 
> > What about setting other CC defaults? It won't be enough for a user to just 
> > turn "congestion_control = TRUE" flag
> > for CC to work. Running with defaults won't be perfect, but CC will start 
> > to work.
> 
> [AL] I initially didn't add it, as we were still trying to figure out
> optimal values for our situation w/ Lustre.
> 
> How about we hold off on CC default values for another patch and
> discussion.  It can be a very big discussion by itself.  I think getting
> the core configuration support is more important presently.
>

Agreed.
 

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


Re: [PATCH V3] libibumad: update umad_recv man page.

2012-07-25 Thread Alex Netes
Hi Ira,

On 14:42 Sat 07 Jul , Ira Weiny wrote:
> 
> Document the umad_recv length parameter better.
> 
> Changes since V1:
>   add comments from Hal
> Changes since V2:
>   Change "should" to "must"
> 
> Signed-off-by: Ira Weiny 
> ---

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


Re: [PATCH] opensm/osm_node_info_rec.c: Also handle non compliant SMA in ni_rcv_process_existing

2012-07-25 Thread Alex Netes
Hi Hal,

On 08:54 Mon 02 Jul , Hal Rosenstock wrote:
> 
> in case of NodeInfo.LocalPortNum > NodeInfo.NumPorts
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH] infiniband-diags: Support MLNX ExtendedPortInfo for ConnectIB device

2012-07-25 Thread Alex Netes
Hi Hal,

On 11:43 Sun 08 Jul , Hal Rosenstock wrote:
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH] opensm/main.c: Handle daemon mode with guid specified as 0 more gracefully

2012-07-25 Thread Alex Netes
Hi Hal,

On 13:15 Mon 09 Jul , Hal Rosenstock wrote:
> 
> As pointed out by Philipp Thomas :
> 
> Currently opensm will silently fail if you pass '-g 0 -B'. As you can't
> ask for a port, exit with failure so admin can see the reason
> for opensm's failure.
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH] opensm/libopensm.map: Removed unimplemented routine

2012-07-25 Thread Alex Netes
Hi Hal,

On 13:15 Mon 09 Jul , Hal Rosenstock wrote:
> 
> osm_dump_pkey_table is not implemented so shouldn't be in map
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCHv1] opensm/osmtest: fix osmtest ignores timeout parameter

2012-07-25 Thread Alex Netes
Hi Hal,

On 17:23 Tue 10 Jul , Daniel Klein wrote:
> Fix: osmtest ignores timeout parameter, and binds with default value
> 
> v1 changes:
> updating only timeout field of bind_info
> 
> Signed-off-by: Daniel Klein 
> ---

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


Re: [PATCH] opensm/osm_subnet.c: Indicate lmc and lmc_esp0 are not changeable "on the fly"

2012-07-25 Thread Alex Netes
Hi Hal,

On 13:09 Tue 10 Jul , Hal Rosenstock wrote:
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH] opensm/osm_node_info_rcv.c: In ni_rcv_process_existing_ca_or_router, handle error

2012-07-25 Thread Alex Netes
Hi Hal,

On 12:23 Thu 12 Jul , Hal Rosenstock wrote:
> 
> Add handling for case where osm_node_get_physp_ptr returns NULL pointer
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH 04/10] opensm: perfmgr delete "inactive" nodes from the DB

2012-07-25 Thread Alex Netes
Hi Ira,

On 16:53 Tue 03 Jul , Ira Weiny wrote:
> 
> 
> When a node drops from the fabric the default behavior was to leave the node
> data in the PerfMgr DB.  Add the option (with default set to TRUE) to delete
> these "inactive" or missing nodes from the DB.
> 
> Signed-off-by: Ira Weiny 
> ---
>  include/opensm/osm_perfmgr.h|   11 +++
>  include/opensm/osm_perfmgr_db.h |1 +
>  include/opensm/osm_subnet.h |1 +
>  opensm/osm_console.c|   22 --
>  opensm/osm_perfmgr.c|4 
>  opensm/osm_perfmgr_db.c |   13 +
>  opensm/osm_subnet.c |9 +++--
>  7 files changed, 53 insertions(+), 8 deletions(-)
> 
> diff --git a/include/opensm/osm_perfmgr.h b/include/opensm/osm_perfmgr.h
> index 0e9f66f..be6f978 100644
> --- a/include/opensm/osm_perfmgr.h
> +++ b/include/opensm/osm_perfmgr.h
> @@ -143,6 +143,7 @@ typedef struct osm_perfmgr {
>   monitored_node_t *remove_list;
>   ib_net64_t port_guid;
>   int16_t local_port;
> + int rm_nodes;
>  } osm_perfmgr_t;
>  /*
>  * FIELDS
> @@ -180,6 +181,16 @@ inline static osm_perfmgr_state_t 
> osm_perfmgr_get_state(osm_perfmgr_t * perfmgr)
>   return perfmgr->state;
>  }
>  
> +inline static void osm_perfmgr_set_rm_nodes(osm_perfmgr_t *perfmgr,
> + int rm_nodes)
> +{
> + perfmgr->rm_nodes = rm_nodes;
> +}
> +inline static int osm_perfmgr_get_rm_nodes(osm_perfmgr_t *perfmgr)
> +{
> + return perfmgr->rm_nodes;
> +}
> +
>  inline static const char *osm_perfmgr_get_state_str(osm_perfmgr_t * 
> p_perfmgr)
>  {
>   switch (p_perfmgr->state) {
> diff --git a/include/opensm/osm_perfmgr_db.h b/include/opensm/osm_perfmgr_db.h
> index 4c7996d..8231a12 100644
> --- a/include/opensm/osm_perfmgr_db.h
> +++ b/include/opensm/osm_perfmgr_db.h
> @@ -160,6 +160,7 @@ void perfmgr_db_destroy(perfmgr_db_t * db);
>  perfmgr_db_err_t perfmgr_db_create_entry(perfmgr_db_t * db, uint64_t guid,
>boolean_t esp0, uint8_t num_ports,
>char *node_name);
> +perfmgr_db_err_t perfmgr_db_delete_entry(perfmgr_db_t * db, uint64_t guid);
>  
>  perfmgr_db_err_t perfmgr_db_add_err_reading(perfmgr_db_t * db, uint64_t guid,
>   uint8_t port,
> diff --git a/include/opensm/osm_subnet.h b/include/opensm/osm_subnet.h
> index abd2158..37314cc 100644
> --- a/include/opensm/osm_subnet.h
> +++ b/include/opensm/osm_subnet.h
> @@ -253,6 +253,7 @@ typedef struct osm_subn_opt {
>   uint32_t perfmgr_max_outstanding_queries;
>   boolean_t perfmgr_ignore_cas;
>   char *event_db_dump_file;
> + int perfmgr_rm_nodes;
>  #endif   /* ENABLE_OSM_PERF_MGR */
>   char *event_plugin_name;
>   char *event_plugin_options;
> diff --git a/opensm/osm_console.c b/opensm/osm_console.c
> index 5b602d1..e68be25 100644
> --- a/opensm/osm_console.c
> +++ b/opensm/osm_console.c
> @@ -239,7 +239,7 @@ static void help_update_desc(FILE *out, int detail)
>  static void help_perfmgr(FILE * out, int detail)
>  {
>   fprintf(out,
> - "perfmgr 
> [enable|disable|clear_counters|dump_counters|print_counters|dump_redir|clear_redir|sweep_time[seconds]]\n");
> + "perfmgr 
> [enable|disable|clear_counters|dump_counters|print_counters|dump_redir|clear_redir|set_rm_nodes|clear_rm_nodes|sweep_time[seconds]]\n");
>   if (detail) {
>   fprintf(out,
>   "perfmgr -- print the performance manager state\n");
> @@ -257,6 +257,9 @@ static void help_perfmgr(FILE * out, int detail)
>   "   [dump_redir []] -- dump the 
> redirection table\n");
>   fprintf(out,
>   "   [clear_redir []] -- clear the 
> redirection table\n");
> + fprintf(out,
> + "   [[set|clear]_rm_nodes] -- enable/disable the 
> removal of \"inactive\" nodes from the DB\n"
> + " Inactive nodes are those 
> which no longer appear on the fabric\n");
>   }
>  }
>  #endif   /* ENABLE_OSM_PERF_MGR */
> @@ -1443,6 +1446,10 @@ static void perfmgr_parse(char **p_last, osm_opensm_t 
> * p_osm, FILE * out)
> PERFMGR_STATE_DISABLE);
>   } else if (strcmp(p_cmd, "clear_counters") == 0) {
>   osm_perfmgr_clear_counters(&p_osm->perfmgr);
> + } else if (strcmp(p_cmd, "set_rm_nodes") == 0) {
> + osm_perfmgr_set_rm_nodes(&p_osm->perfmgr, 1);
> + } else if (strcmp(p_cmd, "clear_rm_nodes") == 0) {
> + osm_perfmgr_set_rm_nodes(&p_osm->perfmgr, 0);
>   } else if (strcmp(p_cmd, "dump_counters") == 0) {
>   p_cmd = next_token(p_last);
>   if (p_cmd && (strcmp(p_cmd, "mach") =

Re: [PATCH] opensm/perfmgr: fix endian conversion of PortCounters

2012-07-29 Thread Alex Netes
Hi Ira,

On 22:49 Tue 24 Jul , Ira Weiny wrote:
> 
> Signed-off-by: Ira Weiny 
> ---

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


Re: [PATCH V2] opensm/perfmgr: add logging of error counters

2012-07-29 Thread Alex Netes
Hi Ira,

On 11:40 Tue 17 Jul , Ira Weiny wrote:
> NOTE: the following applies after previous Performance Manager patches posted 
> to the list.
> 
> The initial performance manager only logged Symbol Error, Receive errors, and
> xmit discards.  Additional errors from PortCounters should be logged.
> 
>- Change error codes to use 4C3X, allows future expansion
>- Add perfmgr_log_errors flag (default true), allows users to reduce log
>  spamming if they are using an alternate method to collect perfmgr data.
> 
> Changes since V1:
>   Add help message within generated opensm.conf
> 
> Signed-off-by: Ira Weiny 
> ---

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


Re: [PATCH 01/10] opensm/perfmgr: Add config option to ignore Channel Adapters.

2012-07-29 Thread Alex Netes
Hi Ira,

On 16:52 Tue 03 Jul , Ira Weiny wrote:
> 
> 
>On many fabrics nodes have monitoring software which can querry counters on
>the nodes (CA's) themselves.  In this case it may be more efficient to keep
>this perfmgr traffic off the subnet.
> 
> Signed-off-by: Ira Weiny 
> ---

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


Re: [PATCH 5/8] opensm: Signal subnet init errors on SubnGet timeouts

2012-07-29 Thread Alex Netes
Hi Jim,

On 15:19 Mon 23 Jul , Jim Foraker wrote:
> 
> On Mon, 2012-07-23 at 08:43 -0700, Alex Netes wrote:
> > Hi Jim,
> > 
> > On 17:55 Mon 25 Jun , Jim Foraker wrote:
> > > A subnet should not be listed as cleanly initialized if CAs
> > > fail to respond to SubnGet requests.
> > > 
> > > Signed-off-by: Jim Foraker 
> > > ---
> > >  opensm/osm_sm_mad_ctrl.c |9 +
> > >  1 file changed, 9 insertions(+)
> > > 
> > > diff --git a/opensm/osm_sm_mad_ctrl.c b/opensm/osm_sm_mad_ctrl.c
> > > index f0bcff2..464b6b0 100644
> > > --- a/opensm/osm_sm_mad_ctrl.c
> > > +++ b/opensm/osm_sm_mad_ctrl.c
> > > @@ -741,6 +741,15 @@ static void sm_mad_ctrl_send_err_cb(IN void 
> > > *context, IN osm_madw_t * p_madw)
> > >   cl_ntoh16(p_smp->attr_id),
> > >   ib_get_sm_attr_str(p_smp->attr_id));
> > >   p_ctrl->p_subn->subnet_initialization_error = TRUE;
> > > + } else if (p_madw->status == IB_TIMEOUT &&
> > > +p_smp->method == IB_MAD_METHOD_GET) {
> > 
> > It's pretty common to see timeouts in fabrics without m_key support (e.g.
> > switch reboots) and it's not desirable to start another heavy sweep because
> > of that. So I guess it would be better if we could initiate heavy sweep only
> > when m_key is set and protection level is 2 or 3.
>  This was done primarily to ensure that "SUBNET UP" doesn't get
> displayed/logged while there are unconfigured HCAs due to misset mkeys.
> I'm reasonably sure (I will re-test to verify) that future light sweeps
> will catch HCAs whos mkeys timeout, presuming the timeout is set.  So we
> could also just log the error and not worry about setting
> subnet_initialization_error.

It's fine to have TIMEOUTs on Get() in case we are dealing with M_Key set, but
in general case we don't want to run into heavy sweep loops because of
TIMEOUTs on Get(), so I suggest the following:

+   } else if (p_ctrl->p_subn->opt.m_key &&
+  p_ctrl->p_subn->opt.m_key_protect_bits > 1 &&
+  p_madw->status == IB_TIMEOUT &&
+  p_smp->method == IB_MAD_METHOD_GET) {
+   /* Timeouts on SubnGet may be an indication of an mkey
+  error at protection levels 2/3 */
+   OSM_LOG(p_ctrl->p_log, OSM_LOG_ERROR, "ERR 3120 "
+   "Timeout while getting attribute 0x%X (%s)\n",
+   cl_ntoh16(p_smp->attr_id),
+   ib_get_sm_attr_str(p_smp->attr_id));
+   p_ctrl->p_subn->subnet_initialization_error = TRUE;


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


Re: [PATCH][TRIVIAL] opensm/osm_sa_mad_ctrl.c: Eliminate commented out code line

2012-07-30 Thread Alex Netes
Hi Hal,

On 06:37 Wed 25 Jul , Hal Rosenstock wrote:
> 
> which would never be used in SA flow
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH] opensm/osm_trap_rcv.c: Add better logging for traps 257 and 258

2012-07-30 Thread Alex Netes
Hi Hal,

On 06:39 Wed 25 Jul , Hal Rosenstock wrote:
> 
> More logging for Bad P_Key (trap 257) and Bad Q_Key (trap 258)
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH][TRIVIAL] opensm/osm_inform.c: Make log message format consistent for error messages

2012-07-30 Thread Alex Netes
Hi Hal,

On 06:39 Wed 25 Jul , Hal Rosenstock wrote:
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH][TRIVIAL] opensm/osm_sa_inform_info.c: Fix some error log messages

2012-07-30 Thread Alex Netes
Hi Hal,

On 06:39 Wed 25 Jul , Hal Rosenstock wrote:
> Make error numbers unique and make log message format consistent for error 
> messages
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH][TRIVIAL] opensm/osm_trap_rcv.c: Remove vestigial comment

2012-07-30 Thread Alex Netes
Hi Hal,

On 06:40 Wed 25 Jul , Hal Rosenstock wrote:
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH][TRIVIAL] opensm/osm_sa_path_record.c: Add missing end-of-line in the log message

2012-07-30 Thread Alex Netes
Hi Hal,

On 06:40 Wed 25 Jul , Hal Rosenstock wrote:
> 
> Signed-off-by: Alex Netes 
> ---

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


Re: [PATCH][TRIVIAL] opensm/osm_madw.h: Fix a couple of cut 'n paste commentary errors

2012-07-30 Thread Alex Netes
Hi Hal,

On 06:40 Wed 25 Jul , Hal Rosenstock wrote:
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH 1/2] opensm/ib_types.h: Add CapabilityMask2 to notice for trap 144

2012-07-30 Thread Alex Netes
Hi Hal,

On 06:40 Wed 25 Jul , Hal Rosenstock wrote:
> 
> Per MgtWG RefID #4855
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH 2/2] opensm/osm_helper.c: Add CapabilityMask2 to notice dump for trap 144

2012-07-30 Thread Alex Netes
Hi Hal,

On 06:40 Wed 25 Jul , Hal Rosenstock wrote:
> 
> Per MgtWG RefID #4855
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH][TRIVIAL] opensm/cl_atomic_osd.h: Cosmetic formatting change

2012-07-30 Thread Alex Netes
Hi Hal,

On 07:26 Sun 29 Jul , Hal Rosenstock wrote:
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


[PATCH] opensm: Move per_mod_log_tbl array from subn to log structure

2012-07-30 Thread Alex Netes
Having per_mod_log_tbl as part of subn structure is problematic because it 
means that
subn structure should be part of libopensm which is highly undesired, so moving
per_mod_log_tbl array from subn to log structure breaks that coupling.

Signed-off-by: Alex Netes 
Signed-off-by: Hal Rosenstock 
---
 include/opensm/osm_log.h| 65 +
 include/opensm/osm_subnet.h |  9 ---
 opensm/libopensm.map|  2 ++
 opensm/osm_log.c| 21 ++-
 opensm/osm_opensm.c |  1 -
 opensm/osm_subnet.c |  4 +--
 6 files changed, 73 insertions(+), 29 deletions(-)

diff --git a/include/opensm/osm_log.h b/include/opensm/osm_log.h
index 535d35e..3247296 100644
--- a/include/opensm/osm_log.h
+++ b/include/opensm/osm_log.h
@@ -48,7 +48,6 @@
 #endif
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -99,10 +98,7 @@ BEGIN_C_DECLS
 * AUTHOR
 *
 */
-#ifndef OSM_LOG_LEVEL_T_DEFINED
-#define OSM_LOG_LEVEL_T_DEFINED
 typedef uint8_t osm_log_level_t;
-#endif
 
 #define OSM_LOG_NONE   0x00
 #define OSM_LOG_ERROR  0x01
@@ -139,7 +135,7 @@ typedef struct osm_log {
boolean_t daemon;
char *log_file_name;
char *log_prefix;
-   osm_subn_t *p_subn;
+   osm_log_level_t per_mod_log_tbl[256];
 } osm_log_t;
 /*/
 
@@ -156,12 +152,12 @@ typedef struct osm_log {
  *
  * SYNOPSIS
  */
-osm_log_level_t osm_get_log_per_module(IN osm_subn_t * subn,
+osm_log_level_t osm_get_log_per_module(IN osm_log_t * p_log,
   IN const int file_id);
 /*
  * PARAMETERS
- * subn
- * [in] Pointer to an osm_subn_t object
+ * p_log
+ * [in] Pointer to a Log object to construct.
  *
  * file_id
  * [in] File ID for module
@@ -170,6 +166,55 @@ osm_log_level_t osm_get_log_per_module(IN osm_subn_t * 
subn,
  * The log level from the per module logging structure for this file ID.
  */
 
+/f* OpenSM: Log/osm_set_log_per_module
+ * NAME
+ * osm_set_log_per_module
+ *
+ * DESCRIPTION
+ * This sets log level for the given file ID in the per module log table.
+ * NOTE: this code is not thread safe. Need to grab the lock before
+ * calling it.
+ *
+ * SYNOPSIS
+ */
+void osm_set_log_per_module(IN osm_log_t * p_log, IN const int file_id,
+   IN osm_log_level_t level);
+/*
+ * PARAMETERS
+ * p_log
+ * [in] Pointer to a Log object to construct.
+ *
+ * file_id
+ * [in] File ID for module
+ *
+ * level
+ * [in] Log level of the module
+ *
+ * RETURN VALUES
+ * This function does not return a value.
+ */
+
+/f* OpenSM: Log/osm_reset_log_per_module
+ * NAME
+ * osm_reset_log_per_module
+ *
+ * DESCRIPTION
+ * This resets log level for the entire per module log table.
+ * NOTE: this code is not thread safe. Need to grab the lock before
+ * calling it.
+ *
+ * SYNOPSIS
+ */
+void osm_reset_log_per_module(IN osm_log_t * p_log);
+/*
+ * PARAMETERS
+ * p_log
+ * [in] Pointer to a Log object to construct.
+ *
+ * RETURN VALUES
+ * This function does not return a value.
+ */
+
 /f* OpenSM: Log/osm_log_construct
 * NAME
 *  osm_log_construct
@@ -432,9 +477,7 @@ static inline boolean_t osm_log_is_active_v2(IN const 
osm_log_t * p_log,
 {
if ((p_log->level & level) != 0)
return 1;
-   if (!p_log->p_subn)
-   return 0;
-   if ((level & p_log->p_subn->per_mod_log_tbl[file_id]))
+   if ((level & p_log->per_mod_log_tbl[file_id]))
return 1;
return 0;
 }
diff --git a/include/opensm/osm_subnet.h b/include/opensm/osm_subnet.h
index 683204b..7f3d6e9 100644
--- a/include/opensm/osm_subnet.h
+++ b/include/opensm/osm_subnet.h
@@ -74,11 +74,6 @@ BEGIN_C_DECLS
 #define OSM_PARTITION_ENFORCE_OUT  "out"
 #define OSM_PARTITION_ENFORCE_OFF  "off"
 
-#ifndef OSM_LOG_LEVEL_T_DEFINED
-#define OSM_LOG_LEVEL_T_DEFINED
-typedef uint8_t osm_log_level_t;
-#endif
-
 typedef enum _osm_partition_enforce_type_enum {
OSM_PARTITION_ENFORCE_TYPE_BOTH,
OSM_PARTITION_ENFORCE_TYPE_IN,
@@ -604,7 +599,6 @@ typedef struct osm_subn {
unsigned need_update;
cl_fmap_t mgrp_mgid_tbl;
void *mboxes[IB_LID_MCAST_END_HO - IB_LID_MCAST_START_HO + 1];
-   osm_log_level_t per_mod_log_tbl[256];
 } osm_subn_t;
 /*
 * FIELDS
@@ -749,9 +743,6 @@ typedef struct osm_subn {
 *  Array of pointers to all Multicast MLID box objects in the
 *  subnet. Indexed by MLID offset from base MLID.
 *
-*  per_mod_log_tbl
-*  Array of log levels based on per module logging file ID.
-*
 * SEE ALSO
 *  Subnet object
 */
diff --git a/opensm/libopensm.map b/opensm/libopensm.map
index 1735488..e75d424 100644
--- a/opensm/libopens

Re: [PATCHv3] opensm: Add initial congestion control configuration support

2012-07-30 Thread Alex Netes
Hi Albert,

On 15:06 Mon 30 Jul , Albert Chu wrote:
> This patch adds initial support for congestion control configuration
> on a fabric.  Users may configure settings via the Switch Congestion
> Setting, CA Congestion Setting, or Congest Control Table MADs.
> 
> Signed-off-by: Albert Chu 
> Signed-off-by: Alex Netes 
> ---

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


[PATCH] opensm: Add per module logging FILE_ID define to osm_congestion_control.c

2012-07-31 Thread Alex Netes
Signed-off-by: Alex Netes 
---
 include/opensm/osm_file_ids.h   | 1 +
 opensm/osm_congestion_control.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/opensm/osm_file_ids.h b/include/opensm/osm_file_ids.h
index 713a0f9..7c45082 100644
--- a/include/opensm/osm_file_ids.h
+++ b/include/opensm/osm_file_ids.h
@@ -149,6 +149,7 @@ typedef enum _osm_file_ids_enum {
OSM_FILE_VL_ARB_RCV_C,
OSM_FILE_ST_C,
OSM_FILE_UCAST_DFSSSP_C,
+   OSM_FILE_CONGESTION_CONTROL_C,
 } osm_file_ids_enum;
 /***/
 
diff --git a/opensm/osm_congestion_control.c b/opensm/osm_congestion_control.c
index 640f3fa..0aa72fd 100644
--- a/opensm/osm_congestion_control.c
+++ b/opensm/osm_congestion_control.c
@@ -47,7 +47,8 @@
 
 #include 
 #include 
-
+#include 
+#define FILE_ID OSM_FILE_CONGESTION_CONTROL_C
 #include 
 #include 
 #include 
-- 
1.7.11.2

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


[PATCHv2] opensm: Add per module logging FILE_ID define to osm_congestion_control.c

2012-07-31 Thread Alex Netes
Signed-off-by: Alex Netes 
---
Changes since v1:
Updated module_name_str array

 include/opensm/osm_file_ids.h   | 1 +
 opensm/osm_congestion_control.c | 3 ++-
 opensm/osm_subnet.c | 3 ++-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/opensm/osm_file_ids.h b/include/opensm/osm_file_ids.h
index 713a0f9..e23710c 100644
--- a/include/opensm/osm_file_ids.h
+++ b/include/opensm/osm_file_ids.h
@@ -149,6 +149,7 @@ typedef enum _osm_file_ids_enum {
OSM_FILE_VL_ARB_RCV_C,
OSM_FILE_ST_C,
OSM_FILE_UCAST_DFSSSP_C,
+   OSM_FILE_CONGESTION_CONTROL_C,
 } osm_file_ids_enum;
 /***/
 
diff --git a/opensm/osm_congestion_control.c b/opensm/osm_congestion_control.c
index 640f3fa..960b728 100644
--- a/opensm/osm_congestion_control.c
+++ b/opensm/osm_congestion_control.c
@@ -47,7 +47,8 @@
 
 #include 
 #include 
-
+#include 
+#define FILE_ID OSM_FILE_CONGESTION_CONTROL_C
 #include 
 #include 
 #include 
diff --git a/opensm/osm_subnet.c b/opensm/osm_subnet.c
index 2358140..3dded18 100644
--- a/opensm/osm_subnet.c
+++ b/opensm/osm_subnet.c
@@ -182,9 +182,10 @@ static const char *module_name_str[] = {
"osm_vl_arb_rcv.c",
"st.c",
"osm_ucast_dfsssp.c",
+   "osm_congestion_control.c"
/* Add new module names here ... */
/* FILE_ID define in those modules must be identical to index here */
-   /* last FILE_ID is currently 88 */
+   /* last FILE_ID is currently 89 */
 };
 
 #define MOD_NAME_STR_UNKNOWN_VAL (ARR_SIZE(module_name_str))
-- 
1.7.11.2

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


Re: Basics of congestion control?

2012-07-31 Thread Alex Netes
Hi Sebastian,

On 11:37 Tue 31 Jul , Sebastian Riemer wrote:
> Hi all,
> 
> could someone please explain what I can do with the new congestion control?
> 
> Do I understand it right that I can influence the flow control (e.g.
> amount of credits) with it so that I can avoid disruption (XmitWait,
> XmitDiscardedPackets) caused by congestion?

Congestion control isn't a credit based mechanism. While InfiniBand flow
control is defined between two ports of the same link, congestion control is
working across the fabric between a congestion point (a switch) and a reaction
point (source node). Reaction point implements a Congestion Control Table that
contains an array of values of injection rate delay used to control
congestion. You can find more information in the IBTA LWG Errata document
3Q2010.

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


[PATCH 01/27] opensm/torus-2QoS: Fix some typos in documentation

2012-07-31 Thread Alex Netes
From: Hal Rosenstock 

Signed-off-by: Hal Rosenstock 
Signed-off-by: Alex Netes 
---
 doc/current-routing.txt | 6 +++---
 man/torus-2QoS.8.in | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/doc/current-routing.txt b/doc/current-routing.txt
index 8cc5154..495a0d2 100644
--- a/doc/current-routing.txt
+++ b/doc/current-routing.txt
@@ -696,7 +696,7 @@ broken by a failure, as in the above example.
 
 Torus Topolgy Discovery:
 
-The algorithm used by torus-2QoS to contruct the torus topology from the
+The algorithm used by torus-2QoS to construct the torus topology from the
 undirected graph representing the fabric requires that the radix of each
 dimension be configured via torus-2QoS.conf. It also requires that the
 torus topology be "seeded"; for a 3D torus this requires configuring four
@@ -710,7 +710,7 @@ links to find the one that is consistent with a face of the 
cube of switch
 locations, and adds its swiches to the discovered topology in the correct
 locations.
 
-Because the algorithm is based on examing the topology of 4-loops of links,
+Because the algorithm is based on examining the topology of 4-loops of links,
 a torus with one or more radix-4 dimensions requires extra initial seed
 configuration.  See torus-2QoS.conf(5) for details. Torus-2QoS will detect
 and report when it has insufficient configuration for a torus with radix-4
@@ -718,7 +718,7 @@ dimensions.
 
 In the event the torus is significantly degraded, i.e., there are many
 missing switches or links, it may happen that torus-2QoS is unable to place
-into the torus some switches and/or links that were discoverd in the
+into the torus some switches and/or links that were discovered in the
 fabric, and will generate a warning in that case.  A similar condition
 occurs if torus-2QoS is misconfigured, i.e., the radix of a torus dimension
 as configured does not match the radix of that torus dimension as wired,
diff --git a/man/torus-2QoS.8.in b/man/torus-2QoS.8.in
index c14278a..be74f26 100644
--- a/man/torus-2QoS.8.in
+++ b/man/torus-2QoS.8.in
@@ -348,7 +348,7 @@ broken by a failure, as in the above example.
 .
 .SH TORUS TOPOLOGY DISCOVERY
 .
-The algorithm used by torus-2QoS to contruct the torus topology from
+The algorithm used by torus-2QoS to construct the torus topology from
 the undirected graph representing the fabric requires that the radix of
 each dimension be configured via torus-2QoS.conf.
 It also requires that the torus topology be "seeded"; for a 3D torus this
@@ -363,7 +363,7 @@ locations, the algorithm examines 4-loops of inter-switch 
links to find the
 one that is consistent with a face of the cube of switch locations,
 and adds its swiches to the discovered topology in the correct locations.
 .P
-Because the algorithm is based on examing the topology of 4-loops of links,
+Because the algorithm is based on examining the topology of 4-loops of links,
 a torus with one or more radix-4 dimensions requires extra initial
 seed configuration.
 See torus-2QoS.conf(5) for details.
@@ -372,7 +372,7 @@ for a torus with radix-4 dimensions.
 .P
 In the event the torus is significantly degraded, \fIi.e.\fR, there are
 many missing switches or links, it may happen that torus-2QoS is unable
-to place into the torus some switches and/or links that were discoverd
+to place into the torus some switches and/or links that were discovered
 in the fabric, and will generate a warning in that case.
 A similar condition occurs if torus-2QoS is misconfigured, \fIi.e.\fR,
 the radix of a torus dimension as configured does not match the radix
-- 
1.7.11.2

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


[PATCH 02/27] Add support to reread configuration file when stacked in rediscovery loop.

2012-07-31 Thread Alex Netes
If SM is stucked in continuous rediscovery loop, it will never reach
rereading the configuration files.

Signed-off-by: Alex Netes 
---
 opensm/osm_state_mgr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/opensm/osm_state_mgr.c b/opensm/osm_state_mgr.c
index 4d762a3..e8c76c0 100644
--- a/opensm/osm_state_mgr.c
+++ b/opensm/osm_state_mgr.c
@@ -1251,8 +1251,10 @@ repeat_discovery:
}
 
/* if new sweep requested - don't bother with the rest */
-   if (sm->p_subn->force_heavy_sweep)
+   if (sm->p_subn->force_heavy_sweep) {
+   config_parsed = 0;
goto repeat_discovery;
+   }
 
osm_opensm_report_event(sm->p_subn->p_osm,
OSM_EVENT_ID_HEAVY_SWEEP_DONE, NULL);
-- 
1.7.11.2

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


[PATCH 03/27] opensm/osm_link_mgr.c: Set PortInfo:PortState to LinkDown when remote port isn't accessible

2012-07-31 Thread Alex Netes
From: Hal Rosenstock 

There might be a scenario where port's link physical state is LinkUp,
but port's peer doesn't answer to SMPs. In this case we will move the port
to LinkDown.

Signed-off-by: Daniel Klein 
Signed-off-by: Vladimir Koushnir 
Signed-off-by: Alex Netes 
Signed-off-by: Hal Rosenstock 
---
 opensm/osm_link_mgr.c | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/opensm/osm_link_mgr.c b/opensm/osm_link_mgr.c
index 8301643..8733329 100644
--- a/opensm/osm_link_mgr.c
+++ b/opensm/osm_link_mgr.c
@@ -484,7 +484,7 @@ Exit:
 static int link_mgr_process_node(osm_sm_t * sm, IN osm_node_t * p_node,
 IN const uint8_t link_state)
 {
-   osm_physp_t *p_physp;
+   osm_physp_t *p_physp, *p_physp_remote;
uint32_t i, num_physp;
int ret = 0;
uint8_t current_state;
@@ -517,6 +517,19 @@ static int link_mgr_process_node(osm_sm_t * sm, IN 
osm_node_t * p_node,
continue;
 
/*
+   Set PortState to DOWN in case Remote Physical Port is
+   unreachable. We have to check this for all ports, except
+   port zero.
+*/
+   p_physp_remote = osm_physp_get_remote(p_physp);
+   if ((i != 0) && (!p_physp_remote ||
+   !osm_physp_is_valid(p_physp_remote))) {
+   if (current_state != IB_LINK_INIT)
+   link_mgr_set_physp_pi(sm, p_physp, 
IB_LINK_DOWN);
+   continue;
+   }
+
+   /*
   Normally we only send state update if state is lower
   then required state. However, we need to send update if
   no state change required.
-- 
1.7.11.2

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


[PATCH 04/27] Fixed Multicast precreation parsing

2012-07-31 Thread Alex Netes
Now allow to define partition without members with only multicast group
definitions.

Default=0x7fff : ALL;
Default=0x7fff,ipoib:
mgid=ff12:401b::0719;

Signed-off-by: Tamir Ronen 
Signed-off-by: Alex Netes 
---
 opensm/osm_prtn_config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/opensm/osm_prtn_config.c b/opensm/osm_prtn_config.c
index 6798979..750cbe0 100644
--- a/opensm/osm_prtn_config.c
+++ b/opensm/osm_prtn_config.c
@@ -670,6 +670,7 @@ skip_header:
if (q)
*q++ = '\0';
ret = parse_name_token(p, &name, &flag);
+   len += ret;
 
if (strcmp(name, "mgid") == 0) {
/* parse an mgid line if specified. */
@@ -685,7 +686,6 @@ skip_header:
return -1;
}
p += ret;
-   len += ret;
} while (q);
 
 done:
-- 
1.7.11.2

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


[PATCH 05/27] Fixed crash in sm_state_mgr_send_master_sm_info_req() during fabric merge

2012-07-31 Thread Alex Netes
From: Vladimir Koushnir 

The scenario that led to a crash is as follows:
1. Our SM in MASTER state discovered another MASTER SM with lower priority.
2. Our SM waited for a HANDOVER and started to poll (SMInfoGet) the other SM.
3. Other SM's port/node disconnected from the fabric and didn't update the 
sm->p_remote_sm - pointer to the other SM.

Fix is to osm_remote_sm struct.
Remove p_port from remote osm_remote_sm struct.
Fix cleanup of sm->p_polling_sm in drop manager.
Add read lock during SM polling timer.

Signed-off-by: Vladimir Koushnir 
Signed-off-by: Alex Netes 
Signed-off-by: Hal Rosenstock 
---
 include/opensm/osm_remote_sm.h |  4 +---
 opensm/osm_drop_mgr.c  |  4 +++-
 opensm/osm_remote_sm.c |  4 +---
 opensm/osm_sa_sminfo_record.c  | 10 +-
 opensm/osm_sm_state_mgr.c  | 19 ++-
 opensm/osm_sminfo_rcv.c| 12 ++--
 opensm/osm_state_mgr.c | 28 +++-
 7 files changed, 53 insertions(+), 28 deletions(-)

diff --git a/include/opensm/osm_remote_sm.h b/include/opensm/osm_remote_sm.h
index 886070e..e7d52fa 100644
--- a/include/opensm/osm_remote_sm.h
+++ b/include/opensm/osm_remote_sm.h
@@ -87,7 +87,6 @@ BEGIN_C_DECLS
 */
 typedef struct osm_remote_sm {
cl_map_item_t map_item;
-   const osm_port_t *p_port;
ib_sm_info_t smi;
 } osm_remote_sm_t;
 /*
@@ -169,8 +168,7 @@ void osm_remote_sm_destroy(IN osm_remote_sm_t * p_sm);
 *
 * SYNOPSIS
 */
-void osm_remote_sm_init(IN osm_remote_sm_t * p_sm, IN const osm_port_t * 
p_port,
-   IN const ib_sm_info_t * p_smi);
+void osm_remote_sm_init(IN osm_remote_sm_t * p_sm, IN const ib_sm_info_t * 
p_smi);
 /*
 * PARAMETERS
 *  p_sm
diff --git a/opensm/osm_drop_mgr.c b/opensm/osm_drop_mgr.c
index ab3b2b3..5e5f1b1 100644
--- a/opensm/osm_drop_mgr.c
+++ b/opensm/osm_drop_mgr.c
@@ -256,7 +256,9 @@ static void drop_mgr_remove_port(osm_sm_t * sm, IN 
osm_port_t * p_port)
OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
"Cleaned SM for port guid 0x%016" PRIx64 "\n",
cl_ntoh64(port_guid));
-
+   /* clean up the polling_sm pointer */
+   if (sm->p_polling_sm == p_sm)
+   sm->p_polling_sm = NULL;
free(p_sm);
}
 
diff --git a/opensm/osm_remote_sm.c b/opensm/osm_remote_sm.c
index a0562ac..4ebbd3f 100644
--- a/opensm/osm_remote_sm.c
+++ b/opensm/osm_remote_sm.c
@@ -59,15 +59,13 @@ void osm_remote_sm_destroy(IN osm_remote_sm_t * p_sm)
memset(p_sm, 0, sizeof(*p_sm));
 }
 
-void osm_remote_sm_init(IN osm_remote_sm_t * p_sm, IN const osm_port_t * 
p_port,
+void osm_remote_sm_init(IN osm_remote_sm_t * p_sm,
IN const ib_sm_info_t * p_smi)
 {
CL_ASSERT(p_sm);
-   CL_ASSERT(p_port);
 
osm_remote_sm_construct(p_sm);
 
-   p_sm->p_port = p_port;
p_sm->smi = *p_smi;
return;
 }
diff --git a/opensm/osm_sa_sminfo_record.c b/opensm/osm_sa_sminfo_record.c
index e549046..23eda1d 100644
--- a/opensm/osm_sa_sminfo_record.c
+++ b/opensm/osm_sa_sminfo_record.c
@@ -123,6 +123,7 @@ static void sa_smir_by_comp_mask(IN osm_sa_t * sa,
const ib_sminfo_record_t *const p_rcvd_rec = p_ctxt->p_rcvd_rec;
const osm_physp_t *const p_req_physp = p_ctxt->p_req_physp;
ib_net64_t const comp_mask = p_ctxt->comp_mask;
+   osm_port_t *p_port;
 
OSM_LOG_ENTER(sa->p_log);
 
@@ -144,8 +145,15 @@ static void sa_smir_by_comp_mask(IN osm_sa_t * sa,
}
 
/* Implement any other needed search cases */
+   p_port = osm_get_port_by_guid(sa->p_subn, p_rem_sm->smi.guid);
 
-   smir_rcv_new_smir(sa, p_rem_sm->p_port, p_ctxt->p_list,
+if (p_port == NULL) {
+OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 2810: "
+"No port for remote sm\n");
+goto Exit;
+}
+
+   smir_rcv_new_smir(sa, p_port, p_ctxt->p_list,
  p_rem_sm->smi.guid, p_rem_sm->smi.act_count,
  p_rem_sm->smi.pri_state, p_req_physp);
 
diff --git a/opensm/osm_sm_state_mgr.c b/opensm/osm_sm_state_mgr.c
index e826f1f..80de22d 100644
--- a/opensm/osm_sm_state_mgr.c
+++ b/opensm/osm_sm_state_mgr.c
@@ -78,10 +78,13 @@ static void sm_state_mgr_send_master_sm_info_req(osm_sm_t * 
sm)
osm_madw_context_t context;
const osm_port_t *p_port;
ib_api_status_t status;
+   osm_dr_path_t dr_path;
+   ib_net64_t guid;
 
OSM_LOG_ENTER(sm->p_log);
 
memset(&context, 0, sizeof(context));
+   CL_PLOCK_ACQUIRE(sm->p_lock);
if (sm->p_subn->sm_state == IB_SMINFO_STATE_STANDBY) {
/*
 * We are in STANDBY state - this means we need to poll the
@@ -89,7 +92,7 @@ static void sm_state_mgr_send_master_sm

[PATCH 06/27] opensm/osm_subnet.c: Cosmetic formatting change

2012-07-31 Thread Alex Netes
From: Hal Rosenstock 

Signed-off-by: Hal Rosenstock 
Signed-off-by: Alex Netes 
---
 opensm/osm_subnet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/opensm/osm_subnet.c b/opensm/osm_subnet.c
index 2358140..fb8213f 100644
--- a/opensm/osm_subnet.c
+++ b/opensm/osm_subnet.c
@@ -1197,7 +1197,7 @@ osm_mgrp_t *osm_get_mgrp_by_mgid(IN osm_subn_t * subn, IN 
ib_gid_t * mgid)
 {
osm_mgrp_t *mgrp;
 
-   mgrp= (osm_mgrp_t *)cl_fmap_get(&subn->mgrp_mgid_tbl, mgid);
+   mgrp = (osm_mgrp_t *)cl_fmap_get(&subn->mgrp_mgid_tbl, mgid);
if (mgrp != (osm_mgrp_t *)cl_fmap_end(&subn->mgrp_mgid_tbl))
return mgrp;
return NULL;
-- 
1.7.11.2

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


[PATCH 07/27] Fix deadlock between sminfo_set_req() and osm_sm_state_mgr()

2012-07-31 Thread Alex Netes
A deadlock will occur when SM with higher priority gets HANDOVER
message during the state manager when it start polling the current MASTER SM.

Both sminfo_set_req() and osm_sm_state_mgr() use two locks -
sm->p_lock and sm->state_lock but in reverse order. This scenario
can lead to a deadlock.

Signed-off-by: Alex Netes 
---
 opensm/osm_sminfo_rcv.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/opensm/osm_sminfo_rcv.c b/opensm/osm_sminfo_rcv.c
index eb7c17f..a0092a5 100644
--- a/opensm/osm_sminfo_rcv.c
+++ b/opensm/osm_sminfo_rcv.c
@@ -181,7 +181,7 @@ static void smi_rcv_process_set_request(IN osm_sm_t * sm,
goto Exit;
}
 
-   CL_PLOCK_EXCL_ACQUIRE(sm->p_lock);
+   CL_PLOCK_ACQUIRE(sm->p_lock);
 
p_smi->guid = sm->p_subn->sm_port_guid;
p_smi->act_count = cl_hton32(sm->p_subn->p_osm->stats.qp0_mads_sent);
@@ -247,6 +247,8 @@ static void smi_rcv_process_set_request(IN osm_sm_t * sm,
goto Exit;
}
 
+   CL_PLOCK_RELEASE(sm->p_lock);
+
/* check legality of the needed transition in the SM state machine */
status = osm_sm_state_mgr_check_legality(sm, sm_signal);
if (status != IB_SUCCESS) {
@@ -260,7 +262,6 @@ static void smi_rcv_process_set_request(IN osm_sm_t * sm,
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 2F08: "
"Error sending response (%s)\n",
ib_get_err_str(status));
-   CL_PLOCK_RELEASE(sm->p_lock);
goto Exit;
}
 
@@ -280,10 +281,11 @@ static void smi_rcv_process_set_request(IN osm_sm_t * sm,
"Received a STANDBY signal. Updating "
"sm_state_mgr master_guid: 0x%016" PRIx64 "\n",
cl_ntoh64(sm_smi->guid));
+   CL_PLOCK_EXCL_ACQUIRE(sm->p_lock);
sm->master_sm_guid = sm_smi->guid;
+   CL_PLOCK_RELEASE(sm->p_lock);
}
 
-   CL_PLOCK_RELEASE(sm->p_lock);
status = osm_sm_state_mgr_process(sm, sm_signal);
 
if (status != IB_SUCCESS)
-- 
1.7.11.2

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


[PATCH 08/27] Fixes in SL2VL table distribution algorithm

2012-07-31 Thread Alex Netes
From: Vladimir Koushnir 

SL2VL and VLARB table shouldn't be sent to DOWN ports

Signed-off-by: Vladimir Koushnir 
---
 opensm/osm_qos.c | 49 +++--
 1 file changed, 39 insertions(+), 10 deletions(-)

diff --git a/opensm/osm_qos.c b/opensm/osm_qos.c
index 429660b..7342561 100644
--- a/opensm/osm_qos.c
+++ b/opensm/osm_qos.c
@@ -212,7 +212,8 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t 
*node,
struct osm_routing_engine *re = sm->p_subn->p_osm->routing_engine_used;
int ret = 0;
unsigned in, out;
-   uint8_t op_vl1;
+   uint8_t op_vl, common_op_vl = 0, max_num = 0;
+   uint8_t op_vl_arr[15];
 
/*
 * Do nothing unless the most recent routing attempt was successful.
@@ -222,6 +223,8 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t 
*node,
 
for (out = 1; out < num_ports; out++) {
p = osm_node_get_physp_ptr(node, out);
+   if (ib_port_info_get_port_state(&p->port_info) == IB_LINK_DOWN)
+   continue;
force_update = p->need_update || sm->p_subn->need_update;
p->vl_high_limit = qcfg->vl_high_limit;
if (vlarb_update(sm, p, p->port_num, force_update, qcfg))
@@ -234,19 +237,43 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t 
*node,
 
if (ib_switch_info_get_opt_sl2vlmapping(&node->sw->switch_info) &&
sm->p_subn->opt.use_optimized_slvl && !re->update_sl2vl) {
-   p = osm_node_get_physp_ptr(node, 1);
-   op_vl1 = ib_port_info_get_op_vls(&p->port_info);
+
+   /* we should find the op_vl that is used by majority of ports */
+   memset(&op_vl_arr[0], 0, sizeof(op_vl_arr));
+   p0 = osm_node_get_physp_ptr(node, 1);
+
+   for (out = 1; out < num_ports; out++) {
+   p = osm_node_get_physp_ptr(node, out);
+   if (ib_port_info_get_port_state(&p->port_info) ==
+   IB_LINK_DOWN)
+   continue;
+   op_vl = ib_port_info_get_op_vls(&p->port_info);
+   op_vl_arr[op_vl]++;
+   if (op_vl_arr[op_vl] > max_num){
+   max_num = op_vl_arr[op_vl];
+   common_op_vl = op_vl;
+   /* remember the port with most common op_vl */
+   p0 = p;
+   }
+
+   }
force_update = p->need_update || sm->p_subn->need_update;
-   if (sl2vl_update_table(sm, p, 0, 0x3, force_update,
+   if (sl2vl_update_table(sm, p0, 0, 0x3, force_update,
&qcfg->sl2vl))
ret = -1;
-   /* overwrite default ALL configuration if port's
-  op_vl is different */
-   for (out = 2; out < num_ports; out++) {
+   /*
+* Overwrite default ALL configuration if port's
+* op_vl is different.
+*/
+   for (out = 1; out < num_ports; out++) {
p = osm_node_get_physp_ptr(node, out);
-   if (ib_port_info_get_op_vls(&p->port_info) != op_vl1 &&
-   sl2vl_update_table(sm, p, 0, 0x2 | out, 
force_update,
-   &qcfg->sl2vl))
+   if (ib_port_info_get_port_state(&p->port_info) ==
+   IB_LINK_DOWN)
+   continue;
+   if (ib_port_info_get_op_vls(&p->port_info) !=
+   common_op_vl &&
+   sl2vl_update_table(sm, p, 0, 0x2 | out,
+  force_update, &qcfg->sl2vl))
ret = -1;
}
return ret;
@@ -256,6 +283,8 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t 
*node,
out = ib_switch_info_is_enhanced_port0(&node->sw->switch_info) ? 0 : 1;
for (; out < num_ports; out++) {
p = osm_node_get_physp_ptr(node, out);
+   if (ib_port_info_get_port_state(&p->port_info) == IB_LINK_DOWN)
+   continue;
force_update = p->need_update || sm->p_subn->need_update;
/* go over all in ports */
for (in = 0; in < num_ports; in++) {
-- 
1.7.11.2

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


[PATCH 11/27] Fix base port0 sl2vl mapping optimization

2012-07-31 Thread Alex Netes
The settings should be saved to the port that was used during the calculation
and not port 0 by default.

Signed-off-by: Alex Netes 
---
 opensm/osm_qos.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/opensm/osm_qos.c b/opensm/osm_qos.c
index ce48867..bfcf1e3 100644
--- a/opensm/osm_qos.c
+++ b/opensm/osm_qos.c
@@ -319,7 +319,7 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t 
*node,
 
}
force_update = node->sw->need_update || sm->p_subn->need_update;
-   if (sl2vl_update_table(sm, p0, 0, 0x3, force_update,
+   if (sl2vl_update_table(sm, p0, p0->port_num, 0x3, 
force_update,
&qcfg->sl2vl, port_mad_list))
ret = -1;
/*
@@ -335,7 +335,7 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t 
*node,
force_update = p->need_update || force_update;
if (ib_port_info_get_op_vls(&p->port_info) !=
common_op_vl &&
-   sl2vl_update_table(sm, p, 0, 0x2 | out,
+   sl2vl_update_table(sm, p, p->port_num, 0x2 | 
out,
   force_update, &qcfg->sl2vl,
   port_mad_list))
ret = -1;
-- 
1.7.11.2

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


[PATCH 12/27] opensm/osm_sa_mcmember_record.c: Dump MCMemberRecord in mcmr_query_mgrp

2012-07-31 Thread Alex Netes
From: Hal Rosenstock 

Signed-off-by: Hal Rosenstock 
Signed-off-by: Alex Netes 
---
 opensm/osm_sa_mcmember_record.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/opensm/osm_sa_mcmember_record.c b/opensm/osm_sa_mcmember_record.c
index 651bc95..e591801 100644
--- a/opensm/osm_sa_mcmember_record.c
+++ b/opensm/osm_sa_mcmember_record.c
@@ -1405,6 +1405,11 @@ static void mcmr_query_mgrp(IN osm_sa_t * sa, IN 
osm_madw_t * p_madw)
goto Exit;
}
 
+   if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) {
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "Dump of record\n");
+   osm_dump_mc_record_v2(sa->p_log, p_rcvd_rec, FILE_ID, 
OSM_LOG_DEBUG);
+   }
+
cl_qlist_init(&rec_list);
 
CL_PLOCK_ACQUIRE(sa->p_lock);
-- 
1.7.11.2

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


[PATCH 10/27] Fix SL2VL configuration

2012-07-31 Thread Alex Netes
Set optimized SL2VL table only if node is maked as 'need_update'.
Set SL2VL tale for port that marked as 'need_update'.

Signed-off-by: Alex Netes 
Signed-off-by: Vladimir Koushnir 
---
 opensm/osm_qos.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/opensm/osm_qos.c b/opensm/osm_qos.c
index dd08ac0..ce48867 100644
--- a/opensm/osm_qos.c
+++ b/opensm/osm_qos.c
@@ -318,7 +318,7 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t 
*node,
}
 
}
-   force_update = p->need_update || sm->p_subn->need_update;
+   force_update = node->sw->need_update || sm->p_subn->need_update;
if (sl2vl_update_table(sm, p0, 0, 0x3, force_update,
&qcfg->sl2vl, port_mad_list))
ret = -1;
@@ -331,6 +331,8 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t 
*node,
if (ib_port_info_get_port_state(&p->port_info) ==
IB_LINK_DOWN)
continue;
+
+   force_update = p->need_update || force_update;
if (ib_port_info_get_op_vls(&p->port_info) !=
common_op_vl &&
sl2vl_update_table(sm, p, 0, 0x2 | out,
-- 
1.7.11.2

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


[PATCH 09/27] Sending SL2VL and VLARB SET MADs in distributed manner

2012-07-31 Thread Alex Netes
From: Vladimir Koushnir 

The algorithm is the following:
1. For each GUID the linked list of QoS MADs is created w/o sending the
   MADs.
2. These linked lists are combined into super-linked list. The nodes in
   the super-list are linked lists from Action 1.
3. Now I'm traversing the super-linked list until it is empty and
   removing the head items from the GUID QoS MAD lists and sending them
   over the wire.

Signed-off-by: Vladimir Koushnir 
Signed-off-by: Alex Netes 
---
 include/opensm/osm_sm.h |  67 +++
 opensm/osm_qos.c| 211 
 opensm/osm_req.c|  49 ---
 3 files changed, 263 insertions(+), 64 deletions(-)

diff --git a/include/opensm/osm_sm.h b/include/opensm/osm_sm.h
index 4c7b120..710d206 100644
--- a/include/opensm/osm_sm.h
+++ b/include/opensm/osm_sm.h
@@ -434,6 +434,73 @@ ib_api_status_t osm_req_get(IN osm_sm_t * sm, IN const 
osm_dr_path_t * p_path,
 *  The response from the node will be routed through the Dispatcher
 *  to the appropriate receive controller object.
 */
+
+/f* OpenSM: SM/osm_send_req_mad
+* NAME
+*   osm_send_req_mad
+*
+* DESCRIPTION
+*  Starts the process to transmit a preallocated/predefined directed route
+*  Set() request.
+*
+* SYNOPSIS
+*/
+void osm_send_req_mad(IN osm_sm_t * sm, IN osm_madw_t *p_madw);
+/*
+* PARAMETERS
+*  sm
+*  [in] Pointer to an osm_sm_t object.
+*  p_madw
+*  [in] Pointer to a preallocated MAD buffer
+*
+*/
+
+/***f* OpenSM: SM/osm_prepare_req_set
+* NAME
+*  osm_prepare_req_set
+*
+* DESCRIPTION
+*  Preallocate and fill a directed route Set() MAD w/o sending it.
+*
+* SYNOPSIS
+*/
+osm_madw_t *osm_prepare_req_set(IN osm_sm_t * sm, IN const osm_dr_path_t * 
p_path,
+   IN const uint8_t * p_payload,
+   IN size_t payload_size, IN ib_net16_t attr_id,
+   IN ib_net32_t attr_mod, IN cl_disp_msgid_t 
err_msg,
+   IN const osm_madw_context_t * p_context);
+/*
+* PARAMETERS
+*  sm
+*  [in] Pointer to an osm_sm_t object.
+*
+*  p_path
+*  [in] Pointer to the directed route path of the recipient.
+*
+*  p_payload
+*  [in] Pointer to the SMP payload to send.
+*
+*  payload_size
+*  [in] The size of the payload to be copied to the SMP data field.
+*
+*  attr_id
+*  [in] Attribute ID to request.
+*
+*  attr_mod
+*  [in] Attribute modifier for this request.
+*
+*  err_msg
+*  [in] Message id with which to post this MAD if an error occurs.
+*
+*  p_context
+*  [in] Mad wrapper context structure to be copied into the wrapper
+*   context, and thus visible to the recipient of the response.
+*
+* RETURN VALUES
+*  Pointer the MAD buffer in case of success and NULL in case of failure.
+*
+*/
+
 /f* OpenSM: SM/osm_req_set
 * NAME
 *  osm_req_set
diff --git a/opensm/osm_qos.c b/opensm/osm_qos.c
index 7342561..dd08ac0 100644
--- a/opensm/osm_qos.c
+++ b/opensm/osm_qos.c
@@ -61,12 +61,79 @@ struct qos_config {
ib_slvl_table_t sl2vl;
 };
 
-static void qos_build_config(struct qos_config *cfg, osm_qos_options_t * opt,
+typedef struct qos_mad_item {
+   cl_list_item_t list_item;
+   osm_madw_t *p_madw;
+} qos_mad_item_t;
+
+typedef struct qos_mad_list {
+   cl_list_item_t list_item;
+   cl_qlist_t port_mad_list;
+} qos_mad_list_t;
+
+static void qos_build_config(struct qos_config *cfg,
+osm_qos_options_t * opt,
 osm_qos_options_t * dflt);
 
 /*
  * QoS primitives
  */
+
+static qos_mad_item_t *osm_qos_mad_create(IN osm_sm_t * sm,
+ IN osm_physp_t * p,
+ IN uint32_t data_size,
+ IN uint8_t * p_data,
+ IN ib_net16_t attr_id,
+ IN uint32_t attr_mod)
+
+{
+   qos_mad_item_t *p_mad;
+   osm_madw_context_t context;
+   osm_madw_t *p_madw;
+   osm_node_t *p_node;
+
+   p_node = osm_physp_get_node_ptr(p);
+
+   switch (attr_id){
+   case IB_MAD_ATTR_SLVL_TABLE:
+   context.slvl_context.node_guid = osm_node_get_node_guid(p_node);
+   context.slvl_context.port_guid = osm_physp_get_port_guid(p);
+   context.slvl_context.set_method = TRUE;
+   break;
+   case IB_MAD_ATTR_VL_ARBITRATION:
+   context.vla_context.node_guid = osm_node_get_node_guid(p_node);
+   context.vla_context.port_guid = osm_physp_get_port_guid(p);
+   context.vla_context.set_method = TRUE;
+   break;
+   default:
+   return NULL;
+   }
+
+   

[PATCH 13/27] Fix pre-creation of MC group with MGID containing P_Key

2012-07-31 Thread Alex Netes
IPoIB MGID can contain only full P_Key.

Signed-off-by: Alex Netes 
---
 opensm/osm_prtn_config.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/opensm/osm_prtn_config.c b/opensm/osm_prtn_config.c
index 750cbe0..8714eba 100644
--- a/opensm/osm_prtn_config.c
+++ b/opensm/osm_prtn_config.c
@@ -129,8 +129,10 @@ static inline boolean_t ip_mgroup_pkey_ok(struct part_conf 
*conf,
char gid_str[INET6_ADDRSTRLEN];
 
if (mgid_is_broadcast(&group->mgid)
-   || mpkey == 0x /* user requested "wild card" of pkey */
-   || mpkey == conf->p_prtn->pkey) /* user was smart enough to match */
+   /* user requested "wild card" of pkey */
+   || mpkey == 0x
+   /* user was smart enough to match */
+   || mpkey == (conf->p_prtn->pkey | cl_hton16(0x8000)))
return (TRUE);
 
OSM_LOG(conf->p_log, OSM_LOG_ERROR,
-- 
1.7.11.2

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


[PATCH 14/27] opensm/osm_sa_mcmember_record.c: In mcmr_rcv_join_mgrp, add MGID to log message

2012-07-31 Thread Alex Netes
From: Hal Rosenstock 

Signed-off-by: Hal Rosenstock 
Signed-off-by: Alex Netes 
---
 opensm/osm_sa_mcmember_record.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/opensm/osm_sa_mcmember_record.c b/opensm/osm_sa_mcmember_record.c
index e591801..79d99ea 100644
--- a/opensm/osm_sa_mcmember_record.c
+++ b/opensm/osm_sa_mcmember_record.c
@@ -1124,13 +1124,16 @@ static void mcmr_rcv_join_mgrp(IN osm_sa_t * sa, IN 
osm_madw_t * p_madw)
   p_sa_mad->comp_mask)
|| !validate_port_caps(sa->p_log, p_mgrp, p_physp)
|| !(join_state != 0)) {
+   char gid_str[INET6_ADDRSTRLEN];
/* since we might have created the new group we need to cleanup 
*/
osm_mgrp_cleanup(sa->p_subn, p_mgrp);
CL_PLOCK_RELEASE(sa->p_lock);
OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1B12: "
"validate_more_comp_fields, validate_port_caps, "
-   "or JoinState = 0 failed from port 0x%016" PRIx64
+   "or JoinState = 0 failed for MGID: %s port 0x%016" 
PRIx64
" (%s), " "sending IB_SA_MAD_STATUS_REQ_INVALID\n",
+  inet_ntop(AF_INET6, p_mgrp->mcmember_rec.mgid.raw,
+gid_str, sizeof gid_str),
cl_ntoh64(portguid), p_port->p_node->print_desc);
osm_sa_send_error(sa, p_madw, IB_SA_MAD_STATUS_REQ_INVALID);
goto Exit;
-- 
1.7.11.2

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


[PATCH 15/27] opensm/osm_sa_path_record.c: Add debug logging to pr_match_mgrp_attributes

2012-07-31 Thread Alex Netes
From: Hal Rosenstock 

Signed-off-by: Hal Rosenstock 
Signed-off-by: Alex Netes 
---
 opensm/osm_sa_path_record.c | 59 ++---
 1 file changed, 50 insertions(+), 9 deletions(-)

diff --git a/opensm/osm_sa_path_record.c b/opensm/osm_sa_path_record.c
index d37d35c..f06696d 100644
--- a/opensm/osm_sa_path_record.c
+++ b/opensm/osm_sa_path_record.c
@@ -1517,50 +1517,91 @@ static ib_api_status_t pr_match_mgrp_attributes(IN 
osm_sa_t * sa,
OSM_LOG_ENTER(sa->p_log);
 
/* check that MLID of the MC group matches the PathRecord DLID */
-   if ((comp_mask & IB_PR_COMPMASK_DLID) && p_mgrp->mlid != p_pr->dlid)
+   if ((comp_mask & IB_PR_COMPMASK_DLID) && p_mgrp->mlid != p_pr->dlid) {
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+   "DLID 0x%x is not MLID 0x%x for MC group\n",
+cl_ntoh16(p_pr->dlid), cl_ntoh16(p_mgrp->mlid));
goto Exit;
+   }
 
/* If SGID and/or SLID specified, should validate as member of MC group 
*/
if (comp_mask & IB_PR_COMPMASK_SGID) {
if (!osm_mgrp_get_mcm_alias_guid(p_mgrp,
-
p_pr->sgid.unicast.interface_id))
+
p_pr->sgid.unicast.interface_id)) {
+   char gid_str[INET6_ADDRSTRLEN];
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+   "SGID %s is not a member of MC group\n",
+   inet_ntop(AF_INET6, p_pr->sgid.raw,
+ gid_str, sizeof gid_str));
goto Exit;
+   }
}
 
if (comp_mask & IB_PR_COMPMASK_SLID) {
port = osm_get_port_by_lid(sa->p_subn, p_pr->slid);
-   if (!port || !osm_mgrp_get_mcm_port(p_mgrp, port->guid))
+   if (!port || !osm_mgrp_get_mcm_port(p_mgrp, port->guid)) {
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+   "Either no port with SLID %u found or "
+   "SLID not a member of MC group\n",
+   cl_ntoh16(p_pr->slid));
goto Exit;
+   }
}
 
/* Also, MTU, rate, packet lifetime, and raw traffic requested are not 
currently checked */
if ((comp_mask & IB_PR_COMPMASK_PKEY) &&
-   p_pr->pkey != p_mgrp->mcmember_rec.pkey)
+   p_pr->pkey != p_mgrp->mcmember_rec.pkey) {
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+   "Pkey 0x%x doesn't match MC group Pkey 0x%x\n",
+   cl_ntoh16(p_pr->pkey),
+   cl_ntoh16(p_mgrp->mcmember_rec.pkey));
goto Exit;
+   }
 
ib_member_get_sl_flow_hop(p_mgrp->mcmember_rec.sl_flow_hop,
  &sl, &flow_label, &hop_limit);
 
-   if ((comp_mask & IB_PR_COMPMASK_SL) && ib_path_rec_sl(p_pr) != sl)
+   if ((comp_mask & IB_PR_COMPMASK_SL) && ib_path_rec_sl(p_pr) != sl) {
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+   "SL %d doesn't match MC group SL %d\n",
+   ib_path_rec_sl(p_pr), sl);
goto Exit;
+   }
 
/* If SubnAdmGet, assume NumbPaths of 1 (1.2 erratum) */
if ((comp_mask & IB_PR_COMPMASK_NUMBPATH) &&
sa_mad->method != IB_MAD_METHOD_GET &&
-   ib_path_rec_num_path(p_pr) == 0)
+   ib_path_rec_num_path(p_pr) == 0) {
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+   "Number of paths requested is 0\n");
goto Exit;
+   }
 
if ((comp_mask & IB_PR_COMPMASK_FLOWLABEL) &&
-   ib_path_rec_flow_lbl(p_pr) != flow_label)
+   ib_path_rec_flow_lbl(p_pr) != flow_label) {
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+   "Flow label 0x%x doesn't match MC group "
+   " flow label 0x%x\n",
+   ib_path_rec_flow_lbl(p_pr), flow_label);
goto Exit;
+   }
 
if ((comp_mask & IB_PR_COMPMASK_HOPLIMIT) &&
-   ib_path_rec_hop_limit(p_pr) != hop_limit)
+   ib_path_rec_hop_limit(p_pr) != hop_limit) {
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+   "Hop limit %u doesn't match MC group hop limit %u\n",
+   ib_path_rec_hop_limit(p_pr), hop_limit);
goto Exit;
+   }
+
 
if ((comp_mask & IB_PR_COMPMASK_TCLASS) &&
-   p_pr->tclass != 

[PATCH 16/27] opensm/osm_sa_path_record.c: Log requester port GUID at DEBUG level

2012-07-31 Thread Alex Netes
From: Hal Rosenstock 

Signed-off-by: Hal Rosenstock 
Signed-off-by: Alex Netes 
---
 opensm/osm_sa_path_record.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/opensm/osm_sa_path_record.c b/opensm/osm_sa_path_record.c
index f06696d..e426ce7 100644
--- a/opensm/osm_sa_path_record.c
+++ b/opensm/osm_sa_path_record.c
@@ -1720,8 +1720,12 @@ void osm_pr_rcv_process(IN void *context, IN void *data)
goto Exit;
}
 
-   if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG))
+   if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) {
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+   "Requester port GUID 0x%" PRIx64 "\n",
+   cl_ntoh64(osm_port_get_guid(requester_port)));
osm_dump_path_record_v2(sa->p_log, p_pr, FILE_ID, 
OSM_LOG_DEBUG);
+   }
 
/* Validate rate if supplied */
if ((p_sa_mad->comp_mask & IB_PR_COMPMASK_RATESELEC) &&
-- 
1.7.11.2

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


[PATCH 17/27] opensm/osm_sa_mcmember_record.c: Log requester port GUID at DEBUG level

2012-07-31 Thread Alex Netes
From: Hal Rosenstock 

Signed-off-by: Hal Rosenstock 
Signed-off-by: Alex Netes 
---
 opensm/osm_sa_mcmember_record.c | 29 -
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/opensm/osm_sa_mcmember_record.c b/opensm/osm_sa_mcmember_record.c
index 79d99ea..c6069d6 100644
--- a/opensm/osm_sa_mcmember_record.c
+++ b/opensm/osm_sa_mcmember_record.c
@@ -913,6 +913,18 @@ static void mcmr_rcv_leave_mgrp(IN osm_sa_t * sa, IN 
osm_madw_t * p_madw)
mcmember_rec = *p_recvd_mcmember_rec;
 
if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) {
+   osm_physp_t *p_req_physp;
+
+   p_req_physp = osm_get_physp_by_mad_addr(sa->p_log, sa->p_subn,
+   
osm_madw_get_mad_addr_ptr(p_madw));
+   if (p_req_physp == NULL) {
+   OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1B02: "
+   "Cannot find requester physical port\n");
+   } else {
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+   "Requester port GUID 0x%" PRIx64 "\n",
+   
cl_ntoh64(osm_physp_get_port_guid(p_req_physp)));
+   }
OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "Dump of record\n");
osm_dump_mc_record_v2(sa->p_log, &mcmember_rec, FILE_ID, 
OSM_LOG_DEBUG);
}
@@ -988,6 +1000,18 @@ static void mcmr_rcv_join_mgrp(IN osm_sa_t * sa, IN 
osm_madw_t * p_madw)
mcmember_rec = *p_recvd_mcmember_rec;
 
if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) {
+   osm_physp_t *p_req_physp;
+
+   p_req_physp = osm_get_physp_by_mad_addr(sa->p_log, sa->p_subn,
+   
osm_madw_get_mad_addr_ptr(p_madw));
+   if (p_req_physp == NULL) {
+   OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1B03: "
+   "Cannot find requester physical port\n");
+   } else {
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+   "Requester port GUID 0x%" PRIx64 "\n",
+   
cl_ntoh64(osm_physp_get_port_guid(p_req_physp)));
+   }
OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "Dump of incoming record\n");
osm_dump_mc_record_v2(sa->p_log, &mcmember_rec, FILE_ID, 
OSM_LOG_DEBUG);
}
@@ -1398,7 +1422,7 @@ static void mcmr_query_mgrp(IN osm_sa_t * sa, IN 
osm_madw_t * p_madw)
 */
trusted_req = (p_rcvd_mad->sm_key != 0);
 
-   /* update the requester physical port. */
+   /* update the requester physical port */
p_req_physp = osm_get_physp_by_mad_addr(sa->p_log, sa->p_subn,
osm_madw_get_mad_addr_ptr
(p_madw));
@@ -1409,6 +1433,9 @@ static void mcmr_query_mgrp(IN osm_sa_t * sa, IN 
osm_madw_t * p_madw)
}
 
if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) {
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+   "Requester port GUID 0x%" PRIx64 "\n",
+   cl_ntoh64(osm_physp_get_port_guid(p_req_physp)));
OSM_LOG(sa->p_log, OSM_LOG_DEBUG, "Dump of record\n");
osm_dump_mc_record(sa->p_log, p_rcvd_rec, OSM_LOG_DEBUG);
}
-- 
1.7.11.2

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


[PATCH 18/27] opensm/osm_sa*.c: Log requester port GUID at DEBUG level

2012-07-31 Thread Alex Netes
From: Hal Rosenstock 

Signed-off-by: Hal Rosenstock 
Signed-off-by: Alex Netes 
---
 opensm/osm_sa_guidinfo_record.c  |  3 +++
 opensm/osm_sa_informinfo.c   |  8 ++--
 opensm/osm_sa_lft_record.c   |  6 +-
 opensm/osm_sa_link_record.c  |  8 ++--
 opensm/osm_sa_mft_record.c   |  5 -
 opensm/osm_sa_multipath_record.c |  8 ++--
 opensm/osm_sa_node_record.c  |  8 ++--
 opensm/osm_sa_pkey_record.c  |  5 -
 opensm/osm_sa_portinfo_record.c  |  8 ++--
 opensm/osm_sa_service_record.c   | 13 ++---
 opensm/osm_sa_slvl_record.c  |  5 -
 opensm/osm_sa_sminfo_record.c|  8 ++--
 opensm/osm_sa_sw_info_record.c   |  8 ++--
 opensm/osm_sa_vlarb_record.c |  5 -
 14 files changed, 76 insertions(+), 22 deletions(-)

diff --git a/opensm/osm_sa_guidinfo_record.c b/opensm/osm_sa_guidinfo_record.c
index f9d7d3d..92f3b1a 100644
--- a/opensm/osm_sa_guidinfo_record.c
+++ b/opensm/osm_sa_guidinfo_record.c
@@ -753,6 +753,9 @@ void osm_gir_rcv_process(IN void *ctx, IN void *data)
"Cannot find requester physical port\n");
goto Exit;
}
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+   "Requester port GUID 0x%" PRIx64 "\n",
+   cl_ntoh64(osm_physp_get_port_guid(p_req_physp)));
 
switch(p_rcvd_mad->method) {
case IB_MAD_METHOD_GET:
diff --git a/opensm/osm_sa_informinfo.c b/opensm/osm_sa_informinfo.c
index 6ab6c21..f20d834 100644
--- a/opensm/osm_sa_informinfo.c
+++ b/opensm/osm_sa_informinfo.c
@@ -328,7 +328,7 @@ static void infr_rcv_process_get_method(osm_sa_t * sa, IN 
osm_madw_t * p_madw)
p_rcvd_rec =
(ib_inform_info_record_t *) ib_sa_mad_get_payload_ptr(p_rcvd_mad);
 
-   /* update the requester physical port. */
+   /* update the requester physical port */
p_req_physp = osm_get_physp_by_mad_addr(sa->p_log, sa->p_subn,
osm_madw_get_mad_addr_ptr
(p_madw));
@@ -338,9 +338,13 @@ static void infr_rcv_process_get_method(osm_sa_t * sa, IN 
osm_madw_t * p_madw)
goto Exit;
}
 
-   if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG))
+   if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) {
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+   "Requester port GUID 0x%" PRIx64 "\n",
+   cl_ntoh64(osm_physp_get_port_guid(p_req_physp)));
osm_dump_inform_info_record_v2(sa->p_log, p_rcvd_rec,
   FILE_ID, OSM_LOG_DEBUG);
+   }
 
cl_qlist_init(&rec_list);
 
diff --git a/opensm/osm_sa_lft_record.c b/opensm/osm_sa_lft_record.c
index 113b9a8..248d8f1 100644
--- a/opensm/osm_sa_lft_record.c
+++ b/opensm/osm_sa_lft_record.c
@@ -206,7 +206,7 @@ void osm_lftr_rcv_process(IN void *ctx, IN void *data)
goto Exit;
}
 
-   /* update the requester physical port. */
+   /* update the requester physical port */
p_req_physp = osm_get_physp_by_mad_addr(sa->p_log, sa->p_subn,
osm_madw_get_mad_addr_ptr
(p_madw));
@@ -216,6 +216,10 @@ void osm_lftr_rcv_process(IN void *ctx, IN void *data)
goto Exit;
}
 
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+   "Requester port GUID 0x%" PRIx64 "\n",
+   cl_ntoh64(osm_physp_get_port_guid(p_req_physp)));
+
cl_qlist_init(&rec_list);
 
context.p_rcvd_rec = p_rcvd_rec;
diff --git a/opensm/osm_sa_link_record.c b/opensm/osm_sa_link_record.c
index 6c426be..f91b654 100644
--- a/opensm/osm_sa_link_record.c
+++ b/opensm/osm_sa_link_record.c
@@ -445,7 +445,7 @@ void osm_lr_rcv_process(IN void *context, IN void *data)
goto Exit;
}
 
-   /* update the requester physical port. */
+   /* update the requester physical port */
p_req_physp = osm_get_physp_by_mad_addr(sa->p_log, sa->p_subn,
osm_madw_get_mad_addr_ptr
(p_madw));
@@ -455,8 +455,12 @@ void osm_lr_rcv_process(IN void *context, IN void *data)
goto Exit;
}
 
-   if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG))
+   if (OSM_LOG_IS_ACTIVE_V2(sa->p_log, OSM_LOG_DEBUG)) {
+   OSM_LOG(sa->p_log, OSM_LOG_DEBUG,
+   "Requester port GUID 0x%" PRIx64 "\n",
+   cl_ntoh64(osm_physp_get_port_guid(p_req_physp)));
osm_dump_link_record_v2(sa->p_log, p_lr, FILE_ID, 
OSM_LOG_DEBUG);
+   }
 
cl_qlist_init(&lr_list);
 
diff --git a/opensm/osm_sa_mft_record.c b/opensm/osm_sa_mft_

[PATCH 19/27] Fix crash in ucast cache when ucast cache invalidates after updating one of the switches

2012-07-31 Thread Alex Netes
Signed-off-by: Alex Netes 
Signed-off-by: Hal Rosenstock 
Signed-off-by: Vladimir Koushnir 
--
Changes since v2:
Sets p_sw->lft_size = 0 in osm_ucast_cache_add_node()

Changes since v1:
Sets p_sw->lft_size only after successful malloc()
---
 opensm/osm_ucast_cache.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/opensm/osm_ucast_cache.c b/opensm/osm_ucast_cache.c
index 701b8a8..fc28be7 100644
--- a/opensm/osm_ucast_cache.c
+++ b/opensm/osm_ucast_cache.c
@@ -318,8 +318,6 @@ cache_restore_ucast_info(osm_ucast_mgr_t * p_mgr,
free(p_sw->new_lft);
p_sw->new_lft = p_cache_sw->lft;
p_cache_sw->lft = NULL;
-   p_sw->lft_size = (p_sw->max_lid_ho / IB_SMP_DATA_SIZE + 1)
-* IB_SMP_DATA_SIZE;
 
p_sw->num_hops = p_cache_sw->num_hops;
p_cache_sw->num_hops = 0;
@@ -978,6 +976,7 @@ void osm_ucast_cache_add_node(osm_ucast_mgr_t * p_mgr, 
osm_node_t * p_node)
/* no LFT buffer, so we use the switch's LFT */
p_cache_sw->lft = p_node->sw->lft;
p_node->sw->lft = NULL;
+   p_node->sw->lft_size = 0;
}
p_cache_sw->max_lid_ho = p_node->sw->max_lid_ho;
} else {
@@ -1007,6 +1006,7 @@ int osm_ucast_cache_process(osm_ucast_mgr_t * p_mgr)
cl_qmap_t *tbl = &p_mgr->p_subn->sw_guid_tbl;
cl_map_item_t *item;
osm_switch_t *p_sw;
+   uint16_t lft_size;
 
if (!p_mgr->p_subn->opt.use_ucast_cache)
return 1;
@@ -1028,10 +1028,12 @@ int osm_ucast_cache_process(osm_ucast_mgr_t * p_mgr)
   switch, but the LFT needs to be updated 
anyway */
p_sw->new_lft = p_sw->lft;
 
-
-   p_sw->lft = malloc(p_sw->lft_size);
+   lft_size = (p_sw->max_lid_ho / IB_SMP_DATA_SIZE + 1)
+  * IB_SMP_DATA_SIZE;
+   p_sw->lft = malloc(lft_size);
if (!p_sw->lft)
return IB_INSUFFICIENT_MEMORY;
+   p_sw->lft_size = lft_size;
memset(p_sw->lft, OSM_NO_PATH, p_sw->lft_size);
}
 
-- 
1.7.11.2

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


[PATCH 20/27] Fix crash in ucast cache when chain of switches connected back at once to the fabric

2012-07-31 Thread Alex Netes
Signed-off-by: Alex Netes 
Signed-off-by: Hal Rosenstock 
Signed-off-by: Vladimir Koushnir 
---
 opensm/osm_ucast_cache.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/opensm/osm_ucast_cache.c b/opensm/osm_ucast_cache.c
index fc28be7..f0b2346 100644
--- a/opensm/osm_ucast_cache.c
+++ b/opensm/osm_ucast_cache.c
@@ -325,6 +325,8 @@ cache_restore_ucast_info(osm_ucast_mgr_t * p_mgr,
free(p_sw->hops);
p_sw->hops = p_cache_sw->hops;
p_cache_sw->hops = NULL;
+
+   p_sw->need_update = 2;
 }
 
 static void ucast_cache_dump(osm_ucast_mgr_t * p_mgr)
-- 
1.7.11.2

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


[PATCH 21/27] Fix transaction id casting

2012-07-31 Thread Alex Netes
cl_atomic() returns signed int32, so without the casting sm_trans_id > 
0x7fff were messed up.

Signed-off-by: Alex Netes 
---
 opensm/osm_req.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/opensm/osm_req.c b/opensm/osm_req.c
index 8780134..40bd1e4 100644
--- a/opensm/osm_req.c
+++ b/opensm/osm_req.c
@@ -93,7 +93,8 @@ ib_api_status_t osm_req_get(IN osm_sm_t * sm, IN const 
osm_dr_path_t * p_path,
goto Exit;
}
 
-   tid = cl_hton64((uint64_t) cl_atomic_inc(&sm->sm_trans_id));
+   tid = cl_hton64((uint64_t) cl_atomic_inc(&sm->sm_trans_id)
+& (uint64_t)(0x));
 
OSM_LOG(sm->p_log, OSM_LOG_DEBUG,
"Getting %s (0x%X), modifier 0x%X, TID 0x%" PRIx64 "\n",
@@ -161,7 +162,8 @@ osm_madw_t *osm_prepare_req_set(IN osm_sm_t * sm, IN const 
osm_dr_path_t * p_pat
goto Exit;
}
 
-   tid = cl_hton64((uint64_t) cl_atomic_inc(&sm->sm_trans_id));
+   tid = cl_hton64((uint64_t) cl_atomic_inc(&sm->sm_trans_id)
+& (uint64_t)(0x));
 
OSM_LOG(sm->p_log, OSM_LOG_DEBUG,
"Setting %s (0x%X), modifier 0x%X, TID 0x%" PRIx64 "\n",
@@ -277,7 +279,8 @@ int osm_send_trap144(osm_sm_t * sm, ib_net16_t local)
smp->mgmt_class = IB_MCLASS_SUBN_LID;
smp->class_ver = 1;
smp->method = IB_MAD_METHOD_TRAP;
-   smp->trans_id = cl_hton64((uint64_t) cl_atomic_inc(&sm->sm_trans_id));
+   smp->trans_id = cl_hton64((uint64_t) cl_atomic_inc(&sm->sm_trans_id)
+  & 
(uint64_t)(0x));
smp->attr_id = IB_MAD_ATTR_NOTICE;
 
ntc = (ib_mad_notice_attr_t *) smp->data;
-- 
1.7.11.2

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


[PATCH 22/27] Skip TID 0 on 32 bit wraparound for SMP, SA and PerfMgt queries

2012-07-31 Thread Alex Netes
Signed-off-by: Alex Netes 
---
 opensm/osm_inform.c  |  9 +++--
 opensm/osm_perfmgr.c |  7 ++-
 opensm/osm_req.c | 10 ++
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/opensm/osm_inform.c b/opensm/osm_inform.c
index a90396b..f5abbc6 100644
--- a/opensm/osm_inform.c
+++ b/opensm/osm_inform.c
@@ -297,6 +297,7 @@ static ib_api_status_t send_report(IN osm_infr_t * 
p_infr_rec,  /* the informinfo
static atomic32_t trap_fwd_trans_id = 0x02DAB000;
ib_api_status_t status = IB_SUCCESS;
osm_log_t *p_log = p_infr_rec->sa->p_log;
+   ib_net64_t tid;
 
OSM_LOG_ENTER(p_log);
 
@@ -323,10 +324,14 @@ static ib_api_status_t send_report(IN osm_infr_t * 
p_infr_rec,/* the informinfo
p_report_madw->resp_expected = TRUE;
 
/* advance trap trans id (cant simply ++ on some systems inside ntoh) */
+   tid = cl_hton64((uint64_t) cl_atomic_inc(&trap_fwd_trans_id) &
+   (uint64_t) (0x));
+   if (trap_fwd_trans_id == 0)
+   tid = cl_hton64((uint64_t) cl_atomic_inc(&trap_fwd_trans_id) &
+   (uint64_t) (0x));
p_mad = osm_madw_get_mad_ptr(p_report_madw);
ib_mad_init_new(p_mad, IB_MCLASS_SUBN_ADM, 2, IB_MAD_METHOD_REPORT,
-   cl_hton64((uint64_t) cl_atomic_inc(&trap_fwd_trans_id)),
-   IB_MAD_ATTR_NOTICE, 0);
+   tid, IB_MAD_ATTR_NOTICE, 0);
 
p_sa_mad = osm_madw_get_sa_mad_ptr(p_report_madw);
 
diff --git a/opensm/osm_perfmgr.c b/opensm/osm_perfmgr.c
index 9083ea9..788ed04 100644
--- a/opensm/osm_perfmgr.c
+++ b/opensm/osm_perfmgr.c
@@ -387,7 +387,12 @@ static ib_api_status_t perfmgr_send_pc_mad(osm_perfmgr_t * 
perfmgr,
pm_mad->header.status = 0;
pm_mad->header.class_spec = 0;
pm_mad->header.trans_id =
-   cl_hton64((uint64_t) cl_atomic_inc(&perfmgr->trans_id));
+   cl_hton64((uint64_t) cl_atomic_inc(&perfmgr->trans_id) &
+ (uint64_t) (0x));
+   if (perfmgr->trans_id == 0)
+   pm_mad->header.trans_id =
+   cl_hton64((uint64_t) cl_atomic_inc(&perfmgr->trans_id) &
+ (uint64_t) (0x));
pm_mad->header.attr_id = IB_MAD_ATTR_PORT_CNTRS;
pm_mad->header.resv = 0;
pm_mad->header.attr_mod = 0;
diff --git a/opensm/osm_req.c b/opensm/osm_req.c
index 40bd1e4..31d22b1 100644
--- a/opensm/osm_req.c
+++ b/opensm/osm_req.c
@@ -95,6 +95,9 @@ ib_api_status_t osm_req_get(IN osm_sm_t * sm, IN const 
osm_dr_path_t * p_path,
 
tid = cl_hton64((uint64_t) cl_atomic_inc(&sm->sm_trans_id)
 & (uint64_t)(0x));
+   if (tid == 0)
+   tid = cl_hton64((uint64_t) cl_atomic_inc(&sm->sm_trans_id)
+& 
(uint64_t)(0x));
 
OSM_LOG(sm->p_log, OSM_LOG_DEBUG,
"Getting %s (0x%X), modifier 0x%X, TID 0x%" PRIx64 "\n",
@@ -164,6 +167,9 @@ osm_madw_t *osm_prepare_req_set(IN osm_sm_t * sm, IN const 
osm_dr_path_t * p_pat
 
tid = cl_hton64((uint64_t) cl_atomic_inc(&sm->sm_trans_id)
 & (uint64_t)(0x));
+   if (tid == 0)
+   tid = cl_hton64((uint64_t) cl_atomic_inc(&sm->sm_trans_id)
+& 
(uint64_t)(0x));
 
OSM_LOG(sm->p_log, OSM_LOG_DEBUG,
"Setting %s (0x%X), modifier 0x%X, TID 0x%" PRIx64 "\n",
@@ -281,6 +287,10 @@ int osm_send_trap144(osm_sm_t * sm, ib_net16_t local)
smp->method = IB_MAD_METHOD_TRAP;
smp->trans_id = cl_hton64((uint64_t) cl_atomic_inc(&sm->sm_trans_id)
   & 
(uint64_t)(0x));
+   if (smp->trans_id == 0)
+   smp->trans_id = cl_hton64((uint64_t) 
cl_atomic_inc(&sm->sm_trans_id)
+  & 
(uint64_t)(0x));
+
smp->attr_id = IB_MAD_ATTR_NOTICE;
 
ntc = (ib_mad_notice_attr_t *) smp->data;
-- 
1.7.11.2

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


[PATCH 23/27] opensm/osm_vendor_ibumad: Add management class into match criteria

2012-07-31 Thread Alex Netes
From: Hal Rosenstock 

Signed-off-by: Hal Rosenstock 
Signed-off-by: Alex Netes 
---
 include/vendor/osm_vendor_ibumad.h |  1 +
 libvendor/osm_vendor_ibumad.c  | 43 +-
 2 files changed, 29 insertions(+), 15 deletions(-)

diff --git a/include/vendor/osm_vendor_ibumad.h 
b/include/vendor/osm_vendor_ibumad.h
index 0a25583..c33a187 100644
--- a/include/vendor/osm_vendor_ibumad.h
+++ b/include/vendor/osm_vendor_ibumad.h
@@ -140,6 +140,7 @@ typedef struct _umad_match {
ib_net64_t tid;
void *v;
uint32_t version;
+   uint8_t mgmt_class;
 } umad_match_t;
 
 #define DEFAULT_OSM_UMAD_MAX_PENDING   1000
diff --git a/libvendor/osm_vendor_ibumad.c b/libvendor/osm_vendor_ibumad.c
index f2432e0..d9ed13a 100644
--- a/libvendor/osm_vendor_ibumad.c
+++ b/libvendor/osm_vendor_ibumad.c
@@ -157,7 +157,8 @@ Exit:
OSM_LOG_EXIT(p_vend->p_log);
 }
 
-static osm_madw_t *get_madw(osm_vendor_t * p_vend, ib_net64_t * tid)
+static osm_madw_t *get_madw(osm_vendor_t * p_vend, ib_net64_t * tid,
+   uint8_t mgmt_class)
 {
umad_match_t *m, *e;
ib_net64_t mtid = (*tid & CL_HTON64(0xULL));
@@ -167,13 +168,14 @@ static osm_madw_t *get_madw(osm_vendor_t * p_vend, 
ib_net64_t * tid)
 * Since mtid == 0 is the empty key, we should not
 * waste time looking for it
 */
-   if (mtid == 0)
+   if (mtid == 0 || mgmt_class == 0)
return 0;
 
pthread_mutex_lock(&p_vend->match_tbl_mutex);
for (m = p_vend->mtbl.tbl, e = m + p_vend->mtbl.max; m < e; m++) {
-   if (m->tid == mtid) {
+   if (m->tid == mtid && m->mgmt_class == mgmt_class) {
m->tid = 0;
+   m->mgmt_class = 0;
*tid = mtid;
res = m->v;
pthread_mutex_unlock(&p_vend->match_tbl_mutex);
@@ -186,18 +188,21 @@ static osm_madw_t *get_madw(osm_vendor_t * p_vend, 
ib_net64_t * tid)
 }
 
 static void
-put_madw(osm_vendor_t * p_vend, osm_madw_t * p_madw, ib_net64_t tid)
+put_madw(osm_vendor_t * p_vend, osm_madw_t * p_madw, ib_net64_t tid,
+uint8_t mgmt_class)
 {
umad_match_t *m, *e, *old_lru, *lru = 0;
osm_madw_t *p_req_madw;
osm_umad_bind_info_t *p_bind;
ib_net64_t old_tid;
uint32_t oldest = ~0;
+   uint8_t old_mgmt_class;
 
pthread_mutex_lock(&p_vend->match_tbl_mutex);
for (m = p_vend->mtbl.tbl, e = m + p_vend->mtbl.max; m < e; m++) {
-   if (m->tid == 0) {
+   if (m->tid == 0 && m->mgmt_class == 0) {
m->tid = tid;
+   m->mgmt_class = mgmt_class;
m->v = p_madw;
m->version =
cl_atomic_inc((atomic32_t *) & p_vend->mtbl.
@@ -213,6 +218,7 @@ put_madw(osm_vendor_t * p_vend, osm_madw_t * p_madw, 
ib_net64_t tid)
 
old_lru = lru;
old_tid = lru->tid;
+   old_mgmt_class = lru->mgmt_class;
p_req_madw = old_lru->v;
p_bind = p_req_madw->h_bind;
p_req_madw->status = IB_CANCELED;
@@ -221,13 +227,15 @@ put_madw(osm_vendor_t * p_vend, osm_madw_t * p_madw, 
ib_net64_t tid)
(*p_bind->send_err_callback) (p_bind->client_context, p_req_madw);
pthread_mutex_unlock(&p_vend->cb_mutex);
lru->tid = tid;
+   lru->mgmt_class = mgmt_class;
lru->v = p_madw;
lru->version =
cl_atomic_inc((atomic32_t *) & p_vend->mtbl.last_version);
pthread_mutex_unlock(&p_vend->match_tbl_mutex);
OSM_LOG(p_vend->p_log, OSM_LOG_ERROR, "ERR 5402: "
-   "evicting entry %p (tid was 0x%" PRIx64 ")\n", old_lru,
-   cl_ntoh64(old_tid));
+   "evicting entry %p (tid was 0x%" PRIx64
+   " mgmt class 0x%x)\n", old_lru,
+   cl_ntoh64(old_tid), old_mgmt_class);
 }
 
 static void
@@ -356,12 +364,14 @@ static void *umad_receiver(void *p_ptr)
 
/* if status != 0 then we are handling recv timeout on send */
if (umad_status(p_madw->vend_wrap.umad)) {
-   if (!(p_req_madw = get_madw(p_vend, &mad->trans_id))) {
+   if (!(p_req_madw = get_madw(p_vend, &mad->trans_id,
+   mad->mgmt_class))) {
OSM_LOG(p_vend->p_log, OSM_LOG_ERROR,
"ERR 5412: "
"Failed to obtain request madw for 
timed out MAD"
-   " (method=0x%X attr=0x%X 
tid=0x%"PRIx6

[PATCH 24/27] opensm/osm_node_info_rcv.c: Handle non-compliant SMA gracefully

2012-07-31 Thread Alex Netes
From: Hal Rosenstock 

If NodeInfo.LocalPortNum > NodeInfo.NumPorts, then SMA is
not compliant. In this case, ignore the node and don't add
it to any subnet data structures.

Signed-off-by: Hal Rosenstock 
Signed-off-by: Alex Netes 
---
 opensm/osm_node_info_rcv.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/opensm/osm_node_info_rcv.c b/opensm/osm_node_info_rcv.c
index c35aea4..75ab853 100644
--- a/opensm/osm_node_info_rcv.c
+++ b/opensm/osm_node_info_rcv.c
@@ -624,6 +624,17 @@ static void ni_rcv_process_new(IN osm_sm_t * sm, IN const 
osm_madw_t * p_madw)
ib_get_node_type_str(p_ni->node_type),
cl_ntoh64(p_ni->node_guid), cl_ntoh64(p_smp->trans_id));
 
+   if (port_num > p_ni->num_ports) {
+   OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0D0A: "
+   "New %s node GUID 0x%" PRIx64 "is non-compliant and "
+   "is being ignored since the "
+   "local port num %u > num ports %u\n",
+   ib_get_node_type_str(p_ni->node_type),
+   cl_ntoh64(p_ni->node_guid), port_num,
+   p_ni->num_ports);
+   goto Exit;
+   }
+
p_node = osm_node_new(p_madw);
if (p_node == NULL) {
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0D07: "
-- 
1.7.11.2

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


[PATCH 25/27] Increase p_port->discovery_count only when received PortInfo for port 0 of the switch

2012-07-31 Thread Alex Netes
Some broken SMA may respond to all MADs except of PortInfo port 0. As a result 
we want
to drop such switch as it's not healthy.

Signed-off-by: Alex Netes 
---
 opensm/osm_port_info_rcv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/opensm/osm_port_info_rcv.c b/opensm/osm_port_info_rcv.c
index ab7418b..692dc2e 100644
--- a/opensm/osm_port_info_rcv.c
+++ b/opensm/osm_port_info_rcv.c
@@ -568,7 +568,6 @@ void osm_pi_rcv_process(IN void *context, IN void *data)
if (p_context->set_method)
pi_rcv_process_set(sm, p_node, port_num, p_madw);
else {
-   p_port->discovery_count++;
 
/*
   This PortInfo arrived because we did a Get() method,
@@ -600,10 +599,13 @@ void osm_pi_rcv_process(IN void *context, IN void *data)
switch (osm_node_get_type(p_node)) {
case IB_NODE_TYPE_CA:
case IB_NODE_TYPE_ROUTER:
+   p_port->discovery_count++;
pi_rcv_process_ca_or_router_port(sm, p_node, p_physp,
 p_pi);
break;
case IB_NODE_TYPE_SWITCH:
+   if (port_num == 0)
+   p_port->discovery_count++;
pi_rcv_process_switch_port(sm, p_node, p_physp, p_pi);
break;
default:
-- 
1.7.11.2

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


[PATCH 26/27] opensm: Fix crash found with ucast cache

2012-07-31 Thread Alex Netes
From: Yevgeny Kliteynik 

OpenSM crashes in case of ucast_cache usage, but the bug itself is in discovery 
logic.

Consider the following scenario:
 - SM is running
 - SM gets some trap (let's say link state change)
 - SM starts heavy sweep
 - switch X discovered: setting p_sw->need_update to 2
 - while still in heavy sweep, more traps received
 - heavy sweep done (note: just the heavy sweep, w/o other stages, such as 
ucast manager)
 - there were traps, hence new heavy sweep started immediately
 - p_sw->need_update field of all switches is reset to default value of 1, 
which is also done for switch X
 - heavy sweep completed
 - proceeding to next stages ...

As a result, we get newly discovered switch X w/o configuration of LFT or other 
fields, but also w/o indication that this is a new switch, because 
p_sw->need_update field was reset.

Signed-off-by: Yevgeny Kliteynik 
Signed-off-by: Hal Rosenstock 
Signed-off-by: Vladimir Koushnir 
Signed-off-by: Alex Netes 
---
 opensm/osm_state_mgr.c | 3 ++-
 opensm/osm_ucast_mgr.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/opensm/osm_state_mgr.c b/opensm/osm_state_mgr.c
index 00e9c72..183be36 100644
--- a/opensm/osm_state_mgr.c
+++ b/opensm/osm_state_mgr.c
@@ -111,7 +111,8 @@ static void state_mgr_reset_switch_count(IN cl_map_item_t * 
p_map_item,
 {
osm_switch_t *p_sw = (osm_switch_t *) p_map_item;
 
-   p_sw->need_update = 1;
+   if (p_sw->max_lid_ho != 0)
+   p_sw->need_update = 1;
 }
 
 static void state_mgr_get_sw_info(IN cl_map_item_t * p_object, IN void 
*context)
diff --git a/opensm/osm_ucast_mgr.c b/opensm/osm_ucast_mgr.c
index f33cc4c..b4cf0f2 100644
--- a/opensm/osm_ucast_mgr.c
+++ b/opensm/osm_ucast_mgr.c
@@ -907,7 +907,7 @@ static void ucast_mgr_set_fwd_top(IN cl_map_item_t * 
p_map_item,
 
OSM_LOG_ENTER(p_mgr->p_log);
 
-   CL_ASSERT(p_sw);
+   CL_ASSERT(p_sw && p_sw->max_lid_ho);
 
p_node = p_sw->p_node;
 
-- 
1.7.11.2

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


[PATCH 27/27] Call drop manager before checking for other Master SM in the fabric

2012-07-31 Thread Alex Netes
We need to clean the database from dropped nodes/ports even in the cases
where we find other Master SM and might leave the do_sweep function.

Signed-off-by: Vladimir Koushnir 
Signed-off-by: Alex Netes 
Signed-off-by: Hal Rosenstock 
---
 opensm/osm_state_mgr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/opensm/osm_state_mgr.c b/opensm/osm_state_mgr.c
index 183be36..191d87f 100644
--- a/opensm/osm_state_mgr.c
+++ b/opensm/osm_state_mgr.c
@@ -1272,6 +1272,8 @@ repeat_discovery:
 
OSM_LOG_MSG_BOX(sm->p_log, OSM_LOG_VERBOSE, "HEAVY SWEEP COMPLETE");
 
+   osm_drop_mgr_process(sm);
+
/* If we are MASTER - get the highest remote_sm, and
 * see if it is higher than our local sm.
 */
@@ -1304,9 +1306,6 @@ repeat_discovery:
}
}
 
-   /* Need to continue with lid assignment */
-   osm_drop_mgr_process(sm);
-
/*
 * If we are not MASTER already - this means that we are
 * in discovery state. call osm_sm_state_mgr with signal
-- 
1.7.11.2

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


Re: [PATCH][TRIVIAL] osmtest/osmtest.c: Fix permissions

2012-08-01 Thread Alex Netes
Hi Hal,

On 14:41 Wed 01 Aug , Hal Rosenstock wrote:
> 
> Remove execute permission
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH 1/2] opensm/osm_base.h: Add some SA ClassPortInfo CapabilityMask2 bits

2012-08-01 Thread Alex Netes
Hi Hal,

On 09:57 Wed 01 Aug , Hal Rosenstock wrote:
> 
> Per MgtWG RefID #4735: IsMulticastServiceRecordsSupported
> Per MgtWG RefID #4858: IsPortInfoCapMask2MatchSupported
> 
> Signed-off-by: Hal Rosenstock 
> ---

Applied the series, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH][TRIVIAL] opensm/osm_congestion_control.c: Fix initialization hex string

2012-08-01 Thread Alex Netes
Hi Albert,

On 10:18 Tue 31 Jul , Albert Chu wrote:
> Use something more professional.
> 
> Signed-off-by: Albert Chu 
> ---

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


Re: [PATCH][MINOR] opensm: Support (null) being specified for per_module_logging_file option

2012-08-01 Thread Alex Netes
Hi Hal,

On 05:13 Tue 31 Jul , Hal Rosenstock wrote:
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH][TRIVIAL] opensm/osm_perfmgr.c: Eliminate compile warning

2012-08-01 Thread Alex Netes
Hi Hal,

On 02:44 Tue 31 Jul , Hal Rosenstock wrote:
> 
> osm_perfmgr_db.c: In function perfmgr_db_delete_inactive:
> osm_perfmgr_db.c:218: warning: guid_list may be used uninitialized in this 
> function
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH][MINOR] opensm: Remove unused per_module_logging option

2012-08-01 Thread Alex Netes
Hi Hal,

On 02:44 Tue 31 Jul , Hal Rosenstock wrote:
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH][TRIVIAL] opensm/osm_perfmgr.c: Use non conflicting error codes in log messages

2012-08-01 Thread Alex Netes
Hi Hal,

On 09:25 Mon 30 Jul , Hal Rosenstock wrote:
> 
> 4Cxx was already used by osm_sa.c so move perfmgr to 54xx error codes
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH] opensm/osm_sa_path_record.c: Restore osm_get_path_params functionality

2012-08-01 Thread Alex Netes
Hi Hal,

On 07:34 Mon 30 Jul , Hal Rosenstock wrote:
> 
> based on alias GUID support which caused change to internal
> pr_rcv_get_path_parms API
> 
> Signed-off-by: Hal Rosenstock 
> ---

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


Re: [PATCH 0/8] opensm: Improved mkey support

2012-08-01 Thread Alex Netes
hi Jim

On 07:48 Wed 01 Aug , Jim Foraker wrote:
> v2 is about to be posted.  It is now a 9-patch set.  Changes from v1:
> 
> . Subnet initialization behavior changed to log errors on SubnGet
> timeouts, but not flag the init as failed, so that we don't heavy sweep
> more than necessary
> . sldd.sh modified to sync multiple files, and neighbors/guid2mkey
> caches added to its default list
> . Rebased against current HEAD
> . Several whitespace/code format/git log cleanup fixes
> 
>  There will be a man page patch coming shortly, but I want to get
> these out the door for review now.
> 
>  Jim
> 

Applied the series, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] opensm/man/opensm.8.in: Add section for MKey support

2012-08-02 Thread Alex Netes
Hi Jim,

On 14:39 Wed 01 Aug , Jim Foraker wrote:
> Signed-off-by: Jim Foraker 
> ---

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


Re: [PATCH] opensm/perfmgr: update new error codes to '54' prefix

2012-08-02 Thread Alex Netes
Hi Ira,

On 15:36 Wed 01 Aug , Ira Weiny wrote:
> 
> 
> Signed-off-by: Ira Weiny 
> ---

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


[ANNOUNCE] libibumad tarball release

2012-08-02 Thread Alex Netes
Hi,

There is a new release of libibumad.
Tarball available in:

http://www.openfabrics.org/downloads/management/

(listed in http://www.openfabrics.org/downloads/management/latest.txt)

md5sum: dadad9caebc974d8c0cdd9131b117c16

All component versions are from recent master branch. Full list of
changes is below.

Ira Weiny (2):
  libibumad: Remove OpenSM reference from COPYING file
  libibumad: update umad_recv man page.

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


[ANNOUNCE] OpenSM tarball release

2012-08-02 Thread Alex Netes
Hi,

There is a new release of OpenSM.
Tarball available in:

http://www.openfabrics.org/downloads/management/

(listed in http://www.openfabrics.org/downloads/management/latest.txt)

md5sum: ad4c179c119bbb78be740e33b59746ad opensm-3.3.15.tar.gz

All component versions are from recent master branch. Full list of
changes is below.

Albert Chu (2):
  opensm: Add initial congestion control configuration support
  opensm/osm_congestion_control.c: Fix initialization hex string

Alex Netes (18):
  opensm: fix locking in osm_guid_mgr_process
  opensm: fix part_enforce parameter parsing crash
  opensm: Move per_mod_log_tbl array from subn to log structure
  Add support to reread configuration file when stacked in rediscovery loop.
  Fixed Multicast precreation parsing
  Fix deadlock between sminfo_set_req() and osm_sm_state_mgr()
  Fix SL2VL configuration
  Fix base port0 sl2vl mapping optimization
  Fix pre-creation of MC group with MGID containing P_Key
  Fix crash in ucast cache when ucast cache invalidates after updating one 
of the switches
  Fix crash in ucast cache when chain of switches connected back at once to 
the fabric
  Fix transaction id casting
  Skip TID 0 on 32 bit wraparound for SMP, SA and PerfMgt queries
  Increase p_port->discovery_count only when received PortInfo for port 0 
of the switch
  Call drop manager before checking for other Master SM in the fabric
  opensm: update shared library versions
  opensm_release_notes-3.3: update
  opensm: packages versions update

Bart Van Assche (1):
  opensm: Fix pthread_create() return value checks

Daniel Klein (1):
  opensm/osmtest: fix osmtest ignores timeout parameter

Hal Rosenstock (52):
  opensm/osm_ucast_ftree.c: Add a couple of asserts
  opensm/include/opensm/osm_log.h: Fix commentary cut 'n paste error
  opensm/complib/cl_fleximap.h: Cosmetic changes
  opensm/osm_ucast_dfsssp.c: Use osm_log_is_active
  opensm/opensm_release_notes-3.3.txt: Update Unsupported IB Compliance 
Statements
  opensm/osm_subnet.c: Fixed ftree/updn configuration failure when 
root_guid_file points to non-existing file
  opensm: Add partition manager configuration doc to docs
  opensm: Cosmetic changes
  opensm: Add per module logging support
  opensm: Add enum for FILE_ID for per module logging
  opensm/osm_vendor_ibumad.c: Make binding log message clearer
  opensm/osm_port.h: Fix commentary typo
  opensm: Dump info functions update for per module logging
  opensm/osm_state_mgr.c: Force subn->need_update when coming out of STANDBY
  opensm: Eliminate unneeded field in DR path structure
  opensm/osm_node_info_rec.c: Also handle non compliant SMA in 
ni_rcv_process_existing
  opensm/osm_subnet.c: Support MLNX ExtendedPortInfo for ConnectIB device
  opensm/main.c: Handle daemon mode with guid specified as 0 more gracefully
  opensm/libopensm.map: Removed unimplemented routine
  opensm/osm_subnet.c: Indicate lmc and lmc_esp0 are not changeable "on the 
fly"
  opensm/osm_node_info_rcv.c: In ni_rcv_process_existing_ca_or_router, 
handle error
  opensm/osm_sa_mad_ctrl.c: Eliminate commented out code line
  opensm/osm_trap_rcv.c: Add better logging for traps 257 and 258
  opensm/osm_inform.c: Make log message format consistent for error messages
  opensm/osm_sa_inform_info.c: Fix some error log messages
  opensm/osm_trap_rcv.c: Remove vestigial comment
  opensm/osm_sa_path_record.c: Add missing end-of-line in the log message
  opensm/osm_madw.h: Fix a couple of cut 'n paste commentary errors
  opensm/ib_types.h: Add CapabilityMask2 to notice for trap 144
  opensm/osm_helper.c: Add CapabilityMask2 to notice dump for trap 144
  opensm/cl_atomic_osd.h: Cosmetic formatting change
  opensm/torus-2QoS: Fix some typos in documentation
  opensm/osm_link_mgr.c: Set PortInfo:PortState to LinkDown when remote 
port isn't accessible
  opensm/osm_subnet.c: Cosmetic formatting change
  opensm/osm_sa_mcmember_record.c: Dump MCMemberRecord in mcmr_query_mgrp
  opensm/osm_sa_mcmember_record.c: In mcmr_rcv_join_mgrp, add MGID to log 
message
  opensm/osm_sa_path_record.c: Add debug logging to pr_match_mgrp_attributes
  opensm/osm_sa_path_record.c: Log requester port GUID at DEBUG level
  opensm/osm_sa_mcmember_record.c: Log requester port GUID at DEBUG level
  opensm/osm_sa*.c: Log requester port GUID at DEBUG level
  opensm/osm_vendor_ibumad: Add management class into match criteria
  opensm/osm_node_info_rcv.c: Handle non-compliant SMA gracefully
  opensm: Remove unused per_module_logging option
  opensm/osm_perfmgr.c: Eliminate compile warning
  opensm: Support (null) being specified for per_module_logging_file option
  opensm/osm_sa_path_record.c: Restore osm_get_path_params functionality

Re: [ANNOUNCE] libibumad tarball release

2012-08-02 Thread Alex Netes
[Forgot to mention the build number in the previous email]

Hi,
 
There is a new release of libibumad.
Tarball available in:
 
http://www.openfabrics.org/downloads/management/
 
(listed in http://www.openfabrics.org/downloads/management/latest.txt)
 
md5sum: dadad9caebc974d8c0cdd9131b117c16 libibumad-1.3.8.tar.gz
 
All component versions are from recent master branch. Full list of
changes is below.
 
Ira Weiny (2):
  libibumad: Remove OpenSM reference from COPYING file
  libibumad: update umad_recv man page.

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


Re: FDR HCA only doing QDR?

2012-08-02 Thread Alex Netes
Hi Albert,

On 10:18 Thu 02 Aug , Albert Strasheim wrote:
> Hello all
> 
> I have a single machine setup with a dual port Mellanox FDR controller
> with a cable marked "FDR" connected between the two ports.
> 
> OpenSM is running on the machine to make the ports active.
> 
> However, as far as I can read the ibv_devinfo output, it seems to
> report that I'm only getting QDR speeds.
> 

You can double check the speeds by running smpquery PortInfo/MlnxExtPortInfo

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


[PATCH] opensm: fix crash in DFSSSP routing engine on reroute

2012-08-11 Thread Alex Netes
Routing engine should delete the context only when calling delete
function.

Found-and-fixed-by: Jens Domke 
Signed-off-by: Alex Netes 
---
 opensm/osm_ucast_dfsssp.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/opensm/osm_ucast_dfsssp.c b/opensm/osm_ucast_dfsssp.c
index d6d65b1..ffc317f 100644
--- a/opensm/osm_ucast_dfsssp.c
+++ b/opensm/osm_ucast_dfsssp.c
@@ -2135,12 +2135,11 @@ static void dfsssp_context_destroy(void *context)
}
free(adj_list);
dfsssp_ctx->adj_list = NULL;
+   dfsssp_ctx->adj_list_size = 0;
 
/* free srcdest2vl table (can be done because, dfsssp_context_destroy 
is called after osm_get_dfsssp_sl) */
vltable_dealloc(&(dfsssp_ctx->srcdest2vl_table));
dfsssp_ctx->srcdest2vl_table = NULL;
-
-   free(context);
 }
 
 static void delete(void *context)
@@ -2148,6 +2147,8 @@ static void delete(void *context)
if (!context)
return;
dfsssp_context_destroy(context);
+
+   free(context);
 }
 
 int osm_ucast_dfsssp_setup(struct osm_routing_engine *r, osm_opensm_t * p_osm)
-- 
1.7.1

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


  1   2   3   4   5   >