Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1846526pxy; Mon, 2 Aug 2021 11:45:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvrUlkJneasMiYQJ2VkmP67NbYb4Z0xYAMDiEA8T9rnudQAMg1hjA6A6TgJBPFegNNllO0 X-Received: by 2002:a92:c605:: with SMTP id p5mr1565783ilm.209.1627929931579; Mon, 02 Aug 2021 11:45:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627929931; cv=none; d=google.com; s=arc-20160816; b=LGD2a6FxObLLEN0A4F1UbydiaobvWp6VP69hJ9DDeMCu2RxZJHsKjxqmKUSwa70ckB qrzmCu9XJomNTWDMadsexGUKCVB8XWwsTPWetWyalsxwsBTbOiObjYGuM+laF27CFdPD xeKmPH9ENt2N0sVvTbSFFecECLIRTUGHnMm4R5g1j87FjbR0/ECX1fMb7IX8+rF06sa4 j5z2iJVg/ZFP1L4IaYElIczu0no6fPrJDxZQfYR2/8/A7M5LpxsQYUNKIIU08y98PGn5 JqnjEwZD2yZkQysAiu8VNK/N0P5kOIRjR0t5RaznShrYdHH03Bk08TsM6RBfVKI1OGm4 nXNQ== 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=zyj/VD9sYCs5e4lB46d4CKsyF7p+d7EY7NKYfqm/TEo=; b=QVz1otk7uiRvYzyiYxsUpySHFMf8TeFhpRQWTXpsR7BwlFuo9SOZEMzSUkDQ/AiQ/I 3E/DaCyUBFeZUB0weWkkz0ZglRk8wAJJECrvJ+EvmaIS3/4H2p8GSJJw2j8luILzA1mx Y262MlymFgTclEtrcETlkDSp7hNE1k0raJ8gx0O/rAdD49GrjKu8hNmhW1tA31ddgV92 BlDCVjbYhkIITvh4bNtOAGE7xfqUm+M0gJx2I1MmCCF+9KCexjG6Xqc/OcpVyEfyYMuK qSVpZ+k1knBb7SaxfSJrasOCSafZOwzZCNl6/14RgaF7LmPyhPawuB60j0rQvgp7GvA0 rvEw== 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 q5si13444081ilt.55.2021.08.02.11.45.18; Mon, 02 Aug 2021 11:45:31 -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 S231273AbhHBSog (ORCPT + 99 others); Mon, 2 Aug 2021 14:44:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:58496 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbhHBSoe (ORCPT ); Mon, 2 Aug 2021 14:44:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D5F6E60EC0; Mon, 2 Aug 2021 18:44:24 +0000 (UTC) Subject: [PATCH v1 2/5] xprtrdma: Put rpcrdma_reps before waking the tear-down completion From: Chuck Lever To: trondmy@hammerspace.com, anna.schumaker@netapp.com Cc: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org Date: Mon, 02 Aug 2021 14:44:24 -0400 Message-ID: <162792986415.3902.15504693027425496524.stgit@manet.1015granger.net> In-Reply-To: <162792979429.3902.11831790821518477892.stgit@manet.1015granger.net> References: <162792979429.3902.11831790821518477892.stgit@manet.1015granger.net> User-Agent: StGit/1.1 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 Ensure the tear-down completion is awoken only /after/ we've stopped fiddling with rpcrdma_rep objects in rpcrdma_post_recvs(). Fixes: 15788d1d1077 ("xprtrdma: Do not refresh Receive Queue while it is draining") Signed-off-by: Chuck Lever --- net/sunrpc/xprtrdma/verbs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c index c1797ea19418..016f10a781b4 100644 --- a/net/sunrpc/xprtrdma/verbs.c +++ b/net/sunrpc/xprtrdma/verbs.c @@ -1416,11 +1416,6 @@ void rpcrdma_post_recvs(struct rpcrdma_xprt *r_xprt, int needed, bool temp) rc = ib_post_recv(ep->re_id->qp, wr, (const struct ib_recv_wr **)&bad_wr); - if (atomic_dec_return(&ep->re_receiving) > 0) - complete(&ep->re_done); - -out: - trace_xprtrdma_post_recvs(r_xprt, count, rc); if (rc) { for (wr = bad_wr; wr;) { struct rpcrdma_rep *rep; @@ -1431,6 +1426,11 @@ void rpcrdma_post_recvs(struct rpcrdma_xprt *r_xprt, int needed, bool temp) --count; } } + if (atomic_dec_return(&ep->re_receiving) > 0) + complete(&ep->re_done); + +out: + trace_xprtrdma_post_recvs(r_xprt, count, rc); ep->re_receive_count += count; return; }