* Re: [PATCH] opensm/mcast_tbl: set max_mlid_ho as actually configured mlid [not found] ` <4AEAEA86.8080309-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org> @ 2009-10-30 13:48 ` Hal Rosenstock [not found] ` <f0e08f230910300648m4d802f57w2910cea678a3cd1f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 9+ messages in thread From: Hal Rosenstock @ 2009-10-30 13:48 UTC (permalink / raw) To: Sasha Khapyorsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA On Thu, Oct 29, 2009 at 3:19 PM, Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org> wrote: > > Set switch's mcast table max_mlid_ho as actually configured mlid for the > switch instead of a value extended to MFT block size aligned. This makes > mlid handling checks to be more reliable. > > Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org> > --- > opensm/opensm/osm_mcast_tbl.c | 5 +++-- > 1 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/opensm/opensm/osm_mcast_tbl.c b/opensm/opensm/osm_mcast_tbl.c > index b5ae6f2..eee9290 100644 > --- a/opensm/opensm/osm_mcast_tbl.c > +++ b/opensm/opensm/osm_mcast_tbl.c > @@ -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) > - return 0; > + goto done; Why should max_mlid_ho be changed when < mft_depth ? Doing so makes group removal not work properly. -- Hal > /* > The number of bytes needed in the mask table is: > @@ -144,7 +144,8 @@ 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 = mft_depth + IB_LID_MCAST_START_HO - 1; > +done: > + p_tbl->max_mlid_ho = mlid_offset + IB_LID_MCAST_START_HO - 1; > return 0; > } > > -- > 1.6.5.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <f0e08f230910300648m4d802f57w2910cea678a3cd1f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] opensm/mcast_tbl: set max_mlid_ho as actually configured mlid [not found] ` <f0e08f230910300648m4d802f57w2910cea678a3cd1f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2009-10-30 20:06 ` Sasha Khapyorsky 2009-10-30 20:44 ` Hal Rosenstock 2009-10-30 21:32 ` [PATCH] opensm/osm_mcast_tbl: fix mlid removal Sasha Khapyorsky 0 siblings, 2 replies; 9+ messages in thread From: Sasha Khapyorsky @ 2009-10-30 20:06 UTC (permalink / raw) To: Hal Rosenstock; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA On 09:48 Fri 30 Oct , Hal Rosenstock wrote: > > > > diff --git a/opensm/opensm/osm_mcast_tbl.c b/opensm/opensm/osm_mcast_tbl.c > > index b5ae6f2..eee9290 100644 > > --- a/opensm/opensm/osm_mcast_tbl.c > > +++ b/opensm/opensm/osm_mcast_tbl.c > > @@ -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) > > - return 0; > > + goto done; > > Why should max_mlid_ho be changed when < mft_depth ? To be equal to an actually configured max mlid value (not a size of mcast table allocation). > Doing so makes group removal not work properly. This may have this issue, but not due to fact of max_mlid_ho change, but due to invalid check in osm_mcast_tbl_clear_mlid(). I think there it should be something like: diff --git a/opensm/opensm/osm_mcast_tbl.c b/opensm/opensm/osm_mcast_tbl.c index 0a45904..a599e56 100644 --- a/opensm/opensm/osm_mcast_tbl.c +++ b/opensm/opensm/osm_mcast_tbl.c @@ -245,8 +245,8 @@ void osm_mcast_tbl_clear_mlid(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho) CL_ASSERT(p_tbl); CL_ASSERT(mlid_ho >= IB_LID_MCAST_START_HO); - if (p_tbl->p_mask_tbl && mlid_ho <= p_tbl->max_mlid_ho) { - mlid_offset = mlid_ho - IB_LID_MCAST_START_HO; + mlid_offset = mlid_ho - IB_LID_MCAST_START_HO; + if (p_tbl->p_mask_tbl && mlid_offset < p_tbl->mft_depth) { for (i = 0; i <= p_tbl->max_position; i++) (*p_tbl->p_mask_tbl)[mlid_offset][i] = 0; } Does it make sense? Sasha -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] opensm/mcast_tbl: set max_mlid_ho as actually configured mlid 2009-10-30 20:06 ` Sasha Khapyorsky @ 2009-10-30 20:44 ` Hal Rosenstock [not found] ` <f0e08f230910301344j5b9564a5k9b77fd4e43e48376-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 2009-10-30 21:32 ` [PATCH] opensm/osm_mcast_tbl: fix mlid removal Sasha Khapyorsky 1 sibling, 1 reply; 9+ messages in thread From: Hal Rosenstock @ 2009-10-30 20:44 UTC (permalink / raw) To: Sasha Khapyorsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA On Fri, Oct 30, 2009 at 4:06 PM, Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org> wrote: > On 09:48 Fri 30 Oct , Hal Rosenstock wrote: >> > >> > diff --git a/opensm/opensm/osm_mcast_tbl.c b/opensm/opensm/osm_mcast_tbl.c >> > index b5ae6f2..eee9290 100644 >> > --- a/opensm/opensm/osm_mcast_tbl.c >> > +++ b/opensm/opensm/osm_mcast_tbl.c >> > @@ -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) >> > - return 0; >> > + goto done; >> >> Why should max_mlid_ho be changed when < mft_depth ? > > To be equal to an actually configured max mlid value (not a size of > mcast table allocation). > >> Doing so makes group removal not work properly. > > This may have this issue, but not due to fact of max_mlid_ho change, but > due to invalid check in osm_mcast_tbl_clear_mlid(). I think there it > should be something like: > > diff --git a/opensm/opensm/osm_mcast_tbl.c b/opensm/opensm/osm_mcast_tbl.c > index 0a45904..a599e56 100644 > --- a/opensm/opensm/osm_mcast_tbl.c > +++ b/opensm/opensm/osm_mcast_tbl.c > @@ -245,8 +245,8 @@ void osm_mcast_tbl_clear_mlid(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho) > CL_ASSERT(p_tbl); > CL_ASSERT(mlid_ho >= IB_LID_MCAST_START_HO); > > - if (p_tbl->p_mask_tbl && mlid_ho <= p_tbl->max_mlid_ho) { > - mlid_offset = mlid_ho - IB_LID_MCAST_START_HO; > + mlid_offset = mlid_ho - IB_LID_MCAST_START_HO; > + if (p_tbl->p_mask_tbl && mlid_offset < p_tbl->mft_depth) { > for (i = 0; i <= p_tbl->max_position; i++) > (*p_tbl->p_mask_tbl)[mlid_offset][i] = 0; > } > > Does it make sense? Yes, that fixes the removal issue. Tested-by: Hal Rosenstock <hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> -- Hal > Sasha > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <f0e08f230910301344j5b9564a5k9b77fd4e43e48376-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] opensm/mcast_tbl: set max_mlid_ho as actually configured mlid [not found] ` <f0e08f230910301344j5b9564a5k9b77fd4e43e48376-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2009-10-30 21:31 ` Sasha Khapyorsky 2009-11-02 16:18 ` Hal Rosenstock 0 siblings, 1 reply; 9+ messages in thread From: Sasha Khapyorsky @ 2009-10-30 21:31 UTC (permalink / raw) To: Hal Rosenstock; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA On 16:44 Fri 30 Oct , Hal Rosenstock wrote: > > > > diff --git a/opensm/opensm/osm_mcast_tbl.c b/opensm/opensm/osm_mcast_tbl.c > > index 0a45904..a599e56 100644 > > --- a/opensm/opensm/osm_mcast_tbl.c > > +++ b/opensm/opensm/osm_mcast_tbl.c > > @@ -245,8 +245,8 @@ void osm_mcast_tbl_clear_mlid(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho) > > CL_ASSERT(p_tbl); > > CL_ASSERT(mlid_ho >= IB_LID_MCAST_START_HO); > > > > - if (p_tbl->p_mask_tbl && mlid_ho <= p_tbl->max_mlid_ho) { > > - mlid_offset = mlid_ho - IB_LID_MCAST_START_HO; > > + mlid_offset = mlid_ho - IB_LID_MCAST_START_HO; > > + if (p_tbl->p_mask_tbl && mlid_offset < p_tbl->mft_depth) { > > for (i = 0; i <= p_tbl->max_position; i++) > > (*p_tbl->p_mask_tbl)[mlid_offset][i] = 0; > > } > > > > Does it make sense? > > Yes, that fixes the removal issue. > > Tested-by: Hal Rosenstock <hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Thanks I will apply the patch. Yet another (likely even more efficient) approach would be memset()ing MFTs in realloc function above requested mlid_offset, then we will be able to remove osm_mcast_tbl_clear_mlid() completely. Sasha -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] opensm/mcast_tbl: set max_mlid_ho as actually configured mlid 2009-10-30 21:31 ` Sasha Khapyorsky @ 2009-11-02 16:18 ` Hal Rosenstock [not found] ` <f0e08f230911020818n2f2f4dcai5c920dbfa98551de-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 9+ messages in thread From: Hal Rosenstock @ 2009-11-02 16:18 UTC (permalink / raw) To: Sasha Khapyorsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA On Fri, Oct 30, 2009 at 5:31 PM, Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org> wrote: > On 16:44 Fri 30 Oct , Hal Rosenstock wrote: >> > >> > diff --git a/opensm/opensm/osm_mcast_tbl.c b/opensm/opensm/osm_mcast_tbl.c >> > index 0a45904..a599e56 100644 >> > --- a/opensm/opensm/osm_mcast_tbl.c >> > +++ b/opensm/opensm/osm_mcast_tbl.c >> > @@ -245,8 +245,8 @@ void osm_mcast_tbl_clear_mlid(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho) >> > CL_ASSERT(p_tbl); >> > CL_ASSERT(mlid_ho >= IB_LID_MCAST_START_HO); >> > >> > - if (p_tbl->p_mask_tbl && mlid_ho <= p_tbl->max_mlid_ho) { >> > - mlid_offset = mlid_ho - IB_LID_MCAST_START_HO; >> > + mlid_offset = mlid_ho - IB_LID_MCAST_START_HO; >> > + if (p_tbl->p_mask_tbl && mlid_offset < p_tbl->mft_depth) { >> > for (i = 0; i <= p_tbl->max_position; i++) >> > (*p_tbl->p_mask_tbl)[mlid_offset][i] = 0; >> > } >> > >> > Does it make sense? >> >> Yes, that fixes the removal issue. >> >> Tested-by: Hal Rosenstock <hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > Thanks I will apply the patch. > > Yet another (likely even more efficient) approach would be memset()ing > MFTs in realloc function above requested mlid_offset, then we will be > able to remove osm_mcast_tbl_clear_mlid() completely. Isn't mlid clearing done on a per mlid basis rather than based on above some mlid (offset) ? Also and perhaps more significantly, an mlid can be removed in the middle of a range of mlids. So I don't see how clear_mlid can be removed. -- Hal > > Sasha > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <f0e08f230911020818n2f2f4dcai5c920dbfa98551de-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] opensm/mcast_tbl: set max_mlid_ho as actually configured mlid [not found] ` <f0e08f230911020818n2f2f4dcai5c920dbfa98551de-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2009-11-02 16:43 ` Sasha Khapyorsky 2009-11-02 16:44 ` Hal Rosenstock 0 siblings, 1 reply; 9+ messages in thread From: Sasha Khapyorsky @ 2009-11-02 16:43 UTC (permalink / raw) To: Hal Rosenstock; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA On 12:18 Mon 02 Nov , Hal Rosenstock wrote: > > > > Yet another (likely even more efficient) approach would be memset()ing > > MFTs in realloc function above requested mlid_offset, then we will be > > able to remove osm_mcast_tbl_clear_mlid() completely. > > Isn't mlid clearing done on a per mlid basis rather than based on > above some mlid (offset) ? Also and perhaps more significantly, an > mlid can be removed in the middle of a range of mlids. So I don't see > how clear_mlid can be removed. Yes, correct, we cannot remove clear_mlid completely. Sasha -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] opensm/mcast_tbl: set max_mlid_ho as actually configured mlid 2009-11-02 16:43 ` Sasha Khapyorsky @ 2009-11-02 16:44 ` Hal Rosenstock [not found] ` <f0e08f230911020844i7f52b492ifdcbadc2babbf4ae-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 9+ messages in thread From: Hal Rosenstock @ 2009-11-02 16:44 UTC (permalink / raw) To: Sasha Khapyorsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA On Mon, Nov 2, 2009 at 12:43 PM, Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org> wrote: > On 12:18 Mon 02 Nov , Hal Rosenstock wrote: >> > >> > Yet another (likely even more efficient) approach would be memset()ing >> > MFTs in realloc function above requested mlid_offset, then we will be >> > able to remove osm_mcast_tbl_clear_mlid() completely. >> >> Isn't mlid clearing done on a per mlid basis rather than based on >> above some mlid (offset) ? Also and perhaps more significantly, an >> mlid can be removed in the middle of a range of mlids. So I don't see >> how clear_mlid can be removed. > > Yes, correct, we cannot remove clear_mlid completely. clear_mlid could be implemented with memset rather than loop. Is that worthwhile ? -- Hal > > Sasha > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <f0e08f230911020844i7f52b492ifdcbadc2babbf4ae-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] opensm/mcast_tbl: set max_mlid_ho as actually configured mlid [not found] ` <f0e08f230911020844i7f52b492ifdcbadc2babbf4ae-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2009-11-02 16:50 ` Sasha Khapyorsky 0 siblings, 0 replies; 9+ messages in thread From: Sasha Khapyorsky @ 2009-11-02 16:50 UTC (permalink / raw) To: Hal Rosenstock; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA On 12:44 Mon 02 Nov , Hal Rosenstock wrote: > > clear_mlid could be implemented with memset rather than loop. Yes, memset() would be better. Sasha -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] opensm/osm_mcast_tbl: fix mlid removal 2009-10-30 20:06 ` Sasha Khapyorsky 2009-10-30 20:44 ` Hal Rosenstock @ 2009-10-30 21:32 ` Sasha Khapyorsky 1 sibling, 0 replies; 9+ messages in thread From: Sasha Khapyorsky @ 2009-10-30 21:32 UTC (permalink / raw) To: Hal Rosenstock; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA Removed mlid can exceed a current max_mlid_ho value, so to prevent MFT garbage above this the requested mlid should be checked against actual MFT size. Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org> --- opensm/opensm/osm_mcast_tbl.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/opensm/opensm/osm_mcast_tbl.c b/opensm/opensm/osm_mcast_tbl.c index 0a45904..8136c37 100644 --- a/opensm/opensm/osm_mcast_tbl.c +++ b/opensm/opensm/osm_mcast_tbl.c @@ -245,11 +245,10 @@ void osm_mcast_tbl_clear_mlid(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho) CL_ASSERT(p_tbl); CL_ASSERT(mlid_ho >= IB_LID_MCAST_START_HO); - if (p_tbl->p_mask_tbl && mlid_ho <= p_tbl->max_mlid_ho) { - mlid_offset = mlid_ho - IB_LID_MCAST_START_HO; + mlid_offset = mlid_ho - IB_LID_MCAST_START_HO; + if (p_tbl->p_mask_tbl && mlid_offset < p_tbl->mft_depth) for (i = 0; i <= p_tbl->max_position; i++) (*p_tbl->p_mask_tbl)[mlid_offset][i] = 0; - } } /********************************************************************** -- 1.6.5.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-11-02 16:50 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <4AEAEA86.8080309@systemfabricworks.com>
[not found] ` <4AEAEA86.8080309-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org>
2009-10-30 13:48 ` [PATCH] opensm/mcast_tbl: set max_mlid_ho as actually configured mlid Hal Rosenstock
[not found] ` <f0e08f230910300648m4d802f57w2910cea678a3cd1f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-10-30 20:06 ` Sasha Khapyorsky
2009-10-30 20:44 ` Hal Rosenstock
[not found] ` <f0e08f230910301344j5b9564a5k9b77fd4e43e48376-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-10-30 21:31 ` Sasha Khapyorsky
2009-11-02 16:18 ` Hal Rosenstock
[not found] ` <f0e08f230911020818n2f2f4dcai5c920dbfa98551de-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-02 16:43 ` Sasha Khapyorsky
2009-11-02 16:44 ` Hal Rosenstock
[not found] ` <f0e08f230911020844i7f52b492ifdcbadc2babbf4ae-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-02 16:50 ` Sasha Khapyorsky
2009-10-30 21:32 ` [PATCH] opensm/osm_mcast_tbl: fix mlid removal Sasha Khapyorsky
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.