Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2777450pxb; Mon, 19 Apr 2021 13:45:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxH9EY6SFQD2BUJ49kMFoTD7K9GXAEn5n/pU+SNewP3KMcNPtrujaMYaNRqzukbTcZKwJEF X-Received: by 2002:a62:b606:0:b029:222:7cab:5b1 with SMTP id j6-20020a62b6060000b02902227cab05b1mr21018913pff.32.1618865103293; Mon, 19 Apr 2021 13:45:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618865103; cv=none; d=google.com; s=arc-20160816; b=Og7Cf0xDwlXm+AU10X6dJI8t6ighyg4nW/nqNjgjLukL7Fblo74Wm3KKioRdqcA7ep V51C7B8x5IFFK0qnykI9YkbO13jGg8ACv+voCjZOlojjodPJQgKPHk45rgDTizL1uSqd o9CwOKZ4gKyUoI0fLCzQXhoQxz3/LGos1ruIy0r0XyW5d8grl4Mln21/reQS/1rTynqq iDeUHy/MO8BRvZIzfo1G3crfNGe6WiwuiwbDim3vnA9fm2ddRuO44Cp0hc5vP7TfacdV FgF3dGzehRSpVEwbZWR4esndwKmViQ91D+1lHo+pFALOTSh2LqgFkA58fhAOVB7/9xrr BPpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject; bh=ctc6e+PQwWnId+xfsV4RzgcpQhUFYylVzZBl/vyualI=; b=czxpyJ46xGcXsuxOlSL2LnHjIRA6o6SkXPYwREpaJJlS0rYjyFM2XjbHDHJCVBsuSc pLkDVlpSobYhIZPLDQVQPLd57sxvN/AIPbmZ+hhd2dCf+oD5eabmscVSZ82DDCD1Jbrs IDjMC+HS0yGkRYiC2scjpeXQFX/Ii02nU15cw5YF9eoM4LjxXc6t8W0c28G1xlP3q5vj MLZYZ6pA9py0/C4AJdTMQIUD1RuFSY/XsM653TByBF9MulaYxZGtQzwjyHLPVh1RU9BP saYxSSjxpj9bK7QFgD+g3QEl3rtqnEDyrzqxLr3seKy8jGHJ7HmvmOm7HeJkwtPxT5mI S/DQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d11si21744751pfd.282.2021.04.19.13.44.49; Mon, 19 Apr 2021 13:45:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240470AbhDSSCf (ORCPT + 99 others); Mon, 19 Apr 2021 14:02:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:40862 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240433AbhDSSCe (ORCPT ); Mon, 19 Apr 2021 14:02:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7A02D61001; Mon, 19 Apr 2021 18:02:04 +0000 (UTC) Subject: [PATCH v3 04/26] xprtrdma: Avoid Receive Queue wrapping From: Chuck Lever To: trondmy@hammerspace.com Cc: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Date: Mon, 19 Apr 2021 14:02:03 -0400 Message-ID: <161885532369.38598.5198559642333362919.stgit@manet.1015granger.net> In-Reply-To: <161885481568.38598.16682844600209775665.stgit@manet.1015granger.net> References: <161885481568.38598.16682844600209775665.stgit@manet.1015granger.net> User-Agent: StGit/0.23-29-ga622f1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Commit e340c2d6ef2a ("xprtrdma: Reduce the doorbell rate (Receive)") increased the number of Receive WRs that are posted by the client, but did not increase the size of the Receive Queue allocated during transport set-up. This is usually not an issue because RPCRDMA_BACKWARD_WRS is defined as (32) when SUNRPC_BACKCHANNEL is defined. In cases where it isn't, there is a real risk of Receive Queue wrapping. Fixes: e340c2d6ef2a ("xprtrdma: Reduce the doorbell rate (Receive)") Signed-off-by: Chuck Lever Reviewed-by: Tom Talpey --- net/sunrpc/xprtrdma/frwr_ops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sunrpc/xprtrdma/frwr_ops.c b/net/sunrpc/xprtrdma/frwr_ops.c index 766a1048a48a..132df9b59ab4 100644 --- a/net/sunrpc/xprtrdma/frwr_ops.c +++ b/net/sunrpc/xprtrdma/frwr_ops.c @@ -257,6 +257,7 @@ int frwr_query_device(struct rpcrdma_ep *ep, const struct ib_device *device) ep->re_attr.cap.max_send_wr += 1; /* for ib_drain_sq */ ep->re_attr.cap.max_recv_wr = ep->re_max_requests; ep->re_attr.cap.max_recv_wr += RPCRDMA_BACKWARD_WRS; + ep->re_attr.cap.max_recv_wr += RPCRDMA_MAX_RECV_BATCH; ep->re_attr.cap.max_recv_wr += 1; /* for ib_drain_rq */ ep->re_max_rdma_segs =