[ofa-general] [PATCH 1/3] opensm: remove osm_port_get_num_physp() function

Sasha Khapyorsky sashak at voltaire.com
Wed May 9 13:30:23 PDT 2007


This removes osm_port_get_num_physp() function and instead uses native
node oriented osm_node_get_num_physp().

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 osm/include/opensm/osm_port.h       |   29 -----------------------------
 osm/opensm/osm_drop_mgr.c           |    2 +-
 osm/opensm/osm_link_mgr.c           |    2 +-
 osm/opensm/osm_qos.c                |    2 +-
 osm/opensm/osm_sa_link_record.c     |    8 ++++----
 osm/opensm/osm_sa_pkey_record.c     |    6 +++---
 osm/opensm/osm_sa_portinfo_record.c |    2 +-
 osm/opensm/osm_sa_slvl_record.c     |    2 +-
 osm/opensm/osm_sa_vlarb_record.c    |    6 +++---
 osm/opensm/osm_state_mgr.c          |    2 +-
 osm/opensm/osm_trap_rcv.c           |    2 +-
 11 files changed, 17 insertions(+), 46 deletions(-)

diff --git a/osm/include/opensm/osm_port.h b/osm/include/opensm/osm_port.h
index 6d51d2b..134012c 100644
--- a/osm/include/opensm/osm_port.h
+++ b/osm/include/opensm/osm_port.h
@@ -1467,35 +1467,6 @@ osm_port_get_guid(
 *	Port
 *********/
 
-/****f* OpenSM: Port/osm_port_get_num_physp
-* NAME
-*	osm_port_get_num_physp
-*
-* DESCRIPTION
-*	Returns the number of Physical Port objects associated with this port.
-*
-* SYNOPSIS
-*/
-static inline uint8_t
-osm_port_get_num_physp(
-	IN const osm_port_t* const p_port )
-{
-	return( p_port->physp_tbl_size );
-}
-/*
-* PARAMETERS
-*	p_port
-*		[in] Pointer to a Port object.
-*
-* RETURN VALUE
-*	Returns the number of Physical Port objects associated with this port.
-*
-* NOTES
-*
-* SEE ALSO
-*	Port
-*********/
-
 /****f* OpenSM: Port/osm_port_get_phys_ptr
 * NAME
 *	osm_port_get_phys_ptr
diff --git a/osm/opensm/osm_drop_mgr.c b/osm/opensm/osm_drop_mgr.c
index 0d08ff6..d091347 100644
--- a/osm/opensm/osm_drop_mgr.c
+++ b/osm/opensm/osm_drop_mgr.c
@@ -237,7 +237,7 @@ __osm_drop_mgr_remove_port(
     Re-initialize each Physical Port.
   */
 
-  num_physp = osm_port_get_num_physp( p_port );
+  num_physp = osm_node_get_num_physp( p_port->p_node );
   for( port_num = 0; port_num < num_physp; port_num++ )
   {
     p_physp = osm_port_get_phys_ptr( p_port, (uint8_t)port_num );
diff --git a/osm/opensm/osm_link_mgr.c b/osm/opensm/osm_link_mgr.c
index a1081bd..71c0495 100644
--- a/osm/opensm/osm_link_mgr.c
+++ b/osm/opensm/osm_link_mgr.c
@@ -426,7 +426,7 @@ __osm_link_mgr_process_port(
     with this Port.  Start iterating with port 1, since the linkstate
     is not applicable to the management port on switches.
   */
-  num_physp = osm_port_get_num_physp( p_port );
+  num_physp = osm_node_get_num_physp( p_port->p_node );
   for( i = 0; i < num_physp; i ++ )
   {
     /*
diff --git a/osm/opensm/osm_qos.c b/osm/opensm/osm_qos.c
index e71c053..11beaae 100644
--- a/osm/opensm/osm_qos.c
+++ b/osm/opensm/osm_qos.c
@@ -334,7 +334,7 @@ osm_signal_t osm_qos_setup(osm_opensm_t * p_osm)
 
 		p_node = p_port->p_node;
 		if (p_node->sw) {
-			num_physp = osm_port_get_num_physp(p_port);
+			num_physp = osm_node_get_num_physp(p_node);
 			for (i = 1; i < num_physp; i++) {
 				p_physp = osm_port_get_phys_ptr(p_port, i);
 				if (!p_physp || !osm_physp_is_valid(p_physp))
diff --git a/osm/opensm/osm_sa_link_record.c b/osm/opensm/osm_sa_link_record.c
index 169e75e..18f655c 100644
--- a/osm/opensm/osm_sa_link_record.c
+++ b/osm/opensm/osm_sa_link_record.c
@@ -346,8 +346,8 @@ __osm_lr_rcv_get_port_links(
         that do not actually connect.  Don't bother screening
         for that here.
       */
-      num_ports = osm_port_get_num_physp( p_src_port );
-      dest_num_ports = osm_port_get_num_physp( p_dest_port );
+      num_ports = osm_node_get_num_physp( p_src_port->p_node );
+      dest_num_ports = osm_node_get_num_physp( p_dest_port->p_node );
       for( port_num = 1; port_num < num_ports; port_num++ )
       {
         p_src_physp = osm_port_get_phys_ptr( p_src_port, port_num );
@@ -385,7 +385,7 @@ __osm_lr_rcv_get_port_links(
       }
       else
       {
-        num_ports = osm_port_get_num_physp( p_src_port );
+        num_ports = osm_node_get_num_physp( p_src_port->p_node );
         for( port_num = 1; port_num < num_ports; port_num++ )
         {
           p_src_physp = osm_port_get_phys_ptr( p_src_port, port_num );
@@ -421,7 +421,7 @@ __osm_lr_rcv_get_port_links(
       }
       else
       {
-        num_ports = osm_port_get_num_physp( p_dest_port );
+        num_ports = osm_node_get_num_physp( p_dest_port->p_node );
         for( port_num = 1; port_num < num_ports; port_num++ )
         {
           p_dest_physp = osm_port_get_phys_ptr(
diff --git a/osm/opensm/osm_sa_pkey_record.c b/osm/opensm/osm_sa_pkey_record.c
index 5eb15df..0a199f1 100644
--- a/osm/opensm/osm_sa_pkey_record.c
+++ b/osm/opensm/osm_sa_pkey_record.c
@@ -249,7 +249,7 @@ __osm_sa_pkey_by_comp_mask(
 
   if( comp_mask & IB_PKEY_COMPMASK_PORT )
   {
-    if (port_num < osm_port_get_num_physp( p_port ))
+    if (port_num < osm_node_get_num_physp( p_port->p_node ))
     {
       p_physp = osm_port_get_phys_ptr( p_port, port_num );
       /* Check that the p_physp is valid, and that is shares a pkey
@@ -263,13 +263,13 @@ __osm_sa_pkey_by_comp_mask(
       osm_log( p_rcv->p_log, OSM_LOG_ERROR,
                "__osm_sa_pkey_by_comp_mask: ERR 4603: "
                "Given Physical Port Number: 0x%X is out of range should be < 0x%X\n",
-               port_num, osm_port_get_num_physp( p_port ));
+               port_num, osm_node_get_num_physp( p_port->p_node ));
       goto Exit;
     }
   }
   else
   {
-    num_ports = osm_port_get_num_physp( p_port );
+    num_ports = osm_node_get_num_physp( p_port->p_node );
     for( port_num = 0; port_num < num_ports; port_num++ )
     {
       p_physp = osm_port_get_phys_ptr( p_port, port_num );
diff --git a/osm/opensm/osm_sa_portinfo_record.c b/osm/opensm/osm_sa_portinfo_record.c
index 5d9b1b2..9d4f18e 100644
--- a/osm/opensm/osm_sa_portinfo_record.c
+++ b/osm/opensm/osm_sa_portinfo_record.c
@@ -538,7 +538,7 @@ __osm_sa_pir_by_comp_mask(
   comp_mask = p_ctxt->comp_mask;
   p_req_physp = p_ctxt->p_req_physp;
 
-  num_ports = osm_port_get_num_physp( p_port );
+  num_ports = osm_node_get_num_physp( p_port->p_node );
 
   if( comp_mask & IB_PIR_COMPMASK_PORTNUM )
   {
diff --git a/osm/opensm/osm_sa_slvl_record.c b/osm/opensm/osm_sa_slvl_record.c
index d831ffd..3c4ff02 100644
--- a/osm/opensm/osm_sa_slvl_record.c
+++ b/osm/opensm/osm_sa_slvl_record.c
@@ -213,7 +213,7 @@ __osm_sa_slvl_by_comp_mask(
 
   p_rcvd_rec = p_ctxt->p_rcvd_rec;
   comp_mask = p_ctxt->comp_mask;
-  num_ports = osm_port_get_num_physp( p_port );
+  num_ports = osm_node_get_num_physp( p_port->p_node );
   in_port_start = 0;
   in_port_end = num_ports;
   out_port_start = 0;
diff --git a/osm/opensm/osm_sa_vlarb_record.c b/osm/opensm/osm_sa_vlarb_record.c
index f0ff957..6df5ed9 100644
--- a/osm/opensm/osm_sa_vlarb_record.c
+++ b/osm/opensm/osm_sa_vlarb_record.c
@@ -253,7 +253,7 @@ __osm_sa_vl_arb_by_comp_mask(
 
   if( comp_mask & IB_VLA_COMPMASK_OUT_PORT )
   {
-    if (port_num < osm_port_get_num_physp( p_port ))
+    if (port_num < osm_node_get_num_physp( p_port->p_node ))
     {
       p_physp = osm_port_get_phys_ptr( p_port, port_num );
       /* check that the p_physp is valid, and that the requester
@@ -267,13 +267,13 @@ __osm_sa_vl_arb_by_comp_mask(
       osm_log( p_rcv->p_log, OSM_LOG_ERROR,
                "__osm_sa_vl_arb_by_comp_mask: ERR 2A03: "
                "Given Physical Port Number: 0x%X is out of range should be < 0x%X\n",
-               port_num, osm_port_get_num_physp( p_port ) );
+               port_num, osm_node_get_num_physp( p_port->p_node ) );
       goto Exit;
     }
   }
   else
   {
-    num_ports = osm_port_get_num_physp( p_port );
+    num_ports = osm_node_get_num_physp( p_port->p_node );
     for( port_num = 0; port_num < num_ports; port_num++ )
     {
       p_physp = osm_port_get_phys_ptr( p_port, port_num );
diff --git a/osm/opensm/osm_state_mgr.c b/osm/opensm/osm_state_mgr.c
index ddec10c..6f53e60 100644
--- a/osm/opensm/osm_state_mgr.c
+++ b/osm/opensm/osm_state_mgr.c
@@ -1284,7 +1284,7 @@ __osm_state_mgr_report(
       else
          start_port = 1;
 
-      num_ports = osm_port_get_num_physp( p_port );
+      num_ports = osm_node_get_num_physp( p_node );
       for( port_num = start_port; port_num < num_ports; port_num++ )
       {
          p_physp = osm_port_get_phys_ptr( p_port, port_num );
diff --git a/osm/opensm/osm_trap_rcv.c b/osm/opensm/osm_trap_rcv.c
index 0858968..ed507b6 100644
--- a/osm/opensm/osm_trap_rcv.c
+++ b/osm/opensm/osm_trap_rcv.c
@@ -108,7 +108,7 @@ __get_physp_by_lid_and_num(
   if (! p_port)
     return NULL;
 
-  if (osm_port_get_num_physp(p_port) < num)
+  if (osm_node_get_num_physp(p_port->p_node) < num)
     return NULL;
 
   return( osm_port_get_phys_ptr(p_port, num) );
-- 
1.5.2.rc2.20.gac2a




More information about the general mailing list