[openib-general] [patch] misc trivia nitpicks 01

Bernhard Fischer blist at aon.at
Thu May 5 10:09:56 PDT 2005


Hi,

please consider attached.

diffstat ./gen2.2257.cow-20050505-1902.diff
 linux-kernel/infiniband/ulp/sdp/sdp_actv.c |   27 +--
 userspace/libmthca/src/mthca.c |    4
 userspace/management/osm/include/opensm/osm_subnet.h |   79 +++++-----
 userspace/management/osm/include/vendor/osm_vendor_mtl_transaction_mgr.h |   43 ++---
 userspace/management/osm/opensm/osm_sa_service_record.c |    8 -
 userspace/management/osm/opensm/osm_sm_state_mgr.c |   38 ++--
 userspace/management/osm/opensm/osm_sw_info_rcv.c |    9 -
 userspace/management/osm/opensm/osm_trap_rcv.c |   62 +++----
 8 files changed, 134 insertions(+), 136 deletions(-)

Thank you,
-------------- next part --------------
- s/reciev/receiv/g; trim superfluous whitespace while touching those.
- src/linux-kernel/infiniband/ulp/sdp/sdp_actv.c (sdp_cm_actv_error): trim return off void().
- src/userspace/libmthca/src/mthca.c (openib_driver_init): vendor is unsigned.
-------------- next part --------------
diff -X excl -rduNp gen2.2257.oorig/trunk/src/linux-kernel/infiniband/ulp/sdp/sdp_actv.c gen2.2257/trunk/src/linux-kernel/infiniband/ulp/sdp/sdp_actv.c
--- gen2.2257.oorig/trunk/src/linux-kernel/infiniband/ulp/sdp/sdp_actv.c	2005-04-26 20:58:46.000000000 +0200
+++ gen2.2257/trunk/src/linux-kernel/infiniband/ulp/sdp/sdp_actv.c	2005-05-05 17:20:25.968369544 +0200
@@ -43,7 +43,7 @@ void sdp_cm_actv_error(struct sdp_opt *c
 	/*
 	 * error value is positive error.
 	 *
-	 * Handle errors within active connections stream. 
+	 * Handle errors within active connections stream.
 	 * First generate appropriate response, REJ, DREQ or nothing.
 	 * Second the socket must be notified of the error.
 	 */
@@ -59,14 +59,14 @@ void sdp_cm_actv_error(struct sdp_opt *c
 		break;
 	case SDP_CONN_ST_ERROR_STRM: /* socket has been destroyed. */
 		error = ECONNRESET;
-        case SDP_CONN_ST_REQ_SENT: 
+        case SDP_CONN_ST_REQ_SENT:
 	case SDP_CONN_ST_REP_RECV:
 	case SDP_CONN_ST_RTU_SENT:
 		/*
 		 * All four states we have gotten a REP and are now in
 		 * one of these states.
 		 */
-		result = ib_send_cm_rej(conn->cm_id, 
+		result = ib_send_cm_rej(conn->cm_id,
 					IB_CM_REJ_CONSUMER_DEFINED,
 					NULL, 0, NULL, 0);
 
@@ -78,14 +78,14 @@ void sdp_cm_actv_error(struct sdp_opt *c
 		break;
 	case SDP_CONN_ST_ESTABLISHED:
 		/*
-		 * Made it all the way to esablished, need to initiate a
+		 * Made it all the way to established, need to initiate a
 		 * full disconnect.
 		 */
 		result = ib_send_cm_dreq(conn->cm_id, NULL, 0);
 		if (result < 0)
-			sdp_dbg_warn(NULL, "Error <%d> sending CM DREQ", 
+			sdp_dbg_warn(NULL, "Error <%d> sending CM DREQ",
 				     result);
-		
+
 		conn->state = SDP_CONN_ST_TIME_WAIT_1;
 		break;
 	}
@@ -100,7 +100,6 @@ void sdp_cm_actv_error(struct sdp_opt *c
 
 	sdp_iocb_q_cancel_all(conn, (0 - error));
 	sdp_inet_wake_error(conn->sk);
-	return;
 }
 
 /*
@@ -113,8 +112,8 @@ static int sdp_cm_actv_establish(struct 
 	struct sock *sk;
 	int result;
 
-	sdp_dbg_ctrl(conn, "active etablish. src <%08x:%04x> dst <%08x:%04x>",
-		     conn->src_addr, conn->src_port, 
+	sdp_dbg_ctrl(conn, "active establish. src <%08x:%04x> dst <%08x:%04x>",
+		     conn->src_addr, conn->src_port,
 		     conn->dst_addr, conn->dst_port);
 
 	sk = conn->sk;
@@ -134,7 +133,7 @@ static int sdp_cm_actv_establish(struct 
 	}
 
 	qp_attr->rq_psn        = conn->rq_psn;
-	
+
 	attr_mask |= IB_QP_RQ_PSN;
 
 	result = ib_modify_qp(conn->qp, qp_attr, attr_mask);
@@ -190,7 +189,7 @@ static int sdp_cm_actv_establish(struct 
 	 * release disconnects.
 	 */
 	conn->flags &= ~SDP_CONN_F_DIS_HOLD;
-		
+
 	inet_sk(sk)->saddr     = htonl(conn->src_addr);
 	inet_sk(sk)->rcv_saddr = htonl(conn->src_addr);
 
@@ -204,7 +203,7 @@ static int sdp_cm_actv_establish(struct 
 	 */
 	sdp_inet_wake_send(sk);
 	sdp_inet_wake_recv(sk, 0);
-	
+
 	result = 0;
 done:
 	kfree(qp_attr);
@@ -273,7 +272,7 @@ int sdp_cm_rep_handler(struct ib_cm_id *
 {
 	struct sdp_msg_hello_ack *hello_ack;
 	int result = -EPROTO;
-	
+
 	if (cm_id != conn->cm_id) {
 		sdp_dbg_warn(conn, "REP comm ID mismatch. <%08x:%08x>",
 			     conn->cm_id->local_id, cm_id->local_id);
@@ -310,7 +309,7 @@ int sdp_cm_rep_handler(struct ib_cm_id *
 	conn->d_qpn  = event->param.rep_rcvd.remote_qpn;
 	/*
 	 * The maximum amount of data that can be sent to the remote
-	 * peer is the smaller of the local and remote buffer sizes, 
+	 * peer is the smaller of the local and remote buffer sizes,
 	 * minus the size of the message header.
 	 */
 	conn->send_size = min((u16)sdp_buff_pool_buff_size(),
diff -X excl -rduNp gen2.2257.oorig/trunk/src/userspace/libmthca/src/mthca.c gen2.2257/trunk/src/userspace/libmthca/src/mthca.c
--- gen2.2257.oorig/trunk/src/userspace/libmthca/src/mthca.c	2005-04-26 20:58:01.000000000 +0200
+++ gen2.2257/trunk/src/userspace/libmthca/src/mthca.c	2005-05-05 14:00:11.916783000 +0200
@@ -220,13 +220,13 @@ struct ibv_device *openib_driver_init(st
 	attr = sysfs_get_device_attr(pcidev, "vendor");
 	if (!attr)
 		return NULL;
-	sscanf(attr->value, "%i", &vendor);
+	sscanf(attr->value, "%u", &vendor);
 	sysfs_close_attribute(attr);
 
 	attr = sysfs_get_device_attr(pcidev, "device");
 	if (!attr)
 		return NULL;
-	sscanf(attr->value, "%i", &device);
+	sscanf(attr->value, "%u", &device);
 	sysfs_close_attribute(attr);
 
 	for (i = 0; i < sizeof hca_table / sizeof hca_table[0]; ++i)
diff -X excl -rduNp gen2.2257.oorig/trunk/src/userspace/management/osm/include/opensm/osm_subnet.h gen2.2257/trunk/src/userspace/management/osm/include/opensm/osm_subnet.h
--- gen2.2257.oorig/trunk/src/userspace/management/osm/include/opensm/osm_subnet.h	2005-04-26 20:58:23.000000000 +0200
+++ gen2.2257/trunk/src/userspace/management/osm/include/opensm/osm_subnet.h	2005-05-05 18:59:01.310100912 +0200
@@ -37,12 +37,12 @@
 
 /*
  * Abstract:
- * 	Declaration of osm_subn_t.
+ *	Declaration of osm_subn_t.
  *	This object represents an IBA subnet.
  *	This object is part of the OpenSM family of objects.
  *
  * Environment:
- * 	Linux User Mode
+ *	Linux User Mode
  *
  * $Revision: 1.12 $
  */
@@ -112,7 +112,7 @@ typedef void
 *	context
 *		[in] Client specific context specified in the subnet opt
 *          Same prefix as the UI funciton (suffixed by ctx)
-*		     
+*
 * RETURN VALUE
 *	This function does not return a value.
 *
@@ -259,13 +259,14 @@ typedef struct _osm_subn_opt
 *     Limit the maximal operational VLs. default is 1.
 *
 *	reassign_lids
-*		If TRUE cause all lids to be re-assigend. Otherwise (teh default) 
+*		If TRUE cause all lids to be re-assigend.
+*		Otherwise (the default)
 *     OpenSM always try to preserve as much LIDs as posible.
 *
 *  reassign_lfts
 *     If TRUE ignore existing LFT entries on first sweep (default).
 *     Otherwise only non minimal hop cases are modified.
-*     NOTE: A standby SM clears its first sweep flag - since the 
+*     NOTE: A standby SM clears its first sweep flag - since the
 *     master SM already sweeps...
 *
 *	ignore_other_sm_option
@@ -273,10 +274,10 @@ typedef struct _osm_subn_opt
 *
 *	no_multicast_option
 *		This flag is TRUE if OpenSM should disable multicast support.
-*		
+*
 *  subnet_timeout
 *     The subnet_timeout that will be set for all the ports in the
-*     design SubnMgt.Set(PortInfo.vl_stall_life)) 
+*     design SubnMgt.Set(PortInfo.vl_stall_life))
 *
 *  head_of_queue_lifetime
 *     The max imal time a packet can live at the head of a VL queue
@@ -284,7 +285,7 @@ typedef struct _osm_subn_opt
 *	local_phy_errors_threshold
 *     Threshold of local phy errors for sending Trap 129
 *
-*	overrun_errors_threshold   
+*	overrun_errors_threshold
 *     Threshold of credits overr-run errors for sending Trap 129
 *
 *  packet_life_time
@@ -302,9 +303,9 @@ typedef struct _osm_subn_opt
 *     the link. If FALSE - only CA/RT nodes are counted.
 *
 *  max_port_profile
-*     Prevent routing through a port subscribed with more then this 
+*     Prevent routing through a port subscribed with more then this
 *     number of routes.
-*     
+*
 *  pfn_ui_pre_lid_assign
 *     A UI function to be invoked prior to lid assigment.
 *
@@ -312,16 +313,16 @@ typedef struct _osm_subn_opt
 *     A UI context (void *) to be provided to the pfn_ui_pre_lid_assign
 *
 *  pfn_ui_ucast_fdb_assign
-*     A UI function to be called instead of the ucast manager FDB 
-*     configuration. 
+*     A UI function to be called instead of the ucast manager FDB
+*     configuration.
 *
 *  ui_ucast_fdb_assign_ctx
 *     A UI context (void *) to be provided to the pfn_ui_ucast_fdb_assign
 *
 *  pfn_ui_mcast_fdb_assign
-*     A UI function to be called inside the mcast manager instead of the 
-*     call for the build spanning tree. This will be called on every 
-*     multicast call for create, join and leave, and is responsible for 
+*     A UI function to be called inside the mcast manager instead of the
+*     call for the build spanning tree. This will be called on every
+*     multicast call for create, join and leave, and is responsible for
 *     the mcast FDB configuration.
 *
 *  ui_mcast_fdb_assign_ctx
@@ -427,8 +428,8 @@ typedef struct _osm_subn
 *	master_sm_base_lid
 *		The base LID owned by the subnet's master SM.
 *
-*  	sm_base_lid
-*     		The base LID of the local port where the SM is.
+*	sm_base_lid
+*		The base LID of the local port where the SM is.
 *
 *	sm_port_guid
 *		This SM's own port GUID.
@@ -456,17 +457,17 @@ typedef struct _osm_subn
 *     - Set to FALSE on end of all lft assignments.
 *
 *  subnet_initalization_error
-*     Similar to the force_immediate_heavy_sweep flag. If TRUE - 
+*     Similar to the force_immediate_heavy_sweep flag. If TRUE -
 *     means that we had errors during initialization (due to SubnSet requests
-*     that failed). We want to declare the subnet as un-healthy, and force 
-*     another heavy sweep. 
+*     that failed). We want to declare the subnet as un-healthy, and force
+*     another heavy sweep.
 
 *  force_immediate_heavy_sweep
 *     If TRUE - we want to force a heavy sweep. This can be done either
-*     due to recieving of trap - meaning there is some change on the subnet, 
-*     or we recieved a handover from a remote sm.
+*     due to receiving of trap - meaning there is some change on the subnet,
+*     or we received a handover from a remote sm.
 *     In this case we want to sweep and reconfigure the entire subnet.
-*     This will cause another heavy sweep to occure when the current sweep 
+*     This will cause another heavy sweep to occure when the current sweep
 *     is done.
 *
 *  force_delayed_heavy_sweep
@@ -486,7 +487,7 @@ typedef struct _osm_subn
 *     in sweep_hop_0 - meaning we do not want to continue beyond
 *     the current node.
 *     This is relevant for the case of SM on switch, since in the
-*     switch info we need to signal somehow not to continue 
+*     switch info we need to signal somehow not to continue
 *     the sweeping.
 *
 *  moved_to_master_state
@@ -498,7 +499,7 @@ typedef struct _osm_subn
 *     This flag is used for the PortInfo setting. On the first sweep as master
 *     (meaning after moving from Standby|Discovering state), the SM must send
 *     a PortInfoSet to all ports. After that - we want to minimize the number of
-*     PortInfoSet requests sent, and to send only requests that change the value 
+*     PortInfoSet requests sent, and to send only requests that change the value
 *     from what is updated in the port (or send a first request if this is a new port).
 *     We will set this flag to TRUE when entering the master state, and set it back
 *     to FALSE at the end of the drop manager. This is done since at the end of the
@@ -618,8 +619,8 @@ struct _osm_port;
 *
 * DESCRIPTION
 *	Looks for the requestor gid in the mad address.
-* 
-* Note: This code is not thread safe. Need to grab the lock before 
+*
+* Note: This code is not thread safe. Need to grab the lock before
 * calling it.
 *
 * SYNOPSIS
@@ -654,8 +655,8 @@ osm_get_gid_by_mad_addr(
 *
 * DESCRIPTION
 *	Looks for the requestor physical port in the mad address.
-* 
-* Note: This code is not thread safe. Need to grab the lock before 
+*
+* Note: This code is not thread safe. Need to grab the lock before
 * calling it.
 *
 * SYNOPSIS
@@ -690,8 +691,8 @@ osm_get_physp_by_mad_addr(
 *
 * DESCRIPTION
 *	Looks for the requestor port in the mad address.
-* 
-* Note: This code is not thread safe. Need to grab the lock before 
+*
+* Note: This code is not thread safe. Need to grab the lock before
 * calling it.
 *
 * SYNOPSIS
@@ -726,7 +727,7 @@ osm_get_port_by_mad_addr(
 *
 * DESCRIPTION
 *	The looks for the given switch guid in the subnet table of switches by guid.
-*  NOTE: this code is not thread safe. Need to grab the lock before 
+*  NOTE: this code is not thread safe. Need to grab the lock before
 *  calling it.
 *
 * SYNOPSIS
@@ -738,7 +739,7 @@ osm_get_switch_by_guid(
 /*
 * PARAMETERS
 *	p_subn
-*		[in] Pointer to an osm_subn_t object 
+*		[in] Pointer to an osm_subn_t object
 *
 *	guid
 *		[in] The node guid in host order
@@ -758,7 +759,7 @@ osm_get_switch_by_guid(
 *
 * DESCRIPTION
 *	The looks for the given node giud in the subnet table of nodes by guid.
-*  NOTE: this code is not thread safe. Need to grab the lock before 
+*  NOTE: this code is not thread safe. Need to grab the lock before
 *  calling it.
 *
 * SYNOPSIS
@@ -770,7 +771,7 @@ osm_get_node_by_guid(
 /*
 * PARAMETERS
 *	p_subn
-*		[in] Pointer to an osm_subn_t object 
+*		[in] Pointer to an osm_subn_t object
 *
 *	guid
 *		[in] The node guid in host order
@@ -790,7 +791,7 @@ osm_get_node_by_guid(
 *
 * DESCRIPTION
 *	The looks for the given port guid in the subnet table of ports by guid.
-*  NOTE: this code is not thread safe. Need to grab the lock before 
+*  NOTE: this code is not thread safe. Need to grab the lock before
 *  calling it.
 *
 * SYNOPSIS
@@ -802,7 +803,7 @@ osm_get_port_by_guid(
 /*
 * PARAMETERS
 *	p_subn
-*		[in] Pointer to an osm_subn_t object 
+*		[in] Pointer to an osm_subn_t object
 *
 *	guid
 *		[in] The port guid in host order
@@ -822,8 +823,8 @@ osm_get_port_by_guid(
 *
 * DESCRIPTION
 *	Looks for the requestor physical port in the mad address.
-* 
-* Note: This code is not thread safe. Need to grab the lock before 
+*
+* Note: This code is not thread safe. Need to grab the lock before
 * calling it.
 *
 * SYNOPSIS
diff -X excl -rduNp gen2.2257.oorig/trunk/src/userspace/management/osm/include/vendor/osm_vendor_mtl_transaction_mgr.h gen2.2257/trunk/src/userspace/management/osm/include/vendor/osm_vendor_mtl_transaction_mgr.h
--- gen2.2257.oorig/trunk/src/userspace/management/osm/include/vendor/osm_vendor_mtl_transaction_mgr.h	2005-04-26 20:58:29.000000000 +0200
+++ gen2.2257/trunk/src/userspace/management/osm/include/vendor/osm_vendor_mtl_transaction_mgr.h	2005-05-05 18:55:55.240387808 +0200
@@ -38,11 +38,11 @@
 
 /*
  * Abstract:
- * 	Definition of interface for the MTL Vendor
+ *	Definition of interface for the MTL Vendor
  *	   This object is part of the OpenSM family of objects.
  *
  * Environment:
- * 	Linux User Mode
+ *	Linux User Mode
  *
  * $Revision: 1.4 $
  */
@@ -108,13 +108,14 @@ typedef struct _osm_madw_req
 *     List item for qlist linkage. Must be first element!!
 *
 *  map_item
-*     Map item for qmap linkage. 
+*     Map item for qmap linkage.
 *
-*  p_madw 
+*  p_madw
 *     pointer to mad wrapper that is expecting to get a response.
 *
 *  waking_time
-*     Time stamp (in microseconds) when the p_madw needs to wake up. This value is 
+*     Time stamp (in microseconds) when the p_madw needs to wake up.
+*     This value is
 *      cl_get_time_stamp() + timeout  during the sending of the mad.
 *      when timeout should be given in microseconds.
 *
@@ -128,7 +129,7 @@ typedef struct _osm_madw_req
 *
 * DESCRIPTION
 *  This structure defines the transaction manager.
-*  It holds a qlist and a qmap, a lock on the transaction manager, and 
+*  It holds a qlist and a qmap, a lock on the transaction manager, and
 *  a timer used for the list.
 *  The manager is responsible for keeping track of every request mad that was
 *  sent. It is used for finding mads according to their transaction id, and for
@@ -136,10 +137,10 @@ typedef struct _osm_madw_req
 *  a response and didn't get one by the timeout time expected.
 *
 *  Both the list and the map hold the osm_madw_req_t objects - one for every madw.
-*  
+*
 *  Managing of the list:
 *  The timer wakes on the timeout of the first madw. If the waking_time is greater than
-*  the current time - then the mad recieved a response. If not - the mad didn't get
+*  the current time - then the mad received a response. If not - the mad didn't get
 *  its response.
 *
 * SYNOPSIS
@@ -155,12 +156,12 @@ osm_transaction_mgr_t;
 
 /*
 * FIELDS
-*  madw_by_tid_map_p 
+*  madw_by_tid_map_p
 *     A qmap with key = transaction id. and value of osm_madw_req_t.
 *
-*  madw_reqs_list_p 
+*  madw_reqs_list_p
 *     A qlist of all the madw with their waking time.
-* 
+*
 *  transaction_mgr_lock
 *     Lock used on the transaction manager - make sure changes on it are serial.
 *
@@ -173,13 +174,13 @@ osm_transaction_mgr_t;
 *	osm_transaction_mgr_init
 *
 * DESCRIPTION
-*	Initialize the transaction manager. 
+*	Initialize the transaction manager.
 *  Will update the p_transaction_mgr in the vendor object with
 *  the new Transaction Manager created.*
 *
 * SYNOPSIS
 */
-void 
+void
 osm_transaction_mgr_init( IN osm_vendor_t * const p_vend );
 
 /*
@@ -195,13 +196,13 @@ osm_transaction_mgr_init( IN osm_vendor_
 *	osm_transaction_mgr_destroy
 *
 * DESCRIPTION
-*	Destroy the transaction manager. 
-*  Will de-allocate all memory allocated by the Transaction 
+*	Destroy the transaction manager.
+*  Will de-allocate all memory allocated by the Transaction
 *  Manager up to now.
 *
 * SYNOPSIS
 */
-void 
+void
 osm_transaction_mgr_destroy ( IN osm_vendor_t * const p_vend );
 
 /*
@@ -243,9 +244,9 @@ osm_transaction_mgr_insert_madw( IN osm_
 *	osm_transaction_mgr_erase_madw
 *
 * DESCRIPTION
-*	Erase a madw object from the manager. 
+*	Erase a madw object from the manager.
 *  The removal is done using the transaction id of the mad - using
-*  it the madw_p is allocated (in the qmap) and removed from the 
+*  it the madw_p is allocated (in the qmap) and removed from the
 *  qmap and qlist.
 *
 * SYNOPSIS
@@ -259,7 +260,7 @@ osm_transaction_mgr_erase_madw( IN osm_v
 *		[in] Pointer to a Osm Vendor object.
 *
 *  p_mad
-*      [in] Pointer to the Mad to be removed. 
+*      [in] Pointer to the Mad to be removed.
 *
 *********/
 
@@ -285,7 +286,7 @@ osm_transaction_mgr_get_madw_for_tid( IN
 *      [in] Pointer to the Mad to be located.
 *
 * req_madw_p
-*      [out] Pointer to the mad Wrapper to be found. 
+*      [out] Pointer to the mad Wrapper to be found.
 *
 *********/
 
@@ -298,7 +299,7 @@ osm_transaction_mgr_get_madw_for_tid( IN
 *	This callback is called on timeout of the timer.
 *  It checks the time of the head madw in the qlist, and compares it to
 *  the current time.
-*  Will send an error callback if the time of the madw is less than the 
+*  Will send an error callback if the time of the madw is less than the
 *  current time - this means that the madw wasn't removed in the timeout
 *  it was supposed to be handled.
 *
diff -X excl -rduNp gen2.2257.oorig/trunk/src/userspace/management/osm/opensm/osm_sa_service_record.c gen2.2257/trunk/src/userspace/management/osm/opensm/osm_sa_service_record.c
--- gen2.2257.oorig/trunk/src/userspace/management/osm/opensm/osm_sa_service_record.c	2005-04-26 20:58:16.000000000 +0200
+++ gen2.2257/trunk/src/userspace/management/osm/opensm/osm_sa_service_record.c	2005-05-05 18:50:17.450739640 +0200
@@ -732,7 +732,7 @@ __get_matching_sr(
   }
 
   /* Check that the requestor port has the pkey which is the service_pkey.
-     If not - then it cannot recieve this serviceRecord. */
+     If not - then it cannot receive this serviceRecord. */
   /* The check is relevant only if the service_pkey is valid */
   if (!ib_pkey_is_invalid(p_svcr->service_record.service_pkey))
   {
@@ -743,7 +743,7 @@ __get_matching_sr(
       osm_log( p_sr_item->p_rcv->p_log, OSM_LOG_VERBOSE,
                "__get_matching_sr: "
                "requestor port doesn't have the service_pkey: 0x%X\n",
-               cl_ntoh16(p_svcr->service_record.service_pkey) );      
+               cl_ntoh16(p_svcr->service_record.service_pkey) );
       return;
     }
   }
@@ -1154,8 +1154,8 @@ osm_sr_rcv_lease_cb(
 
     if(elapsed_time < p_svcr->lease_period)
     {
-      /* 
-         Just update the service lease period 
+      /*
+         Just update the service lease period
          note: for simplicity we work with a uint32_t field
          external to the network order lease_period of the MAD
       */
diff -X excl -rduNp gen2.2257.oorig/trunk/src/userspace/management/osm/opensm/osm_sm_state_mgr.c gen2.2257/trunk/src/userspace/management/osm/opensm/osm_sm_state_mgr.c
--- gen2.2257.oorig/trunk/src/userspace/management/osm/opensm/osm_sm_state_mgr.c	2005-04-26 20:58:16.000000000 +0200
+++ gen2.2257/trunk/src/userspace/management/osm/opensm/osm_sm_state_mgr.c	2005-05-05 18:52:54.883806176 +0200
@@ -75,7 +75,7 @@ static void
 __osm_sm_state_mgr_standby_msg(
   IN const osm_sm_state_mgr_t* p_sm_mgr )
 {
-  osm_log( p_sm_mgr->p_log, OSM_LOG_SYS, 
+  osm_log( p_sm_mgr->p_log, OSM_LOG_SYS,
                "Entering STANDBY state");
 
   if( osm_log_is_active( p_sm_mgr->p_log, OSM_LOG_VERBOSE ) )
@@ -221,18 +221,18 @@ __osm_sm_state_mgr_send_master_sm_info_r
   {
     /*
       We are in STANDBY state - this means we need to poll on the master
-      SM (according to master_guid) 
+      SM (according to master_guid)
       Send a query of SubnGet(SMInfo) to the subn master_sm_base_lid object.
     */
     p_port = (osm_port_t*)cl_qmap_get( &p_sm_mgr->p_subn->port_guid_tbl,
                                        p_sm_mgr->master_guid );
   }
-  else 
+  else
   {
-    /* 
+    /*
        We are not in STANDBY - this means we are in MASTER state - so we need
-       to poll on the SM that is saved in p_polling_sm under p_sm_mgr. 
-       Send a query of SubnGet(SMInfo) to that SM. 
+       to poll on the SM that is saved in p_polling_sm under p_sm_mgr.
+       Send a query of SubnGet(SMInfo) to that SM.
     */
     p_port = p_sm_mgr->p_polling_sm->p_port;
   }
@@ -324,13 +324,13 @@ __osm_sm_state_mgr_polling_callback( IN 
     If we are not in one of these cases - don't need to restart the poller.
   */
   if (!( (p_sm_mgr->p_subn->sm_state == IB_SMINFO_STATE_MASTER &&
-          p_sm_mgr->p_polling_sm != NULL ) || 
+          p_sm_mgr->p_polling_sm != NULL ) ||
          (p_sm_mgr->p_subn->sm_state == IB_SMINFO_STATE_STANDBY ) ) )
   {
     goto Exit;
   }
 
-  /* 
+  /*
      If we are a STANDBY sm, and the osm_exit_flag is 1, then let's signal
      the subnet_up. This is relevant for the case of running only once. It that
      case - the program is stuck until this signal is received. In other cases -
@@ -346,7 +346,7 @@ __osm_sm_state_mgr_polling_callback( IN 
     cl_event_signal( p_sm_mgr->p_state_mgr->p_subnet_up_event );
     goto Exit;
   }
-  
+
   /*
     Incr the retry number.
     If it reached the max_retry_number in the subnet opt - call
@@ -577,7 +577,7 @@ osm_sm_state_mgr_process(
       */
       __osm_sm_state_mgr_standby_msg(p_sm_mgr);
       p_sm_mgr->p_subn->sm_state = IB_SMINFO_STATE_STANDBY;
-      /* 
+      /*
          Since another SM is doing the LFT config - we should not
          ignore the results of it
       */
@@ -674,23 +674,23 @@ osm_sm_state_mgr_process(
     {
     case OSM_SM_SIGNAL_POLLING_TIMEOUT:
       /*
-        we recieved a polling timeout - this means that we waited for
+        we received a polling timeout - this means that we waited for
         a remote master sm to send us a handover, but didn't get it, and
         didn't get a response from that remote 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 are 
+        subnet after a heavy sweep.
+        We also want to clear the p_polling_sm object - since we are
         done polling on that remote sm - we are sweeping again.
       */
     case OSM_SM_SIGNAL_HANDOVER:
       /*
-        If we recieved a handover in a master state - then we want to
+        If we received a handover in a master state - then we want to
         force a heavy sweep. This means that either we are in a sweep
-        currently - in this case - no change, or we are in idle state - 
+        currently - in this case - no 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 are 
+        We also want to clear the p_polling_sm object - since we are
         done polling on that remote sm - we got a handover from it.
       */
     osm_log( p_sm_mgr->p_log, OSM_LOG_VERBOSE,
@@ -712,12 +712,12 @@ osm_sm_state_mgr_process(
       __osm_sm_state_mgr_start_polling(p_sm_mgr);
       break;
     case OSM_SM_SIGNAL_WAIT_FOR_HANDOVER:
-      /* 
+      /*
          We found a remote master SM, and we are waiting for it
-         to handover the mastership to us. Need to start polling 
+         to handover the mastership to us. Need to start polling
          on that SM, to make sure it is alive, if it isn't - then
          we should move back to discovering, since something must
-         have happend to it. 
+         have happend to it.
       */
       __osm_sm_state_mgr_start_polling(p_sm_mgr);
       break;
diff -X excl -rduNp gen2.2257.oorig/trunk/src/userspace/management/osm/opensm/osm_sw_info_rcv.c gen2.2257/trunk/src/userspace/management/osm/opensm/osm_sw_info_rcv.c
--- gen2.2257.oorig/trunk/src/userspace/management/osm/opensm/osm_sw_info_rcv.c	2005-04-26 20:58:16.000000000 +0200
+++ gen2.2257/trunk/src/userspace/management/osm/opensm/osm_sw_info_rcv.c	2005-05-05 18:54:21.451645864 +0200
@@ -420,10 +420,10 @@ __osm_si_rcv_process_new(
     osm_switch_delete( &p_sw );
     goto Exit;
   }
-    
+
   /*
-    Update the switch info according to the 
-    info we just recieved.
+    Update the switch info according to the
+    info we just received.
   */
   osm_switch_set_switch_info( p_sw, p_si );
   osm_switch_discovery_count_inc( p_sw );
@@ -557,7 +557,6 @@ __osm_si_rcv_process_existing(
                  "Not discovering again through switch:0x%"
                  PRIx64 ".\n",
                  osm_node_get_node_guid( p_sw->p_node) );
-        
       }
     }
   }
@@ -699,7 +698,7 @@ osm_si_rcv_process(
     if( p_sw == (osm_switch_t*)cl_qmap_end( p_sw_guid_tbl ) )
     {
       __osm_si_rcv_process_new( p_rcv, p_node, p_madw );
-      /* 
+      /*
          A new switch was found during the sweep so we need
          to ignore the current LFT settings.
       */
diff -X excl -rduNp gen2.2257.oorig/trunk/src/userspace/management/osm/opensm/osm_trap_rcv.c gen2.2257/trunk/src/userspace/management/osm/opensm/osm_trap_rcv.c
--- gen2.2257.oorig/trunk/src/userspace/management/osm/opensm/osm_trap_rcv.c	2005-04-26 20:58:16.000000000 +0200
+++ gen2.2257/trunk/src/userspace/management/osm/opensm/osm_trap_rcv.c	2005-05-05 19:01:10.263497016 +0200
@@ -136,7 +136,7 @@ osm_trap_rcv_aging_tracker_callback(
   if (osm_exit_flag)
     /* We got an exit flag - do nothing */
     return 0;
-  
+
   lid = cl_ntoh16(( key & 0x0000FFFF00000000ULL) >> 32);
   port_num = ( key & 0x00FF000000000000ULL) >> 48;
 
@@ -161,7 +161,7 @@ osm_trap_rcv_aging_tracker_callback(
                  "osm_trap_rcv_aging_tracker_callback: "
                  "Clearing health bit of port num:%u with lid:%u\n",
                  port_num, lid );
-         
+
         /* Clear its health bit */
         osm_physp_set_health(p_physp, TRUE);
       }
@@ -169,8 +169,8 @@ osm_trap_rcv_aging_tracker_callback(
   }
 
   OSM_LOG_EXIT (p_rcv->p_log );
-  
-  /* We want to remove the event from the tracker - so 
+
+  /* We want to remove the event from the tracker - so
      need to return zero. */
   return 0;
 }
@@ -264,7 +264,7 @@ __osm_trap_calc_crc32(void *buffer, uint
     }
     first = FALSE;
   }
-  
+
   crc = -1L;
   /* do the calculation */
   while (count-- != 0)
@@ -331,13 +331,13 @@ __osm_trap_rcv_process_request(
 
   if (osm_exit_flag)
   {
-    /* 
-       We got an exit flag - do nothing 
+    /*
+       We got an exit flag - do nothing
        Otherwise we start a sweep on the trap 144 caused by cleaning up
-       SM Cap bit ... 
+       SM Cap bit ...
     */
     goto Exit;
-  } 
+  }
 
   /* update the is_gsi flag according to the mgmt_class field */
   if (p_madw->p_mad->mgmt_class == IB_MCLASS_SUBN_LID ||
@@ -371,13 +371,13 @@ __osm_trap_rcv_process_request(
   cl_memcpy(&tmp_madw, p_madw, sizeof( tmp_madw ));
 
   if (is_gsi == FALSE)
-  { 
+  {
     /* We are in smi flow */
     /*
      * When we received a TRAP with dlid = 0 - it means it
      * came from our own node. So we need to fix it.
      */
-  
+
     if (p_madw->mad_addr.addr_type.smi.source_lid == 0)
     {
       osm_log( p_rcv->p_log, OSM_LOG_DEBUG,
@@ -462,7 +462,7 @@ __osm_trap_rcv_process_request(
                          p_ntci,
                          &trap_key);
     }
-    else 
+    else
       __osm_trap_get_key(source_lid,
                          0,
                          p_ntci,
@@ -471,7 +471,7 @@ __osm_trap_rcv_process_request(
     /* try to find it in the aging tracker */
     num_received = cl_event_wheel_num_regs(&p_rcv->trap_aging_tracker,
                                            trap_key);
-    
+
     /* Now we know how many times it provided this trap */
     if (num_received > 10)
     {
@@ -492,7 +492,7 @@ __osm_trap_rcv_process_request(
           cl_ntoh16(p_ntci->data_details.ntc_129_131.lid),
           port_num
           );
-        
+
         if (! p_physp)
         {
           osm_log( p_rcv->p_log, OSM_LOG_ERROR,
@@ -522,17 +522,16 @@ __osm_trap_rcv_process_request(
             run_heavy_sweep = TRUE;
           }
           /* If we are marking the port as unhealthy - we want to
-             keep this for a longer period of time then the 
-             OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT. Use the 
+             keep this for a longer period of time then the
+             OSM_DEFAULT_TRAP_SUPRESSION_TIMEOUT. Use the
              OSM_DEFAULT_UNHEALTHY_TIMEOUT */
           event_wheel_timeout = OSM_DEFAULT_UNHEALTHY_TIMEOUT;
         }
-        
       }
     }
 
     /* restart the aging anyway */
-    /* If physp_change_trap is TRUE - then use a callback to unset the 
+    /* If physp_change_trap is TRUE - then use a callback to unset the
        healthy bit. If not - no need to use a callback. */
     if (physp_change_trap == TRUE )
       cl_event_wheel_reg(&p_rcv->trap_aging_tracker,
@@ -549,7 +548,6 @@ __osm_trap_rcv_process_request(
                          NULL /*  no conetxt */
                          );
 
-    
     /* If was already registered do nothing more */
     if ( num_received > 10 && run_heavy_sweep == FALSE )
     {
@@ -561,41 +559,41 @@ __osm_trap_rcv_process_request(
     }
   }
 
-  /* do a sweep if we recieved a trap */
+  /* do a sweep if we received a trap */
   if (p_rcv->p_subn->opt.sweep_on_trap)
   {
-    /* if this is trap number 128 or run_heavy_sweep is TRUE - update the 
-       force_single_heavy_sweep flag of the subnet. 
+    /* if this is trap number 128 or run_heavy_sweep is TRUE - update the
+       force_single_heavy_sweep flag of the subnet.
        Sweep also on traps 144/145 - these traps signal a change on a certain
-       port capability/system image guid. 
+       port capability/system image guid.
        TODO: In the future we can change this to just getting PortInfo on
        this port instead of sweeping the entire subnet. */
     if (ib_notice_is_generic(p_ntci) &&
         ( (cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 128) ||
           (cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 144) ||
           (cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 145) ||
-          run_heavy_sweep )) 
+          run_heavy_sweep ))
     {
       osm_log( p_rcv->p_log, OSM_LOG_VERBOSE,
                "__osm_trap_rcv_process_request: "
                "Forcing immediate heavy sweep. "
                "Received trap:%u \n",
                cl_ntoh16(p_ntci->g_or_v.generic.trap_num) );
-      
+
       p_rcv->p_subn->force_immediate_heavy_sweep = TRUE;
     }
     osm_state_mgr_process( p_rcv->p_state_mgr,
                            OSM_SIGNAL_SWEEP );
   }
 
-  /* If we reached here due to trap 129/130/131 - do not need to do 
+  /* If we reached here due to trap 129/130/131 - do not need to do
      the notice report. Just goto exit. We know this is the case
      if physp_change_trap is TRUE. */
   if ( physp_change_trap == TRUE )
     goto Exit;
 
   /* Add a call to osm_report_notice */
-  /* We are going to report the notice - so need to fix the IssuerGID 
+  /* We are going to report the notice - so need to fix the IssuerGID
      accordingly. See IBA 1.1 P.653 or IBA 1.2 P.739 for details. */
   if (is_gsi)
   {
@@ -605,7 +603,7 @@ __osm_trap_rcv_process_request(
                 &(tmp_madw.mad_addr.addr_type.gsi.grh_info.src_gid),
                 sizeof(ib_gid_t));
     }
-    else 
+    else
     {
       osm_log( p_rcv->p_log, OSM_LOG_ERROR,
                "__osm_trap_rcv_process_request: ERR 3806: "
@@ -618,7 +616,7 @@ __osm_trap_rcv_process_request(
   {
     /* Need to use the IssuerLID. */
     p_tbl = &p_rcv->p_subn->port_lid_tbl;
-    
+
     if (cl_ptr_vector_get_size(p_tbl) <= cl_ntoh16(source_lid) )
     {
       /*  the source lid is out of range. */
@@ -626,7 +624,7 @@ __osm_trap_rcv_process_request(
                "__osm_trap_rcv_process_request: "
                "source lid is out of range:0x%X \n",
                cl_ntoh16(source_lid) );
-      
+
       goto Exit;
     }
     p_port = cl_ptr_vector_get( p_tbl, cl_ntoh16(source_lid) );
@@ -637,10 +635,10 @@ __osm_trap_rcv_process_request(
                "__osm_trap_rcv_process_request: "
                "Cannot find port according to lid:0x%X \n",
                cl_ntoh16(source_lid) );
-      
+
       goto Exit;
     }
- 
+
     p_ntci->issuer_gid.unicast.prefix = p_rcv->p_subn->opt.subnet_prefix;
     p_ntci->issuer_gid.unicast.interface_id = p_port->guid;
   }


More information about the general mailing list