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,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 7EC0AC2BA2B for ; Mon, 13 Apr 2020 14:15:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 561DE20774 for ; Mon, 13 Apr 2020 14:15:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586787359; bh=TS3Nv/0eudYMFcl8DRFARMo0DGxMAFm3mGpjELkwPB8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=GG360dg1zFfAGmmMkQT+y3od6Sv5CYSV/ySuefPU6lyGs0jrBbsjH2lCFXuJO+dx9 pqXteZ3DIdRnFs7kg7l4H/HWfu5SRMc/rzyowZogQ/uG62I2b2UnBMZKKqAMwltrlP syUHSn0MQDBGzMzOLx3GLENfTs0WVy1TsUc0dpZE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730458AbgDMOP6 (ORCPT ); Mon, 13 Apr 2020 10:15:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:47410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730417AbgDMOP5 (ORCPT ); Mon, 13 Apr 2020 10:15:57 -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 A78652075E; Mon, 13 Apr 2020 14:15:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586787357; bh=TS3Nv/0eudYMFcl8DRFARMo0DGxMAFm3mGpjELkwPB8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fEYU9OwLjvov8ltAU3+pRGNrOvD2nmc/oXPaYykCQKr35evNDmvuAVVk+eSb1RNDp zXwkoWlO4wRnGQ0zoXkGvOn5eMf0892YtUelFHYiRq4xzJHRuxjZGzMvdyWiyPzXi4 hm6u2eurT3PY6sni7Unb0goNnu8yyhtVU+E7aVw8= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , linux-rdma@vger.kernel.org Subject: [PATCH rdma-next v2 4/7] RDMA/ucma: Deliver ECE parameters through UCMA events Date: Mon, 13 Apr 2020 17:15:35 +0300 Message-Id: <20200413141538.935574-5-leon@kernel.org> X-Mailer: git-send-email 2.25.2 In-Reply-To: <20200413141538.935574-1-leon@kernel.org> References: <20200413141538.935574-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 Passive side of CMID connection receives ECE request through REQ message and needs to respond with relevant REP message which will be forwarded to active side. The UCMA events interface is responsible for such communication with the user space (librdmacm). Extend it to provide ECE wire data. Signed-off-by: Leon Romanovsky --- drivers/infiniband/core/ucma.c | 6 +++++- include/rdma/rdma_cm.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c index f7415d8d2140..ed2c17046ee1 100644 --- a/drivers/infiniband/core/ucma.c +++ b/drivers/infiniband/core/ucma.c @@ -360,6 +360,9 @@ static int ucma_event_handler(struct rdma_cm_id *cm_id, ucma_copy_conn_event(&uevent->resp.param.conn, &event->param.conn); + uevent->resp.ece.vendor_id = event->ece.vendor_id; + uevent->resp.ece.attr_mod = event->ece.attr_mod; + if (event->event == RDMA_CM_EVENT_CONNECT_REQUEST) { if (!ctx->backlog) { ret = -ENOMEM; @@ -404,7 +407,8 @@ static ssize_t ucma_get_event(struct ucma_file *file, const char __user *inbuf, * Old 32 bit user space does not send the 4 byte padding in the * reserved field. We don't care, allow it to keep working. */ - if (out_len < sizeof(uevent->resp) - sizeof(uevent->resp.reserved)) + if (out_len < sizeof(uevent->resp) - sizeof(uevent->resp.reserved) - + sizeof(uevent->resp.ece)) return -ENOSPC; if (copy_from_user(&cmd, inbuf, sizeof(cmd))) diff --git a/include/rdma/rdma_cm.h b/include/rdma/rdma_cm.h index 86a849214c84..761168c41848 100644 --- a/include/rdma/rdma_cm.h +++ b/include/rdma/rdma_cm.h @@ -111,6 +111,7 @@ struct rdma_cm_event { struct rdma_conn_param conn; struct rdma_ud_param ud; } param; + struct rdma_ucm_ece ece; }; struct rdma_cm_id; -- 2.25.2