public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: "Eli Dorfman (Voltaire)" <dorfman.eli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
Cc: linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Vladimir Koushnir
	<vladimirk-smomgflXvOZWk0Htik3J/w@public.gmane.org>
Subject: [PATCH] opensm: configure multicast only once during sweep
Date: Thu, 6 Jan 2011 18:39:05 +0200	[thread overview]
Message-ID: <4D25F029.1080005@gmail.com> (raw)

[PATCH] configure multicast only once during sweep

opensm performed multicast configuration twice during sweep by calling
two different function that are very similar.
remove osm_mcast_mgr_process() which had a bug and didn't clear mlid bit
after configuration and rename osm_mcast_mgr_process_mgroups()
to osm_mcast_mgr_process()

Signed-off-by: Eli Dorfman <elid-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
 opensm/opensm/osm_mcast_mgr.c |   46 +----------------------------------------
 opensm/opensm/osm_state_mgr.c |    3 +-
 2 files changed, 2 insertions(+), 47 deletions(-)

diff --git a/opensm/opensm/osm_mcast_mgr.c b/opensm/opensm/osm_mcast_mgr.c
index e42070d..9e15f2c 100644
--- a/opensm/opensm/osm_mcast_mgr.c
+++ b/opensm/opensm/osm_mcast_mgr.c
@@ -1081,54 +1081,11 @@ static int alloc_mfts(osm_sm_t * sm)
 	return 0;
 }
 
-int osm_mcast_mgr_process(osm_sm_t * sm)
-{
-	int i, ret = 0;
-
-	OSM_LOG_ENTER(sm->p_log);
-
-	/* While holding the lock, iterate over all the established
-	   multicast groups, servicing each in turn.
-	   Then, download the multicast tables to the switches. */
-	CL_PLOCK_EXCL_ACQUIRE(sm->p_lock);
-
-	/* If there are no switches in the subnet we have nothing to do. */
-	if (cl_qmap_count(&sm->p_subn->sw_guid_tbl) == 0) {
-		OSM_LOG(sm->p_log, OSM_LOG_DEBUG,
-			"No switches in subnet. Nothing to do\n");
-		goto exit;
-	}
-
-	if (alloc_mfts(sm)) {
-		OSM_LOG(sm->p_log, OSM_LOG_ERROR,
-			"ERR 0A07: alloc_mfts failed\n");
-		ret = -1;
-		goto exit;
-	}
-
-	for (i = 0; i <= sm->p_subn->max_mcast_lid_ho - IB_LID_MCAST_START_HO;
-	     i++)
-		if (sm->p_subn->mboxes[i] || sm->mlids_req[i])
-			mcast_mgr_process_mlid(sm, i + IB_LID_MCAST_START_HO);
-
-	memset(sm->mlids_req, 0, sm->mlids_req_max);
-	sm->mlids_req_max = 0;
-
-	ret = mcast_mgr_set_mftables(sm);
-
-exit:
-	CL_PLOCK_RELEASE(sm->p_lock);
-
-	OSM_LOG_EXIT(sm->p_log);
-
-	return ret;
-}
-
 /**********************************************************************
   This is the function that is invoked during idle time to handle the
   process request for mcast groups where join/leave/delete was required.
  **********************************************************************/
-int osm_mcast_mgr_process_mgroups(osm_sm_t * sm)
+int osm_mcast_mgr_process(osm_sm_t * sm)
 {
 	int ret = 0;
 	unsigned i;
@@ -1158,7 +1115,6 @@ int osm_mcast_mgr_process_mgroups(osm_sm_t * sm)
 		mcast_mgr_process_mlid(sm, i + IB_LID_MCAST_START_HO);
 	}
 
-	memset(sm->mlids_req, 0, sm->mlids_req_max);
 	sm->mlids_req_max = 0;
 
 	ret = mcast_mgr_set_mftables(sm);
diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c
index 68841f8..ff94cfe 100644
--- a/opensm/opensm/osm_state_mgr.c
+++ b/opensm/opensm/osm_state_mgr.c
@@ -69,7 +69,6 @@ extern void osm_drop_mgr_process(IN osm_sm_t * sm);
 extern int osm_qos_setup(IN osm_opensm_t * p_osm);
 extern int osm_pkey_mgr_process(IN osm_opensm_t * p_osm);
 extern int osm_mcast_mgr_process(IN osm_sm_t * sm);
-extern int osm_mcast_mgr_process_mgroups(IN osm_sm_t * sm);
 extern int osm_link_mgr_process(IN osm_sm_t * sm, IN uint8_t state);
 
 static void state_mgr_up_msg(IN const osm_sm_t * sm)
@@ -1415,7 +1414,7 @@ static void do_process_mgrp_queue(osm_sm_t * sm)
 	if (sm->p_subn->sm_state != IB_SMINFO_STATE_MASTER)
 		return;
 	if (!sm->p_subn->opt.disable_multicast) {
-		osm_mcast_mgr_process_mgroups(sm);
+		osm_mcast_mgr_process(sm);
 		wait_for_pending_transactions(&sm->p_subn->p_osm->stats);
 	}
 }
-- 
1.5.5

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

             reply	other threads:[~2011-01-06 16:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-06 16:39 Eli Dorfman (Voltaire) [this message]
     [not found] ` <4D25F029.1080005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-03-13 17:23   ` [PATCH] opensm: configure multicast only once during sweep Alex Netes

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=4D25F029.1080005@gmail.com \
    --to=dorfman.eli-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org \
    --cc=vladimirk-smomgflXvOZWk0Htik3J/w@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox