From patchwork Tue May 30 18:16:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 9755075 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0CC0E601D2 for ; Tue, 30 May 2017 18:16:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0787267EC for ; Tue, 30 May 2017 18:16:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E55C127EE2; Tue, 30 May 2017 18:16:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8485A267EC for ; Tue, 30 May 2017 18:16:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751162AbdE3SQN (ORCPT ); Tue, 30 May 2017 14:16:13 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:33490 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750979AbdE3SQM (ORCPT ); Tue, 30 May 2017 14:16:12 -0400 Received: by mail-io0-f195.google.com with SMTP id m4so9823310ioe.0; Tue, 30 May 2017 11:16:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=052UduebrT+hjyr5H6ksE9ga2LCPRuGopnvn/IAn96M=; b=Sht3iDVMQ7UHVfO6sMZWy1Ir0BxuYAgrC+Lb0Mv6X5IgQsjz0Kyg46+uYJnp3KHzkX IQ96wlJnFlHRSrp5luDiJexai1SSYB4tDyuKbscucb+viV2GQSDRnTet2K3rbl8+bKyR Xv32s0Aj3akO/ywmlBJBm2ZcfIrI72bfmWyRDlNHiBEGNolMFf+E9F9Qq1JJG0KHu3Kw fClDXyk+GT3RGxP39G1+KweWfV5nGOO6jcCcYSN8/3HwKrWmZEFyKRjjhQTFKpFplr3c 7ow7BMtAa8A5tuA5JShJHR8ve43Dm7QpY7CFcmvlk6lL7KZbvdxfflgjvyn8bEZPgPHi 4WlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=052UduebrT+hjyr5H6ksE9ga2LCPRuGopnvn/IAn96M=; b=k/P0aEqLQnLhjcxqBLpklFxxEu4qj3JQFWPnnXqzEKFxX2Sh7exGjsejt2+mX4OlAY VuYGSnuAiysGuew5e2jmSkp3cDtsCTjqyrSWKEtqTd5ZzYVeGl6EFlzbL9Qzw7vtZCaU ijzy/iPxMSW0ViIOGeRJ6+tyrUpNf2n8cD/H4ygkVtUg37LjoftqszMwZd0RzZf7Lhi9 J937FhRRZjFwawIzkKGG5GzqZtrSDmXgoY1uSaXZE347eVh/qABN/1uVRT9+mN/3G946 zxg0m1Hcn6x/z8rHTagsEVnELGIkQFK4U7ifEH5fWnUEPP9+DrUNxZro0ZVBQTXRh1uZ 1hwA== X-Gm-Message-State: AODbwcCrmbRmvspsbGvhHh01JykWzlaJ6SbXSZJGDaqvdCuIsTKlURAA VvnYbHHMRBLeNnky X-Received: by 10.107.156.140 with SMTP id f134mr19718541ioe.9.1496168171645; Tue, 30 May 2017 11:16:11 -0700 (PDT) Received: from klimt.1015granger.net (c-68-46-169-226.hsd1.mi.comcast.net. [68.46.169.226]) by smtp.gmail.com with ESMTPSA id e126sm5961811ioe.12.2017.05.30.11.16.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 May 2017 11:16:11 -0700 (PDT) Subject: [PATCH v1 16/17] svcrdma: Clean up after converting svc_rdma_recvfrom to rdma_rw API From: Chuck Lever To: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org Date: Tue, 30 May 2017 14:16:10 -0400 Message-ID: <20170530181610.2992.59462.stgit@klimt.1015granger.net> In-Reply-To: <20170530175808.2992.60365.stgit@klimt.1015granger.net> References: <20170530175808.2992.60365.stgit@klimt.1015granger.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Clean up: Registration mode details are now handled by the rdma_rw API, and thus can be removed from svcrdma. Signed-off-by: Chuck Lever --- include/linux/sunrpc/svc_rdma.h | 4 --- net/sunrpc/xprtrdma/svc_rdma_transport.c | 39 +++--------------------------- 2 files changed, 4 insertions(+), 39 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h index fd7775f..995c6fe 100644 --- a/include/linux/sunrpc/svc_rdma.h +++ b/include/linux/sunrpc/svc_rdma.h @@ -90,9 +90,6 @@ struct svc_rdma_op_ctxt { struct page *pages[RPCSVC_MAXPAGES]; }; -#define SVCRDMA_DEVCAP_FAST_REG 1 /* fast mr registration */ -#define SVCRDMA_DEVCAP_READ_W_INV 2 /* read w/ invalidate */ - struct svcxprt_rdma { struct svc_xprt sc_xprt; /* SVC transport structure */ struct rdma_cm_id *sc_cm_id; /* RDMA connection id */ @@ -123,7 +120,6 @@ struct svcxprt_rdma { struct ib_qp *sc_qp; struct ib_cq *sc_rq_cq; struct ib_cq *sc_sq_cq; - u32 sc_dev_caps; /* distilled device caps */ spinlock_t sc_lock; /* transport lock */ diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 75bd11f..e660d49 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c @@ -783,7 +783,7 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) memset(&qp_attr, 0, sizeof qp_attr); qp_attr.event_handler = qp_event_handler; qp_attr.qp_context = &newxprt->sc_xprt; - qp_attr.port_num = newxprt->sc_cm_id->port_num; + qp_attr.port_num = newxprt->sc_port_num; qp_attr.cap.max_rdma_ctxs = newxprt->sc_max_requests; qp_attr.cap.max_send_wr = newxprt->sc_sq_depth; qp_attr.cap.max_recv_wr = newxprt->sc_rq_depth; @@ -807,43 +807,12 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) } newxprt->sc_qp = newxprt->sc_cm_id->qp; - /* - * Use the most secure set of MR resources based on the - * transport type and available memory management features in - * the device. Here's the table implemented below: - * - * Fast Global DMA Remote WR - * Reg LKEY MR Access - * Sup'd Sup'd Needed Needed - * - * IWARP N N Y Y - * N Y Y Y - * Y N Y N - * Y Y N - - * - * IB N N Y N - * N Y N - - * Y N Y N - * Y Y N - - * - * NB: iWARP requires remote write access for the data sink - * of an RDMA_READ. IB does not. - */ - if (dev->attrs.device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) { - newxprt->sc_dev_caps |= SVCRDMA_DEVCAP_FAST_REG; - } else + if (!(dev->attrs.device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS)) newxprt->sc_snd_w_inv = false; - - /* - * Determine if a DMA MR is required and if so, what privs are required - */ - if (!rdma_protocol_iwarp(dev, newxprt->sc_cm_id->port_num) && - !rdma_ib_or_roce(dev, newxprt->sc_cm_id->port_num)) + if (!rdma_protocol_iwarp(dev, newxprt->sc_port_num) && + !rdma_ib_or_roce(dev, newxprt->sc_port_num)) goto errout; - if (rdma_protocol_iwarp(dev, newxprt->sc_cm_id->port_num)) - newxprt->sc_dev_caps |= SVCRDMA_DEVCAP_READ_W_INV; - /* Post receive buffers */ for (i = 0; i < newxprt->sc_max_requests; i++) { ret = svc_rdma_post_recv(newxprt, GFP_KERNEL);