Skip to content

Commit

Permalink
RDMA/cm: Remove the cm_free_id() wrapper function
Browse files Browse the repository at this point in the history
Just call xa_erase directly during cm_destroy_id()

Link: https://lore.kernel.org/r/20200506074701.9775-9-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
  • Loading branch information
Jason Gunthorpe committed May 13, 2020
1 parent cfa68b0 commit 1cc4427
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/infiniband/core/cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,11 +580,6 @@ static u32 cm_local_id(__be32 local_id)
return (__force u32) (local_id ^ cm.random_id_operand);
}

static void cm_free_id(__be32 local_id)
{
xa_erase_irq(&cm.local_id_table, cm_local_id(local_id));
}

static struct cm_id_private *cm_acquire_id(__be32 local_id, __be32 remote_id)
{
struct cm_id_private *cm_id_priv;
Expand Down Expand Up @@ -1136,7 +1131,7 @@ static void cm_destroy_id(struct ib_cm_id *cm_id, int err)
case IB_CM_TIMEWAIT:
/*
* The cm_acquire_id in cm_timewait_handler will stop working
* once we do cm_free_id() below, so just move to idle here for
* once we do xa_erase below, so just move to idle here for
* consistency.
*/
cm_id->state = IB_CM_IDLE;
Expand Down Expand Up @@ -1166,7 +1161,7 @@ static void cm_destroy_id(struct ib_cm_id *cm_id, int err)
spin_unlock(&cm.lock);
spin_unlock_irq(&cm_id_priv->lock);

cm_free_id(cm_id->local_id);
xa_erase_irq(&cm.local_id_table, cm_local_id(cm_id->local_id));
cm_deref_id(cm_id_priv);
wait_for_completion(&cm_id_priv->comp);
while ((work = cm_dequeue_work(cm_id_priv)) != NULL)
Expand Down

0 comments on commit 1cc4427

Please sign in to comment.