Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3081023pxj; Mon, 17 May 2021 17:17:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNOaCOygY50BiosbdzgvE2+bJYCFN6IIx7NeQwkDV121gSUO2X51Kbtc1uXRN7SsLHrCJJ X-Received: by 2002:a17:906:349b:: with SMTP id g27mr2816101ejb.218.1621297022486; Mon, 17 May 2021 17:17:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621297022; cv=none; d=google.com; s=arc-20160816; b=tb0VgxNN6c1bXpEWF0Vr7AwcCjEwu99I7/4SL15jd+fTEIcOVSkll86iybEGtgU4Xz Jx5Ex0ztHD2tf0rwMvAQznH7sXTiW7y1pQ+z/kbyxHI5XXL8tgO0ISVcs0VVGA/bKmZf MS9NIOq5+XFp1spl6gikGKJvo4wgfw1BZfqrYkV6aIJSku8orLy7lLYQSzX+3B05DUYV tnNFDKt9lMUrjm/wFZgGmCM7Ym7mtKol3HVIts610JBsNebWE0psI6h1V9YeZ5DbptR1 /9MycE2VdwbWjjvbIjATzh76f2LoHbA+N5+SUenU1WqtEegDlPyMkX6Dmgw4byW3kzT3 aZCQ== 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:subject:cc:to :from:dkim-signature; bh=aUE7wPMmZtQlDm+qmjYtXjuDYgzxt0V7tS0sowNWaAU=; b=cUtCnabSeWyxZCmoXMMBWkugDEIZTpxli+gJpsUeZ5ovv7PSD+ICQUbI8meFNi2QEu Xx9cxq0Mc07TuzFD14UeAClX9nQfcYw41GXSwwOTFRwHfchXquvraMwGq/WvlA6lu2CP mV3OuWjHj1wJSoSbgCL8SnTdXsioOhCXpjHHbZ9ZGmbVxcjQuCJ5v2D86nZn2wsrC+KQ ddlqqaKHJcvlxIoZS+KL/S087HG2sIGlBgFeqjbD/1jjyF9+X10lgVM4sjfuXfdRGu8c TnJudB9ewB2mJ47bjQ5ERlEDwYKcK9Ju9oEMqjf9wdqvs9koCAtg19v9J4nC2yjb2bZW zx6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lTSNRPpz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j7si15835279ejn.636.2021.05.17.17.16.39; Mon, 17 May 2021 17:17:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lTSNRPpz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237487AbhEQO03 (ORCPT + 99 others); Mon, 17 May 2021 10:26:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:48432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239295AbhEQOWt (ORCPT ); Mon, 17 May 2021 10:22:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6690B61462; Mon, 17 May 2021 14:12:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260734; bh=b83efOLHTmSSGmFU5D4z0nVxQnv622V+MVAwLRfQLy8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lTSNRPpzVxUXBhwGrBYCsMfDsDTjJFoap/S2yOK36kL29Z1Pg4SgbgLMqrukbR+yz KpgWKDSsTG4bExxIASuA87P1WMB6O6mAzTPBSPO4k34pCYuwvNLsLwYN+g+LxEbDMk LSDTyVr97Z/92MjswdUZTQr7T5SFgCIEvboSmxsk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuck Lever , Tom Talpey , Trond Myklebust , Sasha Levin Subject: [PATCH 5.12 181/363] xprtrdma: Avoid Receive Queue wrapping Date: Mon, 17 May 2021 16:00:47 +0200 Message-Id: <20210517140308.712181135@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chuck Lever [ Upstream commit 32e6b68167f1d446111c973d57e6f52aee11897a ] 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 Signed-off-by: Trond Myklebust Signed-off-by: Sasha Levin --- 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 = -- 2.30.2