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=-10.1 required=3.0 tests=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 0529CC432C0 for ; Thu, 21 Nov 2019 18:15:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CC6A4206EC for ; Thu, 21 Nov 2019 18:15:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574360154; bh=yc1DwBpFalJ1L0F08H1FGhIh6TYw+bXEDBqhVhhRwdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=xE9v8MRVgdiWFsGnJOeg3AVmJCPVpvA10G+aLT7iML29gqV3SjC8OdfW59utzCLfA ZfRTip2Eld3jEdHEIlOewJiiQgPC6XtNixX+bcv+TBFbJbJ6DsNcpWTcjAsIxSKniB jkqjfwQCATF/n4jeFgVKFdpewZNlI2Q/uah7PSA0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727165AbfKUSPy (ORCPT ); Thu, 21 Nov 2019 13:15:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:54374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726279AbfKUSPx (ORCPT ); Thu, 21 Nov 2019 13:15:53 -0500 Received: from localhost (unknown [5.29.147.182]) (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 1D24A2068E; Thu, 21 Nov 2019 18:15:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574360152; bh=yc1DwBpFalJ1L0F08H1FGhIh6TYw+bXEDBqhVhhRwdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pCnThXodrM3VuZfH3zGyR6K+ljemxv18mZf5OgwhVH9MSeIMAZFX87wI33y3Ym8li 9p8C3xM6baIkqpKqPOAU4eoj3Leo0ifnmGVzuSFUAWdJnBvOrHiINQRIntaRa6NmY+ 8uDPFXO3e7XX1edvr/xp9i9vyxujma8oHfPYgHmE= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , RDMA mailing list , Bart Van Assche , Sean Hefty Subject: [PATCH rdma-next v1 45/48] RDMA/cm: Delete unused CM ARP functions Date: Thu, 21 Nov 2019 20:13:10 +0200 Message-Id: <20191121181313.129430-46-leon@kernel.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191121181313.129430-1-leon@kernel.org> References: <20191121181313.129430-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: Leon Romanovsky Clean the code by deleting ARP functions, which are not called anyway. Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/cm.c | 66 ------------------------------------ include/rdma/ib_cm.h | 34 ------------------- 2 files changed, 100 deletions(-) diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 0db15799969f..41422bf13279 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c @@ -3238,72 +3238,6 @@ deref: cm_deref_id(cm_id_priv); return -EINVAL; } -static void cm_format_apr(struct cm_apr_msg *apr_msg, - struct cm_id_private *cm_id_priv, - enum ib_cm_apr_status status, - void *info, - u8 info_length, - const void *private_data, - u8 private_data_len) -{ - cm_format_mad_hdr(&apr_msg->hdr, CM_APR_ATTR_ID, cm_id_priv->tid); - apr_msg->local_comm_id = cm_id_priv->id.local_id; - apr_msg->remote_comm_id = cm_id_priv->id.remote_id; - apr_msg->ap_status = (u8) status; - - if (info && info_length) { - apr_msg->info_length = info_length; - memcpy(apr_msg->info, info, info_length); - } - - if (private_data && private_data_len) - memcpy(apr_msg->private_data, private_data, private_data_len); -} - -int ib_send_cm_apr(struct ib_cm_id *cm_id, - enum ib_cm_apr_status status, - void *info, - u8 info_length, - const void *private_data, - u8 private_data_len) -{ - struct cm_id_private *cm_id_priv; - struct ib_mad_send_buf *msg; - unsigned long flags; - int ret; - - if ((private_data && private_data_len > CM_APR_PRIVATE_DATA_SIZE) || - (info && info_length > CM_APR_ADDITIONAL_INFORMATION_SIZE)) - return -EINVAL; - - cm_id_priv = container_of(cm_id, struct cm_id_private, id); - spin_lock_irqsave(&cm_id_priv->lock, flags); - if (cm_id->state != IB_CM_ESTABLISHED || - (cm_id->lap_state != IB_CM_LAP_RCVD && - cm_id->lap_state != IB_CM_MRA_LAP_SENT)) { - ret = -EINVAL; - goto out; - } - - ret = cm_alloc_msg(cm_id_priv, &msg); - if (ret) - goto out; - - cm_format_apr((struct cm_apr_msg *) msg->mad, cm_id_priv, status, - info, info_length, private_data, private_data_len); - ret = ib_post_send_mad(msg, NULL); - if (ret) { - spin_unlock_irqrestore(&cm_id_priv->lock, flags); - cm_free_msg(msg); - return ret; - } - - cm_id->lap_state = IB_CM_LAP_IDLE; -out: spin_unlock_irqrestore(&cm_id_priv->lock, flags); - return ret; -} -EXPORT_SYMBOL(ib_send_cm_apr); - static int cm_apr_handler(struct cm_work *work) { struct cm_id_private *cm_id_priv; diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h index 6237c369dbd6..adccdc12b8e3 100644 --- a/include/rdma/ib_cm.h +++ b/include/rdma/ib_cm.h @@ -483,21 +483,6 @@ int ib_send_cm_mra(struct ib_cm_id *cm_id, const void *private_data, u8 private_data_len); -/** - * ib_send_cm_lap - Sends a load alternate path request. - * @cm_id: Connection identifier associated with the load alternate path - * message. - * @alternate_path: A path record that identifies the alternate path to - * load. - * @private_data: Optional user-defined private data sent with the - * load alternate path message. - * @private_data_len: Size of the private data buffer, in bytes. - */ -int ib_send_cm_lap(struct ib_cm_id *cm_id, - struct sa_path_rec *alternate_path, - const void *private_data, - u8 private_data_len); - /** * ib_cm_init_qp_attr - Initializes the QP attributes for use in transitioning * to a specified QP state. @@ -518,25 +503,6 @@ int ib_cm_init_qp_attr(struct ib_cm_id *cm_id, struct ib_qp_attr *qp_attr, int *qp_attr_mask); -/** - * ib_send_cm_apr - Sends an alternate path response message in response to - * a load alternate path request. - * @cm_id: Connection identifier associated with the alternate path response. - * @status: Reply status sent with the alternate path response. - * @info: Optional additional information sent with the alternate path - * response. - * @info_length: Size of the additional information, in bytes. - * @private_data: Optional user-defined private data sent with the - * alternate path response message. - * @private_data_len: Size of the private data buffer, in bytes. - */ -int ib_send_cm_apr(struct ib_cm_id *cm_id, - enum ib_cm_apr_status status, - void *info, - u8 info_length, - const void *private_data, - u8 private_data_len); - struct ib_cm_sidr_req_param { struct sa_path_rec *path; const struct ib_gid_attr *sgid_attr; -- 2.20.1