[ofa-general] [PATCH] ib/core: fix for send multicast group send leave retry

Ron Livne ronli at voltaire.com
Mon Aug 4 11:17:12 PDT 2008


Until now, only if joinning a multicast group failed there was a retry
mechanism.
This patch will add a mechanism that will retry to leave a multicast
group before giving up.

Signed-off-by: Ron Livne <ronli at voltaire.com>

diff --git a/drivers/infiniband/core/multicast.c b/drivers/infiniband/core/multicast.c
index 107f170..9aba771 100644
--- a/drivers/infiniband/core/multicast.c
+++ b/drivers/infiniband/core/multicast.c
@@ -106,6 +106,7 @@ struct mcast_group {
 	struct ib_sa_query	*query;
 	int			query_id;
 	u16			pkey_index;
+	int			retries;
 };

 struct mcast_member {
@@ -540,9 +541,16 @@ static void join_handler(int status, struct ib_sa_mcmember_rec *rec,
 static void leave_handler(int status, struct ib_sa_mcmember_rec *rec,
 			  void *context)
 {
+	__u8 leave_state;
 	struct mcast_group *group = context;

-	mcast_work_handler(&group->work);
+	leave_state = get_leave_state(group);
+	if (status && (group->retries > 0)) {
+		send_leave(group, leave_state);
+		group->retries--;
+	}
+	if (!status || (group->retries == 0))
+		mcast_work_handler(&group->work);
 }

 static struct mcast_group *acquire_group(struct mcast_port *port,
@@ -565,6 +573,7 @@ static struct mcast_group *acquire_group(struct mcast_port *port,
 	if (!group)
 		return NULL;

+	group->retries = 3;
 	group->port = port;
 	group->rec.mgid = *mgid;
 	group->pkey_index = MCAST_INVALID_PKEY_INDEX;



More information about the general mailing list