diff mbox

OpenSM: LFT update breaks if IB_SMP_DATA_SIZE changes

Message ID 1444742750-23875-1-git-send-email-jens.domke@tu-dresden.de (mailing list archive)
State Accepted
Delegated to: Hal Rosenstock
Headers show

Commit Message

Jens Domke Oct. 13, 2015, 1:25 p.m. UTC
This is only a precautionary patch for a theoretical
bug which would arise if someone redefines IB_SMP_DATA_SIZE
to a values !=64.

ucast_mgr_pipeline_fwd_tbl() calculates the max. number of
blocks to update using 64 explicitly, while set_lft_block()
uses IB_SMP_DATA_SIZE.
If IB_SMP_DATA_SIZE != 64 then switches would receive too few
or too many blocks.

Signed-off-by: Jens Domke <jens.domke@tu-dresden.de>
---
 opensm/osm_ucast_mgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hal Rosenstock Oct. 13, 2015, 2:25 p.m. UTC | #1
On 10/13/2015 9:25 AM, Jens Domke wrote:
> This is only a precautionary patch for a theoretical
> bug which would arise if someone redefines IB_SMP_DATA_SIZE
> to a values !=64.
> 
> ucast_mgr_pipeline_fwd_tbl() calculates the max. number of
> blocks to update using 64 explicitly, while set_lft_block()
> uses IB_SMP_DATA_SIZE.
> If IB_SMP_DATA_SIZE != 64 then switches would receive too few
> or too many blocks.
> 
> Signed-off-by: Jens Domke <jens.domke@tu-dresden.de>

Thanks. Applied.

-- Hal
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/opensm/osm_ucast_mgr.c b/opensm/osm_ucast_mgr.c
index 7ccaa77..893a70b 100644
--- a/opensm/osm_ucast_mgr.c
+++ b/opensm/osm_ucast_mgr.c
@@ -1036,7 +1036,7 @@  static void ucast_mgr_pipeline_fwd_tbl(osm_ucast_mgr_t * p_mgr)
 {
 	cl_qmap_t *tbl;
 	cl_map_item_t *item;
-	unsigned i, max_block = p_mgr->max_lid / 64 + 1;
+	unsigned i, max_block = p_mgr->max_lid / IB_SMP_DATA_SIZE + 1;
 
 	tbl = &p_mgr->p_subn->sw_guid_tbl;
 	for (i = 0; i < max_block; i++)