IB/core: Fix send multicast group leave retry
Until now, retries were only sent when joining a multicast group. This patch will adds retries when leaving a multicast group as well. Signed-off-by: Ron Livne <ronli@voltaire.com> Signed-off-by: Yossi Etigin <yosefe@voltaire.com> Acked-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
committed by
Roland Dreier
parent
f1aa78b26e
commit
e1d7806df3
@@ -106,6 +106,8 @@ struct mcast_group {
|
|||||||
struct ib_sa_query *query;
|
struct ib_sa_query *query;
|
||||||
int query_id;
|
int query_id;
|
||||||
u16 pkey_index;
|
u16 pkey_index;
|
||||||
|
u8 leave_state;
|
||||||
|
int retries;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct mcast_member {
|
struct mcast_member {
|
||||||
@@ -350,6 +352,7 @@ static int send_leave(struct mcast_group *group, u8 leave_state)
|
|||||||
|
|
||||||
rec = group->rec;
|
rec = group->rec;
|
||||||
rec.join_state = leave_state;
|
rec.join_state = leave_state;
|
||||||
|
group->leave_state = leave_state;
|
||||||
|
|
||||||
ret = ib_sa_mcmember_rec_query(&sa_client, port->dev->device,
|
ret = ib_sa_mcmember_rec_query(&sa_client, port->dev->device,
|
||||||
port->port_num, IB_SA_METHOD_DELETE, &rec,
|
port->port_num, IB_SA_METHOD_DELETE, &rec,
|
||||||
@@ -542,6 +545,10 @@ static void leave_handler(int status, struct ib_sa_mcmember_rec *rec,
|
|||||||
{
|
{
|
||||||
struct mcast_group *group = context;
|
struct mcast_group *group = context;
|
||||||
|
|
||||||
|
if (status && group->retries > 0 &&
|
||||||
|
!send_leave(group, group->leave_state))
|
||||||
|
group->retries--;
|
||||||
|
else
|
||||||
mcast_work_handler(&group->work);
|
mcast_work_handler(&group->work);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -565,6 +572,7 @@ static struct mcast_group *acquire_group(struct mcast_port *port,
|
|||||||
if (!group)
|
if (!group)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
group->retries = 3;
|
||||||
group->port = port;
|
group->port = port;
|
||||||
group->rec.mgid = *mgid;
|
group->rec.mgid = *mgid;
|
||||||
group->pkey_index = MCAST_INVALID_PKEY_INDEX;
|
group->pkey_index = MCAST_INVALID_PKEY_INDEX;
|
||||||
|
Reference in New Issue
Block a user