Skip to content

Commit

Permalink
RDMA/cma: Remove dead code for kernel rdmacm multicast
Browse files Browse the repository at this point in the history
There is no kernel user of RDMA CM multicast so this code managing the
multicast subscription of the kernel-only internal QP is dead. Remove it.

This makes the bug fixes in the next patches much simpler.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Leon Romanovsky <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
  • Loading branch information
jgunthorpe committed Sep 17, 2020
1 parent 7e85bcd commit 1bb5091
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions drivers/infiniband/core/cma.c
Original file line number Diff line number Diff line change
Expand Up @@ -4337,16 +4337,6 @@ static int cma_ib_mc_handler(int status, struct ib_sa_multicast *multicast)
else
pr_debug_ratelimited("RDMA CM: MULTICAST_ERROR: failed to join multicast. status %d\n",
status);
mutex_lock(&id_priv->qp_mutex);
if (!status && id_priv->id.qp) {
status = ib_attach_mcast(id_priv->id.qp, &multicast->rec.mgid,
be16_to_cpu(multicast->rec.mlid));
if (status)
pr_debug_ratelimited("RDMA CM: MULTICAST_ERROR: failed to attach QP. status %d\n",
status);
}
mutex_unlock(&id_priv->qp_mutex);

event.status = status;
event.param.ud.private_data = mc->context;
if (!status) {
Expand Down Expand Up @@ -4600,6 +4590,10 @@ int rdma_join_multicast(struct rdma_cm_id *id, struct sockaddr *addr,
struct cma_multicast *mc;
int ret;

/* Not supported for kernel QPs */
if (WARN_ON(id->qp))
return -EINVAL;

/* ULP is calling this wrong. */
if (!id->device || (READ_ONCE(id_priv->state) != RDMA_CM_ADDR_BOUND &&
READ_ONCE(id_priv->state) != RDMA_CM_ADDR_RESOLVED))
Expand Down Expand Up @@ -4651,11 +4645,6 @@ void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr)
list_del(&mc->list);
spin_unlock_irq(&id_priv->lock);

if (id->qp)
ib_detach_mcast(id->qp,
&mc->multicast.ib->rec.mgid,
be16_to_cpu(mc->multicast.ib->rec.mlid));

BUG_ON(id_priv->cma_dev->device != id->device);

if (rdma_cap_ib_mcast(id->device, id->port_num)) {
Expand Down

0 comments on commit 1bb5091

Please sign in to comment.