Skip to contentSkip to conversation

opensm: fix LFT allocation size

PATCH New Sasha Khapyorsky 1 participant 1 message Oct 16, 2009 2 messages not in the archive InfiniBand

lore
Share & tools
lore
#2 lore raw

PATCH 1/1 opensm: fix LFT allocation size

In reply to a message not in the archive

Fix LFT allocation size - count zero entry as well.

---
 opensm/opensm/osm_switch.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
opensm/opensm/osm_switch.c +1 -2
index ed0bc66..67e3ede 100644
@@ -497,8 +497,7 @@ static int alloc_lft(IN osm_switch_t * p_sw, uint16_t lids)
 	uint16_t lft_size;
 
 	/* Ensure LFT is in units of LFT block size */
-	lft_size = (lids + IB_SMP_DATA_SIZE - 1) / IB_SMP_DATA_SIZE * IB_SMP_DATA_SIZE;
-
+	lft_size = (lids / IB_SMP_DATA_SIZE + 1) * IB_SMP_DATA_SIZE;
 	if (lft_size > p_sw->lft_size) {
 		uint8_t *new_lft = realloc(p_sw->lft, lft_size);
 		if (!new_lft)
Signature · 5 lines
1.6.5
--
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