From: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
To: Hal Rosenstock <hnrose-Wuw85uim5zDR7s880joybQ@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH] opensm/osm_mcast_mgr: simplify alloc_mfts()
Date: Thu, 29 Oct 2009 21:18:28 +0200 [thread overview]
Message-ID: <20091029191828.GC20136@me> (raw)
In-Reply-To: <20091029191732.GB20136@me>
Remove not actually needed 'max_mlid' variable from alloc_mft()
function.
Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
opensm/opensm/osm_mcast_mgr.c | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/opensm/opensm/osm_mcast_mgr.c b/opensm/opensm/osm_mcast_mgr.c
index a5e9758..faa0c4b 100644
--- a/opensm/opensm/osm_mcast_mgr.c
+++ b/opensm/opensm/osm_mcast_mgr.c
@@ -1048,17 +1048,12 @@ static int alloc_mfts(osm_sm_t * sm)
int i;
cl_map_item_t *item;
osm_switch_t *p_sw;
- int max_mlid = 0;
for (i = sm->p_subn->max_mcast_lid_ho - IB_LID_MCAST_START_HO; i >= 0;
- i--) {
- if (sm->p_subn->mgroups[i]) {
- max_mlid = i + IB_LID_MCAST_START_HO;
+ i--)
+ if (sm->p_subn->mgroups[i])
break;
- }
- }
-
- if (max_mlid == 0)
+ if (i < 0)
return 0;
/* Now, walk switches and (re)allocate multicast tables */
@@ -1066,8 +1061,7 @@ static int alloc_mfts(osm_sm_t * sm)
item != cl_qmap_end(&sm->p_subn->sw_guid_tbl);
item = cl_qmap_next(item)) {
p_sw = (osm_switch_t *)item;
- if (osm_mcast_tbl_realloc(&p_sw->mcast_tbl,
- max_mlid - IB_LID_MCAST_START_HO))
+ if (osm_mcast_tbl_realloc(&p_sw->mcast_tbl, i))
return -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
next prev parent reply other threads:[~2009-10-29 19:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-23 23:48 [PATCHv5] opensm: Reduce heap consumption by multicast routing tables (MFTs) Hal Rosenstock
[not found] ` <20091023234856.GA1482-Wuw85uim5zDR7s880joybQ@public.gmane.org>
2009-10-29 19:17 ` Sasha Khapyorsky
2009-10-29 19:18 ` Sasha Khapyorsky [this message]
2009-10-29 19:19 ` [PATCH] opensm/osm_mcast_tbl: remove redundant checks Sasha Khapyorsky
2009-10-30 13:47 ` Hal Rosenstock
2009-10-29 19:19 ` [PATCH] opensm/mcast_tbl: set max_mlid_ho as actually configured mlid Sasha Khapyorsky
2009-10-29 22:44 ` Ira Weiny
[not found] ` <20091029154431.72fc32bd.weiny2-i2BcT+NCU+M@public.gmane.org>
2009-10-29 23:02 ` Sasha Khapyorsky
2009-10-29 23:09 ` Ira Weiny
[not found] ` <20091029160958.d13ed53e.weiny2-i2BcT+NCU+M@public.gmane.org>
2009-10-30 0:32 ` Sasha Khapyorsky
2009-10-30 13:47 ` [PATCHv5] opensm: Reduce heap consumption by multicast routing tables (MFTs) Hal Rosenstock
[not found] ` <f0e08f230910300647q274e4e76v70c60a978f84309c-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-10-30 19:55 ` Sasha Khapyorsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20091029191828.GC20136@me \
--to=sashak-smomgflxvozwk0htik3j/w@public.gmane.org \
--cc=hnrose-Wuw85uim5zDR7s880joybQ@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.