[ofa-general] Re: [PATCH] opensm: eliminate some unneeded PortInfo Set requests
Sasha Khapyorsky
sashak at voltaire.com
Mon Nov 12 13:11:56 PST 2007
>From 3fc4260eb97bbc9af20ed1f401c5925fe245a7c7 Mon Sep 17 00:00:00 2001
From: Sasha Khapyorsky <sashak at voltaire.com>
Date: Sun, 11 Nov 2007 17:49:36 +0200
Subject: [PATCH] opensm/osm_link_mgr: use return status when PortInfo is updated
This adds return status to __osm_link_mgr_set_physp_pi() function
(instead of stored at link_mgr structure flag), which indicates PortInfo
Set request sending.
Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
opensm/include/opensm/osm_link_mgr.h | 5 -----
opensm/opensm/osm_link_mgr.c | 21 ++++++++-------------
2 files changed, 8 insertions(+), 18 deletions(-)
diff --git a/opensm/include/opensm/osm_link_mgr.h b/opensm/include/opensm/osm_link_mgr.h
index 214dd80..11a7352 100644
--- a/opensm/include/opensm/osm_link_mgr.h
+++ b/opensm/include/opensm/osm_link_mgr.h
@@ -98,8 +98,6 @@ typedef struct _osm_link_mgr {
osm_req_t *p_req;
osm_log_t *p_log;
cl_plock_t *p_lock;
- boolean_t send_set_reqs;
-
} osm_link_mgr_t;
/*
* FIELDS
@@ -115,9 +113,6 @@ typedef struct _osm_link_mgr {
* p_lock
* Pointer to the serializing lock.
*
-* send_set_reqs
-* Boolean to indicate whether any set requests sent.
-*
* SEE ALSO
* Link Manager object
*********/
diff --git a/opensm/opensm/osm_link_mgr.c b/opensm/opensm/osm_link_mgr.c
index 768d4c4..6fcff72 100644
--- a/opensm/opensm/osm_link_mgr.c
+++ b/opensm/opensm/osm_link_mgr.c
@@ -102,7 +102,7 @@ osm_link_mgr_init(IN osm_link_mgr_t * const p_mgr,
/**********************************************************************
**********************************************************************/
-static void
+static boolean_t
__osm_link_mgr_set_physp_pi(IN osm_link_mgr_t * const p_mgr,
IN osm_physp_t * const p_physp,
IN uint8_t const port_state)
@@ -381,8 +381,7 @@ __osm_link_mgr_set_physp_pi(IN osm_link_mgr_t * const p_mgr,
&& p_mgr->p_subn->first_time_master_sweep == TRUE)
send_set = TRUE;
- if (send_set) {
- p_mgr->send_set_reqs = TRUE;
+ if (send_set)
status = osm_req_set(p_mgr->p_req,
osm_physp_get_dr_path_ptr(p_physp),
payload,
@@ -390,10 +389,10 @@ __osm_link_mgr_set_physp_pi(IN osm_link_mgr_t * const p_mgr,
IB_MAD_ATTR_PORT_INFO,
cl_hton32(port_num),
CL_DISP_MSGID_NONE, &context);
- }
Exit:
OSM_LOG_EXIT(p_mgr->p_log);
+ return send_set;
}
/**********************************************************************
@@ -435,7 +434,6 @@ __osm_link_mgr_process_node(IN osm_link_mgr_t * const p_mgr,
continue;
current_state = osm_physp_get_port_state(p_physp);
-
if (current_state == IB_LINK_DOWN)
continue;
@@ -444,19 +442,16 @@ __osm_link_mgr_process_node(IN osm_link_mgr_t * const p_mgr,
then required state. However, we need to send update if
no state change required.
*/
- if ((link_state == IB_LINK_NO_CHANGE) ||
- (current_state < link_state)) {
- p_mgr->send_set_reqs = FALSE;
- __osm_link_mgr_set_physp_pi(p_mgr, p_physp, link_state);
-
- if (p_mgr->send_set_reqs == TRUE)
- signal = OSM_SIGNAL_DONE_PENDING;
- } else if (osm_log_is_active(p_mgr->p_log, OSM_LOG_DEBUG))
+ if (link_state != IB_LINK_NO_CHANGE &&
+ link_state <= current_state)
osm_log(p_mgr->p_log, OSM_LOG_DEBUG,
"__osm_link_mgr_process_node: "
"Physical port 0x%X already %s. Skipping\n",
p_physp->port_num,
ib_get_port_state_str(current_state));
+ else if (__osm_link_mgr_set_physp_pi(p_mgr, p_physp,
+ link_state))
+ signal = OSM_SIGNAL_DONE_PENDING;
}
OSM_LOG_EXIT(p_mgr->p_log);
--
1.5.3.rc2.29.gc4640f
More information about the general
mailing list