本文整理汇总了C++中osm_node_get_physp_ptr函数的典型用法代码示例。如果您正苦于以下问题:C++ osm_node_get_physp_ptr函数的具体用法?C++ osm_node_get_physp_ptr怎么用?C++ osm_node_get_physp_ptr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了osm_node_get_physp_ptr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: osm_node_link_exists
boolean_t osm_node_link_exists(IN osm_node_t * p_node, IN uint8_t port_num,
IN osm_node_t * p_remote_node,
IN uint8_t remote_port_num)
{
osm_physp_t *p_physp;
osm_physp_t *p_remote_physp;
CL_ASSERT(port_num < p_node->physp_tbl_size);
CL_ASSERT(remote_port_num < p_remote_node->physp_tbl_size);
p_physp = osm_node_get_physp_ptr(p_node, port_num);
p_remote_physp = osm_node_get_physp_ptr(p_remote_node, remote_port_num);
return osm_physp_link_exists(p_physp, p_remote_physp);
}
示例2: 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);
}
示例3: osm_node_link
void osm_node_link(IN osm_node_t * p_node, IN uint8_t port_num,
IN osm_node_t * p_remote_node, IN uint8_t remote_port_num)
{
osm_physp_t *p_physp;
osm_physp_t *p_remote_physp;
p_physp = osm_node_get_physp_ptr(p_node, port_num);
p_remote_physp = osm_node_get_physp_ptr(p_remote_node, remote_port_num);
if (p_physp->p_remote_physp)
p_physp->p_remote_physp->p_remote_physp = NULL;
if (p_remote_physp->p_remote_physp)
p_remote_physp->p_remote_physp->p_remote_physp = NULL;
osm_physp_link(p_physp, p_remote_physp);
}
示例4: osm_node_has_any_link
boolean_t osm_node_has_any_link(IN osm_node_t * p_node, IN uint8_t port_num)
{
osm_physp_t *p_physp;
CL_ASSERT(port_num < p_node->physp_tbl_size);
p_physp = osm_node_get_physp_ptr(p_node, port_num);
return osm_physp_has_any_link(p_physp);
}
示例5: ni_rcv_get_node_desc
/**********************************************************************
The plock must be held before calling this function.
**********************************************************************/
static void ni_rcv_get_node_desc(IN osm_sm_t * sm, IN osm_node_t * p_node,
IN const osm_madw_t * p_madw)
{
ib_node_info_t *p_ni;
ib_smp_t *p_smp;
uint8_t port_num;
osm_physp_t *p_physp = NULL;
OSM_LOG_ENTER(sm->p_log);
p_smp = osm_madw_get_smp_ptr(p_madw);
p_ni = ib_smp_get_payload_ptr(p_smp);
port_num = ib_node_info_get_local_port_num(p_ni);
/*
Request PortInfo & NodeDescription attributes for the port
that responded to the NodeInfo attribute.
Because this is a channel adapter or router, we are
not allowed to request PortInfo for the other ports.
Set the context union properly, so the recipient
knows which node & port are relevant.
*/
p_physp = osm_node_get_physp_ptr(p_node, port_num);
if (!p_physp) {
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR OD1F: "
"Failed to find physp for port %d of Node GUID 0x%"
PRIx64 "\n", port_num,
cl_ntoh64(osm_node_get_node_guid(p_node)));
return;
}
osm_req_get_node_desc(sm, p_physp);
OSM_LOG_EXIT(sm->p_log);
}
示例6: ni_rcv_process_switch
static void ni_rcv_process_switch(IN osm_sm_t * sm, IN osm_node_t * p_node,
IN const osm_madw_t * p_madw)
{
ib_api_status_t status = IB_SUCCESS;
osm_physp_t *p_physp;
osm_madw_context_t context;
osm_dr_path_t *path;
ib_smp_t *p_smp;
OSM_LOG_ENTER(sm->p_log);
p_smp = osm_madw_get_smp_ptr(p_madw);
p_physp = osm_node_get_physp_ptr(p_node, 0);
/* update DR path of already initialized switch port 0 */
path = osm_physp_get_dr_path_ptr(p_physp);
osm_dr_path_init(path, p_smp->hop_count, p_smp->initial_path);
context.si_context.node_guid = osm_node_get_node_guid(p_node);
context.si_context.set_method = FALSE;
context.si_context.light_sweep = FALSE;
context.si_context.lft_top_change = FALSE;
/* Request a SwitchInfo attribute */
status = osm_req_get(sm, path, IB_MAD_ATTR_SWITCH_INFO, 0, TRUE, 0,
CL_DISP_MSGID_NONE, &context);
if (status != IB_SUCCESS)
/* continue despite error */
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0D06: "
"Failure initiating SwitchInfo request (%s)\n",
ib_get_err_str(status));
OSM_LOG_EXIT(sm->p_log);
}
示例7: report_duplicated_guid
static void report_duplicated_guid(IN osm_sm_t * sm, osm_physp_t * p_physp,
osm_node_t * p_neighbor_node,
const uint8_t port_num)
{
osm_physp_t *p_old, *p_new;
osm_dr_path_t path;
p_old = p_physp->p_remote_physp;
p_new = osm_node_get_physp_ptr(p_neighbor_node, port_num);
OSM_LOG(sm->p_log, OSM_LOG_SYS | OSM_LOG_ERROR, "ERR 0D01: "
"Found duplicated node GUID.\n"
"Node 0x%" PRIx64 " port %u is reachable from remote node "
"0x%" PRIx64 " port %u and remote node 0x%" PRIx64 " port %u.\n"
"Paths are:\n",
cl_ntoh64(p_physp->p_node->node_info.node_guid),
p_physp->port_num,
p_old ? cl_ntoh64(p_old->p_node->node_info.node_guid) : 0,
p_old ? p_old->port_num : 0,
p_new ? cl_ntoh64(p_new->p_node->node_info.node_guid) : 0,
p_new ? p_new->port_num : 0);
osm_dump_dr_path_v2(sm->p_log, osm_physp_get_dr_path_ptr(p_physp),
FILE_ID, OSM_LOG_ERROR);
path = *osm_physp_get_dr_path_ptr(p_new);
if (osm_dr_path_extend(&path, port_num))
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0D05: "
"DR path with hop count %d couldn't be extended\n",
path.hop_count);
osm_dump_dr_path_v2(sm->p_log, &path, FILE_ID, OSM_LOG_ERROR);
}
示例8: mark_ignored_port
static int mark_ignored_port(void *ctx, uint64_t guid, char *p)
{
osm_ucast_mgr_t *m = ctx;
osm_node_t *node = osm_get_node_by_guid(m->p_subn, cl_hton64(guid));
osm_physp_t *physp;
unsigned port;
if (!node || !node->sw) {
OSM_LOG(m->p_log, OSM_LOG_DEBUG,
"switch with guid 0x%016" PRIx64 " is not found\n",
guid);
return 0;
}
if (!p || !*p || !(port = strtoul(p, NULL, 0)) ||
port >= node->sw->num_ports) {
OSM_LOG(m->p_log, OSM_LOG_DEBUG,
"bad port specified for guid 0x%016" PRIx64 "\n", guid);
return 0;
}
physp = osm_node_get_physp_ptr(node, port);
if (!physp)
return 0;
physp->is_prof_ignored = 1;
return 0;
}
示例9: ep_port_tbl_rec_init
/** =========================================================================
*/
void ep_port_tbl_rec_init(osm_physp_t *p_physp, struct ep_port_tbl_rec *p_rec)
{
const ib_port_info_t *p_pi;
const osm_physp_t *p_physp0;
uint8_t is_fdr10_active;
uint8_t is_switch;
if (osm_node_get_type(p_physp->p_node) == IB_NODE_TYPE_SWITCH &&
osm_physp_get_port_num(p_physp) > 0) {
/* for SW external ports, port 0 Capability Mask is used */
p_physp0 = osm_node_get_physp_ptr((osm_node_t *)p_physp->p_node, 0);
p_pi = &p_physp0->port_info;
} else {
p_pi = &p_physp->port_info;
}
is_fdr10_active = ((p_physp->ext_port_info.link_speed_active & FDR10) ? 0xff : 0) &
SSA_DB_PORT_IS_FDR10_ACTIVE_MASK;
is_switch = ((osm_node_get_type(p_physp->p_node) == IB_NODE_TYPE_SWITCH) ? 0xff : 0) &
SSA_DB_PORT_IS_SWITCH_MASK;
p_rec->pkey_tbl_offset = 0;
p_rec->pkey_tbl_size = 0;
p_rec->port_lid = osm_physp_get_base_lid(p_physp);
p_rec->port_num = osm_physp_get_port_num(p_physp);
p_rec->neighbor_mtu = ib_port_info_get_neighbor_mtu(&p_physp->port_info);
p_rec->rate = ib_port_info_compute_rate(&p_physp->port_info,
p_pi->capability_mask & IB_PORT_CAP_HAS_EXT_SPEEDS) &
SSA_DB_PORT_RATE_MASK;
p_rec->vl_enforce = p_physp->port_info.vl_enforce;
p_rec->rate = (uint8_t) (p_rec->rate | is_fdr10_active | is_switch);
}
示例10: osm_pi_rcv_process_set
static void
osm_pi_rcv_process_set(IN osm_sm_t * sm, IN osm_node_t * const p_node,
IN const uint8_t port_num, IN osm_madw_t * const p_madw)
{
osm_physp_t *p_physp;
ib_net64_t port_guid;
ib_smp_t *p_smp;
ib_port_info_t *p_pi;
osm_pi_context_t *p_context;
osm_log_level_t level;
OSM_LOG_ENTER(sm->p_log);
p_context = osm_madw_get_pi_context_ptr(p_madw);
CL_ASSERT(p_node);
p_physp = osm_node_get_physp_ptr(p_node, port_num);
CL_ASSERT(p_physp);
port_guid = osm_physp_get_port_guid(p_physp);
p_smp = osm_madw_get_smp_ptr(p_madw);
p_pi = (ib_port_info_t *) ib_smp_get_payload_ptr(p_smp);
/* check for error */
if (cl_ntoh16(p_smp->status) & 0x7fff) {
/* If port already ACTIVE, don't treat status 7 as error */
if (p_context->active_transition &&
(cl_ntoh16(p_smp->status) & 0x7fff) == 0x1c) {
level = OSM_LOG_INFO;
OSM_LOG(sm->p_log, OSM_LOG_INFO,
"Received error status 0x%x for SetResp() during ACTIVE transition\n",
cl_ntoh16(p_smp->status) & 0x7fff);
/* Should there be a subsequent Get to validate that port is ACTIVE ? */
} else {
level = OSM_LOG_ERROR;
OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0F10: "
"Received error status for SetResp()\n");
}
osm_dump_port_info(sm->p_log,
osm_node_get_node_guid(p_node),
port_guid, port_num, p_pi, level);
}
OSM_LOG(sm->p_log, OSM_LOG_DEBUG,
"Received logical SetResp() for GUID 0x%" PRIx64
", port num %u"
"\n\t\t\t\tfor parent node GUID 0x%" PRIx64
" TID 0x%" PRIx64 "\n",
cl_ntoh64(port_guid), port_num,
cl_ntoh64(osm_node_get_node_guid(p_node)),
cl_ntoh64(p_smp->trans_id));
osm_physp_set_port_info(p_physp, p_pi);
OSM_LOG_EXIT(sm->p_log);
}
示例11: __osm_link_mgr_process_node
static osm_signal_t
__osm_link_mgr_process_node(osm_sm_t * sm,
IN osm_node_t * const p_node,
IN const uint8_t link_state)
{
uint32_t i;
uint32_t num_physp;
osm_physp_t *p_physp;
uint8_t current_state;
osm_signal_t signal = OSM_SIGNAL_DONE;
OSM_LOG_ENTER(sm->p_log);
OSM_LOG(sm->p_log, OSM_LOG_DEBUG,
"Node 0x%" PRIx64 " going to %s\n",
cl_ntoh64(osm_node_get_node_guid(p_node)),
ib_get_port_state_str(link_state));
/*
Set the PortInfo for every Physical Port associated
with this Port. Start iterating with port 1, since the linkstate
is not applicable to the management port on switches.
*/
num_physp = osm_node_get_num_physp(p_node);
for (i = 0; i < num_physp; i++) {
/*
Don't bother doing anything if this Physical Port is not valid.
or if the state of the port is already better then the
specified state.
*/
p_physp = osm_node_get_physp_ptr(p_node, (uint8_t) i);
if (!p_physp)
continue;
current_state = osm_physp_get_port_state(p_physp);
if (current_state == 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.
*/
if (link_state != IB_LINK_NO_CHANGE &&
link_state <= current_state)
OSM_LOG(sm->p_log, OSM_LOG_DEBUG,
"Physical port %u already %s. Skipping\n",
p_physp->port_num,
ib_get_port_state_str(current_state));
else if (__osm_link_mgr_set_physp_pi(sm, p_physp, link_state))
signal = OSM_SIGNAL_DONE_PENDING;
}
OSM_LOG_EXIT(sm->p_log);
return (signal);
}
示例12: osm_node_unlink
void osm_node_unlink(IN osm_node_t * p_node, IN uint8_t port_num,
IN osm_node_t * p_remote_node, IN uint8_t remote_port_num)
{
osm_physp_t *p_physp;
osm_physp_t *p_remote_physp;
CL_ASSERT(port_num < p_node->physp_tbl_size);
CL_ASSERT(remote_port_num < p_remote_node->physp_tbl_size);
if (osm_node_link_exists(p_node, port_num,
p_remote_node, remote_port_num)) {
p_physp = osm_node_get_physp_ptr(p_node, port_num);
p_remote_physp =
osm_node_get_physp_ptr(p_remote_node, remote_port_num);
osm_physp_unlink(p_physp, p_remote_physp);
}
}
示例13: set_default_hop_wf
static void set_default_hop_wf(cl_map_item_t * p_map_item, void *ctx)
{
osm_switch_t *sw = (osm_switch_t *) p_map_item;
int i;
for (i = 1; i < sw->num_ports; i++) {
osm_physp_t *p = osm_node_get_physp_ptr(sw->p_node, i);
if (p)
p->hop_wf = 1;
}
}
示例14: clear_prof_ignore_flag
static void clear_prof_ignore_flag(cl_map_item_t * p_map_item, void *ctx)
{
osm_switch_t *sw = (osm_switch_t *) p_map_item;
int i;
for (i = 1; i < sw->num_ports; i++) {
osm_physp_t *p = osm_node_get_physp_ptr(sw->p_node, i);
if (p)
p->is_prof_ignored = 0;
}
}
示例15: sw_count_endport_links
static void sw_count_endport_links(osm_switch_t * sw)
{
osm_physp_t *p;
int i;
sw->endport_links = 0;
for (i = 1; i < sw->num_ports; i++) {
p = osm_node_get_physp_ptr(sw->p_node, i);
if (p && p->p_remote_physp && !p->p_remote_physp->p_node->sw)
sw->endport_links++;
}
}