opensm/osm_mcast_tbl.c: Fix multicast group removal
PATCH 1/1 opensm/osm_mcast_tbl.c: Fix multicast group removal
Revert de3171043b3cbe078e410351a00e5756509bd514 and some of 537d67b19a4b72d72341e529f611e4e30754f8fc
In osm_mcast_tbl_realloc, don't change max_mlid_ho when mlid_offset < p_tbl->mft_depth Also, restore some checks when mlid_offset >= p_tbl->mft_depth
These changes are needed for proper group removal
---
opensm/opensm/osm_mcast_tbl.c +8 -2
@@ -122,7 +122,7 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset)uint16_t (*p_mask_tbl)[][IB_MCAST_POSITION_MAX ];if (mlid_offset < p_tbl->mft_depth) - goto done; +return 0 ;/* The number of bytes needed in the mask table is:
@@ -144,7 +144,6 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset) size - p_tbl->mft_depth * (IB_MCAST_POSITION_MAX + 1) * IB_MCAST_MASK_SIZE / 8); p_tbl->p_mask_tbl = p_mask_tbl; p_tbl->mft_depth = mft_depth; -done: p_tbl->max_mlid_ho = mlid_offset +IB_LID_MCAST_START_HO ;return 0 ; }
@@ -167,6 +166,9 @@ boolean_t osm_mcast_tbl_is_port(IN const osm_mcast_tbl_t * p_tbl,CL_ASSERT (mlid_ho <= p_tbl->max_mlid_ho); mlid_offset = mlid_ho -IB_LID_MCAST_START_HO ; +if (mlid_offset >= p_tbl->mft_depth) +return FALSE; + mask_offset = port_num /IB_MCAST_MASK_SIZE ; bit_mask =cl_ntoh16 ((uint16_t ) (1 << (port_num %IB_MCAST_MASK_SIZE )));
@@ -194,6 +196,8 @@ boolean_t osm_mcast_tbl_is_any_port(IN const osm_mcast_tbl_t * p_tbl,CL_ASSERT (mlid_ho <= p_tbl->max_mlid_ho); mlid_offset = mlid_ho -IB_LID_MCAST_START_HO ; +if (mlid_offset >= p_tbl->mft_depth) +return FALSE;for (position =0 ; position <= p_tbl->max_position; position++) result |= (*p_tbl->p_mask_tbl)[mlid_offset][position];
@@ -247,6 +251,8 @@ void osm_mcast_tbl_clear_mlid(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho)if (p_tbl->p_mask_tbl && mlid_ho <= p_tbl->max_mlid_ho) { mlid_offset = mlid_ho -IB_LID_MCAST_START_HO ; +if (mlid_offset >= p_tbl->mft_depth) +return ;for (i =0 ; i <= p_tbl->max_position; i++) (*p_tbl->p_mask_tbl)[mlid_offset][i] =0 ; }
--
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): [email protected]
This patch causes this assert again...
OpenSM $ opensm: osm_mcast_tbl.c:104: osm_mcast_tbl_set: Assertion `mlid_ho <= p_tbl->max_mlid_ho' failed. Aborted (core dumped)
I thought the -1 was required...
opensm/opensm/osm_mcast_tbl.c +1 -1
@@ -144,7 +144,7 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset) size - p_tbl->mft_depth * (IB_MCAST_POSITION_MAX + 1) * IB_MCAST_MASK_SIZE / 8); p_tbl->p_mask_tbl = p_mask_tbl; p_tbl->mft_depth = mft_depth; - p_tbl->max_mlid_ho = mlid_offset +IB_LID_MCAST_START_HO ; + p_tbl->max_mlid_ho = mlid_offset +IB_LID_MCAST_START_HO -1 ;return 0 ; }
But this did not fix it... I would dig further but I am kind of busy today, sorry.
Ira
Quoted 64 lines · On Fri, 30 Oct 2009 09:49:19 -0500 Hal Rosenstock…
Revert
de3171043b3cbe078e410351a00e5756509bd514and some of537d67b19a4b72d72341e529f611e4e30754f8fcIn
osm_mcast_tbl_realloc, don't changemax_mlid_howhenmlid_offset<p_tbl->mft_depthAlso, restore some checks whenmlid_offset>=p_tbl->mft_depth
These changes are needed for proper group removalSigned-off-by Hal Rosenstock <[email protected]>---
opensm/opensm/osm_mcast_tbl.c +8
-3@@ -122,7 +122,7 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset)uint16_t (*p_mask_tbl)[][IB_MCAST_POSITION_MAX ];if (mlid_offset < p_tbl->mft_depth) - goto done; +return 0 ;/* The number of bytes needed in the mask table is: @@ -144,7 +144,6 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset) size - p_tbl->mft_depth * (IB_MCAST_POSITION_MAX + 1) * IB_MCAST_MASK_SIZE / 8); p_tbl->p_mask_tbl = p_mask_tbl; p_tbl->mft_depth = mft_depth; -done: p_tbl->max_mlid_ho = mlid_offset +IB_LID_MCAST_START_HO ;return 0 ; }@@ -167,6 +166,9 @@ boolean_t osm_mcast_tbl_is_port(IN const osm_mcast_tbl_t * p_tbl,CL_ASSERT (mlid_ho <= p_tbl->max_mlid_ho); mlid_offset = mlid_ho -IB_LID_MCAST_START_HO ; +if (mlid_offset >= p_tbl->mft_depth) +return FALSE; + mask_offset = port_num /IB_MCAST_MASK_SIZE ; bit_mask =cl_ntoh16 ((uint16_t ) (1 << (port_num %IB_MCAST_MASK_SIZE )));@@ -194,6 +196,8 @@ boolean_t osm_mcast_tbl_is_any_port(IN const osm_mcast_tbl_t * p_tbl,CL_ASSERT (mlid_ho <= p_tbl->max_mlid_ho); mlid_offset = mlid_ho -IB_LID_MCAST_START_HO ; +if (mlid_offset >= p_tbl->mft_depth) +return FALSE;for (position =0 ; position <= p_tbl->max_position; position++) result |= (*p_tbl->p_mask_tbl)[mlid_offset][position];@@ -247,6 +251,8 @@ void osm_mcast_tbl_clear_mlid(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho)if (p_tbl->p_mask_tbl && mlid_ho <= p_tbl->max_mlid_ho) { mlid_offset = mlid_ho -IB_LID_MCAST_START_HO ; +if (mlid_offset >= p_tbl->mft_depth) +return ;for (i =0 ; i <= p_tbl->max_position; i++) (*p_tbl->p_mask_tbl)[mlid_offset][i] =0 ; } --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
Signature · 9 lines
Ira Weiny Math Programmer/Computer Scientist Lawrence Livermore National Lab 925-423-8008 [email protected] -- 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): [email protected]
perhaps that should have been +1?
Not really thinking today either... ;-)
Ira
Quoted 100 lines · On Fri, 30 Oct 2009 10:26:49 -0700 Ira Weiny…
This patch causes this assert again...
OpenSM $ opensm: osm_mcast_tbl.c:104:
osm_mcast_tbl_set: Assertion `mlid_ho <=p_tbl->max_mlid_ho' failed. Aborted (core dumped)I thought the -1 was required...
opensm/opensm/osm_mcast_tbl.c +1
-1@@ -144,7 +144,7 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset) size - p_tbl->mft_depth * (IB_MCAST_POSITION_MAX + 1) * IB_MCAST_MASK_SIZE / 8); p_tbl->p_mask_tbl = p_mask_tbl; p_tbl->mft_depth = mft_depth; - p_tbl->max_mlid_ho = mlid_offset +IB_LID_MCAST_START_HO ; + p_tbl->max_mlid_ho = mlid_offset +IB_LID_MCAST_START_HO -1 ;return 0 ; }But this did not fix it... I would dig further but I am kind of busy today, sorry.
Ira
Quoted 64 lines · On Fri, 30 Oct 2009 09:49:19 -0500 Hal Rosenstock…
Revert
de3171043b3cbe078e410351a00e5756509bd514and some of537d67b19a4b72d72341e529f611e4e30754f8fcIn
osm_mcast_tbl_realloc, don't changemax_mlid_howhenmlid_offset<p_tbl->mft_depthAlso, restore some checks whenmlid_offset>=p_tbl->mft_depth
These changes are needed for proper group removalSigned-off-by Hal Rosenstock <[email protected]>---
opensm/opensm/osm_mcast_tbl.c +8
-3@@ -122,7 +122,7 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset)uint16_t (*p_mask_tbl)[][IB_MCAST_POSITION_MAX ];if (mlid_offset < p_tbl->mft_depth) - goto done; +return 0 ;/* The number of bytes needed in the mask table is: @@ -144,7 +144,6 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset) size - p_tbl->mft_depth * (IB_MCAST_POSITION_MAX + 1) * IB_MCAST_MASK_SIZE / 8); p_tbl->p_mask_tbl = p_mask_tbl; p_tbl->mft_depth = mft_depth; -done: p_tbl->max_mlid_ho = mlid_offset +IB_LID_MCAST_START_HO ;return 0 ; }@@ -167,6 +166,9 @@ boolean_t osm_mcast_tbl_is_port(IN const osm_mcast_tbl_t * p_tbl,CL_ASSERT (mlid_ho <= p_tbl->max_mlid_ho); mlid_offset = mlid_ho -IB_LID_MCAST_START_HO ; +if (mlid_offset >= p_tbl->mft_depth) +return FALSE; + mask_offset = port_num /IB_MCAST_MASK_SIZE ; bit_mask =cl_ntoh16 ((uint16_t ) (1 << (port_num %IB_MCAST_MASK_SIZE )));@@ -194,6 +196,8 @@ boolean_t osm_mcast_tbl_is_any_port(IN const osm_mcast_tbl_t * p_tbl,CL_ASSERT (mlid_ho <= p_tbl->max_mlid_ho); mlid_offset = mlid_ho -IB_LID_MCAST_START_HO ; +if (mlid_offset >= p_tbl->mft_depth) +return FALSE;for (position =0 ; position <= p_tbl->max_position; position++) result |= (*p_tbl->p_mask_tbl)[mlid_offset][position];@@ -247,6 +251,8 @@ void osm_mcast_tbl_clear_mlid(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho)if (p_tbl->p_mask_tbl && mlid_ho <= p_tbl->max_mlid_ho) { mlid_offset = mlid_ho -IB_LID_MCAST_START_HO ; +if (mlid_offset >= p_tbl->mft_depth) +return ;for (i =0 ; i <= p_tbl->max_position; i++) (*p_tbl->p_mask_tbl)[mlid_offset][i] =0 ; } --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
Signature · 5 lines
Ira Weiny Math Programmer/Computer Scientist Lawrence Livermore National Lab 925-423-8008 [email protected]
Signature · 9 lines
Ira Weiny Math Programmer/Computer Scientist Lawrence Livermore National Lab 925-423-8008 [email protected] -- 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
Quoted 6 lines · Ira Weiny
This patch causes this assert again...
OpenSM $ opensm: osm_mcast_tbl.c:104:
osm_mcast_tbl_set: Assertion `mlid_ho <=p_tbl->max_mlid_ho' failed. Aborted (core dumped)I thought the -1 was required...
I didn't mean to change that.. New version shortly...
Quoted 90 lines
opensm/opensm/osm_mcast_tbl.c +1
-1@@ -144,7 +144,7 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset) size - p_tbl->mft_depth * (IB_MCAST_POSITION_MAX + 1) * IB_MCAST_MASK_SIZE / 8); p_tbl->p_mask_tbl = p_mask_tbl; p_tbl->mft_depth = mft_depth; - p_tbl->max_mlid_ho = mlid_offset + IB_LID_MCAST_START_HO; + p_tbl->max_mlid_ho = mlid_offset + IB_LID_MCAST_START_HO - 1; return 0; }But this did not fix it... I would dig further but I am kind of busy today, sorry.
Ira
Quoted 60 lines · On Fri, 30 Oct 2009 09:49:19 -0500 Hal Rosenstock…
Revert
de3171043b3cbe078e410351a00e5756509bd514and some of537d67b19a4b72d72341e529f611e4e30754f8fcIn
osm_mcast_tbl_realloc, don't changemax_mlid_howhenmlid_offset<p_tbl->mft_depthAlso, restore some checks whenmlid_offset>=p_tbl->mft_depth
These changes are needed for proper group removalSigned-off-by Hal Rosenstock <[email protected]>---
opensm/opensm/osm_mcast_tbl.c +1
-1@@ -122,7 +122,7 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset) uint16_t (*p_mask_tbl)[][IB_MCAST_POSITION_MAX]; if (mlid_offset < p_tbl->mft_depth) - goto done; + return 0; /*The number of bytes needed in the mask table is:
opensm/opensm/osm_mcast_tbl.c +7
-2@@ -144,7 +144,6 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset) size - p_tbl->mft_depth * (IB_MCAST_POSITION_MAX + 1) * IB_MCAST_MASK_SIZE / 8); p_tbl->p_mask_tbl = p_mask_tbl; p_tbl->mft_depth = mft_depth; -done: p_tbl->max_mlid_ho = mlid_offset + IB_LID_MCAST_START_HO; return 0; }@@ -167,6 +166,9 @@ boolean_t osm_mcast_tbl_is_port(IN const osm_mcast_tbl_t * p_tbl, CL_ASSERT(mlid_ho <= p_tbl->max_mlid_ho); mlid_offset = mlid_ho - IB_LID_MCAST_START_HO; + if (mlid_offset >= p_tbl->mft_depth) + return FALSE; + mask_offset = port_num / IB_MCAST_MASK_SIZE; bit_mask = cl_ntoh16((uint16_t) (1 << (port_num % IB_MCAST_MASK_SIZE)));@@ -194,6 +196,8 @@ boolean_t osm_mcast_tbl_is_any_port(IN const osm_mcast_tbl_t * p_tbl, CL_ASSERT(mlid_ho <= p_tbl->max_mlid_ho); mlid_offset = mlid_ho - IB_LID_MCAST_START_HO; + if (mlid_offset >= p_tbl->mft_depth) + return FALSE; for (position = 0; position <= p_tbl->max_position; position++) result |= (*p_tbl->p_mask_tbl)[mlid_offset][position];@@ -247,6 +251,8 @@ void osm_mcast_tbl_clear_mlid(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho) if (p_tbl->p_mask_tbl && mlid_ho <= p_tbl->max_mlid_ho) { mlid_offset = mlid_ho - IB_LID_MCAST_START_HO; + if (mlid_offset >= p_tbl->mft_depth) + return; for (i = 0; i <= p_tbl->max_position; i++) (*p_tbl->p_mask_tbl)[mlid_offset][i] = 0; } --Quoted 4 lines
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
--
Ira Weiny
Quoted 9 lines
Math Programmer/Computer Scientist
Lawrence Livermore National Lab
925-423-8008
[email protected]
--
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
--
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): f0e08f230910301033w2814ef9dje6164d9652fb624a-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 9 lines · Hal Rosenstock
Quoted 6 lines · Ira Weiny
This patch causes this assert again...
OpenSM $ opensm: osm_mcast_tbl.c:104:
osm_mcast_tbl_set: Assertion `mlid_ho <=p_tbl->max_mlid_ho' failed. Aborted (core dumped)I thought the -1 was required...
I didn't mean to change that..
I didn't change that. The -1 was eliminated by commit 52a1ce536a9054273c427ef0edd15a657beaa735
There's something else in terms of this patch which needs changing. I'll run with the asserts to see...
-- Hal
Quoted 92 lines
Quoted 92 lines
opensm/opensm/osm_mcast_tbl.c +1
-1@@ -144,7 +144,7 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset) size - p_tbl->mft_depth * (IB_MCAST_POSITION_MAX + 1) * IB_MCAST_MASK_SIZE / 8); p_tbl->p_mask_tbl = p_mask_tbl; p_tbl->mft_depth = mft_depth; - p_tbl->max_mlid_ho = mlid_offset +IB_LID_MCAST_START_HO ; + p_tbl->max_mlid_ho = mlid_offset +IB_LID_MCAST_START_HO -1 ;return 0 ; }But this did not fix it... I would dig further but I am kind of busy today, sorry.
Ira
Quoted 60 lines · On Fri, 30 Oct 2009 09:49:19 -0500 Hal Rosenstock…
Revert
de3171043b3cbe078e410351a00e5756509bd514and some of537d67b19a4b72d72341e529f611e4e30754f8fcIn
osm_mcast_tbl_realloc, don't changemax_mlid_howhenmlid_offset<p_tbl->mft_depthAlso, restore some checks whenmlid_offset>=p_tbl->mft_depth
These changes are needed for proper group removalSigned-off-by Hal Rosenstock <[email protected]>---
opensm/opensm/osm_mcast_tbl.c +8
-3@@ -122,7 +122,7 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset)uint16_t (*p_mask_tbl)[][IB_MCAST_POSITION_MAX ];if (mlid_offset < p_tbl->mft_depth) - goto done; +return 0 ;/* The number of bytes needed in the mask table is: @@ -144,7 +144,6 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset) size - p_tbl->mft_depth * (IB_MCAST_POSITION_MAX + 1) * IB_MCAST_MASK_SIZE / 8); p_tbl->p_mask_tbl = p_mask_tbl; p_tbl->mft_depth = mft_depth; -done: p_tbl->max_mlid_ho = mlid_offset +IB_LID_MCAST_START_HO ;return 0 ; }@@ -167,6 +166,9 @@ boolean_t osm_mcast_tbl_is_port(IN const osm_mcast_tbl_t * p_tbl,CL_ASSERT (mlid_ho <= p_tbl->max_mlid_ho); mlid_offset = mlid_ho -IB_LID_MCAST_START_HO ; +if (mlid_offset >= p_tbl->mft_depth) +return FALSE; + mask_offset = port_num /IB_MCAST_MASK_SIZE ; bit_mask =cl_ntoh16 ((uint16_t ) (1 << (port_num %IB_MCAST_MASK_SIZE )));@@ -194,6 +196,8 @@ boolean_t osm_mcast_tbl_is_any_port(IN const osm_mcast_tbl_t * p_tbl,CL_ASSERT (mlid_ho <= p_tbl->max_mlid_ho); mlid_offset = mlid_ho -IB_LID_MCAST_START_HO ; +if (mlid_offset >= p_tbl->mft_depth) +return FALSE;for (position =0 ; position <= p_tbl->max_position; position++) result |= (*p_tbl->p_mask_tbl)[mlid_offset][position];@@ -247,6 +251,8 @@ void osm_mcast_tbl_clear_mlid(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho)if (p_tbl->p_mask_tbl && mlid_ho <= p_tbl->max_mlid_ho) { mlid_offset = mlid_ho -IB_LID_MCAST_START_HO ; +if (mlid_offset >= p_tbl->mft_depth) +return ;for (i =0 ; i <= p_tbl->max_position; i++) (*p_tbl->p_mask_tbl)[mlid_offset][i] =0 ; } --Quoted 4 lines
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
--
Ira Weiny
Math Programmer/Computer Scientist
Quoted 9 lines
Quoted 8 lines
Lawrence Livermore National Lab
925-423-8008
[email protected]
--
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
--
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
Quoted 6 lines · Ira Weiny
This patch causes this assert again...
OpenSM $ opensm: osm_mcast_tbl.c:104:
osm_mcast_tbl_set: Assertion `mlid_ho <=p_tbl->max_mlid_ho' failed. Aborted (core dumped)I thought the -1 was required...
The problem is different: when osm_mcast_tbl_realloc() is called twice let's say with 'mlid_offset = 0' and later with 'mlid_offset = 1' tbl->max_mlid_ho still have MLID_START value because its update is skipped in this patch. Seems wrong to me.
Sasha
Quoted 74 lines
opensm/opensm/osm_mcast_tbl.c +1
-1@@ -144,7 +144,7 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset) size - p_tbl->mft_depth * (IB_MCAST_POSITION_MAX + 1) * IB_MCAST_MASK_SIZE / 8); p_tbl->p_mask_tbl = p_mask_tbl; p_tbl->mft_depth = mft_depth; - p_tbl->max_mlid_ho = mlid_offset +IB_LID_MCAST_START_HO ; + p_tbl->max_mlid_ho = mlid_offset +IB_LID_MCAST_START_HO -1 ;return 0 ; }But this did not fix it... I would dig further but I am kind of busy today, sorry.
Ira
Quoted 52 lines · On Fri, 30 Oct 2009 09:49:19 -0500 Hal Rosenstock…
Revert
de3171043b3cbe078e410351a00e5756509bd514and some of537d67b19a4b72d72341e529f611e4e30754f8fcIn
osm_mcast_tbl_realloc, don't changemax_mlid_howhenmlid_offset<p_tbl->mft_depthAlso, restore some checks whenmlid_offset>=p_tbl->mft_depth
These changes are needed for proper group removalSigned-off-by Hal Rosenstock <[email protected]>---
opensm/opensm/osm_mcast_tbl.c +6
-2@@ -122,7 +122,7 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset)uint16_t (*p_mask_tbl)[][IB_MCAST_POSITION_MAX ];if (mlid_offset < p_tbl->mft_depth) - goto done; +return 0 ;/* The number of bytes needed in the mask table is: @@ -144,7 +144,6 @@ int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset) size - p_tbl->mft_depth * (IB_MCAST_POSITION_MAX + 1) * IB_MCAST_MASK_SIZE / 8); p_tbl->p_mask_tbl = p_mask_tbl; p_tbl->mft_depth = mft_depth; -done: p_tbl->max_mlid_ho = mlid_offset +IB_LID_MCAST_START_HO ;return 0 ; }@@ -167,6 +166,9 @@ boolean_t osm_mcast_tbl_is_port(IN const osm_mcast_tbl_t * p_tbl,CL_ASSERT (mlid_ho <= p_tbl->max_mlid_ho); mlid_offset = mlid_ho -IB_LID_MCAST_START_HO ; +if (mlid_offset >= p_tbl->mft_depth) +return FALSE; + mask_offset = port_num /IB_MCAST_MASK_SIZE ; bit_mask =cl_ntoh16 ((uint16_t ) (1 << (port_num %IB_MCAST_MASK_SIZE )));@@ -194,6 +196,8 @@ boolean_t osm_mcast_tbl_is_any_port(IN const osm_mcast_tbl_t * p_tbl,CL_ASSERT (mlid_ho <= p_tbl->max_mlid_ho); mlid_offset = mlid_ho -IB_LID_MCAST_START_HO ; +if (mlid_offset >= p_tbl->mft_depth) +return FALSE;for (position =0 ; position <= p_tbl->max_position; position++) result |= (*p_tbl->p_mask_tbl)[mlid_offset][position];@@ -247,6 +251,8 @@ void osm_mcast_tbl_clear_mlid(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho)
Quoted 25 lines
Quoted 12 lines
opensm/opensm/osm_mcast_tbl.c +2
-1if (p_tbl->p_mask_tbl && mlid_ho <= p_tbl->max_mlid_ho) { mlid_offset = mlid_ho -IB_LID_MCAST_START_HO ; +if (mlid_offset >= p_tbl->mft_depth) +return ;for (i =0 ; i <= p_tbl->max_position; i++) (*p_tbl->p_mask_tbl)[mlid_offset][i] =0 ; } --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
Signature · 9 lines
Ira Weiny Math Programmer/Computer Scientist Lawrence Livermore National Lab 925-423-8008 [email protected] -- 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
--
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