Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: a977049dacde ("[PATCH] IB: Add the kernel CM implementation")
Link: https://lore.kernel.org/r/75261c00c1d82128b1d981af9ff46e994186e621.1649062436.git.leonro@nvidia.com
Signed-off-by: Mark Zhang <markzhang@nvidia.com>
Reviewed-by: Maor Gottlieb <maorg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>

authored by

Mark Zhang and committed by
Jason Gunthorpe
107dd7be 1d735eee

+1 -2
+1 -2
drivers/infiniband/core/cm.c
··· 2824 2824 switch (cm_id_priv->id.state) { 2825 2825 case IB_CM_REP_SENT: 2826 2826 case IB_CM_DREQ_SENT: 2827 + case IB_CM_MRA_REP_RCVD: 2827 2828 ib_cancel_mad(cm_id_priv->msg); 2828 2829 break; 2829 2830 case IB_CM_ESTABLISHED: 2830 2831 if (cm_id_priv->id.lap_state == IB_CM_LAP_SENT || 2831 2832 cm_id_priv->id.lap_state == IB_CM_MRA_LAP_RCVD) 2832 2833 ib_cancel_mad(cm_id_priv->msg); 2833 - break; 2834 - case IB_CM_MRA_REP_RCVD: 2835 2834 break; 2836 2835 case IB_CM_TIMEWAIT: 2837 2836 atomic_long_inc(&work->port->counters[CM_RECV_DUPLICATES]