osm_port_info_rcv.c: Fixed calculation of min_data_vls
PATCH 1/1 osm_port_info_rcv.c: Fixed calculation of min_data_vls
From: Tomer Cohen <tomerco-VPRAkNaXOzVWk0Htik3J/[email protected]>
Date: Sun, 13 Apr 2014 15:26:47 +0300
Bug description:
opensm is not using future value of op_vls when calculating subnet's minimal op_vl. opensm calculates minimal op_vls (sm->p_subn->min_data_vl) when receiving pi mads, and the linkmgr might update that port's op_vls according to it's vl_cap. as a result, routing engines that depends on the minimal op_vls (such as torus) might fail on the first heavy sweep. for example, if in the fabric there is a port with op_vls = 1. vl_cap = 5, peer port vl_cap = 5. tours routing engine would fail on first sweep.
Fix: now the calculation is done respective to vl_cap and max_op_vls
--- opensm/osm_port_info_rcv.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
opensm/osm_port_info_rcv.c +6 -2
@@ -115,7 +115,9 @@ static void pi_rcv_process_endport(IN osm_sm_t * sm, IN osm_physp_t * p_physp, sm->p_subn->min_ca_rate = rate; } - data_vls =1U << (ib_port_info_get_op_vls (p_pi) -1 ); + data_vls =1U << (ib_port_info_get_vl_cap (p_pi) -1 ); +if (data_vls > sm->p_subn->opt.max_op_vls) + data_vls = sm->p_subn->opt.max_op_vls;if (data_vls >=IB_MAX_NUM_VLS ) data_vls =IB_MAX_NUM_VLS -1 ;if ((uint8_t )data_vls < sm->p_subn->min_data_vls) {
@@ -416,7 +418,9 @@ static void pi_rcv_process_switch_ext_port(IN osm_sm_t * sm,if (p_remote_physp) { p_remote_node =osm_physp_get_node_ptr (p_remote_physp);if (p_remote_node->sw) { - data_vls =1U << (ib_port_info_get_op_vls (p_pi) -1 ); + data_vls =1U << (ib_port_info_get_vl_cap (p_pi) -1 ); +if (data_vls > sm->p_subn->opt.max_op_vls) + data_vls = sm->p_subn->opt.max_op_vls;if (data_vls >=IB_MAX_NUM_VLS ) data_vls =IB_MAX_NUM_VLS -1 ;if ((uint8_t )data_vls < sm->p_subn->min_sw_data_vls) {
Signature · 6 lines
1.7.8.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html