Skip to contentSkip to conversation

Fixes wrong assertion failed in osm_switch_get_lft_block()

PATCH In review Vangelis Tasoulas 3 participants 5 messages Dec 20, 2014 – Jan 2, 2015 3 messages not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fixes wrong assertion failed in osm_switch_get_lft_block()

From a399cd7398a86b72541c628588365c252882cd80 Mon Sep 17 00:00:00 2001
From: Vangelis Tasoulas <[email protected]>
Date: Sat, 20 Dec 2014 19:10:33 +0100
Subject: [PATCH] Fixes wrong assertion failed in osm_switch_get_lft_block()
when LIDs from the top LFT block (0xbfc0-0xbfff) are used.

---
 opensm/osm_switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
opensm/osm_switch.c +0 -0
index 11efd54..a28ec28 100644
@@ -168,7 +168,7 @@ boolean_t osm_switch_get_lft_block(IN const

osm_switch_t * p_sw,

        if (base_lid_ho > p_sw->max_lid_ho)
                return FALSE;

- CL_ASSERT(base_lid_ho + IB_SMP_DATA_SIZE <= IB_LID_UCAST_END_HO);
+ CL_ASSERT(base_lid_ho + IB_SMP_DATA_SIZE - 1 <=

IB_LID_UCAST_END_HO);
        memcpy(p_block, &(p_sw->lft[base_lid_ho]), IB_SMP_DATA_SIZE);
        return TRUE;

}

Signature · 1 line
1.9.1

From a399cd7398a86b72541c628588365c252882cd80 Mon Sep 17 00:00:00 2001
From: Vangelis Tasoulas <[email protected]>
Date: Sat, 20 Dec 2014 19:10:33 +0100
Subject: [PATCH] Fixes wrong assertion failed in osm_switch_get_lft_block()
when LIDs from the top LFT block (0xbfc0-0xbfff) are used.

---
 opensm/osm_switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
opensm/osm_switch.c +1 -1
index 11efd54..a28ec28 100644
@@ -168,7 +168,7 @@ boolean_t osm_switch_get_lft_block(IN const osm_switch_t * p_sw,
 	if (base_lid_ho > p_sw->max_lid_ho)
 		return FALSE;
 
-	CL_ASSERT(base_lid_ho + IB_SMP_DATA_SIZE <= IB_LID_UCAST_END_HO);
+	CL_ASSERT(base_lid_ho + IB_SMP_DATA_SIZE - 1 <= IB_LID_UCAST_END_HO);
 	memcpy(p_block, &(p_sw->lft[base_lid_ho]), IB_SMP_DATA_SIZE);
 	return TRUE;
 }
Signature · 1 line
1.9.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 15 lines · Vangelis Tasoulas

From a399cd7398a86b72541c628588365c252882cd80 Mon Sep 17 00:00:00 2001
From: Vangelis Tasoulas <[email protected]>
Date: Sat, 20 Dec 2014 19:10:33 +0100
Subject: [PATCH] Fixes wrong assertion failed in osm_switch_get_lft_block()
when LIDs from the top LFT block (0xbfc0-0xbfff) are used.

---
 opensm/osm_switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
opensm/osm_switch.c +0 -0
index 11efd54..a28ec28 100644

opensm/osm_switch.c boolean_t osm_switch_get_lft_block(IN const · line 173

Quoted 7 lines
opensm/osm_switch.c +1 -1
@@ -168,7 +168,7 @@ boolean_t osm_switch_get_lft_block(IN const
 osm_switch_t * p_sw,
        if (base_lid_ho > p_sw->max_lid_ho)
                return FALSE;
 
-       CL_ASSERT(base_lid_ho + IB_SMP_DATA_SIZE <= IB_LID_UCAST_END_HO);
+       CL_ASSERT(base_lid_ho + IB_SMP_DATA_SIZE - 1 <=
 IB_LID_UCAST_END_HO);

What about using IB_LID_MCAST_START_HO (49152) instead of IB_LID_UCAST_END_HO (49151)? No additional arithemtic will be needed then.

Quoted 4 lines
opensm/osm_switch.c +0 -0
        memcpy(p_block, &(p_sw->lft[base_lid_ho]), IB_SMP_DATA_SIZE);
        return TRUE;

}

--
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

A message that is not in the archive (sent off-list or not yet received): 54969BC4.8060400-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org

#4 lore raw
Quoted 20 lines · Ilya Nelkenbaum
Quoted 19 lines · Vangelis Tasoulas

From a399cd7398a86b72541c628588365c252882cd80 Mon Sep 17 00:00:00 2001
From: Vangelis Tasoulas <[email protected]>
Date: Sat, 20 Dec 2014 19:10:33 +0100
Subject: [PATCH] Fixes wrong assertion failed in osm_switch_get_lft_block()
when LIDs from the top LFT block (0xbfc0-0xbfff) are used.

---
 opensm/osm_switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
opensm/osm_switch.c +0 -0
index 11efd54..a28ec28 100644
@@ -168,7 +168,7 @@ boolean_t osm_switch_get_lft_block(IN const
 osm_switch_t * p_sw,
        if (base_lid_ho > p_sw->max_lid_ho)
                return FALSE;
 
Quoted 5 lines

opensm/osm_switch.c boolean_t osm_switch_get_lft_block(IN const · line 173

Quoted 3 lines
opensm/osm_switch.c +1 -1
-       CL_ASSERT(base_lid_ho + IB_SMP_DATA_SIZE <= IB_LID_UCAST_END_HO);
+       CL_ASSERT(base_lid_ho + IB_SMP_DATA_SIZE - 1 <=
 IB_LID_UCAST_END_HO);

What about using IB_LID_MCAST_START_HO (49152) instead of IB_LID_UCAST_END_HO (49151)? No additional arithemtic will be needed then.

This function is about the LFTs and not the MFTs, so having '<= IB_LID_MCAST_START_HO' would look a bit confusing -at least to me- at a first glance due to the equal sign.

Less or equal to the first mcast LID? I understand the less, but why equal?

Quoted 6 lines
Quoted 5 lines
opensm/osm_switch.c +0 -0
        memcpy(p_block, &(p_sw->lft[base_lid_ho]), IB_SMP_DATA_SIZE);
        return TRUE;

}

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 27 lines · Vangelis Tasoulas
Quoted 20 lines · Ilya Nelkenbaum
Quoted 19 lines · Vangelis Tasoulas

From a399cd7398a86b72541c628588365c252882cd80 Mon Sep 17 00:00:00 2001
From: Vangelis Tasoulas <[email protected]>
Date: Sat, 20 Dec 2014 19:10:33 +0100
Subject: [PATCH] Fixes wrong assertion failed in osm_switch_get_lft_block()
when LIDs from the top LFT block (0xbfc0-0xbfff) are used.

---
 opensm/osm_switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
opensm/osm_switch.c +0 -0
index 11efd54..a28ec28 100644
@@ -168,7 +168,7 @@ boolean_t osm_switch_get_lft_block(IN const
 osm_switch_t * p_sw,
        if (base_lid_ho > p_sw->max_lid_ho)
                return FALSE;
 
Quoted 5 lines

opensm/osm_switch.c boolean_t osm_switch_get_lft_block(IN const · line 173

Quoted 3 lines
opensm/osm_switch.c +1 -1
-       CL_ASSERT(base_lid_ho + IB_SMP_DATA_SIZE <= IB_LID_UCAST_END_HO);
+       CL_ASSERT(base_lid_ho + IB_SMP_DATA_SIZE - 1 <=
 IB_LID_UCAST_END_HO);

What about using IB_LID_MCAST_START_HO (49152) instead of IB_LID_UCAST_END_HO (49151)? No additional arithemtic will be needed then.

Quoted 3 lines

This function is about the LFTs and not the MFTs, so having '<= IB_LID_MCAST_START_HO' would look a bit confusing -at least to me- at a first glance due to the equal sign.

Sounds reasonable.

Quoted 11 lines

Less or equal to the first mcast LID? I understand the less, but why equal?

Quoted 6 lines
Quoted 5 lines
opensm/osm_switch.c +0 -0
        memcpy(p_block, &(p_sw->lft[base_lid_ho]), IB_SMP_DATA_SIZE);
        return TRUE;

}

--
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

#7 lore raw
In reply to a message not in the archive
Quoted 5 lines · Vangelis Tasoulas

From a399cd7398a86b72541c628588365c252882cd80 Mon Sep 17 00:00:00 2001
From: Vangelis Tasoulas <[email protected]>
Date: Sat, 20 Dec 2014 19:10:33 +0100
Subject: [PATCH] Fixes wrong assertion failed in osm_switch_get_lft_block()
when LIDs from the top LFT block (0xbfc0-0xbfff) are used.

Thanks. Applied.

-- Hal
--
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