Commit 107dd7be authored by Mark Zhang's avatar Mark Zhang Committed by Jason Gunthorpe

IB/cm: Cancel mad on the DREQ event when the state is MRA_REP_RCVD

On the passive side when the disconnectReq event comes, if the current
state is MRA_REP_RCVD, it needs to cancel the MAD before entering the
DREQ_RCVD and TIMEWAIT states, otherwise the destroy_id may block until
this mad will reach timeout.

Fixes: a977049d ("[PATCH] IB: Add the kernel CM implementation")
Link: https://lore.kernel.org/r/75261c00c1d82128b1d981af9ff46e994186e621.1649062436.git.leonro@nvidia.comSigned-off-by: default avatarMark Zhang <markzhang@nvidia.com>
Reviewed-by: default avatarMaor Gottlieb <maorg@nvidia.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 1d735eee
...@@ -2824,6 +2824,7 @@ static int cm_dreq_handler(struct cm_work *work) ...@@ -2824,6 +2824,7 @@ static int cm_dreq_handler(struct cm_work *work)
switch (cm_id_priv->id.state) { switch (cm_id_priv->id.state) {
case IB_CM_REP_SENT: case IB_CM_REP_SENT:
case IB_CM_DREQ_SENT: case IB_CM_DREQ_SENT:
case IB_CM_MRA_REP_RCVD:
ib_cancel_mad(cm_id_priv->msg); ib_cancel_mad(cm_id_priv->msg);
break; break;
case IB_CM_ESTABLISHED: case IB_CM_ESTABLISHED:
...@@ -2831,8 +2832,6 @@ static int cm_dreq_handler(struct cm_work *work) ...@@ -2831,8 +2832,6 @@ static int cm_dreq_handler(struct cm_work *work)
cm_id_priv->id.lap_state == IB_CM_MRA_LAP_RCVD) cm_id_priv->id.lap_state == IB_CM_MRA_LAP_RCVD)
ib_cancel_mad(cm_id_priv->msg); ib_cancel_mad(cm_id_priv->msg);
break; break;
case IB_CM_MRA_REP_RCVD:
break;
case IB_CM_TIMEWAIT: case IB_CM_TIMEWAIT:
atomic_long_inc(&work->port->counters[CM_RECV_DUPLICATES] atomic_long_inc(&work->port->counters[CM_RECV_DUPLICATES]
[CM_DREQ_COUNTER]); [CM_DREQ_COUNTER]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment