* [PATCH] Fixes wrong assertion failed in osm_switch_get_lft_block()
@ 2014-12-20 18:22 Vangelis Tasoulas
[not found] ` <5495BE60.50301-S8y2klWGCOFhl2p70BpVqQ@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Vangelis Tasoulas @ 2014-12-20 18:22 UTC (permalink / raw)
To: Hal Rosenstock; +Cc: Linux RDMA Mailing List
[-- Attachment #1.1: Type: text/plain, Size: 981 bytes --]
From a399cd7398a86b72541c628588365c252882cd80 Mon Sep 17 00:00:00 2001
From: Vangelis Tasoulas <vangelis-e629+x1LERvk1uMJSBkQmQ@public.gmane.org>
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(-)
diff --git a/opensm/osm_switch.c b/opensm/osm_switch.c
index 11efd54..a28ec28 100644
--- a/opensm/osm_switch.c
+++ b/opensm/osm_switch.c
@@ -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;
}
--
1.9.1
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-Fixes-wrong-assertion-failed-in-osm_switch_get_lft_b.patch --]
[-- Type: text/x-patch; name="0001-Fixes-wrong-assertion-failed-in-osm_switch_get_lft_b.patch", Size: 939 bytes --]
From a399cd7398a86b72541c628588365c252882cd80 Mon Sep 17 00:00:00 2001
From: Vangelis Tasoulas <vangelis-e629+x1LERvk1uMJSBkQmQ@public.gmane.org>
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(-)
diff --git a/opensm/osm_switch.c b/opensm/osm_switch.c
index 11efd54..a28ec28 100644
--- a/opensm/osm_switch.c
+++ b/opensm/osm_switch.c
@@ -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;
}
--
1.9.1
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply related [flat|nested] 5+ messages in thread[parent not found: <5495BE60.50301-S8y2klWGCOFhl2p70BpVqQ@public.gmane.org>]
* Re: [PATCH] Fixes wrong assertion failed in osm_switch_get_lft_block() [not found] ` <5495BE60.50301-S8y2klWGCOFhl2p70BpVqQ@public.gmane.org> @ 2014-12-21 10:07 ` Ilya Nelkenbaum [not found] ` <54969BC4.8060400-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> 2015-01-02 13:25 ` Hal Rosenstock 1 sibling, 1 reply; 5+ messages in thread From: Ilya Nelkenbaum @ 2014-12-21 10:07 UTC (permalink / raw) To: Vangelis Tasoulas, Hal Rosenstock; +Cc: Linux RDMA Mailing List On 12/20/2014 8:22 PM, Vangelis Tasoulas wrote: > From a399cd7398a86b72541c628588365c252882cd80 Mon Sep 17 00:00:00 2001 > From: Vangelis Tasoulas <vangelis-e629+x1LERvk1uMJSBkQmQ@public.gmane.org> > 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(-) > > diff --git a/opensm/osm_switch.c b/opensm/osm_switch.c > index 11efd54..a28ec28 100644 > --- a/opensm/osm_switch.c > +++ b/opensm/osm_switch.c > @@ -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. > 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <54969BC4.8060400-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>]
* Re: [PATCH] Fixes wrong assertion failed in osm_switch_get_lft_block() [not found] ` <54969BC4.8060400-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> @ 2014-12-21 13:50 ` Vangelis Tasoulas [not found] ` <5496D024.2030704-S8y2klWGCOFhl2p70BpVqQ@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Vangelis Tasoulas @ 2014-12-21 13:50 UTC (permalink / raw) To: Ilya Nelkenbaum, Hal Rosenstock; +Cc: Linux RDMA Mailing List [-- Attachment #1: Type: text/plain, Size: 1553 bytes --] On 12/21/2014 11:07 AM, Ilya Nelkenbaum wrote: > On 12/20/2014 8:22 PM, Vangelis Tasoulas wrote: >> From a399cd7398a86b72541c628588365c252882cd80 Mon Sep 17 00:00:00 2001 >> From: Vangelis Tasoulas <vangelis-e629+x1LERvk1uMJSBkQmQ@public.gmane.org> >> 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(-) >> >> diff --git a/opensm/osm_switch.c b/opensm/osm_switch.c >> index 11efd54..a28ec28 100644 >> --- a/opensm/osm_switch.c >> +++ b/opensm/osm_switch.c >> @@ -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. 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? > >> memcpy(p_block, &(p_sw->lft[base_lid_ho]), IB_SMP_DATA_SIZE); >> return TRUE; >> } >> > [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 473 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <5496D024.2030704-S8y2klWGCOFhl2p70BpVqQ@public.gmane.org>]
* Re: [PATCH] Fixes wrong assertion failed in osm_switch_get_lft_block() [not found] ` <5496D024.2030704-S8y2klWGCOFhl2p70BpVqQ@public.gmane.org> @ 2014-12-21 14:02 ` Ilya Nelkenbaum 0 siblings, 0 replies; 5+ messages in thread From: Ilya Nelkenbaum @ 2014-12-21 14:02 UTC (permalink / raw) To: Vangelis Tasoulas, Hal Rosenstock; +Cc: Linux RDMA Mailing List On 12/21/2014 3:50 PM, Vangelis Tasoulas wrote: > On 12/21/2014 11:07 AM, Ilya Nelkenbaum wrote: >> On 12/20/2014 8:22 PM, Vangelis Tasoulas wrote: >>> From a399cd7398a86b72541c628588365c252882cd80 Mon Sep 17 00:00:00 2001 >>> From: Vangelis Tasoulas <vangelis-e629+x1LERvk1uMJSBkQmQ@public.gmane.org> >>> 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(-) >>> >>> diff --git a/opensm/osm_switch.c b/opensm/osm_switch.c >>> index 11efd54..a28ec28 100644 >>> --- a/opensm/osm_switch.c >>> +++ b/opensm/osm_switch.c >>> @@ -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. > > 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. > > Less or equal to the first mcast LID? I understand the less, but why equal? > >> >>> 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fixes wrong assertion failed in osm_switch_get_lft_block() [not found] ` <5495BE60.50301-S8y2klWGCOFhl2p70BpVqQ@public.gmane.org> 2014-12-21 10:07 ` Ilya Nelkenbaum @ 2015-01-02 13:25 ` Hal Rosenstock 1 sibling, 0 replies; 5+ messages in thread From: Hal Rosenstock @ 2015-01-02 13:25 UTC (permalink / raw) To: Vangelis Tasoulas; +Cc: Linux RDMA Mailing List On 12/20/2014 1:22 PM, Vangelis Tasoulas wrote: > From a399cd7398a86b72541c628588365c252882cd80 Mon Sep 17 00:00:00 2001 > From: Vangelis Tasoulas <vangelis-e629+x1LERvk1uMJSBkQmQ@public.gmane.org> > 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 majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-01-02 13:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-20 18:22 [PATCH] Fixes wrong assertion failed in osm_switch_get_lft_block() Vangelis Tasoulas
[not found] ` <5495BE60.50301-S8y2klWGCOFhl2p70BpVqQ@public.gmane.org>
2014-12-21 10:07 ` Ilya Nelkenbaum
[not found] ` <54969BC4.8060400-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2014-12-21 13:50 ` Vangelis Tasoulas
[not found] ` <5496D024.2030704-S8y2klWGCOFhl2p70BpVqQ@public.gmane.org>
2014-12-21 14:02 ` Ilya Nelkenbaum
2015-01-02 13:25 ` Hal Rosenstock
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox