From patchwork Thu Sep 17 20:46:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 7210391 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2C94E9F336 for ; Thu, 17 Sep 2015 20:46:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 373982054C for ; Thu, 17 Sep 2015 20:46:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 490D0206A0 for ; Thu, 17 Sep 2015 20:46:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751854AbbIQUqK (ORCPT ); Thu, 17 Sep 2015 16:46:10 -0400 Received: from mail-qg0-f51.google.com ([209.85.192.51]:35034 "EHLO mail-qg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751190AbbIQUqI (ORCPT ); Thu, 17 Sep 2015 16:46:08 -0400 Received: by qgt47 with SMTP id 47so23441038qgt.2; Thu, 17 Sep 2015 13:46:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:from:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=cKnk7IMW6/c4IzZ5F870JOV05kEY1HPYd4Ukkrr0vGE=; b=McCbrCmiqIyjjXFKQ1xhavgDv5JJsfLdO9NO37+KtdT5zevEytf6UK/oohT3rF38fc 3kvVWDFBq9KIQE7SfVXFRJlqZrWRuRI9XHbmndG1aENuZzIjX9mtpcbMYZRB9pJbaYTq z5kY0FcaX1D4y8dRZBZNi+Vq7wK8YQJdh+JOw+CeNxvHXZFFshedCYP1ll6fg2Hka2l9 KRqHxiOFEqqkcF2EY5u+vEPEhCyBebgZkDHqZLpQFCOr39hl6UwbG/NBg4a4MMLU+J3f +HpZ4aGMvAF+XKZ8a2W8skD9SGhd+8pPlnxwR7v3Oq5g7tCkpqO6MBuzTIpCZ7dOHzJ/ Px2g== X-Received: by 10.140.106.226 with SMTP id e89mr2144908qgf.84.1442522767373; Thu, 17 Sep 2015 13:46:07 -0700 (PDT) Received: from manet.1015granger.net ([2604:8800:100:81fc:82ee:73ff:fe43:d64f]) by smtp.gmail.com with ESMTPSA id s12sm2069702qkl.2.2015.09.17.13.46.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 13:46:07 -0700 (PDT) Subject: [PATCH v1 14/18] svcrdma: Define maximum number of backchannel requests From: Chuck Lever To: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org Date: Thu, 17 Sep 2015 16:46:06 -0400 Message-ID: <20150917204606.19671.5961.stgit@manet.1015granger.net> In-Reply-To: <20150917202829.19671.90044.stgit@manet.1015granger.net> References: <20150917202829.19671.90044.stgit@manet.1015granger.net> User-Agent: StGit/0.17.1-3-g7d0f MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Extra resources for handling backchannel requests have to be pre-allocated when a transport instance is created. Set a limit. Signed-off-by: Chuck Lever --- include/linux/sunrpc/svc_rdma.h | 5 +++++ net/sunrpc/xprtrdma/svc_rdma_transport.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" 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 fb4013e..6ce7495 100644 --- a/include/linux/sunrpc/svc_rdma.h +++ b/include/linux/sunrpc/svc_rdma.h @@ -180,6 +180,11 @@ struct svcxprt_rdma { #define RPCRDMA_SQ_DEPTH_MULT 8 #define RPCRDMA_MAX_REQUESTS 32 #define RPCRDMA_MAX_REQ_SIZE 4096 +#if defined(CONFIG_SUNRPC_BACKCHANNEL) +#define RPCRDMA_MAX_BC_REQUESTS 8 +#else +#define RPCRDMA_MAX_BC_REQUESTS 0 +#endif #define RPCSVC_MAXPAYLOAD_RDMA RPCSVC_MAXPAYLOAD diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index a133b1e..23aba30 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c @@ -935,8 +935,10 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) (size_t)RPCSVC_MAXPAGES); newxprt->sc_max_sge_rd = min_t(size_t, devattr.max_sge_rd, RPCSVC_MAXPAGES); + /* XXX: what if HCA can't support enough WRs for bc operation? */ newxprt->sc_max_requests = min((size_t)devattr.max_qp_wr, - (size_t)svcrdma_max_requests); + (size_t)(svcrdma_max_requests + + RPCRDMA_MAX_BC_REQUESTS)); newxprt->sc_sq_depth = RPCRDMA_SQ_DEPTH_MULT * newxprt->sc_max_requests; /* @@ -976,7 +978,9 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt) qp_attr.event_handler = qp_event_handler; qp_attr.qp_context = &newxprt->sc_xprt; qp_attr.cap.max_send_wr = newxprt->sc_sq_depth; + qp_attr.cap.max_send_wr += RPCRDMA_MAX_BC_REQUESTS; qp_attr.cap.max_recv_wr = newxprt->sc_max_requests; + qp_attr.cap.max_recv_wr += RPCRDMA_MAX_BC_REQUESTS; qp_attr.cap.max_send_sge = newxprt->sc_max_sge; qp_attr.cap.max_recv_sge = newxprt->sc_max_sge; qp_attr.sq_sig_type = IB_SIGNAL_REQ_WR;