[ofa-general] [PATCH 4/4 v2] opensm: remove some unneeded funcs
Sasha Khapyorsky
sashak at voltaire.com
Thu May 10 14:14:40 PDT 2007
This removes some not really needed functions
osm_port_get_default_phys_ptr() and osm_port_get_parent_node().
Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
osm/include/opensm/osm_port.h | 66 ----------------------------------
osm/opensm/osm_lid_mgr.c | 14 ++------
osm/opensm/osm_mcast_mgr.c | 2 +-
osm/opensm/osm_node_info_rcv.c | 6 +--
osm/opensm/osm_pkey.c | 8 ++--
osm/opensm/osm_pkey_mgr.c | 8 ++---
osm/opensm/osm_pkey_rcv.c | 4 +-
osm/opensm/osm_port.c | 6 ++--
osm/opensm/osm_port_info_rcv.c | 2 +-
osm/opensm/osm_prtn.c | 2 +-
osm/opensm/osm_qos.c | 4 +-
osm/opensm/osm_sa_informinfo.c | 6 ++--
osm/opensm/osm_sa_lft_record.c | 2 +-
osm/opensm/osm_sa_mcmember_record.c | 2 +-
osm/opensm/osm_sa_mft_record.c | 2 +-
osm/opensm/osm_sa_multipath_record.c | 10 +++---
osm/opensm/osm_sa_path_record.c | 12 +++---
osm/opensm/osm_sa_service_record.c | 2 +-
osm/opensm/osm_sa_slvl_record.c | 2 +-
osm/opensm/osm_sa_sminfo_record.c | 2 +-
osm/opensm/osm_sa_sw_info_record.c | 2 +-
osm/opensm/osm_slvl_map_rcv.c | 4 +-
osm/opensm/osm_sm_state_mgr.c | 5 +--
osm/opensm/osm_state_mgr.c | 11 +++---
osm/opensm/osm_subnet.c | 6 +--
osm/opensm/osm_switch.c | 6 ++--
osm/opensm/osm_ucast_lash.c | 2 +-
osm/opensm/osm_ucast_mgr.c | 7 ++--
osm/opensm/osm_ucast_updn.c | 2 +-
osm/opensm/osm_vl_arb_rcv.c | 5 +--
30 files changed, 64 insertions(+), 148 deletions(-)
diff --git a/osm/include/opensm/osm_port.h b/osm/include/opensm/osm_port.h
index 0873a7e..df9065e 100644
--- a/osm/include/opensm/osm_port.h
+++ b/osm/include/opensm/osm_port.h
@@ -1454,72 +1454,6 @@ osm_port_get_guid(
* Port
*********/
-/****f* OpenSM: Port/osm_port_get_default_phys_ptr
-* NAME
-* osm_port_get_default_phys_ptr
-*
-* DESCRIPTION
-* Gets the pointer to the default Physical Port object.
-* This call should only be used for non-switch ports in which there
-* is a one-for-one mapping of port to physp.
-*
-* SYNOPSIS
-*/
-static inline
-osm_physp_t*
-osm_port_get_default_phys_ptr(
- IN const osm_port_t* const p_port )
-{
- CL_ASSERT( osm_physp_is_valid( p_port->p_physp ) );
- return p_port->p_physp;
-}
-/*
-* PARAMETERS
-* p_port
-* [in] Pointer to a Port object.
-*
-* RETURN VALUE
-* Pointer to the Physical Port object.
-*
-* NOTES
-*
-* SEE ALSO
-* Port
-*********/
-
-/****f* OpenSM: Port/osm_port_get_parent_node
-* NAME
-* osm_port_get_parent_node
-*
-* DESCRIPTION
-* Gets the pointer to the this port's Node object.
-*
-* SYNOPSIS
-*/
-static inline struct _osm_node*
-osm_port_get_parent_node(
- IN const osm_port_t* const p_port )
-{
- return( p_port->p_node );
-}
-/*
-* PARAMETERS
-* p_port
-* [in] Pointer to a Port object.
-*
-* port_num
-* [in] Number of physical port for which to return the
-* osm_physp_t object.
-*
-* RETURN VALUE
-* Pointer to the Physical Port object.
-*
-* NOTES
-*
-* SEE ALSO
-* Port
-*********/
-
/****f* OpenSM: Port/osm_port_get_lid_range_ho
* NAME
* osm_port_get_lid_range_ho
diff --git a/osm/opensm/osm_lid_mgr.c b/osm/opensm/osm_lid_mgr.c
index d856fb0..6712c6c 100644
--- a/osm/opensm/osm_lid_mgr.c
+++ b/osm/opensm/osm_lid_mgr.c
@@ -975,10 +975,7 @@ __osm_lid_mgr_set_physp_pi(
Don't bother doing anything if this Physical Port is not valid.
This allows simplified code in the caller.
*/
- if( p_physp == NULL )
- goto Exit;
-
- if( !osm_physp_is_valid( p_physp ) )
+ if( p_physp == NULL || !osm_physp_is_valid( p_physp ) )
goto Exit;
port_num = osm_physp_get_port_num( p_physp );
@@ -1283,7 +1280,6 @@ __osm_lid_mgr_process_our_sm_node(
osm_port_t *p_port;
uint16_t min_lid_ho;
uint16_t max_lid_ho;
- osm_physp_t *p_physp;
boolean_t res = TRUE;
OSM_LOG_ENTER( p_mgr->p_log, __osm_lid_mgr_process_our_sm_node );
@@ -1336,9 +1332,7 @@ __osm_lid_mgr_process_our_sm_node(
Set the PortInfo the Physical Port associated
with this Port.
*/
- p_physp = osm_port_get_default_phys_ptr( p_port );
-
- __osm_lid_mgr_set_physp_pi( p_mgr, p_port, p_physp, cl_hton16( min_lid_ho ) );
+ __osm_lid_mgr_set_physp_pi( p_mgr, p_port, p_port->p_physp, cl_hton16( min_lid_ho ) );
Exit:
OSM_LOG_EXIT( p_mgr->p_log );
@@ -1404,7 +1398,6 @@ osm_lid_mgr_process_subnet(
osm_port_t *p_port;
ib_net64_t port_guid;
uint16_t min_lid_ho, max_lid_ho;
- osm_physp_t *p_physp;
int lid_changed;
CL_ASSERT( p_mgr );
@@ -1460,9 +1453,8 @@ osm_lid_mgr_process_subnet(
", LID [0x%X,0x%X]\n", cl_ntoh64( port_guid ),
min_lid_ho, max_lid_ho );
- p_physp = osm_port_get_default_phys_ptr( p_port );
/* the proc returns the fact it sent a set port info */
- if (__osm_lid_mgr_set_physp_pi( p_mgr, p_port, p_physp, cl_hton16( min_lid_ho )))
+ if (__osm_lid_mgr_set_physp_pi( p_mgr, p_port, p_port->p_physp, cl_hton16( min_lid_ho )))
p_mgr->send_set_reqs = TRUE;
}
} /* all ports */
diff --git a/osm/opensm/osm_mcast_mgr.c b/osm/opensm/osm_mcast_mgr.c
index 0cdcc0e..f5059c9 100644
--- a/osm/opensm/osm_mcast_mgr.c
+++ b/osm/opensm/osm_mcast_mgr.c
@@ -1127,7 +1127,7 @@ osm_mcast_mgr_process_single(
goto Exit;
}
- p_physp = osm_port_get_default_phys_ptr( p_port );
+ p_physp = p_port->p_physp;
if( p_physp == NULL )
{
osm_log( p_mgr->p_log, OSM_LOG_ERROR,
diff --git a/osm/opensm/osm_node_info_rcv.c b/osm/opensm/osm_node_info_rcv.c
index 364b07c..2c79056 100644
--- a/osm/opensm/osm_node_info_rcv.c
+++ b/osm/opensm/osm_node_info_rcv.c
@@ -791,12 +791,10 @@ __osm_ni_rcv_process_new(
"Duplicate Port GUID 0x%" PRIx64 "! Found by the two directed routes:\n",
cl_ntoh64( p_ni->port_guid ) );
osm_dump_dr_path(p_rcv->p_log,
- osm_physp_get_dr_path_ptr(
- osm_port_get_default_phys_ptr ( p_port) ),
+ osm_physp_get_dr_path_ptr(p_port->p_physp),
OSM_LOG_ERROR);
osm_dump_dr_path(p_rcv->p_log,
- osm_physp_get_dr_path_ptr(
- osm_port_get_default_phys_ptr ( p_port_check) ),
+ osm_physp_get_dr_path_ptr(p_port_check->p_physp),
OSM_LOG_ERROR);
if ( p_rtr )
osm_router_delete( &p_rtr );
diff --git a/osm/opensm/osm_pkey.c b/osm/opensm/osm_pkey.c
index be5578a..c0daa38 100644
--- a/osm/opensm/osm_pkey.c
+++ b/osm/opensm/osm_pkey.c
@@ -432,8 +432,8 @@ osm_port_share_pkey(
goto Exit;
}
- p_physp1 = osm_port_get_default_phys_ptr(p_port_1);
- p_physp2 = osm_port_get_default_phys_ptr(p_port_2);
+ p_physp1 = p_port_1->p_physp;
+ p_physp2 = p_port_2->p_physp;
if (!p_physp1 || !p_physp2)
{
@@ -478,7 +478,7 @@ osm_lid_share_pkey(
}
else
{
- p_physp1 = osm_port_get_default_phys_ptr(p_port1);
+ p_physp1 = p_port1->p_physp;
}
if (osm_node_get_type( p_node2 ) == IB_NODE_TYPE_SWITCH)
@@ -487,7 +487,7 @@ osm_lid_share_pkey(
}
else
{
- p_physp2 = osm_port_get_default_phys_ptr(p_port2);
+ p_physp2 = p_port2->p_physp;
}
return(osm_physp_share_pkey(p_log, p_physp1, p_physp2));
diff --git a/osm/opensm/osm_pkey_mgr.c b/osm/opensm/osm_pkey_mgr.c
index bbbe192..33ac8b5 100644
--- a/osm/opensm/osm_pkey_mgr.c
+++ b/osm/opensm/osm_pkey_mgr.c
@@ -310,7 +310,7 @@ static boolean_t pkey_mgr_update_port(
memset(&empty_block, 0, sizeof(ib_pkey_table_t));
- p_physp = osm_port_get_default_phys_ptr( p_port );
+ p_physp = p_port->p_physp;
if ( !osm_physp_is_valid( p_physp ) )
return FALSE;
@@ -449,7 +449,7 @@ pkey_mgr_update_peer_port(
memset(&empty_block, 0, sizeof(ib_pkey_table_t));
- p_physp = osm_port_get_default_phys_ptr( p_port );
+ p_physp = p_port->p_physp;
if (!osm_physp_is_valid( p_physp ))
return FALSE;
peer = osm_physp_get_remote( p_physp );
@@ -532,7 +532,6 @@ osm_pkey_mgr_process(
osm_prtn_t *p_prtn;
osm_port_t *p_port;
osm_signal_t signal = OSM_SIGNAL_DONE;
- osm_node_t *p_node;
CL_ASSERT( p_osm );
@@ -570,8 +569,7 @@ osm_pkey_mgr_process(
p_next = cl_qmap_next( p_next );
if ( pkey_mgr_update_port( &p_osm->log, &p_osm->sm.req, p_port ) )
signal = OSM_SIGNAL_DONE_PENDING;
- p_node = osm_port_get_parent_node( p_port );
- if ( ( osm_node_get_type( p_node ) != IB_NODE_TYPE_SWITCH ) &&
+ if ( ( osm_node_get_type( p_port->p_node ) != IB_NODE_TYPE_SWITCH ) &&
pkey_mgr_update_peer_port( &p_osm->log, &p_osm->sm.req,
&p_osm->subn, p_port,
!p_osm->subn.opt.no_partition_enforcement ) )
diff --git a/osm/opensm/osm_pkey_rcv.c b/osm/opensm/osm_pkey_rcv.c
index 0e0ec46..7c58d98 100644
--- a/osm/opensm/osm_pkey_rcv.c
+++ b/osm/opensm/osm_pkey_rcv.c
@@ -159,7 +159,7 @@ osm_pkey_rcv_process(
goto Exit;
}
- p_node = osm_port_get_parent_node( p_port );
+ p_node = p_port->p_node;
CL_ASSERT( p_node );
block_num = (uint16_t)((cl_ntoh32(p_smp->attr_mod)) & 0x0000FFFF);
@@ -171,7 +171,7 @@ osm_pkey_rcv_process(
}
else
{
- p_physp = osm_port_get_default_phys_ptr(p_port);
+ p_physp = p_port->p_physp;
port_num = p_physp->port_num;
}
diff --git a/osm/opensm/osm_port.c b/osm/opensm/osm_port.c
index 30e2ab2..eab86e1 100644
--- a/osm/opensm/osm_port.c
+++ b/osm/opensm/osm_port.c
@@ -302,7 +302,7 @@ osm_port_add_new_physp(
The LID value in the PortInfo for example, is only valid
for port 0 on switches.
*/
- if( !osm_physp_is_valid( osm_port_get_default_phys_ptr( p_port ) ) ||
+ if( !osm_physp_is_valid( p_port->p_physp ) ||
port_num < p_port->p_physp->port_num )
p_port->p_physp = p_physp;
}
@@ -565,7 +565,7 @@ __osm_physp_get_dr_physp_set(
}
/* get the node of the SM */
- p_node = osm_port_get_parent_node(p_port);
+ p_node = p_port->p_node;
/*
traverse the path adding the nodes to the table
@@ -732,7 +732,7 @@ osm_physp_replace_dr_path_with_alternate_dr_path(
port we'll get the port connected to the rest of the subnet. If SM is
running on SWITCH - we should try to get a dr path from all switch ports.
*/
- p_physp = osm_port_get_default_phys_ptr( p_port );
+ p_physp = p_port->p_physp;
CL_ASSERT( p_physp );
CL_ASSERT( osm_physp_is_valid( p_physp ) );
diff --git a/osm/opensm/osm_port_info_rcv.c b/osm/opensm/osm_port_info_rcv.c
index 5d9c5c7..0076b00 100644
--- a/osm/opensm/osm_port_info_rcv.c
+++ b/osm/opensm/osm_port_info_rcv.c
@@ -743,7 +743,7 @@ osm_pi_rcv_process(
cl_ntoh64( p_smp->trans_id ) );
}
- p_node = osm_port_get_parent_node( p_port );
+ p_node = p_port->p_node;
p_physp = osm_node_get_physp_ptr( p_node, port_num );
CL_ASSERT( p_node );
diff --git a/osm/opensm/osm_prtn.c b/osm/opensm/osm_prtn.c
index 4099cee..027a5a4 100644
--- a/osm/opensm/osm_prtn.c
+++ b/osm/opensm/osm_prtn.c
@@ -119,7 +119,7 @@ ib_api_status_t osm_prtn_add_port(osm_log_t *p_log, osm_subn_t *p_subn,
return status;
}
- p_physp = osm_port_get_default_phys_ptr(p_port);
+ p_physp = p_port->p_physp;
if (!p_physp) {
osm_log(p_log, OSM_LOG_VERBOSE, "osm_prtn_add_port: "
"no physical for port 0x%" PRIx64 "\n",
diff --git a/osm/opensm/osm_qos.c b/osm/opensm/osm_qos.c
index 1255169..f426241 100644
--- a/osm/opensm/osm_qos.c
+++ b/osm/opensm/osm_qos.c
@@ -195,7 +195,7 @@ static ib_api_status_t sl2vl_update(osm_req_t * p_req, osm_port_t * p_port,
if (osm_node_get_type(osm_physp_get_node_ptr(p)) == IB_NODE_TYPE_SWITCH) {
if (ib_port_info_get_vl_cap(&p->port_info) == 1) {
/* Check port 0's capability mask */
- p_physp = osm_port_get_default_phys_ptr(p_port);
+ p_physp = p_port->p_physp;
if (!(p_physp->port_info.capability_mask & IB_PORT_CAP_HAS_SL_MAP))
return IB_SUCCESS;
}
@@ -353,7 +353,7 @@ osm_signal_t osm_qos_setup(osm_opensm_t * p_osm)
else
cfg = &ca_config;
- p_physp = osm_port_get_default_phys_ptr(p_port);
+ p_physp = p_port->p_physp;
if (!osm_physp_is_valid(p_physp))
continue;
diff --git a/osm/opensm/osm_sa_informinfo.c b/osm/opensm/osm_sa_informinfo.c
index 340a7f1..6109c5d 100644
--- a/osm/opensm/osm_sa_informinfo.c
+++ b/osm/opensm/osm_sa_informinfo.c
@@ -194,7 +194,7 @@ __validate_ports_access_rights(
}
/* get the destination InformInfo physical port */
- p_physp = osm_port_get_default_phys_ptr(p_port);
+ p_physp = p_port->p_physp;
/* make sure that the requester and destination port can access each other
according to the current partitioning. */
@@ -244,7 +244,7 @@ __validate_ports_access_rights(
if ( p_port == NULL )
continue;
- p_physp = osm_port_get_default_phys_ptr(p_port);
+ p_physp = p_port->p_physp;
/* make sure that the requester and destination port can access
each other according to the current partitioning. */
if (! osm_physp_share_pkey( p_rcv->p_log, p_physp, p_requester_physp))
@@ -405,7 +405,7 @@ __osm_sa_inform_info_rec_by_comp_mask(
}
/* get the subscriber InformInfo physical port */
- p_subscriber_physp = osm_port_get_default_phys_ptr(p_subscriber_port);
+ p_subscriber_physp = p_subscriber_port->p_physp;
/* make sure that the requester and subscriber port can access each other
according to the current partitioning. */
if (! osm_physp_share_pkey( p_rcv->p_log, p_req_physp, p_subscriber_physp ))
diff --git a/osm/opensm/osm_sa_lft_record.c b/osm/opensm/osm_sa_lft_record.c
index b6333e7..c5cd9ca 100644
--- a/osm/opensm/osm_sa_lft_record.c
+++ b/osm/opensm/osm_sa_lft_record.c
@@ -244,7 +244,7 @@ __osm_lftr_rcv_by_comp_mask(
/* check that the requester physp and the current physp are under
the same partition. */
- p_physp = osm_port_get_default_phys_ptr( p_port );
+ p_physp = p_port->p_physp;
if (! p_physp)
{
osm_log( p_rcv->p_log, OSM_LOG_ERROR,
diff --git a/osm/opensm/osm_sa_mcmember_record.c b/osm/opensm/osm_sa_mcmember_record.c
index 50c4f22..8241129 100644
--- a/osm/opensm/osm_sa_mcmember_record.c
+++ b/osm/opensm/osm_sa_mcmember_record.c
@@ -1570,7 +1570,7 @@ __osm_mcmr_rcv_join_mgrp(
goto Exit;
}
- p_physp = osm_port_get_default_phys_ptr(p_port);
+ p_physp = p_port->p_physp;
/* Check that the p_physp and the requester physp are in the same
partition. */
p_request_physp =
diff --git a/osm/opensm/osm_sa_mft_record.c b/osm/opensm/osm_sa_mft_record.c
index 005c9bd..7908583 100644
--- a/osm/opensm/osm_sa_mft_record.c
+++ b/osm/opensm/osm_sa_mft_record.c
@@ -250,7 +250,7 @@ __osm_mftr_rcv_by_comp_mask(
/* check that the requester physp and the current physp are under
the same partition. */
- p_physp = osm_port_get_default_phys_ptr( p_port );
+ p_physp = p_port->p_physp;
if (! p_physp)
{
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..06640d9 100644
--- a/osm/opensm/osm_sa_multipath_record.c
+++ b/osm/opensm/osm_sa_multipath_record.c
@@ -154,7 +154,7 @@ __osm_sa_multipath_rec_is_tavor_port(
osm_node_t const* p_node;
ib_net32_t vend_id;
- p_node = osm_port_get_parent_node( p_port );
+ p_node = p_port->p_node;
vend_id = ib_node_info_get_vendor_id( &p_node->node_info );
return( (p_node->node_info.device_id == CL_HTON16(23108)) &&
@@ -255,8 +255,8 @@ __osm_mpr_rcv_get_path_parms(
dest_lid = cl_hton16( dest_lid_ho );
- p_dest_physp = osm_port_get_default_phys_ptr( p_dest_port );
- p_physp = osm_port_get_default_phys_ptr( p_src_port );
+ p_dest_physp = p_dest_port->p_physp;
+ p_physp = p_src_port->p_physp;
p_pi = &p_physp->port_info;
mtu = ib_port_info_get_mtu_cap( p_pi );
@@ -744,8 +744,8 @@ __osm_mpr_rcv_build_pr(
OSM_LOG_ENTER( p_rcv->p_log, __osm_mpr_rcv_build_pr );
- p_src_physp = osm_port_get_default_phys_ptr( p_src_port );
- p_dest_physp = osm_port_get_default_phys_ptr( p_dest_port );
+ p_src_physp = p_src_port->p_physp;
+ p_dest_physp = p_dest_port->p_physp;
p_pr->dgid.unicast.prefix = osm_physp_get_subnet_prefix( p_dest_physp );
p_pr->dgid.unicast.interface_id = osm_physp_get_port_guid( p_dest_physp );
diff --git a/osm/opensm/osm_sa_path_record.c b/osm/opensm/osm_sa_path_record.c
index 1b0f89f..47d9c33 100644
--- a/osm/opensm/osm_sa_path_record.c
+++ b/osm/opensm/osm_sa_path_record.c
@@ -171,7 +171,7 @@ __osm_sa_path_rec_is_tavor_port(
osm_node_t const* p_node;
ib_net32_t vend_id;
- p_node = osm_port_get_parent_node( p_port );
+ p_node = p_port->p_node;
vend_id = ib_node_info_get_vendor_id( &p_node->node_info );
return( (p_node->node_info.device_id == CL_HTON16(23108)) &&
@@ -268,8 +268,8 @@ __osm_pr_rcv_get_path_parms(
dest_lid = cl_hton16( dest_lid_ho );
- p_dest_physp = osm_port_get_default_phys_ptr( p_dest_port );
- p_physp = osm_port_get_default_phys_ptr( p_src_port );
+ p_dest_physp = p_dest_port->p_physp;
+ p_physp = p_src_port->p_physp;
p_pi = &p_physp->port_info;
mtu = ib_port_info_get_mtu_cap( p_pi );
@@ -753,9 +753,9 @@ __osm_pr_rcv_build_pr(
OSM_LOG_ENTER( p_rcv->p_log, __osm_pr_rcv_build_pr );
- p_src_physp = osm_port_get_default_phys_ptr( p_src_port );
+ p_src_physp = p_src_port->p_physp;
#ifndef ROUTER_EXP
- p_dest_physp = osm_port_get_default_phys_ptr( p_dest_port );
+ p_dest_physp = p_dest_port->p_physp;
p_pr->dgid.unicast.prefix = osm_physp_get_subnet_prefix( p_dest_physp );
p_pr->dgid.unicast.interface_id = osm_physp_get_port_guid( p_dest_physp );
@@ -770,7 +770,7 @@ __osm_pr_rcv_build_pr(
p_pr->dgid = *p_dgid;
else
{
- p_dest_physp = osm_port_get_default_phys_ptr( p_dest_port );
+ p_dest_physp = p_dest_port->p_physp;
p_pr->dgid.unicast.prefix = osm_physp_get_subnet_prefix( p_dest_physp );
p_pr->dgid.unicast.interface_id = osm_physp_get_port_guid( p_dest_physp );
diff --git a/osm/opensm/osm_sa_service_record.c b/osm/opensm/osm_sa_service_record.c
index b23a12d..eff0b0a 100644
--- a/osm/opensm/osm_sa_service_record.c
+++ b/osm/opensm/osm_sa_service_record.c
@@ -213,7 +213,7 @@ __match_service_pkey_with_ports_pkey(
/* check on the table of the default physical port of the service port */
if ( !osm_physp_has_pkey( p_rcv->p_log,
p_service_rec->service_pkey,
- osm_port_get_default_phys_ptr(service_port) ) )
+ service_port->p_physp ) )
{
valid = FALSE;
goto Exit;
diff --git a/osm/opensm/osm_sa_slvl_record.c b/osm/opensm/osm_sa_slvl_record.c
index 168901e..e40ad61 100644
--- a/osm/opensm/osm_sa_slvl_record.c
+++ b/osm/opensm/osm_sa_slvl_record.c
@@ -226,7 +226,7 @@ __osm_sa_slvl_by_comp_mask(
"__osm_sa_slvl_by_comp_mask: "
"Using Physical Default Port Number: 0x%X (for End Node)\n",
p_port->p_physp->port_num );
- p_out_physp = osm_port_get_default_phys_ptr( p_port );
+ p_out_physp = p_port->p_physp;
/* check that the p_out_physp and the p_req_physp share a pkey */
if (osm_physp_share_pkey( p_rcv->p_log, p_req_physp, p_out_physp ))
__osm_sa_slvl_create( p_rcv, p_out_physp, p_ctxt, 0 );
diff --git a/osm/opensm/osm_sa_sminfo_record.c b/osm/opensm/osm_sa_sminfo_record.c
index 5e15f52..8c343b4 100644
--- a/osm/opensm/osm_sa_sminfo_record.c
+++ b/osm/opensm/osm_sa_sminfo_record.c
@@ -374,7 +374,7 @@ osm_smir_rcv_process(
{
if (FALSE ==
osm_physp_share_pkey( p_rcv->p_log, p_req_physp,
- osm_port_get_default_phys_ptr( local_port ) ) )
+ local_port->p_physp ) )
{
cl_plock_release( p_rcv->p_lock );
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..94b1ff9 100644
--- a/osm/opensm/osm_sa_sw_info_record.c
+++ b/osm/opensm/osm_sa_sw_info_record.c
@@ -245,7 +245,7 @@ __osm_sir_rcv_create_sir(
/* check that the requester physp and the current physp are under
the same partition. */
- p_physp = osm_port_get_default_phys_ptr( p_port );
+ p_physp = p_port->p_physp;
if (! p_physp)
{
osm_log( p_rcv->p_log, OSM_LOG_ERROR,
diff --git a/osm/opensm/osm_slvl_map_rcv.c b/osm/opensm/osm_slvl_map_rcv.c
index b109f75..3352627 100644
--- a/osm/opensm/osm_slvl_map_rcv.c
+++ b/osm/opensm/osm_slvl_map_rcv.c
@@ -170,7 +170,7 @@ osm_slvl_rcv_process(
goto Exit;
}
- p_node = osm_port_get_parent_node( p_port );
+ p_node = p_port->p_node;
CL_ASSERT( p_node );
/* in case of a non switch node the attr modifier should be ignored */
@@ -182,7 +182,7 @@ osm_slvl_rcv_process(
}
else
{
- p_physp = osm_port_get_default_phys_ptr(p_port);
+ p_physp = p_port->p_physp;
out_port_num = p_physp->port_num;
in_port_num = 0;
}
diff --git a/osm/opensm/osm_sm_state_mgr.c b/osm/opensm/osm_sm_state_mgr.c
index 0034320..51df1df 100644
--- a/osm/opensm/osm_sm_state_mgr.c
+++ b/osm/opensm/osm_sm_state_mgr.c
@@ -192,7 +192,7 @@ __osm_sm_state_mgr_send_local_port_info_req(
status = osm_req_get( p_sm_mgr->p_req,
osm_physp_get_dr_path_ptr
- ( osm_port_get_default_phys_ptr( p_port ) ),
+ ( p_port->p_physp ),
IB_MAD_ATTR_PORT_INFO,
cl_hton32( p_port->p_physp->port_num ),
CL_DISP_MSGID_NONE, &context );
@@ -261,8 +261,7 @@ __osm_sm_state_mgr_send_master_sm_info_req(
context.smi_context.set_method = FALSE;
status = osm_req_get( p_sm_mgr->p_req,
- osm_physp_get_dr_path_ptr
- ( osm_port_get_default_phys_ptr( p_port ) ),
+ osm_physp_get_dr_path_ptr(p_port->p_physp),
IB_MAD_ATTR_SM_INFO, 0, CL_DISP_MSGID_NONE,
&context );
diff --git a/osm/opensm/osm_state_mgr.c b/osm/opensm/osm_state_mgr.c
index 9aeec74..6681cfc 100644
--- a/osm/opensm/osm_state_mgr.c
+++ b/osm/opensm/osm_state_mgr.c
@@ -849,7 +849,7 @@ __osm_state_mgr_is_sm_port_down(
goto Exit;
}
- p_physp = osm_port_get_default_phys_ptr( p_port );
+ p_physp = p_port->p_physp;
CL_ASSERT( p_physp );
CL_ASSERT( osm_physp_is_valid( p_physp ) );
@@ -914,7 +914,7 @@ __osm_state_mgr_sweep_hop_1(
goto Exit;
}
- p_node = osm_port_get_parent_node( p_port );
+ p_node = p_port->p_node;
CL_ASSERT( p_node );
port_num = ib_node_info_get_local_port_num( &p_node->node_info );
@@ -1277,7 +1277,7 @@ __osm_state_mgr_report(
cl_ntoh64( osm_port_get_guid( p_port ) ) );
}
- p_node = osm_port_get_parent_node( p_port );
+ p_node = p_port->p_node;
node_type = osm_node_get_type( p_node );
if( node_type == IB_NODE_TYPE_SWITCH )
start_port = 0;
@@ -1622,9 +1622,8 @@ __osm_state_mgr_send_handover(
}
status = osm_req_set( p_mgr->p_req,
- osm_physp_get_dr_path_ptr
- ( osm_port_get_default_phys_ptr( p_port ) ), payload,
- sizeof(payload),
+ osm_physp_get_dr_path_ptr(p_port->p_physp),
+ payload, sizeof(payload),
IB_MAD_ATTR_SM_INFO, IB_SMINFO_ATTR_MOD_HANDOVER,
CL_DISP_MSGID_NONE, &context );
diff --git a/osm/opensm/osm_subnet.c b/osm/opensm/osm_subnet.c
index 8e0c53b..0484530 100644
--- a/osm/opensm/osm_subnet.c
+++ b/osm/opensm/osm_subnet.c
@@ -238,7 +238,6 @@ osm_get_gid_by_mad_addr(
{
const cl_ptr_vector_t* p_tbl;
const osm_port_t* p_port = NULL;
- const osm_physp_t* p_physp = NULL;
if ( p_gid == NULL )
{
@@ -266,8 +265,7 @@ osm_get_gid_by_mad_addr(
);
return(IB_INVALID_PARAMETER);
}
- p_physp = osm_port_get_default_phys_ptr( p_port );
- p_gid->unicast.interface_id = p_physp->port_guid;
+ p_gid->unicast.interface_id = p_port->p_physp->port_guid;
p_gid->unicast.prefix = p_subn->opt.subnet_prefix;
}
else
@@ -316,7 +314,7 @@ osm_get_physp_by_mad_addr(
goto Exit;
}
- p_physp = osm_port_get_default_phys_ptr( p_port );
+ p_physp = p_port->p_physp;
}
else
{
diff --git a/osm/opensm/osm_switch.c b/osm/opensm/osm_switch.c
index 9273459..a79f5cd 100644
--- a/osm/opensm/osm_switch.c
+++ b/osm/opensm/osm_switch.c
@@ -291,7 +291,7 @@ osm_switch_recommend_path(
}
else
{
- p_physp = osm_port_get_default_phys_ptr(p_port);
+ p_physp = p_port->p_physp;
if (!p_physp || !p_physp->p_remote_physp ||
!p_physp->p_remote_physp->p_node->sw)
return OSM_NO_PATH;
@@ -566,7 +566,7 @@ osm_switch_get_port_least_hops(
}
else
{
- osm_physp_t *p = osm_port_get_default_phys_ptr(p_port);
+ osm_physp_t *p = p_port->p_physp;
uint8_t hops;
if (!p || !p->p_remote_physp || !p->p_remote_physp->p_node->sw)
@@ -604,7 +604,7 @@ osm_switch_recommend_mcast_path(
}
else
{
- osm_physp_t *p_physp = osm_port_get_default_phys_ptr(p_port);
+ osm_physp_t *p_physp = p_port->p_physp;
if (!p_physp || !p_physp->p_remote_physp ||
!p_physp->p_remote_physp->p_node->sw)
return OSM_NO_PATH;
diff --git a/osm/opensm/osm_ucast_lash.c b/osm/opensm/osm_ucast_lash.c
index 4459d9f..5d32e89 100644
--- a/osm/opensm/osm_ucast_lash.c
+++ b/osm/opensm/osm_ucast_lash.c
@@ -170,7 +170,7 @@ static uint64_t osm_lash_get_switch_guid(IN const osm_switch_t *p_sw)
static osm_switch_t *get_osm_switch_from_port(osm_port_t *port)
{
- osm_physp_t *p = osm_port_get_default_phys_ptr(port);
+ osm_physp_t *p = port->p_physp;
if (p->p_node->sw)
return p->p_node->sw;
else if (p->p_remote_physp->p_node->sw)
diff --git a/osm/opensm/osm_ucast_mgr.c b/osm/opensm/osm_ucast_mgr.c
index 7d3916b..2860e66 100644
--- a/osm/opensm/osm_ucast_mgr.c
+++ b/osm/opensm/osm_ucast_mgr.c
@@ -306,7 +306,7 @@ __osm_ucast_mgr_dump_ucast_routes(
}
else
{
- osm_physp_t *p_physp = osm_port_get_default_phys_ptr(p_port);
+ osm_physp_t *p_physp = p_port->p_physp;
if( !p_physp || !p_physp->p_remote_physp ||
!p_physp->p_remote_physp->p_node->sw )
num_hops = OSM_NO_PATH;
@@ -413,7 +413,7 @@ ucast_mgr_dump_lfts(cl_map_item_t *p_map_item, void *cxt)
p_port = cl_ptr_vector_get(&p_mgr->p_subn->port_lid_tbl, lid);
if (p_port) {
- p_node = osm_port_get_parent_node(p_port);
+ p_node = p_port->p_node;
fprintf(file, "%s portguid 0x016%" PRIx64 ": \'%s\'",
ib_get_node_type_str(osm_node_get_type(p_node)),
cl_ntoh64(osm_port_get_guid(p_port)),
@@ -671,8 +671,7 @@ __osm_ucast_mgr_process_port(
if (!p_mgr->p_subn->opt.port_profile_switch_nodes)
{
is_ignored_by_port_prof |=
- (osm_node_get_type(osm_port_get_parent_node(p_port)) ==
- IB_NODE_TYPE_SWITCH);
+ (osm_node_get_type(p_port->p_node) == IB_NODE_TYPE_SWITCH);
}
}
diff --git a/osm/opensm/osm_ucast_updn.c b/osm/opensm/osm_ucast_updn.c
index b15fe5e..d9446e9 100644
--- a/osm/opensm/osm_ucast_updn.c
+++ b/osm/opensm/osm_ucast_updn.c
@@ -792,7 +792,7 @@ __osm_updn_find_root_nodes_by_min_hop(
p_next_port = (osm_port_t*)cl_qmap_next( &p_next_port->map_item );
if ( osm_node_get_type(p_port->p_node) != IB_NODE_TYPE_SWITCH )
{
- p_physp = osm_port_get_default_phys_ptr(p_port);
+ p_physp = p_port->p_physp;
self_lid_ho = cl_ntoh16( osm_physp_get_base_lid(p_physp) );
numCas++;
/* EZ:
diff --git a/osm/opensm/osm_vl_arb_rcv.c b/osm/opensm/osm_vl_arb_rcv.c
index ed8dfc5..f36751e 100644
--- a/osm/opensm/osm_vl_arb_rcv.c
+++ b/osm/opensm/osm_vl_arb_rcv.c
@@ -171,7 +171,7 @@ osm_vla_rcv_process(
goto Exit;
}
- p_node = osm_port_get_parent_node( p_port );
+ p_node = p_port->p_node;
CL_ASSERT( p_node );
block_num = (uint8_t)(cl_ntoh32(p_smp->attr_mod) >> 16);
@@ -183,7 +183,7 @@ osm_vla_rcv_process(
}
else
{
- p_physp = osm_port_get_default_phys_ptr(p_port);
+ p_physp = p_port->p_physp;
port_num = p_physp->port_num;
}
@@ -239,4 +239,3 @@ osm_vla_rcv_process(
OSM_LOG_EXIT( p_rcv->p_log );
}
-
--
1.5.2.rc2.20.gac2a
More information about the general
mailing list