[ofa-general] [PATCH] OpenSM: Improve QP0 and QP1 counter accounting

Sasha Khapyorsky sashak at voltaire.com
Mon Sep 17 17:58:20 PDT 2007


Hi Hal,

On 11:04 Tue 11 Sep     , Hal Rosenstock wrote:
> OpenSM: Improve QP0 and QP1 counter accounting
> 
> Note: Patch is based on OFED 1.2

Well, you know :)

The question is below.

> 
> Signed-off-by: Hal Rosenstock <hal at xsigo.com>
> 
> diff --git a/osm/include/opensm/osm_sa.h b/osm/include/opensm/osm_sa.h
> index ea60341..eced96b 100644
> --- a/osm/include/opensm/osm_sa.h
> +++ b/osm/include/opensm/osm_sa.h
> @@ -209,6 +209,7 @@ typedef struct _osm_sa
>  * FIELDS
>  *	state
>  *		State of this SA object
> +*
>  *	p_subn
>  *		Pointer to the Subnet object for this subnet.
>  *
> @@ -448,6 +449,22 @@ osm_sa_bind(
>  * SEE ALSO
>  *********/
>  
> +/****f* OpenSM: SA/osm_sa_vendor_send
> +* NAME
> +*	osm_sa_vendor_send
> +*
> +* DESCRIPTION
> +*	Sends SA MAD via osm_vendor_call and maintains the QP1 sent statistic
> +*
> +* SYNOPSIS
> +*/
> +ib_api_status_t
> +osm_sa_vendor_send(
> +	IN osm_bind_handle_t h_bind,
> +	IN osm_madw_t* const p_madw,
> +	IN boolean_t const resp_expected,
> +	IN osm_subn_t* const p_subn );
> +
>  struct _osm_opensm_t;
>  /****f* OpenSM: SA/osm_sa_db_file_dump
>  * NAME
> diff --git a/osm/include/opensm/osm_sa_guidinfo_record.h b/osm/include/opensm/osm_sa_guidinfo_record.h
> index 5c23cf9..d3cb23d 100644
> --- a/osm/include/opensm/osm_sa_guidinfo_record.h
> +++ b/osm/include/opensm/osm_sa_guidinfo_record.h
> @@ -98,7 +98,7 @@ BEGIN_C_DECLS
>  */
>  typedef struct _osm_gir_rcv
>  {
> -	const osm_subn_t	*p_subn;
> +	osm_subn_t		*p_subn;
>  	osm_sa_resp_t		*p_resp;
>  	osm_mad_pool_t		*p_mad_pool;
>  	osm_log_t		*p_log;
> @@ -209,7 +209,7 @@ osm_gir_rcv_init(
>  	IN osm_gir_rcv_t* const p_rcv,
>  	IN osm_sa_resp_t* const p_resp,
>  	IN osm_mad_pool_t* const p_mad_pool,
> -	IN const osm_subn_t* const p_subn,
> +	IN osm_subn_t* const p_subn,
>  	IN osm_log_t* const p_log,
>  	IN cl_plock_t* const p_lock );
>  /*
> diff --git a/osm/include/opensm/osm_sa_node_record.h b/osm/include/opensm/osm_sa_node_record.h
> index c0e8988..0ee8ae1 100644
> --- a/osm/include/opensm/osm_sa_node_record.h
> +++ b/osm/include/opensm/osm_sa_node_record.h
> @@ -99,7 +99,7 @@ BEGIN_C_DECLS
>  */
>  typedef struct _osm_nr_recv
>  {
> -	const osm_subn_t	*p_subn;
> +	osm_subn_t		*p_subn;
>  	osm_sa_resp_t		*p_resp;
>  	osm_mad_pool_t		*p_mad_pool;
>  	osm_log_t		*p_log;
> @@ -206,7 +206,7 @@ ib_api_status_t osm_nr_rcv_init(
>  	IN osm_nr_rcv_t* const p_rcv,
>  	IN osm_sa_resp_t* const p_resp,
>  	IN osm_mad_pool_t* const p_mad_pool,
> -	IN const osm_subn_t* const p_subn,
> +	IN osm_subn_t* const p_subn,
>  	IN osm_log_t* const p_log,
>  	IN cl_plock_t* const p_lock );
>  /*
> diff --git a/osm/include/opensm/osm_sa_pkey_record.h b/osm/include/opensm/osm_sa_pkey_record.h
> index aceab9a..08b7fee 100644
> --- a/osm/include/opensm/osm_sa_pkey_record.h
> +++ b/osm/include/opensm/osm_sa_pkey_record.h
> @@ -87,7 +87,7 @@ BEGIN_C_DECLS
>  */
>  typedef struct _osm_pkey_rec_rcv
>  {
> -  const osm_subn_t* p_subn;
> +  osm_subn_t* p_subn;
>    osm_sa_resp_t* p_resp;
>    osm_mad_pool_t* p_mad_pool;
>    osm_log_t* p_log;
> @@ -198,7 +198,7 @@ osm_pkey_rec_rcv_init(
>    IN osm_pkey_rec_rcv_t* const p_rcv,
>    IN osm_sa_resp_t* const p_resp,
>    IN osm_mad_pool_t* const p_mad_pool,
> -  IN const osm_subn_t* const p_subn,
> +  IN osm_subn_t* const p_subn,
>    IN osm_log_t* const p_log,
>    IN cl_plock_t* const p_lock );
>  /*
> diff --git a/osm/include/opensm/osm_sa_response.h b/osm/include/opensm/osm_sa_response.h
> index b9e84d1..d883c3b 100644
> --- a/osm/include/opensm/osm_sa_response.h
> +++ b/osm/include/opensm/osm_sa_response.h
> @@ -52,6 +52,7 @@
>  #include <opensm/osm_log.h>
>  #include <opensm/osm_madw.h>
>  #include <opensm/osm_mad_pool.h>
> +#include <opensm/osm_subnet.h>
>  
>  #ifdef __cplusplus
>  #  define BEGIN_C_DECLS extern "C" {
> @@ -97,6 +98,7 @@ BEGIN_C_DECLS
>  typedef struct _osm_sa_resp
>  {
>  	osm_mad_pool_t				*p_pool;
> +	osm_subn_t				*p_subn;
>  	osm_log_t				*p_log;
>  } osm_sa_resp_t;
>  /*
> @@ -186,6 +188,7 @@ ib_api_status_t
>  osm_sa_resp_init(
>  	IN osm_sa_resp_t*		const p_resp,
>  	IN osm_mad_pool_t*		const p_pool,
> +	IN osm_subn_t*			const p_subn,
>  	IN osm_log_t*			const p_log );
>  /*
>  * PARAMETERS
> @@ -195,8 +198,8 @@ osm_sa_resp_init(
>  *	p_mad_pool
>  *		[in] Pointer to the MAD pool.
>  *
> -*	p_vl15
> -*		[in] Pointer to the VL15 interface.
> +*	p_subn
> +*		[in] Pointer to Subnet object for this subnet.
>  *
>  *	p_log
>  *		[in] Pointer to the log object.
> diff --git a/osm/include/opensm/osm_sa_slvl_record.h b/osm/include/opensm/osm_sa_slvl_record.h
> index a5ce9b4..fabd133 100644
> --- a/osm/include/opensm/osm_sa_slvl_record.h
> +++ b/osm/include/opensm/osm_sa_slvl_record.h
> @@ -100,7 +100,7 @@ BEGIN_C_DECLS
>  */
>  typedef struct _osm_slvl_rec_rcv
>  {
> -	const osm_subn_t	*p_subn;
> +	osm_subn_t		*p_subn;
>  	osm_sa_resp_t		*p_resp;
>  	osm_mad_pool_t		*p_mad_pool;
>  	osm_log_t		*p_log;
> @@ -211,7 +211,7 @@ osm_slvl_rec_rcv_init(
>  	IN osm_slvl_rec_rcv_t* const p_rcv,
>  	IN osm_sa_resp_t* const p_resp,
>  	IN osm_mad_pool_t* const p_mad_pool,
> -	IN const osm_subn_t* const p_subn,
> +	IN osm_subn_t* const p_subn,
>  	IN osm_log_t* const p_log,
>  	IN cl_plock_t* const p_lock );
>  /*
> diff --git a/osm/include/opensm/osm_sa_vlarb_record.h b/osm/include/opensm/osm_sa_vlarb_record.h
> index 4aad76f..9796483 100644
> --- a/osm/include/opensm/osm_sa_vlarb_record.h
> +++ b/osm/include/opensm/osm_sa_vlarb_record.h
> @@ -100,7 +100,7 @@ BEGIN_C_DECLS
>  */
>  typedef struct _osm_vlarb_rec_rcv
>  {
> -	const osm_subn_t	*p_subn;
> +	osm_subn_t		*p_subn;
>  	osm_sa_resp_t		*p_resp;
>  	osm_mad_pool_t		*p_mad_pool;
>  	osm_log_t		*p_log;
> @@ -211,7 +211,7 @@ osm_vlarb_rec_rcv_init(
>  	IN osm_vlarb_rec_rcv_t* const p_rcv,
>  	IN osm_sa_resp_t* const p_resp,
>  	IN osm_mad_pool_t* const p_mad_pool,
> -	IN const osm_subn_t* const p_subn,
> +	IN osm_subn_t* const p_subn,
>  	IN osm_log_t* const p_log,
>  	IN cl_plock_t* const p_lock );
>  /*
> diff --git a/osm/include/opensm/osm_stats.h b/osm/include/opensm/osm_stats.h
> index 5cffc00..15bc8e0 100644
> --- a/osm/include/opensm/osm_stats.h
> +++ b/osm/include/opensm/osm_stats.h
> @@ -90,9 +90,12 @@ typedef struct _osm_stats
>  	atomic32_t					qp0_mads_rcvd;
>  	atomic32_t					qp0_mads_sent;
>  	atomic32_t					qp0_unicasts_sent;
> +	atomic32_t					qp0_mads_rcvd_unknown;
>  	atomic32_t					qp1_mads_outstanding;
>  	atomic32_t					qp1_mads_rcvd;
>  	atomic32_t					qp1_mads_sent;
> +	atomic32_t					qp1_mads_rcvd_unknown;
> +	atomic32_t					qp1_mads_ignored;
>  
>  } osm_stats_t;
>  /*
> @@ -117,6 +120,27 @@ typedef struct _osm_stats
>  *		Total number of response-less MADs sent on the wire.  This count
>  *		includes getresp(), send() and trap() methods.
>  *
> +*	qp0_mads_rcvd_unknown
> +*		Total number of unknown QP0 MADs received. This includes
> +*		unrecognized attribute IDs and methods.
> +*
> +*	qp1_mads_outstanding
> +*		Contains the number of MADs outstanding on QP1.
> +*
> +*	qp1_mads_rcvd
> +*		Total number of QP1 MADs received.
> +*
> +*	qp1_mads_sent
> +*		Total number of QP1 MADs sent.
> +*
> +*	qp1_mads_rcvd_unknown
> +*		Total number of unknown QP1 MADs received. This includes
> +*		unrecognized attribute IDs and methods.
> +*
> +*	qp1_mads_ignored
> +*		Total number of QP1 MADs received because SM is not
> +*		master or SM is in first time sweep.
> +*
>  * SEE ALSO
>  ***************/
>  
> diff --git a/osm/include/opensm/osm_version.h b/osm/include/opensm/osm_version.h
> index ef91e16..6d2c8ee 100644
> --- a/osm/include/opensm/osm_version.h
> +++ b/osm/include/opensm/osm_version.h
> @@ -55,7 +55,7 @@ BEGIN_C_DECLS
>  *
>  * SYNOPSIS
>  */
> -#define OSM_VERSION "OpenSM Rev:openib-3.0.14-xsigo2"
> +#define OSM_VERSION "OpenSM Rev:openib-3.0.14-xsigo3"
>  /********/
>  
>  END_C_DECLS
> diff --git a/osm/opensm/osm_console.c b/osm/opensm/osm_console.c
> index 5575425..7acfdf1 100644
> --- a/osm/opensm/osm_console.c
> +++ b/osm/opensm/osm_console.c
> @@ -336,23 +336,29 @@ static void print_status(osm_opensm_t *p_osm, FILE *out)
>  			p_osm->routing_engine.name ? p_osm->routing_engine.name : "null (min-hop)");
>  		fprintf(out, "\n   MAD stats\n"
>  			     "   ---------\n"
> -			     "   QP0 MADS outstanding           : %d\n"
> -			     "   QP0 MADS outstanding (on wire) : %d\n"
> -			     "   QP0 MADS rcvd                  : %d\n"
> -			     "   QP0 MADS sent                  : %d\n"
> +			     "   QP0 MADs outstanding           : %d\n"
> +			     "   QP0 MADs outstanding (on wire) : %d\n"
> +			     "   QP0 MADs rcvd                  : %d\n"
> +			     "   QP0 MADs sent                  : %d\n"
>  			     "   QP0 unicasts sent              : %d\n"
> -			     "   QP1 MADS outstanding           : %d\n"
> -			     "   QP1 MADS rcvd                  : %d\n"
> -			     "   QP1 MADS sent                  : %d\n"
> +			     "   QP0 unknown MADs rcvd          : %d\n"
> +			     "   QP1 MADs outstanding           : %d\n"
> +			     "   QP1 MADs rcvd                  : %d\n"
> +			     "   QP1 MADs sent                  : %d\n"
> +			     "   QP1 unknown MADs rcvd          : %d\n"
> +			     "   QP1 MADs ignored               : %d\n"
>  			     ,
>  			p_osm->stats.qp0_mads_outstanding,
>  			p_osm->stats.qp0_mads_outstanding_on_wire,
>  			p_osm->stats.qp0_mads_rcvd,
>  			p_osm->stats.qp0_mads_sent,
>  			p_osm->stats.qp0_unicasts_sent,
> +			p_osm->stats.qp0_mads_rcvd_unknown,
>  			p_osm->stats.qp1_mads_outstanding,
>  			p_osm->stats.qp1_mads_rcvd,
> -			p_osm->stats.qp1_mads_sent
> +			p_osm->stats.qp1_mads_sent,
> +			p_osm->stats.qp1_mads_rcvd_unknown,
> +			p_osm->stats.qp1_mads_ignored
>  			);
>  		fprintf(out, "\n   Subnet flags\n"
>  			     "   ------------\n"
> diff --git a/osm/opensm/osm_inform.c b/osm/opensm/osm_inform.c
> index f91fa49..e1e1dec 100644
> --- a/osm/opensm/osm_inform.c
> +++ b/osm/opensm/osm_inform.c
> @@ -57,6 +57,7 @@
>  #include <opensm/osm_trap_rcv.h>
>  #include <vendor/osm_vendor_api.h>
>  #include <opensm/osm_pkey.h>
> +#include <opensm/osm_sa.h>
>  
>  typedef struct _osm_infr_match_ctxt
>  {
> @@ -442,7 +443,8 @@ __osm_send_report(
>    *p_report_ntc = *p_ntc;
>  
>    /* The TRUE is for: response is expected */
> -  status = osm_vendor_send( p_report_madw->h_bind, p_report_madw, TRUE );
> +  status = osm_sa_vendor_send( p_report_madw->h_bind, p_report_madw, TRUE,
> +                               p_infr_rec->p_infr_rcv->p_subn );
>    if ( status != IB_SUCCESS )
>    {
>      osm_log( p_log, OSM_LOG_ERROR,
> diff --git a/osm/opensm/osm_lid_mgr.c b/osm/opensm/osm_lid_mgr.c
> index d856fb0..f10ed60 100644
> --- a/osm/opensm/osm_lid_mgr.c
> +++ b/osm/opensm/osm_lid_mgr.c
> @@ -1163,15 +1163,19 @@ __osm_lid_mgr_set_physp_pi(
>      if ( (mtu != ib_port_info_get_neighbor_mtu(p_old_pi)) ||
>           (op_vls !=  ib_port_info_get_op_vls(p_old_pi)))
>      {
> -      if( osm_log_is_active( p_mgr->p_log, OSM_LOG_DEBUG ) )
> +#if 0
> +      if( osm_log_is_active( p_mgr->p_log, OSM_LOG_ERROR ) )
>        {
> -        osm_log( p_mgr->p_log, OSM_LOG_DEBUG,
> +#endif
> +        osm_log( p_mgr->p_log, OSM_LOG_ERROR,
>                   "__osm_lid_mgr_set_physp_pi: "
> -                 "Sending Link Down due to op_vls or mtu change. MTU:%u,%u VL_CAP:%u,%u\n",
> +                 "Setting Link Down due to op_vls or mtu change. MTU:%u,%u VL_CAP:%u,%u\n",
>                   mtu, ib_port_info_get_neighbor_mtu(p_old_pi),
>                   op_vls, ib_port_info_get_op_vls(p_old_pi)
>                   );
> +#if 0
>        }
> +#endif

Why those #if 0? Should it be here?

Sasha

>  
>        /* 
>           we need to make sure the internal DB will follow the fact the remote
> diff --git a/osm/opensm/osm_sa.c b/osm/opensm/osm_sa.c
> index 6d68ed2..360ad70 100644
> --- a/osm/opensm/osm_sa.c
> +++ b/osm/opensm/osm_sa.c
> @@ -69,6 +69,7 @@
>  #include <opensm/osm_multicast.h>
>  #include <opensm/osm_inform.h>
>  #include <opensm/osm_service.h>
> +#include <vendor/osm_vendor_api.h>
>  
>  #define  OSM_SA_INITIAL_TID_VALUE 0xabc
>  
> @@ -202,6 +203,7 @@ osm_sa_init(
>  
>    status = osm_sa_resp_init(&p_sa->resp,
>                              p_sa->p_mad_pool,
> +                            p_subn,
>                              p_log);
>    if( status != IB_SUCCESS )
>      goto Exit;
> @@ -519,6 +521,22 @@ osm_sa_bind(
>    return( status );
>  }
>  
> +ib_api_status_t
> +osm_sa_vendor_send(
> +  IN osm_bind_handle_t h_bind,
> +  IN osm_madw_t* const p_madw,
> +  IN boolean_t const resp_expected,
> +  IN osm_subn_t* const p_subn )
> +{
> +  ib_api_status_t status;
> +
> +  cl_atomic_inc( &p_subn->p_osm->stats.qp1_mads_sent );
> +  status = osm_vendor_send( h_bind, p_madw, resp_expected );
> +  if ( status != IB_SUCCESS )
> +    cl_atomic_dec( &p_subn->p_osm->stats.qp1_mads_sent );
> +  return status;
> +}
> +
>  /**********************************************************************
>   **********************************************************************/
>  /*
> diff --git a/osm/opensm/osm_sa_class_port_info.c b/osm/opensm/osm_sa_class_port_info.c
> index da107ee..9ee434a 100644
> --- a/osm/opensm/osm_sa_class_port_info.c
> +++ b/osm/opensm/osm_sa_class_port_info.c
> @@ -60,6 +60,7 @@
>  #include <vendor/osm_vendor.h>
>  #include <vendor/osm_vendor_api.h>
>  #include <opensm/osm_helper.h>
> +#include <opensm/osm_sa.h>
>  
>  #define MAX_MSECS_TO_RTV 24
>  /* Precalculated table in msec (index is related to encoded value) */
> @@ -223,7 +224,8 @@ __osm_cpi_rcv_respond(
>    if( osm_log_is_active( p_rcv->p_log, OSM_LOG_FRAMES ) )
>      osm_dump_sa_mad( p_rcv->p_log, p_resp_sa_mad, OSM_LOG_FRAMES );
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw,  FALSE );
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw,  FALSE,
> +                               p_rcv->p_subn );
>    if( status != IB_SUCCESS )
>    {
>      osm_log( p_rcv->p_log, OSM_LOG_ERROR,
> diff --git a/osm/opensm/osm_sa_guidinfo_record.c b/osm/opensm/osm_sa_guidinfo_record.c
> index 10fac3c..fe85eff 100644
> --- a/osm/opensm/osm_sa_guidinfo_record.c
> +++ b/osm/opensm/osm_sa_guidinfo_record.c
> @@ -33,7 +33,6 @@
>   *
>   */
>  
> -
>  /*
>   * Abstract:
>   *    Implementation of osm_gir_rcv_t.
> @@ -61,6 +60,7 @@
>  #include <vendor/osm_vendor_api.h>
>  #include <opensm/osm_helper.h>
>  #include <opensm/osm_pkey.h>
> +#include <opensm/osm_sa.h>
>  
>  #define OSM_GIR_RCV_POOL_MIN_SIZE      32
>  #define OSM_GIR_RCV_POOL_GROW_SIZE     32
> @@ -108,7 +108,7 @@ osm_gir_rcv_init(
>    IN osm_gir_rcv_t*        const p_rcv,
>    IN osm_sa_resp_t*        const p_resp,
>    IN osm_mad_pool_t*       const p_mad_pool,
> -  IN const osm_subn_t*     const p_subn,
> +  IN osm_subn_t*           const p_subn,
>    IN osm_log_t*            const p_log,
>    IN cl_plock_t*           const p_lock )
>  {
> @@ -595,7 +595,8 @@ osm_gir_rcv_process(
>  
>    CL_ASSERT( cl_is_qlist_empty( &rec_list ) );
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE);
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE,
> +                               p_rcv->p_subn );
>    if (status != IB_SUCCESS)
>    {
>      osm_log(p_rcv->p_log, OSM_LOG_ERROR,
> diff --git a/osm/opensm/osm_sa_informinfo.c b/osm/opensm/osm_sa_informinfo.c
> index 340a7f1..dc999b3 100644
> --- a/osm/opensm/osm_sa_informinfo.c
> +++ b/osm/opensm/osm_sa_informinfo.c
> @@ -339,7 +339,8 @@ __osm_infr_rcv_respond(
>  
>    p_resp_infr = (ib_inform_info_t*)ib_sa_mad_get_payload_ptr( p_resp_sa_mad );
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw,  FALSE );
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw,  FALSE,
> +                               p_rcv->p_subn );
>  
>    if ( status != IB_SUCCESS )
>    {
> @@ -647,7 +648,8 @@ osm_infr_rcv_process_get_method(
>  
>    CL_ASSERT( cl_is_qlist_empty( &rec_list ) );
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE );
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE,
> +                               p_rcv->p_subn );
>    if (status != IB_SUCCESS)
>    {
>      osm_log(p_rcv->p_log, OSM_LOG_ERROR,
> diff --git a/osm/opensm/osm_sa_lft_record.c b/osm/opensm/osm_sa_lft_record.c
> index b6333e7..ed989a0 100644
> --- a/osm/opensm/osm_sa_lft_record.c
> +++ b/osm/opensm/osm_sa_lft_record.c
> @@ -58,6 +58,7 @@
>  #include <vendor/osm_vendor_api.h>
>  #include <opensm/osm_helper.h>
>  #include <opensm/osm_pkey.h>
> +#include <opensm/osm_sa.h>
>  
>  #define OSM_LFTR_RCV_POOL_MIN_SIZE      32
>  #define OSM_LFTR_RCV_POOL_GROW_SIZE     32
> @@ -502,7 +503,8 @@ osm_lftr_rcv_process(
>  
>    CL_ASSERT( cl_is_qlist_empty( &rec_list ) );
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE );
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE,
> +                               p_rcv->p_subn );
>    if (status != IB_SUCCESS)
>    {
>      osm_log(p_rcv->p_log, OSM_LOG_ERROR,
> diff --git a/osm/opensm/osm_sa_link_record.c b/osm/opensm/osm_sa_link_record.c
> index 169e75e..058b6b2 100644
> --- a/osm/opensm/osm_sa_link_record.c
> +++ b/osm/opensm/osm_sa_link_record.c
> @@ -60,6 +60,7 @@
>  #include <vendor/osm_vendor_api.h>
>  #include <opensm/osm_helper.h>
>  #include <opensm/osm_pkey.h>
> +#include <opensm/osm_sa.h>
>  
>  #define OSM_LR_RCV_POOL_MIN_SIZE    64
>  #define OSM_LR_RCV_POOL_GROW_SIZE   64
> @@ -679,7 +680,8 @@ __osm_lr_rcv_respond(
>      }
>    }
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw,  FALSE );
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw,  FALSE,
> +                               p_rcv->p_subn );
>    if (status != IB_SUCCESS)
>    {
>      osm_log( p_rcv->p_log, OSM_LOG_ERROR,
> diff --git a/osm/opensm/osm_sa_mad_ctrl.c b/osm/opensm/osm_sa_mad_ctrl.c
> index d6518e4..579e8f1 100644
> --- a/osm/opensm/osm_sa_mad_ctrl.c
> +++ b/osm/opensm/osm_sa_mad_ctrl.c
> @@ -269,6 +269,7 @@ __osm_sa_mad_ctrl_process(
>        There is an unknown MAD attribute type for which there is
>        no recipient.  Simply retire the MAD here.
>      */
> +    cl_atomic_inc( &p_ctrl->p_stats->qp1_mads_rcvd_unknown );
>      osm_mad_pool_put( p_ctrl->p_mad_pool, p_madw );
>    }
>  
> @@ -330,6 +331,7 @@ __osm_sa_mad_ctrl_rcv_callback(
>     */
>    if ( p_ctrl->p_subn->sm_state != IB_SMINFO_STATE_MASTER )
>    {
> +    cl_atomic_inc( &p_ctrl->p_stats->qp1_mads_ignored );
>      osm_log( p_ctrl->p_log, OSM_LOG_VERBOSE,
>               "__osm_sa_mad_ctrl_rcv_callback: "
>               "Received SA MAD while SM not MASTER. MAD ignored\n");
> @@ -338,6 +340,7 @@ __osm_sa_mad_ctrl_rcv_callback(
>    }
>    if ( p_ctrl->p_subn->first_time_master_sweep == TRUE )
>    {
> +    cl_atomic_inc( &p_ctrl->p_stats->qp1_mads_ignored );
>      osm_log( p_ctrl->p_log, OSM_LOG_VERBOSE,
>               "__osm_sa_mad_ctrl_rcv_callback: "
>               "Received SA MAD while SM in first sweep. MAD ignored\n");
> @@ -394,6 +397,7 @@ __osm_sa_mad_ctrl_rcv_callback(
>      break;
>  
>    default:
> +    cl_atomic_inc( &p_ctrl->p_stats->qp1_mads_rcvd_unknown );
>      osm_log( p_ctrl->p_log, OSM_LOG_ERROR,
>               "__osm_sa_mad_ctrl_rcv_callback: ERR 1A05: "
>               "Unsupported method = 0x%X\n",
> diff --git a/osm/opensm/osm_sa_mcmember_record.c b/osm/opensm/osm_sa_mcmember_record.c
> index 50c4f22..260360f 100644
> --- a/osm/opensm/osm_sa_mcmember_record.c
> +++ b/osm/opensm/osm_sa_mcmember_record.c
> @@ -68,6 +68,7 @@
>  #include <opensm/osm_msgdef.h>
>  #include <opensm/osm_pkey.h>
>  #include <opensm/osm_inform.h>
> +#include <opensm/osm_sa.h>
>  
>  #define OSM_MCMR_RCV_POOL_MIN_SIZE     32
>  #define OSM_MCMR_RCV_POOL_GROW_SIZE    32
> @@ -571,7 +572,8 @@ __osm_mcmr_rcv_respond(
>    p_resp_mcmember_rec->pkt_life &= 0x3f;
>    p_resp_mcmember_rec->pkt_life |= 2<<6; /* exactly */
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE );
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE,
> +                               p_rcv->p_subn );
>  
>    if(status != IB_SUCCESS)
>    {
> @@ -2266,7 +2268,8 @@ __osm_mcmr_query_mgrp(IN osm_mcmr_recv_t*  const p_rcv,
>  
>    CL_ASSERT( cl_is_qlist_empty( &rec_list ) );
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE );
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE,
> +                               p_rcv->p_subn );
>    if(status != IB_SUCCESS)
>    {
>      osm_log( p_rcv->p_log, OSM_LOG_ERROR,
> diff --git a/osm/opensm/osm_sa_mft_record.c b/osm/opensm/osm_sa_mft_record.c
> index 005c9bd..d7c7544 100644
> --- a/osm/opensm/osm_sa_mft_record.c
> +++ b/osm/opensm/osm_sa_mft_record.c
> @@ -57,6 +57,7 @@
>  #include <vendor/osm_vendor_api.h>
>  #include <opensm/osm_helper.h>
>  #include <opensm/osm_pkey.h>
> +#include <opensm/osm_sa.h>
>  
>  #define OSM_MFTR_RCV_POOL_MIN_SIZE      32
>  #define OSM_MFTR_RCV_POOL_GROW_SIZE     32
> @@ -534,7 +535,8 @@ osm_mftr_rcv_process(
>  
>    CL_ASSERT( cl_is_qlist_empty( &rec_list ) );
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE );
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE,
> +                               p_rcv->p_subn );
>    if (status != IB_SUCCESS)
>    {
>      osm_log(p_rcv->p_log, OSM_LOG_ERROR,
> diff --git a/osm/opensm/osm_sa_multipath_record.c b/osm/opensm/osm_sa_multipath_record.c
> index 0c5643e..2df3699 100644
> --- a/osm/opensm/osm_sa_multipath_record.c
> +++ b/osm/opensm/osm_sa_multipath_record.c
> @@ -64,6 +64,7 @@
>  #include <vendor/osm_vendor.h>
>  #include <vendor/osm_vendor_api.h>
>  #include <opensm/osm_helper.h>
> +#include <opensm/osm_sa.h>
>  
>  #define OSM_MPR_RCV_POOL_MIN_SIZE	64
>  #define OSM_MPR_RCV_POOL_GROW_SIZE	64
> @@ -1536,7 +1537,8 @@ __osm_mpr_rcv_respond(
>  
>    osm_dump_sa_mad( p_rcv->p_log, p_resp_sa_mad, OSM_LOG_FRAMES );
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE );
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE,
> +                               p_rcv->p_subn );
>  
>    if ( status != IB_SUCCESS )
>    {
> diff --git a/osm/opensm/osm_sa_node_record.c b/osm/opensm/osm_sa_node_record.c
> index 892582e..0d08a4c 100644
> --- a/osm/opensm/osm_sa_node_record.c
> +++ b/osm/opensm/osm_sa_node_record.c
> @@ -58,6 +58,7 @@
>  #include <vendor/osm_vendor_api.h>
>  #include <opensm/osm_helper.h>
>  #include <opensm/osm_pkey.h>
> +#include <opensm/osm_sa.h>
>  
>  #define OSM_NR_RCV_POOL_MIN_SIZE    32
>  #define OSM_NR_RCV_POOL_GROW_SIZE   32
> @@ -105,7 +106,7 @@ osm_nr_rcv_init(
>    IN osm_nr_rcv_t*         const p_rcv,
>    IN osm_sa_resp_t*        const p_resp,
>    IN osm_mad_pool_t*       const p_mad_pool,
> -  IN const osm_subn_t*     const p_subn,
> +  IN osm_subn_t*           const p_subn,
>    IN osm_log_t*            const p_log,
>    IN cl_plock_t*           const p_lock )
>  {
> @@ -587,7 +588,8 @@ osm_nr_rcv_process(
>  
>    CL_ASSERT( cl_is_qlist_empty( &rec_list ) );
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE );
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE,
> +                               p_rcv->p_subn );
>    if (status != IB_SUCCESS)
>    {
>      osm_log(p_rcv->p_log, OSM_LOG_ERROR,
> diff --git a/osm/opensm/osm_sa_path_record.c b/osm/opensm/osm_sa_path_record.c
> index 1b0f89f..b993fdd 100644
> --- a/osm/opensm/osm_sa_path_record.c
> +++ b/osm/opensm/osm_sa_path_record.c
> @@ -67,6 +67,7 @@
>  #include <opensm/osm_multicast.h>
>  #include <opensm/osm_partition.h>
>  #include <opensm/osm_opensm.h>
> +#include <opensm/osm_sa.h>
>  #ifdef ROUTER_EXP
>  #include <opensm/osm_router.h>
>  #include <opensm/osm_sa_mcmember_record.h>
> @@ -1892,7 +1893,8 @@ __osm_pr_rcv_respond(
>  
>    CL_ASSERT( cl_is_qlist_empty( p_list ) );
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE );
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE,
> +                               p_rcv->p_subn );
>  
>    if( status != IB_SUCCESS )
>    {
> diff --git a/osm/opensm/osm_sa_pkey_record.c b/osm/opensm/osm_sa_pkey_record.c
> index 5eb15df..2692d0c 100644
> --- a/osm/opensm/osm_sa_pkey_record.c
> +++ b/osm/opensm/osm_sa_pkey_record.c
> @@ -49,6 +49,7 @@
>  #include <vendor/osm_vendor_api.h>
>  #include <opensm/osm_helper.h>
>  #include <opensm/osm_pkey.h>
> +#include <opensm/osm_sa.h>
>  
>  #define OSM_PKEY_REC_RCV_POOL_MIN_SIZE      32
>  #define OSM_PKEY_REC_RCV_POOL_GROW_SIZE     32
> @@ -94,10 +95,10 @@ osm_pkey_rec_rcv_destroy(
>   **********************************************************************/
>  ib_api_status_t
>  osm_pkey_rec_rcv_init(
> -  IN osm_pkey_rec_rcv_t*     const p_rcv,
> +  IN osm_pkey_rec_rcv_t*   const p_rcv,
>    IN osm_sa_resp_t*        const p_resp,
> -  IN osm_mad_pool_t*    const p_mad_pool,
> -  IN const osm_subn_t*     const p_subn,
> +  IN osm_mad_pool_t*       const p_mad_pool,
> +  IN osm_subn_t*           const p_subn,
>    IN osm_log_t*            const p_log,
>    IN cl_plock_t*           const p_lock )
>  {
> @@ -573,7 +574,8 @@ osm_pkey_rec_rcv_process(
>  
>    CL_ASSERT( cl_is_qlist_empty( &rec_list ) );
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE);
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE,
> +                               p_rcv->p_subn );
>    if (status != IB_SUCCESS)
>    {
>      osm_log(p_rcv->p_log, OSM_LOG_ERROR,
> diff --git a/osm/opensm/osm_sa_portinfo_record.c b/osm/opensm/osm_sa_portinfo_record.c
> index 5d9b1b2..4aa1723 100644
> --- a/osm/opensm/osm_sa_portinfo_record.c
> +++ b/osm/opensm/osm_sa_portinfo_record.c
> @@ -33,7 +33,6 @@
>   *
>   */
>  
> -
>  /*
>   * Abstract:
>   *    Implementation of osm_pir_rcv_t.
> @@ -63,6 +62,7 @@
>  #include <vendor/osm_vendor_api.h>
>  #include <opensm/osm_helper.h>
>  #include <opensm/osm_pkey.h>
> +#include <opensm/osm_sa.h>
>  
>  #define OSM_PIR_RCV_POOL_MIN_SIZE      32
>  #define OSM_PIR_RCV_POOL_GROW_SIZE     32
> @@ -865,7 +865,8 @@ osm_pir_rcv_process(
>  
>    CL_ASSERT( cl_is_qlist_empty( &rec_list ) );
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE);
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE,
> +                               p_rcv->p_subn );
>    if (status != IB_SUCCESS)
>    {
>      osm_log(p_rcv->p_log, OSM_LOG_ERROR,
> diff --git a/osm/opensm/osm_sa_response.c b/osm/opensm/osm_sa_response.c
> index 4f158e9..fac2159 100644
> --- a/osm/opensm/osm_sa_response.c
> +++ b/osm/opensm/osm_sa_response.c
> @@ -56,6 +56,7 @@
>  #include <opensm/osm_helper.h>
>  #include <vendor/osm_vendor_api.h>
>  #include <opensm/osm_opensm.h>
> +#include <opensm/osm_sa.h>
>  
>  /**********************************************************************
>   **********************************************************************/
> @@ -81,6 +82,7 @@ ib_api_status_t
>  osm_sa_resp_init(
>    IN osm_sa_resp_t*     const p_resp,
>    IN osm_mad_pool_t*    const p_pool,
> +  IN osm_subn_t*        const p_subn,
>    IN osm_log_t*         const p_log )
>  {
>    ib_api_status_t status = IB_SUCCESS;
> @@ -89,6 +91,7 @@ osm_sa_resp_init(
>  
>    osm_sa_resp_construct( p_resp );
>  
> +  p_resp->p_subn = p_subn;
>    p_resp->p_log = p_log;
>    p_resp->p_pool = p_pool;
>  
> @@ -158,8 +161,8 @@ osm_sa_send_error(
>    if( osm_log_is_active( p_resp->p_log, OSM_LOG_FRAMES ) )
>      osm_dump_sa_mad( p_resp->p_log, p_resp_sa_mad, OSM_LOG_FRAMES );
>  
> -  status = osm_vendor_send( osm_madw_get_bind_handle( p_resp_madw ),
> -                            p_resp_madw, FALSE );
> +  status = osm_sa_vendor_send( osm_madw_get_bind_handle( p_resp_madw ),
> +                               p_resp_madw, FALSE, p_resp->p_subn );
>  
>    if( status != IB_SUCCESS )
>    {
> diff --git a/osm/opensm/osm_sa_service_record.c b/osm/opensm/osm_sa_service_record.c
> index b23a12d..4479f00 100644
> --- a/osm/opensm/osm_sa_service_record.c
> +++ b/osm/opensm/osm_sa_service_record.c
> @@ -465,7 +465,8 @@ __osm_sr_rcv_respond(
>      }
>    }
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw,  FALSE );
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw,  FALSE,
> +                               p_rcv->p_subn );
>  
>    if( status != IB_SUCCESS )
>    {
> diff --git a/osm/opensm/osm_sa_slvl_record.c b/osm/opensm/osm_sa_slvl_record.c
> index d831ffd..885bdc5 100644
> --- a/osm/opensm/osm_sa_slvl_record.c
> +++ b/osm/opensm/osm_sa_slvl_record.c
> @@ -61,6 +61,7 @@
>  #include <vendor/osm_vendor_api.h>
>  #include <opensm/osm_helper.h>
>  #include <opensm/osm_pkey.h>
> +#include <opensm/osm_sa.h>
>  
>  #define OSM_SLVL_REC_RCV_POOL_MIN_SIZE    32
>  #define OSM_SLVL_REC_RCV_POOL_GROW_SIZE   32
> @@ -109,7 +110,7 @@ osm_slvl_rec_rcv_init(
>    IN osm_slvl_rec_rcv_t*   const p_rcv,
>    IN osm_sa_resp_t*        const p_resp,
>    IN osm_mad_pool_t*       const p_mad_pool,
> -  IN const osm_subn_t*     const p_subn,
> +  IN osm_subn_t*           const p_subn,
>    IN osm_log_t*            const p_log,
>    IN cl_plock_t*           const p_lock )
>  {
> @@ -540,7 +541,8 @@ osm_slvl_rec_rcv_process(
>  
>    CL_ASSERT( cl_is_qlist_empty( &rec_list ) );
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE);
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE,
> +                               p_rcv->p_subn );
>    if(status != IB_SUCCESS)
>    {
>      osm_log( p_rcv->p_log, OSM_LOG_ERROR,
> diff --git a/osm/opensm/osm_sa_sminfo_record.c b/osm/opensm/osm_sa_sminfo_record.c
> index 5e15f52..99e31c6 100644
> --- a/osm/opensm/osm_sa_sminfo_record.c
> +++ b/osm/opensm/osm_sa_sminfo_record.c
> @@ -68,6 +68,7 @@
>  #include <opensm/osm_port.h>
>  #include <opensm/osm_pkey.h>
>  #include <opensm/osm_remote_sm.h>
> +#include <opensm/osm_sa.h>
>  
>  #define OSM_SMIR_RCV_POOL_MIN_SIZE     32
>  #define OSM_SMIR_RCV_POOL_GROW_SIZE    32
> @@ -570,7 +571,8 @@ osm_smir_rcv_process(
>  
>    CL_ASSERT( cl_is_qlist_empty( &rec_list ) );
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE );
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE,
> +                               p_rcv->p_subn );
>    if( status != IB_SUCCESS )
>    {
>      osm_log(p_rcv->p_log, OSM_LOG_ERROR,
> diff --git a/osm/opensm/osm_sa_sw_info_record.c b/osm/opensm/osm_sa_sw_info_record.c
> index da65864..1c2b6c7 100644
> --- a/osm/opensm/osm_sa_sw_info_record.c
> +++ b/osm/opensm/osm_sa_sw_info_record.c
> @@ -57,6 +57,7 @@
>  #include <vendor/osm_vendor_api.h>
>  #include <opensm/osm_helper.h>
>  #include <opensm/osm_pkey.h>
> +#include <opensm/osm_sa.h>
>  
>  #define OSM_SIR_RCV_POOL_MIN_SIZE    32
>  #define OSM_SIR_RCV_POOL_GROW_SIZE   32
> @@ -522,7 +523,8 @@ osm_sir_rcv_process(
>  
>    CL_ASSERT( cl_is_qlist_empty( &rec_list ) );
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE );
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE,
> +                               p_rcv->p_subn );
>    if (status != IB_SUCCESS)
>    {
>      osm_log(p_rcv->p_log, OSM_LOG_ERROR,
> diff --git a/osm/opensm/osm_sa_vlarb_record.c b/osm/opensm/osm_sa_vlarb_record.c
> index f0ff957..fdb3d99 100644
> --- a/osm/opensm/osm_sa_vlarb_record.c
> +++ b/osm/opensm/osm_sa_vlarb_record.c
> @@ -61,6 +61,7 @@
>  #include <vendor/osm_vendor_api.h>
>  #include <opensm/osm_helper.h>
>  #include <opensm/osm_pkey.h>
> +#include <opensm/osm_sa.h>
>  
>  #define OSM_VLARB_REC_RCV_POOL_MIN_SIZE      32
>  #define OSM_VLARB_REC_RCV_POOL_GROW_SIZE     32
> @@ -109,7 +110,7 @@ osm_vlarb_rec_rcv_init(
>    IN osm_vlarb_rec_rcv_t*  const p_rcv,
>    IN osm_sa_resp_t*        const p_resp,
>    IN osm_mad_pool_t*       const p_mad_pool,
> -  IN const osm_subn_t*     const p_subn,
> +  IN osm_subn_t*           const p_subn,
>    IN osm_log_t*            const p_log,
>    IN cl_plock_t*           const p_lock )
>  {
> @@ -560,7 +561,8 @@ osm_vlarb_rec_rcv_process(
>  
>    CL_ASSERT( cl_is_qlist_empty( &rec_list ) );
>  
> -  status = osm_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE );
> +  status = osm_sa_vendor_send( p_resp_madw->h_bind, p_resp_madw, FALSE,
> +                               p_rcv->p_subn );
>    if(status != IB_SUCCESS)
>    {
>      osm_log( p_rcv->p_log, OSM_LOG_ERROR,
> diff --git a/osm/opensm/osm_sm_mad_ctrl.c b/osm/opensm/osm_sm_mad_ctrl.c
> index acd68d7..85729af 100644
> --- a/osm/opensm/osm_sm_mad_ctrl.c
> +++ b/osm/opensm/osm_sm_mad_ctrl.c
> @@ -318,6 +318,7 @@ __osm_sm_mad_ctrl_process_get_resp(
>    case IB_MAD_ATTR_NOTICE:
>    case IB_MAD_ATTR_INFORM_INFO:
>    default:
> +    cl_atomic_inc( &p_ctrl->p_stats->qp0_mads_rcvd_unknown );
>      osm_log( p_ctrl->p_log, OSM_LOG_ERROR,
>               "__osm_sm_mad_ctrl_process_get_resp: ERR 3103: "
>               "Unsupported attribute = 0x%X\n",
> @@ -395,6 +396,7 @@ __osm_sm_mad_ctrl_process_get(
>      break;
>  
>    default:
> +    cl_atomic_inc( &p_ctrl->p_stats->qp0_mads_rcvd_unknown );
>      osm_log( p_ctrl->p_log, OSM_LOG_VERBOSE,
>               "__osm_sm_mad_ctrl_process_get: "
>               "Ignoring SubnGet MAD - unsupported attribute = 0x%X\n",
> @@ -487,6 +489,7 @@ __osm_sm_mad_ctrl_process_set(
>      break;
>  
>    default:
> +    cl_atomic_inc( &p_ctrl->p_stats->qp0_mads_rcvd_unknown );
>      osm_log( p_ctrl->p_log, OSM_LOG_ERROR,
>               "__osm_sm_mad_ctrl_process_set: ERR 3107: "
>               "Unsupported attribute = 0x%X\n",
> @@ -591,6 +594,7 @@ __osm_sm_mad_ctrl_process_trap(
>      break;
>  
>    default:
> +    cl_atomic_inc( &p_ctrl->p_stats->qp0_mads_rcvd_unknown );
>      osm_log( p_ctrl->p_log, OSM_LOG_ERROR,
>               "__osm_sm_mad_ctrl_process_trap: ERR 3109: "
>               "Unsupported attribute = 0x%X\n",
> @@ -763,6 +767,7 @@ __osm_sm_mad_ctrl_rcv_callback(
>    case IB_MAD_METHOD_REPORT_RESP:
>    case IB_MAD_METHOD_TRAP_REPRESS:
>    default:
> +    cl_atomic_inc( &p_ctrl->p_stats->qp0_mads_rcvd_unknown );
>      osm_log( p_ctrl->p_log, OSM_LOG_ERROR,
>               "__osm_sm_mad_ctrl_rcv_callback: ERR 3112: "
>               "Unsupported method = 0x%X\n", p_smp->method );
> 
> _______________________________________________
> general mailing list
> general at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
> 
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



More information about the general mailing list