当前位置: 首页>>代码示例>>C++>>正文


C++ OSM_LOG_EXIT函数代码示例

本文整理汇总了C++中OSM_LOG_EXIT函数的典型用法代码示例。如果您正苦于以下问题:C++ OSM_LOG_EXIT函数的具体用法?C++ OSM_LOG_EXIT怎么用?C++ OSM_LOG_EXIT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了OSM_LOG_EXIT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: __osmv_txnmgr_remove_txn

ib_api_status_t
__osmv_txnmgr_remove_txn(IN osmv_txn_mgr_t * p_tx_mgr,
			 IN uint64_t key, OUT osmv_txn_ctx_t ** pp_txn)
{
	cl_map_obj_t *p_obj;
	cl_map_item_t *p_item;

	OSM_LOG_ENTER(p_tx_mgr->p_log);

	CL_ASSERT(p_tx_mgr);
	CL_ASSERT(pp_txn);

	p_item = cl_qmap_remove(p_tx_mgr->p_txn_map, key);

	if (p_item == cl_qmap_end(p_tx_mgr->p_txn_map)) {

		osm_log(p_tx_mgr->p_log, OSM_LOG_ERROR,
			"__osmv_txnmgr_remove_txn: ERR 6701: "
			"Could not remove the transaction 0x%llX - "
			"something is really wrong!\n", key);
		OSM_LOG_EXIT(p_tx_mgr->p_log);
		return IB_NOT_FOUND;
	}

	p_obj = PARENT_STRUCT(p_item, cl_map_obj_t, item);
	*pp_txn = cl_qmap_obj(p_obj);

	free(p_obj);

	OSM_LOG_EXIT(p_tx_mgr->p_log);
	return IB_SUCCESS;
}
开发者ID:2014-class,项目名称:freerouter,代码行数:32,代码来源:osm_vendor_mlx_txn.c

示例2: link_mgr_get_smsl

static uint8_t link_mgr_get_smsl(IN osm_sm_t * sm, IN osm_physp_t * p_physp)
{
	osm_opensm_t *p_osm = sm->p_subn->p_osm;
	struct osm_routing_engine *re = p_osm->routing_engine_used;
	ib_net16_t slid;
	ib_net16_t smlid;
	uint8_t sl;

	OSM_LOG_ENTER(sm->p_log);

	if (!(re && re->path_sl &&
	      (slid = osm_physp_get_base_lid(p_physp)))) {
		/*
		 * Use default SL if routing engine does not provide a
		 * path SL lookup callback.
		 */
		OSM_LOG_EXIT(sm->p_log);
		return sm->p_subn->opt.sm_sl;
	}

	smlid = sm->p_subn->sm_base_lid;

	/* Call into routing engine to find proper SL */
	sl = re->path_sl(re->context, sm->p_subn->opt.sm_sl,
			 slid, smlid);

	OSM_LOG_EXIT(sm->p_log);
	return sl;
}
开发者ID:Maigard,项目名称:opensm-pnnl,代码行数:29,代码来源:osm_link_mgr.c

示例3: link_mgr_get_smsl

static uint8_t link_mgr_get_smsl(IN osm_sm_t * sm, IN osm_physp_t * p_physp)
{
	osm_opensm_t *p_osm = sm->p_subn->p_osm;
	struct osm_routing_engine *re = p_osm->routing_engine_used;
	const osm_port_t *p_sm_port, *p_src_port;
	ib_net16_t slid;
	uint8_t sl;

	OSM_LOG_ENTER(sm->p_log);

	if (!(re && re->path_sl &&
	      (slid = osm_physp_get_base_lid(p_physp)))) {
		/*
		 * Use default SL if routing engine does not provide a
		 * path SL lookup callback.
		 */
		OSM_LOG_EXIT(sm->p_log);
		return sm->p_subn->opt.sm_sl;
	}

	/* Find osm_port of the SM itself = dest_port */
	p_sm_port = osm_get_port_by_lid(sm->p_subn, sm->p_subn->sm_base_lid);

	/* Find osm_port of the source = p_physp */
	p_src_port = osm_get_port_by_lid(sm->p_subn, slid);

	/* Call into routing engine to find proper SL */
	sl = re->path_sl(re->context, sm->p_subn->opt.sm_sl,
			 p_src_port, p_sm_port);

	OSM_LOG_EXIT(sm->p_log);
	return sl;
}
开发者ID:Cai900205,项目名称:test,代码行数:33,代码来源:osm_link_mgr.c

示例4: osmv_txn_init

ib_api_status_t
osmv_txn_init(IN osm_bind_handle_t h_bind,
	      IN uint64_t tid, IN uint64_t key, OUT osmv_txn_ctx_t ** pp_txn)
{
	ib_api_status_t st;
	osmv_txn_ctx_t *p_txn;
	osmv_bind_obj_t *p_bo = (osmv_bind_obj_t *) h_bind;

	OSM_LOG_ENTER(p_bo->p_vendor->p_log);

	CL_ASSERT(NULL != h_bind && NULL != pp_txn);

	osm_log(p_bo->p_vendor->p_log, OSM_LOG_DEBUG,
		"Starting transaction 0x%016" PRIx64
		" (key=0x%016" PRIx64 ")\n", tid, key);

	p_txn = malloc(sizeof(osmv_txn_ctx_t));
	if (!p_txn) {
		return IB_INSUFFICIENT_MEMORY;
	}

	memset(p_txn, 0, sizeof(osmv_txn_ctx_t));
	p_txn->p_log = p_bo->txn_mgr.p_log;
	p_txn->tid = tid;
	p_txn->key = key;
	p_txn->p_madw = NULL;
	p_txn->rmpp_txfr.rmpp_state = OSMV_TXN_RMPP_NONE;

	/* insert into transaction manager DB */
	st = __osmv_txnmgr_insert_txn(&p_bo->txn_mgr, p_txn, key);
	if (IB_SUCCESS != st) {
		osm_log(p_bo->p_vendor->p_log, OSM_LOG_ERROR,
			"osmv_txn_init: ERR 6703: "
			"Failed to insert to transaction 0x%016" PRIx64
			" (key=0x%016" PRIx64 ") to manager DB\n",
			tid, key);
		goto insert_txn_failed;
	}

	*pp_txn = p_txn;
	OSM_LOG_EXIT(p_bo->p_vendor->p_log);
	return IB_SUCCESS;

insert_txn_failed:
	free(p_txn);

	OSM_LOG_EXIT(p_bo->p_vendor->p_log);
	return st;
}
开发者ID:ChristianKniep,项目名称:opensm-qnibng,代码行数:49,代码来源:osm_vendor_mlx_txn.c

示例5: osm_vendor_put

/**********************************************************************
 * Return a MAD by providing it's wrapper object.
 **********************************************************************/
void
osm_vendor_put(IN osm_bind_handle_t h_bind, IN osm_vend_wrap_t * const p_vw)
{
	osm_ts_bind_info_t *p_bind = (osm_ts_bind_info_t *) h_bind;
	osm_vendor_t *p_vend = p_bind->p_vend;
	osm_madw_t *p_madw;

	OSM_LOG_ENTER(p_vend->p_log);

	CL_ASSERT(p_vw);
	CL_ASSERT(p_vw->p_mad_buf);

	if (osm_log_get_level(p_vend->p_log) >= OSM_LOG_DEBUG) {
		osm_log(p_vend->p_log, OSM_LOG_DEBUG,
			"osm_vendor_put: " "Retiring MAD %p.\n",
			p_vw->p_mad_buf);
	}

	/*
	 * We moved the removal of the transaction to immediatly after
	 * it was looked up.
	 */

	/* free the mad but the wrapper is part of the madw object */
	free(p_vw->p_mad_buf);
	p_vw->p_mad_buf = NULL;
	p_madw = PARENT_STRUCT(p_vw, osm_madw_t, vend_wrap);
	p_madw->p_mad = NULL;

	OSM_LOG_EXIT(p_vend->p_log);
}
开发者ID:2014-class,项目名称:freerouter,代码行数:34,代码来源:osm_vendor_ts.c

示例6: osm_vendor_set_sm

void osm_vendor_set_sm(IN osm_bind_handle_t h_bind, IN boolean_t is_sm_val)
{
	osm_ts_bind_info_t *p_bind = (osm_ts_bind_info_t *) h_bind;
	osm_vendor_t *p_vend = p_bind->p_vend;
	VAPI_ret_t status;
	VAPI_hca_attr_t attr_mod;
	VAPI_hca_attr_mask_t attr_mask;

	OSM_LOG_ENTER(p_vend->p_log);

	memset(&attr_mod, 0, sizeof(attr_mod));
	memset(&attr_mask, 0, sizeof(attr_mask));

	attr_mod.is_sm = is_sm_val;
	attr_mask = HCA_ATTR_IS_SM;

	status =
	    VAPI_modify_hca_attr(p_bind->hca_hndl, p_bind->port_num, &attr_mod,
				 &attr_mask);
	if (status != VAPI_OK) {
		osm_log(p_vend->p_log, OSM_LOG_ERROR,
			"osm_vendor_set_sm: ERR 5027: "
			"Unable set 'IS_SM' bit to:%u in port attributes (%d).\n",
			is_sm_val, status);
	}

	OSM_LOG_EXIT(p_vend->p_log);
}
开发者ID:2014-class,项目名称:freerouter,代码行数:28,代码来源:osm_vendor_ts.c

示例7: OSM_LOG_ENTER

/**********************************************************************
 *  Create and Initialize osm_vendor_t Object
 **********************************************************************/
osm_vendor_t *osm_vendor_new(IN osm_log_t * const p_log,
			     IN const uint32_t timeout)
{
	ib_api_status_t status;
	osm_vendor_t *p_vend;

	OSM_LOG_ENTER(p_log);

	CL_ASSERT(p_log);

	p_vend = malloc(sizeof(*p_vend));
	if (p_vend != NULL) {
		memset(p_vend, 0, sizeof(*p_vend));

		status = osm_vendor_init(p_vend, p_log, timeout);
		if (status != IB_SUCCESS) {
			osm_vendor_delete(&p_vend);
		}
	} else {
		osm_log(p_vend->p_log, OSM_LOG_ERROR,
			"osm_vendor_new: ERR 5007: "
			"Fail to allocate vendor object.\n");
	}

	OSM_LOG_EXIT(p_log);
	return (p_vend);
}
开发者ID:2014-class,项目名称:freerouter,代码行数:30,代码来源:osm_vendor_ts.c

示例8: state_mgr_notify_lid_change

/**********************************************************************
 Notifies the transport layer that the local LID has changed,
 which give it a chance to update address vectors, etc..
**********************************************************************/
static ib_api_status_t state_mgr_notify_lid_change(IN osm_sm_t * sm)
{
	ib_api_status_t status;
	osm_bind_handle_t h_bind;

	OSM_LOG_ENTER(sm->p_log);

	/*
	 * First, get the bind handle.
	 */
	h_bind = osm_sm_mad_ctrl_get_bind_handle(&sm->mad_ctrl);
	if (h_bind == OSM_BIND_INVALID_HANDLE) {
		OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3306: "
			"No bound ports\n");
		status = IB_ERROR;
		goto Exit;
	}

	/*
	 * Notify the transport layer that we changed the local LID.
	 */
	status = osm_vendor_local_lid_change(h_bind);
	if (status != IB_SUCCESS)
		OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3307: "
			"Vendor LID update failed (%s)\n",
			ib_get_err_str(status));

Exit:
	OSM_LOG_EXIT(sm->p_log);
	return status;
}
开发者ID:Cai900205,项目名称:test,代码行数:35,代码来源:osm_state_mgr.c

示例9: osm_cpi_rcv_process

/**********************************************************************
 * This code actually handles the call
 **********************************************************************/
void osm_cpi_rcv_process(IN void *context, IN void *data)
{
	osm_sa_t *sa = context;
	osm_madw_t *p_madw = data;
	const ib_sa_mad_t *p_sa_mad;

	OSM_LOG_ENTER(sa->p_log);

	CL_ASSERT(p_madw);

	p_sa_mad = osm_madw_get_sa_mad_ptr(p_madw);

	/* we only support GET */
	if (p_sa_mad->method != IB_MAD_METHOD_GET) {
		OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 1403: "
			"Unsupported Method (%s) for ClassPortInfo request\n",
			ib_get_sa_method_str(p_sa_mad->method));
		osm_sa_send_error(sa, p_madw, IB_SA_MAD_STATUS_REQ_INVALID);
		goto Exit;
	}

	CL_ASSERT(p_sa_mad->attr_id == IB_MAD_ATTR_CLASS_PORT_INFO);

	/* CLASS PORT INFO does not really look at the SMDB - no lock required. */

	cpi_rcv_respond(sa, p_madw);

Exit:
	OSM_LOG_EXIT(sa->p_log);
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:33,代码来源:osm_sa_class_port_info.c

示例10: __osm_sm_mad_ctrl_disp_done_callback

/****f* opensm: SM/__osm_sm_mad_ctrl_disp_done_callback
 * NAME
 * __osm_sm_mad_ctrl_disp_done_callback
 *
 * DESCRIPTION
 * This function is the Dispatcher callback that indicates
 * a received MAD has been processed by the recipient.
 *
 * SYNOPSIS
 */
static void
__osm_sm_mad_ctrl_disp_done_callback(IN void *context, IN void *p_data)
{
	osm_sm_mad_ctrl_t *const p_ctrl = (osm_sm_mad_ctrl_t *) context;
	osm_madw_t *const p_madw = (osm_madw_t *) p_data;
	ib_smp_t *p_smp;

	OSM_LOG_ENTER(p_ctrl->p_log);

	/*
	   If the MAD that just finished processing was a response,
	   then retire the transaction, since we must have generated
	   the request.

	   Otherwise, retire the transaction if a response was expected,
	   as in the case of a send failure. If a response was not expected,
	   just put the MAD back in the pool, because the MAD was a query
	   from some outside agent, e.g. Get(SMInfo) from another SM.
	 */
	p_smp = osm_madw_get_smp_ptr(p_madw);
	if (ib_smp_is_response(p_smp)) {
		CL_ASSERT(p_madw->resp_expected == FALSE);
		__osm_sm_mad_ctrl_retire_trans_mad(p_ctrl, p_madw);
	} else if (p_madw->resp_expected == TRUE)
		__osm_sm_mad_ctrl_retire_trans_mad(p_ctrl, p_madw);
	else
		osm_mad_pool_put(p_ctrl->p_mad_pool, p_madw);

	OSM_LOG_EXIT(p_ctrl->p_log);
}
开发者ID:2014-class,项目名称:freerouter,代码行数:40,代码来源:osm_sm_mad_ctrl.c

示例11: nd_rcv_process_nd

static void nd_rcv_process_nd(IN osm_sm_t * sm, IN osm_node_t * p_node,
			      IN const ib_node_desc_t * p_nd)
{
	char *tmp_desc;
	char print_desc[IB_NODE_DESCRIPTION_SIZE + 1];

	OSM_LOG_ENTER(sm->p_log);

	memcpy(&p_node->node_desc.description, p_nd, sizeof(*p_nd));

	/* also set up a printable version */
	memcpy(print_desc, p_nd, sizeof(*p_nd));
	print_desc[IB_NODE_DESCRIPTION_SIZE] = '\0';
	tmp_desc = remap_node_name(sm->p_subn->p_osm->node_name_map,
				   cl_ntoh64(osm_node_get_node_guid(p_node)),
				   print_desc);

	/* make a copy for this node to "own" */
	if (p_node->print_desc)
		free(p_node->print_desc);
	p_node->print_desc = tmp_desc;

#ifdef ENABLE_OSM_PERF_MGR
	/* update the perfmgr entry if available */
	osm_perfmgr_update_nodename(&sm->p_subn->p_osm->perfmgr,
				cl_ntoh64(osm_node_get_node_guid(p_node)),
				p_node->print_desc);
#endif				/* ENABLE_OSM_PERF_MGR */

	OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
		"Node 0x%" PRIx64 ", Description = %s\n",
		cl_ntoh64(osm_node_get_node_guid(p_node)), p_node->print_desc);

	OSM_LOG_EXIT(sm->p_log);
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:35,代码来源:osm_node_desc_rcv.c

示例12: state_mgr_get_sw_info

static void state_mgr_get_sw_info(IN cl_map_item_t * p_object, IN void *context)
{
	osm_node_t *p_node;
	osm_dr_path_t *p_dr_path;
	osm_madw_context_t mad_context;
	osm_switch_t *const p_sw = (osm_switch_t *) p_object;
	osm_sm_t *sm = context;
	ib_api_status_t status;

	OSM_LOG_ENTER(sm->p_log);

	p_node = p_sw->p_node;
	p_dr_path =
	    osm_physp_get_dr_path_ptr(osm_node_get_physp_ptr(p_node, 0));

	memset(&mad_context, 0, sizeof(mad_context));

	mad_context.si_context.node_guid = osm_node_get_node_guid(p_node);
	mad_context.si_context.set_method = FALSE;
	mad_context.si_context.light_sweep = TRUE;

	status = osm_req_get(sm, p_dr_path, IB_MAD_ATTR_SWITCH_INFO, 0,
			     OSM_MSG_LIGHT_SWEEP_FAIL, &mad_context);
	if (status != IB_SUCCESS)
		OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3304: "
			"Request for SwitchInfo failed (%s)\n",
			ib_get_err_str(status));

	OSM_LOG_EXIT(sm->p_log);
}
开发者ID:Cai900205,项目名称:test,代码行数:30,代码来源:osm_state_mgr.c

示例13: osmv_txn_abort_rmpp_txns

void osmv_txn_abort_rmpp_txns(osm_bind_handle_t h_bind)
{
	osmv_bind_obj_t *p_bo = (osmv_bind_obj_t *) h_bind;
	cl_map_item_t *p_item;
	cl_map_obj_t *p_obj;
	osmv_txn_ctx_t *p_txn;
	osmv_rmpp_send_ctx_t *p_send_ctx;
	cl_qmap_t *p_map = p_bo->txn_mgr.p_txn_map;

	OSM_LOG_ENTER(p_bo->p_vendor->p_log);

	while (FALSE == cl_is_qmap_empty(p_map)) {

		p_item = cl_qmap_head(p_map);
		p_obj = PARENT_STRUCT(p_item, cl_map_obj_t, item);
		p_txn = (osmv_txn_ctx_t *) cl_qmap_obj(p_obj);
		p_send_ctx = osmv_txn_get_rmpp_send_ctx(p_txn);

		if (NULL != p_send_ctx) {

			p_send_ctx->status = IB_INTERRUPTED;

			/* Wake up the sender thread to let it break out */
			cl_event_signal(&p_send_ctx->event);
		}

		cl_qmap_remove_item(p_map, p_item);
	}

	OSM_LOG_EXIT(p_bo->p_vendor->p_log);
}
开发者ID:2014-class,项目名称:freerouter,代码行数:31,代码来源:osm_vendor_mlx_txn.c

示例14: osm_port_share_pkey

boolean_t osm_port_share_pkey(IN osm_log_t * p_log,
			      IN const osm_port_t * p_port_1,
			      IN const osm_port_t * p_port_2,
			      IN boolean_t allow_both_pkeys)
{

	osm_physp_t *p_physp1, *p_physp2;
	boolean_t ret;

	OSM_LOG_ENTER(p_log);

	if (!p_port_1 || !p_port_2) {
		ret = FALSE;
		goto Exit;
	}

	p_physp1 = p_port_1->p_physp;
	p_physp2 = p_port_2->p_physp;

	if (!p_physp1 || !p_physp2) {
		ret = FALSE;
		goto Exit;
	}

	ret = osm_physp_share_pkey(p_log, p_physp1, p_physp2, allow_both_pkeys);

Exit:
	OSM_LOG_EXIT(p_log);
	return ret;
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:30,代码来源:osm_pkey.c

示例15: OSM_LOG_ENTER

/**********************************************************************
 * Go over all the remote SMs (as updated in the sm_guid_tbl).
 * Find if there is a remote sm that is a master SM.
 * If there is a remote master SM - return a pointer to it,
 * else - return NULL.
 **********************************************************************/
static osm_remote_sm_t *state_mgr_exists_other_master_sm(IN osm_sm_t * sm)
{
	cl_qmap_t *p_sm_tbl;
	osm_remote_sm_t *p_sm;
	osm_remote_sm_t *p_sm_res = NULL;

	OSM_LOG_ENTER(sm->p_log);

	p_sm_tbl = &sm->p_subn->sm_guid_tbl;

	/* go over all the remote SMs */
	for (p_sm = (osm_remote_sm_t *) cl_qmap_head(p_sm_tbl);
	     p_sm != (osm_remote_sm_t *) cl_qmap_end(p_sm_tbl);
	     p_sm = (osm_remote_sm_t *) cl_qmap_next(&p_sm->map_item)) {
		/* If the sm is in MASTER state - return a pointer to it */
		if (ib_sminfo_get_state(&p_sm->smi) == IB_SMINFO_STATE_MASTER) {
			OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
				"Found remote master SM with guid:0x%016" PRIx64
				" (node %s)\n", cl_ntoh64(p_sm->smi.guid),
				p_sm->p_port->p_node ? p_sm->p_port->p_node->
				print_desc : "UNKNOWN");
			p_sm_res = p_sm;
			goto Exit;
		}
	}

Exit:
	OSM_LOG_EXIT(sm->p_log);
	return p_sm_res;
}
开发者ID:Cai900205,项目名称:test,代码行数:36,代码来源:osm_state_mgr.c


注:本文中的OSM_LOG_EXIT函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。