From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B328C433E6 for ; Wed, 2 Sep 2020 08:11:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03B3E2087C for ; Wed, 2 Sep 2020 08:11:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599034307; bh=1ZSyhTuTDYHvQ+Y7pyF7+o4SsP2l73YssbFYud/RUGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KGunyHIUHMk15m/Trlh1zp+4fgAVE8HqnK93quHciCAKZnUAR9ZqUNSAPUWHZEk0z T/Y1yXtwXh/8bEoNFGXOPwTRBUZzhENg7TZHLBOE7Kn1MmuyM/rnwR15mae3TCyd94 XPUVRaqphOzqq/MJ1roM+9iXPIaKSLgNCU2hQJIc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726293AbgIBILq (ORCPT ); Wed, 2 Sep 2020 04:11:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:34466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726292AbgIBILp (ORCPT ); Wed, 2 Sep 2020 04:11:45 -0400 Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 497A12087E; Wed, 2 Sep 2020 08:11:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599034305; bh=1ZSyhTuTDYHvQ+Y7pyF7+o4SsP2l73YssbFYud/RUGk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P/MqXpEXO4IifuD+QJNU1A08SZCtt+mkU+fSgwPHTf/CyM3f/hTP6ZJTS/WrDQs2c +UdJs3HXHiW9EYDyXfJtKp1d5sk+HxXh0IkPqQzwHvg7+80Zzh4cZ5iI509l99GXoG BTXZiVun3Ri4e77fdfThTCyUUt5+dE83CuxZlXTI= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org Subject: [PATCH rdma-next 6/8] RDMA/cma: Remove dead code for kernel rdmacm multicast Date: Wed, 2 Sep 2020 11:11:20 +0300 Message-Id: <20200902081122.745412-7-leon@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200902081122.745412-1-leon@kernel.org> References: <20200902081122.745412-1-leon@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Jason Gunthorpe 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. Signed-off-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/cma.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index 088981db10f7..b9d794ba9f6a 100644 --- a/drivers/infiniband/core/cma.c +++ b/drivers/infiniband/core/cma.c @@ -4366,16 +4366,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) { @@ -4629,6 +4619,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)) @@ -4680,11 +4674,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)) { -- 2.26.2