Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp459756pxj; Tue, 18 May 2021 07:14:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7ghmO56Ozkgsas3Ay3gzoPIeuHgHZQXyHEjC/d3EGCK7DdRmrc28WYdVuSkwjyD+ptX3T X-Received: by 2002:a50:ccc9:: with SMTP id b9mr7411708edj.316.1621347260585; Tue, 18 May 2021 07:14:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621347260; cv=none; d=google.com; s=arc-20160816; b=pzfUudgkq0TSsiIzi0GxYf/ZUxnYkQphVn9aC6IdAnmYIecWhiANHFdb1bGfmCLC+X 0N+RuiBjoP4Mpd0Z3Zwyc+FLy/FTbxaAYQSsXFNjDTrCm/T+D5/mfC05ouZAO9OFwmx8 sFKjH9UjgG1/hpZFC8q5S6lqF6nViGTWznVhlZH+RS15vRJSnq+UasctxyKTnyQm7Taw lMVVuQ0kzZ0IiX3laXky0N65WDzm09UwWS+zf4YHK/MtcFWz1kEMIlp4dIdQZp7Eu9XW mKtVU1YuxM9SK6R7G11uZjD/kl3EsUjqqYkayS0NMgGgOGoUivpKRENE8r46px+96olX yurQ== 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=p+Ta5VvKCzqSvvQqjoH1JCUAQ0KXPglmSi2Pjvg9M9k=; b=Obv7lp8OfQythVO0JvFCKK+9QCt2xRo9S6bj2ylkxvriJ3R3FSoGDL4JqzmW7TJhiY +px7TdxGhP457Hfuo4Q1AkIBKuSGzvrsPbLOB7XXQmzrCvy7DJQ5M/LtARmLb5j9kMNg a/bXMSWC+CqmicxOPZHuSE5ZFJmzftCGb8vZyJ+5i6UAGnj1GR1CtpMtJSNrPlnTsHcN +EzyALf507L4DxQbg4Nw8hEPcewE6lCMFyPlD20bcrtG+/CL7WcSx1aLpsdtAP6lEFAn mcz/Kreay0RB+Snrdz/h2jLCHyPOljRvOKWGojGmX7LkX904cbtb3nD8PbLBilOQno3W p1yQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cAcISgTE; 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 b13si457656ede.603.2021.05.18.07.13.57; Tue, 18 May 2021 07:14:20 -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=cAcISgTE; 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 S1343814AbhEQPnL (ORCPT + 99 others); Mon, 17 May 2021 11:43:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:53994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244522AbhEQP2E (ORCPT ); Mon, 17 May 2021 11:28:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 872DF61353; Mon, 17 May 2021 14:36:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262217; bh=VlQCGAaOLVx6NvIAQ6R7D6hLw6Vt4K6BgxSHA91dWtc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cAcISgTEgkm257TjFsUlz/zrwsJwU26JWqF4JV0mhD7DHkAIDP7dc6rJ50+JJxVy7 TcLMjXvjgeM+cV64CWhY8Z4BK/bWk956dCkPGdOG/o3p5e6CK4E0lPL9fsivB7k5Pf ivpxZp9oo9EPBKcjUnPDTT6x11eCwBdLfWhVENn0= 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.10 135/289] xprtrdma: Avoid Receive Queue wrapping Date: Mon, 17 May 2021 16:01:00 +0200 Message-Id: <20210517140309.708009272@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@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 44888f5badef..8f96bb0a6061 100644 --- a/net/sunrpc/xprtrdma/frwr_ops.c +++ b/net/sunrpc/xprtrdma/frwr_ops.c @@ -242,6 +242,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