[ofa-general] [PATCH] opensm: simplify PortInfo.LinkSpeed setup flow
Sasha Khapyorsky
sashak at voltaire.com
Sat Nov 10 06:50:25 PST 2007
Simplify setup of PortInfo.LinkSpeed setup flow based on
opt.force_link_speed OpenSM option.
Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
opensm/opensm/osm_link_mgr.c | 25 +++++++------------------
1 files changed, 7 insertions(+), 18 deletions(-)
diff --git a/opensm/opensm/osm_link_mgr.c b/opensm/opensm/osm_link_mgr.c
index d5be7b5..19d03d9 100644
--- a/opensm/opensm/osm_link_mgr.c
+++ b/opensm/opensm/osm_link_mgr.c
@@ -312,24 +312,13 @@ __osm_link_mgr_set_physp_pi(IN osm_link_mgr_t * const p_mgr,
sizeof(p_pi->link_width_enabled)))
send_set = TRUE;
- if (p_mgr->p_subn->opt.force_link_speed) {
- if (p_mgr->p_subn->opt.force_link_speed == 15) { /* LinkSpeedSupported */
- if (ib_port_info_get_link_speed_enabled
- (p_old_pi) !=
- ib_port_info_get_link_speed_sup(p_pi))
- ib_port_info_set_link_speed_enabled
- (p_pi,
- IB_PORT_LINK_SPEED_ENABLED_MASK);
- else
- ib_port_info_set_link_speed_enabled
- (p_pi,
- ib_port_info_get_link_speed_enabled
- (p_old_pi));
- } else
- ib_port_info_set_link_speed_enabled(p_pi,
- p_mgr->
- p_subn->opt.
- force_link_speed);
+ if (p_mgr->p_subn->opt.force_link_speed &&
+ (p_mgr->p_subn->opt.force_link_speed != 15 ||
+ ib_port_info_get_link_speed_enabled(p_pi) !=
+ ib_port_info_get_link_speed_sup(p_pi))) {
+ ib_port_info_set_link_speed_enabled(p_pi,
+ p_mgr->p_subn->opt.
+ force_link_speed);
if (memcmp(&p_pi->link_speed, &p_old_pi->link_speed,
sizeof(p_pi->link_speed)))
send_set = TRUE;
--
1.5.3.4.206.g58ba4
More information about the general
mailing list