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

Olga Shern (Voltaire) olga.shern at gmail.com
Wed Aug 27 10:07:39 PDT 2008


Hi Vlad,

Please add this patch to OFED 1.4
It is in Roland's tree for 2.6.28

Thanks
Olga


---------- Forwarded message ----------
From: Yossi Etigin <yosefe at voltaire.com>
Date: Aug 11, 2008 7:35 PM
Subject: [ofa-general] [PATCH v3] ib/core: fix for send multicast
group send leave retry
To: Roland Drier <rolandd at cisco.com>
Cc: Olga Shern <olgas at voltaire.com>, general list
<general at lists.openfabrics.org>, Ron Livne <ronli at voltaire.com>


Until now, only if joining 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.

Changes from v1:
- Save the leave state because it's overridden
- use 'else'

Changes from v2:
- Call mcast_work_handler() when send_leave() fails

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


Index: b/drivers/infiniband/core/multicast.c
===================================================================
--- a/drivers/infiniband/core/multicast.c       2008-08-11
19:13:26.000000000 +0300
+++ b/drivers/infiniband/core/multicast.c       2008-08-11
19:34:21.000000000 +0300
@@ -106,6 +106,8 @@ struct mcast_group {
       struct ib_sa_query      *query;
       int                     query_id;
       u16                     pkey_index;
+       u8                      leave_state;
+       int                     retries;
};

struct mcast_member {
@@ -350,6 +352,7 @@ static int send_leave(struct mcast_group

       rec = group->rec;
       rec.join_state = leave_state;
+       group->leave_state = leave_state;

       ret = ib_sa_mcmember_rec_query(&sa_client, port->dev->device,
                                      port->port_num, IB_SA_METHOD_DELETE, &rec,
@@ -542,7 +545,11 @@ static void leave_handler(int status, st
{
       struct mcast_group *group = context;

-       mcast_work_handler(&group->work);
+       if (status && (group->retries > 0) &&
+           !send_leave(group, group->leave_state))
+               group->retries--;
+       else
+               mcast_work_handler(&group->work);
}

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

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

_______________________________________________
general mailing list
general at lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



More information about the ewg mailing list