From patchwork Mon Jun 29 14:50:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 11631811 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8DCA514B7 for ; Mon, 29 Jun 2020 19:38:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76636206A1 for ; Mon, 29 Jun 2020 19:38:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GfpSf3j2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387463AbgF2Thx (ORCPT ); Mon, 29 Jun 2020 15:37:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387454AbgF2Tho (ORCPT ); Mon, 29 Jun 2020 15:37:44 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E180C02F013; Mon, 29 Jun 2020 07:50:05 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id g13so13006216qtv.8; Mon, 29 Jun 2020 07:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=Xqol0YYHpEvswBoUVlP6v8tsfvVQp+w5nGY/v7Hvy2s=; b=GfpSf3j274MQbN6wKacSMHs3mq+lwatB1WxvTrVMlfHDXxXFZlcKXe1DqTLGqmE9zA Y0cG2ARBdR0WL3MdjpQz+S4/0lQVczgl/iat/9lcAvnC9OmQdfe0lZYRRm/qFtJIskT0 TDe0TCVFTkpKsThMbO1A4lDn4NFTRn5O2abZ2Yy86wPprlMisokp+k7BqhVvgtBZucHq w2VHnZi5wuqj7+gvUYMAX7ggXdDuou4bwmZZmMKtDvWvQrypjRBPIWJgDRYl4f3A7z4R 6UfwudChBT6GpV3+xbP5v2mb9qGD54+B8v+5vLo0qj6Ff0DrpjEmiZ+crjwELrARSnWF vR+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=Xqol0YYHpEvswBoUVlP6v8tsfvVQp+w5nGY/v7Hvy2s=; b=IYsNWlyOP0SE4VbcNrU4W5S8K0iSMZ5LQ97LiTHMVOrodYJv6H8jpR2NGqQuwvzpVW 7eLjRapvkPrDU0sdoxR2YLL/spZtqu7FMshILmcSB9n7ywZGbWpaZgj3NHus7VASwoO4 lpTjjILUDpZF2CdZxNgN5e+sE/RvTZVfrD/UNHRNR8F1MvceNWHCvopR0scikEH6ReRy VQ9alvHI/rBXbzje8kXaeSMC4o9Zk/cIdQIcYmXluyoWdtvlL//iwd11zXFb7koii2xe 8NDSGW22lHQGK/T159EU6tnrsNCqHNOrUli8zEemjuZPpMSQTooR5qqYxuj41wVKt0y8 JQxg== X-Gm-Message-State: AOAM531TuXWDPmDJSnbu8BfySHNKj7xmcSPXCOM404F2OMBAKCd/vowP 03m0GZnw2boJl3k+sTTEztKFBF3T X-Google-Smtp-Source: ABdhPJyivBLhFQqyWungfUcgPb7+fQCgRWma10Cy63pDZE9RQlizbBc3+fJceAHi4Ot77kzbNqqOXg== X-Received: by 2002:ac8:c4e:: with SMTP id l14mr736301qti.106.1593442204478; Mon, 29 Jun 2020 07:50:04 -0700 (PDT) Received: from gateway.1015granger.net (c-68-61-232-219.hsd1.mi.comcast.net. [68.61.232.219]) by smtp.gmail.com with ESMTPSA id 16sm31099qkv.48.2020.06.29.07.50.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2020 07:50:04 -0700 (PDT) Received: from klimt.1015granger.net (klimt.1015granger.net [192.168.1.55]) by gateway.1015granger.net (8.14.7/8.14.7) with ESMTP id 05TEo3R1006195; Mon, 29 Jun 2020 14:50:03 GMT Subject: [PATCH v2 1/8] svcrdma: Fix page leak in svc_rdma_recv_read_chunk() From: Chuck Lever To: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Date: Mon, 29 Jun 2020 10:50:03 -0400 Message-ID: <20200629145003.15024.82869.stgit@klimt.1015granger.net> In-Reply-To: <20200629144802.15024.30635.stgit@klimt.1015granger.net> References: <20200629144802.15024.30635.stgit@klimt.1015granger.net> User-Agent: StGit/0.22-31-g4b47 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Commit 07d0ff3b0cd2 ("svcrdma: Clean up Read chunk path") moved the page saver logic so that it gets executed event when an error occurs. In that case, the I/O is never posted, and those pages are then leaked. Errors in this path, however, are quite rare. Fixes: 07d0ff3b0cd2 ("svcrdma: Clean up Read chunk path") Signed-off-by: Chuck Lever --- net/sunrpc/xprtrdma/svc_rdma_rw.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/net/sunrpc/xprtrdma/svc_rdma_rw.c b/net/sunrpc/xprtrdma/svc_rdma_rw.c index 5eb35309ecef..83806fa94def 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_rw.c +++ b/net/sunrpc/xprtrdma/svc_rdma_rw.c @@ -684,7 +684,6 @@ static int svc_rdma_build_read_chunk(struct svc_rqst *rqstp, struct svc_rdma_read_info *info, __be32 *p) { - unsigned int i; int ret; ret = -EINVAL; @@ -707,12 +706,6 @@ static int svc_rdma_build_read_chunk(struct svc_rqst *rqstp, info->ri_chunklen += rs_length; } - /* Pages under I/O have been copied to head->rc_pages. - * Prevent their premature release by svc_xprt_release() . - */ - for (i = 0; i < info->ri_readctxt->rc_page_count; i++) - rqstp->rq_pages[i] = NULL; - return ret; } @@ -807,6 +800,26 @@ static int svc_rdma_build_pz_read_chunk(struct svc_rqst *rqstp, return ret; } +/* Pages under I/O have been copied to head->rc_pages. Ensure they + * are not released by svc_xprt_release() until the I/O is complete. + * + * This has to be done after all Read WRs are constructed to properly + * handle a page that is part of I/O on behalf of two different RDMA + * segments. + * + * Do this only if I/O has been posted. Otherwise, we do indeed want + * svc_xprt_release() to clean things up properly. + */ +static void svc_rdma_save_io_pages(struct svc_rqst *rqstp, + const unsigned int start, + const unsigned int num_pages) +{ + unsigned int i; + + for (i = start; i < num_pages + start; i++) + rqstp->rq_pages[i] = NULL; +} + /** * svc_rdma_recv_read_chunk - Pull a Read chunk from the client * @rdma: controlling RDMA transport @@ -860,6 +873,7 @@ int svc_rdma_recv_read_chunk(struct svcxprt_rdma *rdma, struct svc_rqst *rqstp, ret = svc_rdma_post_chunk_ctxt(&info->ri_cc); if (ret < 0) goto out_err; + svc_rdma_save_io_pages(rqstp, 0, head->rc_page_count); return 0; out_err: From patchwork Mon Jun 29 14:50:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 11631809 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D774F14E3 for ; Mon, 29 Jun 2020 19:37:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0217206F1 for ; Mon, 29 Jun 2020 19:37:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VFzoyaMV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731972AbgF2Thu (ORCPT ); Mon, 29 Jun 2020 15:37:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387456AbgF2Thp (ORCPT ); Mon, 29 Jun 2020 15:37:45 -0400 Received: from mail-qv1-xf44.google.com (mail-qv1-xf44.google.com [IPv6:2607:f8b0:4864:20::f44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2333C02F014; Mon, 29 Jun 2020 07:50:10 -0700 (PDT) Received: by mail-qv1-xf44.google.com with SMTP id t7so7731523qvl.8; Mon, 29 Jun 2020 07:50:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=qdqoEbktn4y6PV/kskrC+LFY1GfPSLmprda8TiArdPQ=; b=VFzoyaMVhuFajSsuvze+4TRviiSsqUWHrQazHBM94wkZcJcme1Kr+RsczMppE2do93 GFQ1uASU0e/W7RXB8GBt2CRA/Twle5tenunnRCVIP4PoIK/Yj+A9KQCPIDc3B7a2vdNY JDGPfd8WShBwumxtFP5jLPos9qXUyiFfODxK1Hf+/Ozxw8rTKPmbUVMxVYxhnXHLP8lM nUNZ1f7pN0H6aLHOcqEd58X+3iczrcpgZji4tswM7UcSDnP8jm9h/ytXdS1ebm5Ae/NX X0fJG79D3NgpzyBTC0US0idOC9om+PCigVSaL/pONINuhKGu4I/MWjdQmx4VPUeVteCv WYJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=qdqoEbktn4y6PV/kskrC+LFY1GfPSLmprda8TiArdPQ=; b=N9zI3ArpeEIs2VmsenDdaDAJY3RMNPLcvaaWMf65hUSDvHhXMQZOCAYyZN2Luxmgn7 rMoWN6bNvG/Z+AT+7fpm3+lSMKoGD431xn/at56SblcMlqt4fCje7cfH0iWCzitujmX+ /Ha23JjEgHPI0ifh4Ih8X09SFmuPxMSIdUKdDhlAOQotEAvo8UWjG0fzz198y3n8B5nJ AJTrG4Lct7Q96QzNCzLO0rQwlguxhFNwnJtS5bkvI5zy3/z4E1nZyg5J9kCuZzBCNWA3 vhjRjn9hdjTQZV4QrWFDwOZPo6wbaZFopNQ4T+EdWAanpADiY3CvYaZQjXoAPPBl5kQE KCwA== X-Gm-Message-State: AOAM533OpFFSND9kIO6iqJKcet6EQZDPCqykhgO02G+fjjIvc2AvPuxF A+p0ihU1Oyja6Ouot+9vUF3Fy2aa X-Google-Smtp-Source: ABdhPJwwXu1A+Q3DtTA+w/TNmFZj3V/YwdqFlo7H4DLU3uK3oUHClt0CNOxdv7kY0LPjAOdWz3w2RA== X-Received: by 2002:a0c:f486:: with SMTP id i6mr15145220qvm.229.1593442209748; Mon, 29 Jun 2020 07:50:09 -0700 (PDT) Received: from gateway.1015granger.net (c-68-61-232-219.hsd1.mi.comcast.net. [68.61.232.219]) by smtp.gmail.com with ESMTPSA id n64sm20238qke.77.2020.06.29.07.50.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2020 07:50:09 -0700 (PDT) Received: from klimt.1015granger.net (klimt.1015granger.net [192.168.1.55]) by gateway.1015granger.net (8.14.7/8.14.7) with ESMTP id 05TEo8Fn006198; Mon, 29 Jun 2020 14:50:08 GMT Subject: [PATCH v2 2/8] svcrdma: Remove save_io_pages() call from send_error_msg() From: Chuck Lever To: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Date: Mon, 29 Jun 2020 10:50:08 -0400 Message-ID: <20200629145008.15024.61477.stgit@klimt.1015granger.net> In-Reply-To: <20200629144802.15024.30635.stgit@klimt.1015granger.net> References: <20200629144802.15024.30635.stgit@klimt.1015granger.net> User-Agent: StGit/0.22-31-g4b47 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Commit 4757d90b15d8 ("svcrdma: Report Write/Reply chunk overruns") made an effort to preserve I/O pages until RDMA Write completion. In a subsequent patch, I intend to de-duplicate the two functions that send ERR_CHUNK responses. Pull the save_io_pages() call out of svc_rdma_send_error_msg() to make it more like svc_rdma_send_error(). Signed-off-by: Chuck Lever --- net/sunrpc/xprtrdma/svc_rdma_sendto.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index 38e7c3c8c4a9..2f88d01e8d27 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c @@ -806,8 +806,7 @@ static int svc_rdma_send_reply_msg(struct svcxprt_rdma *rdma, /* Given the client-provided Write and Reply chunks, the server was not * able to form a complete reply. Return an RDMA_ERROR message so the - * client can retire this RPC transaction. As above, the Send completion - * routine releases payload pages that were part of a previous RDMA Write. + * client can retire this RPC transaction. * * Remote Invalidation is skipped for simplicity. */ @@ -834,8 +833,6 @@ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, *p = err_chunk; trace_svcrdma_err_chunk(*rdma_argp); - svc_rdma_save_io_pages(rqstp, ctxt); - ctxt->sc_send_wr.num_sge = 1; ctxt->sc_send_wr.opcode = IB_WR_SEND; ctxt->sc_sges[0].length = ctxt->sc_hdrbuf.len; @@ -930,6 +927,10 @@ int svc_rdma_sendto(struct svc_rqst *rqstp) if (ret != -E2BIG && ret != -EINVAL) goto err1; + /* Send completion releases payload pages that were part + * of previously posted RDMA Writes. + */ + svc_rdma_save_io_pages(rqstp, sctxt); ret = svc_rdma_send_error_msg(rdma, sctxt, rqstp); if (ret < 0) goto err1; From patchwork Mon Jun 29 14:50:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 11631803 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 83CC514B7 for ; Mon, 29 Jun 2020 19:37:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B3E0206F1 for ; Mon, 29 Jun 2020 19:37:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AfhSnfsv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730753AbgF2Tht (ORCPT ); Mon, 29 Jun 2020 15:37:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387460AbgF2Thp (ORCPT ); Mon, 29 Jun 2020 15:37:45 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2B0BC02F015; Mon, 29 Jun 2020 07:50:15 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id q22so6504062qtl.2; Mon, 29 Jun 2020 07:50:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=m3s/UkyYnkq3YGDNG0dmiQUvsV/sibLQqZw3O2Q0D4M=; b=AfhSnfsvIbXQfmLzY/Rt8yo66Wpz5wuvj2qIa1JUd6vcX6NN57tYGUjmSIpLt8huFn ecW1dMzvdERrGcYEXcbM/hWGdSX60OULThMeNaPFydlpsmZGmnNDdDC+fZxGUBuMHHVh qcXcGBm4Z9VrEM/Qp8Zm9NkrCWiLJJe/h4yJytsAqqSwcIIX7zdMr35N9IGgNLkGE/iJ cFdV5XlVsr2BI/j73AKzeGHuE+BLEtc3onSrvn+K6AkpCH79JbQwV9Zty0kcOXy28ZZf sWn8xqa0iR9Ip3s3Ft05JLp76scqXykAEp8D3UJPzTKJN18qbUm51rbAr0+26smq9vd5 SHOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=m3s/UkyYnkq3YGDNG0dmiQUvsV/sibLQqZw3O2Q0D4M=; b=fTx/TIijQ1jq/lPHq+fzTkJMzGJTs2cYjNFv9j+jkWd1ZPMycvkafbKvhb1SMJDSq2 PZIr60z/6mYg+PkKr1BuHX0fzIKS7VR/R5Hgiqwtbv/3NFVnYoQkQroeZzhmHvbhqvqO mO0+ry1BnsoDDMOPgLPyp0+ti56EojR0ITdXwQIvF/m825uQSiUxt+EPHgkQCQXg6n9E tnQFYrTzD7SqgnrLibXpVtPT4fTP/eWhSawErE85AASBg+QZRnRyuY180078rau56lNe brVqfv/8sZX2ZBVc/5E41NW+W3k1FxuCgN9bGjipWrA/qe+PZMAJQOpb8Ke5JMzQm2mc Yvlw== X-Gm-Message-State: AOAM533kRO2u7YpiLNi6RXXv3CE7ji/udMU+gSCZhjx1LmfqJf/3DzU6 WvZAkqXiFtC5z06W5d4RBxeDYag9 X-Google-Smtp-Source: ABdhPJxtzBHSAxjoNJWIKY+xSsiqa5biNN3RNEABOl7ad7oI8LD4csTBkHVl3PNTstuwIqOVFOmyPg== X-Received: by 2002:aed:3081:: with SMTP id 1mr16580938qtf.118.1593442215019; Mon, 29 Jun 2020 07:50:15 -0700 (PDT) Received: from gateway.1015granger.net (c-68-61-232-219.hsd1.mi.comcast.net. [68.61.232.219]) by smtp.gmail.com with ESMTPSA id 188sm28021qkf.50.2020.06.29.07.50.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2020 07:50:14 -0700 (PDT) Received: from klimt.1015granger.net (klimt.1015granger.net [192.168.1.55]) by gateway.1015granger.net (8.14.7/8.14.7) with ESMTP id 05TEoD7O006202; Mon, 29 Jun 2020 14:50:13 GMT Subject: [PATCH v2 3/8] svcrdma: Add @rctxt parameter to svc_rdma_send_error() functions From: Chuck Lever To: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Date: Mon, 29 Jun 2020 10:50:13 -0400 Message-ID: <20200629145013.15024.68894.stgit@klimt.1015granger.net> In-Reply-To: <20200629144802.15024.30635.stgit@klimt.1015granger.net> References: <20200629144802.15024.30635.stgit@klimt.1015granger.net> User-Agent: StGit/0.22-31-g4b47 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Another step towards making svc_rdma_send_error_msg() and svc_rdma_send_error() similar enough to eliminate one of them. Signed-off-by: Chuck Lever --- net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | 9 +++++---- net/sunrpc/xprtrdma/svc_rdma_sendto.c | 23 +++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c index e426fedb9524..60d855116ae7 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c @@ -715,10 +715,11 @@ static void rdma_read_complete(struct svc_rqst *rqstp, } static void svc_rdma_send_error(struct svcxprt_rdma *xprt, - __be32 *rdma_argp, int status) + struct svc_rdma_recv_ctxt *rctxt, + int status) { + __be32 *p, *rdma_argp = rctxt->rc_recv_buf; struct svc_rdma_send_ctxt *ctxt; - __be32 *p; int ret; ctxt = svc_rdma_send_ctxt_get(xprt); @@ -900,13 +901,13 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp) return 0; out_err: - svc_rdma_send_error(rdma_xprt, p, ret); + svc_rdma_send_error(rdma_xprt, ctxt, ret); svc_rdma_recv_ctxt_put(rdma_xprt, ctxt); return 0; out_postfail: if (ret == -EINVAL) - svc_rdma_send_error(rdma_xprt, p, ret); + svc_rdma_send_error(rdma_xprt, ctxt, ret); svc_rdma_recv_ctxt_put(rdma_xprt, ctxt); return ret; diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index 2f88d01e8d27..47ada61411c3 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c @@ -811,18 +811,17 @@ static int svc_rdma_send_reply_msg(struct svcxprt_rdma *rdma, * Remote Invalidation is skipped for simplicity. */ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, - struct svc_rdma_send_ctxt *ctxt, - struct svc_rqst *rqstp) + struct svc_rdma_send_ctxt *sctxt, + struct svc_rdma_recv_ctxt *rctxt) { - struct svc_rdma_recv_ctxt *rctxt = rqstp->rq_xprt_ctxt; __be32 *rdma_argp = rctxt->rc_recv_buf; __be32 *p; - rpcrdma_set_xdrlen(&ctxt->sc_hdrbuf, 0); - xdr_init_encode(&ctxt->sc_stream, &ctxt->sc_hdrbuf, ctxt->sc_xprt_buf, - NULL); + rpcrdma_set_xdrlen(&sctxt->sc_hdrbuf, 0); + xdr_init_encode(&sctxt->sc_stream, &sctxt->sc_hdrbuf, + sctxt->sc_xprt_buf, NULL); - p = xdr_reserve_space(&ctxt->sc_stream, RPCRDMA_HDRLEN_ERR); + p = xdr_reserve_space(&sctxt->sc_stream, RPCRDMA_HDRLEN_ERR); if (!p) return -ENOMSG; @@ -833,10 +832,10 @@ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, *p = err_chunk; trace_svcrdma_err_chunk(*rdma_argp); - ctxt->sc_send_wr.num_sge = 1; - ctxt->sc_send_wr.opcode = IB_WR_SEND; - ctxt->sc_sges[0].length = ctxt->sc_hdrbuf.len; - return svc_rdma_send(rdma, &ctxt->sc_send_wr); + sctxt->sc_send_wr.num_sge = 1; + sctxt->sc_send_wr.opcode = IB_WR_SEND; + sctxt->sc_sges[0].length = sctxt->sc_hdrbuf.len; + return svc_rdma_send(rdma, &sctxt->sc_send_wr); } /** @@ -931,7 +930,7 @@ int svc_rdma_sendto(struct svc_rqst *rqstp) * of previously posted RDMA Writes. */ svc_rdma_save_io_pages(rqstp, sctxt); - ret = svc_rdma_send_error_msg(rdma, sctxt, rqstp); + ret = svc_rdma_send_error_msg(rdma, sctxt, rctxt); if (ret < 0) goto err1; return 0; From patchwork Mon Jun 29 14:50:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 11631831 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F5E1913 for ; Mon, 29 Jun 2020 19:38:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1670B206A1 for ; Mon, 29 Jun 2020 19:38:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="vaH66BxM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387444AbgF2Tit (ORCPT ); Mon, 29 Jun 2020 15:38:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387441AbgF2Tho (ORCPT ); Mon, 29 Jun 2020 15:37:44 -0400 Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41BB8C02F016; Mon, 29 Jun 2020 07:50:23 -0700 (PDT) Received: by mail-qk1-x741.google.com with SMTP id e11so15485025qkm.3; Mon, 29 Jun 2020 07:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=O0yZJkvLrK6LFmPqzu5suqBMbRhXZtym0DCUxXeWW9I=; b=vaH66BxMgK0O4Y+rCJXDQOGW1r0zbOxCd2jicRBaN2ceRK8W5yuKyyrrCCfRuvWG6r RsaLlx1pxeS81XWWnRWpiVvUXUMpr3DZIPg+XhKsnh+Yh71UoRmhpRHGCSmZdHYgXij8 Axwlsqs+RwF2tLH/OUn2KNSuG5LHzZmsMMGvnt9KMfHv9i5zPBWWKjorwDtRYHF+6yE7 8ZntkLMGARkJje/OmPVinRJuQCtwyxpMf3rHJ9y+bTeoWO4uzSrxpcCkkoQWIE6HOdcg /SMkJ5lB39z3Lap6ToXJBtczGEQGNKw0gVtKKU68Vl/EIPDU9/fSo8J/wMj/EjONE1oB WJQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=O0yZJkvLrK6LFmPqzu5suqBMbRhXZtym0DCUxXeWW9I=; b=jss7EcvFoM3Gz3Xfgf4fFmOqJXcA/4xyFtpqbmLvitRceYP6FN5Aqierf5tgVfyd4d Obztktt5OxAtghkEhmrCI4MhcD9xGj6HXC60esRMAz8F4Z8yq26qid5o7/QxeuJh52ZC CJhY0L3+AGNq4yweHSnyrKPioWucXbuyO5xH7pTvAqxLumk4uuw8SULfC7nh44HRlbZX XE/j80HHSBJqFmkOoG2+c3bmExYSBhV6JNuyA6pwNfmH44TWklKqyGe2N2C90ngYdEn4 dYemc2/ND5ana1PS2aB9BYzOXtZR1IijcEpOfrNhO8pI5xm2IDJGhOXHKdWlSIROstFZ GZkw== X-Gm-Message-State: AOAM5315YG31DeSx0ewflv/OT2JZf2bkMLuzvs502RXHllxWtugDSBWc SXLqcJBmuYLaZGNynPtHIPyxXtCi X-Google-Smtp-Source: ABdhPJwQ5Caa0kCJ6l3RnaKYN49m4Zu+NmTqPCxDeL4n3fIP/EbP6GAwdhcbb/3uJZaBqoPpwg1BtA== X-Received: by 2002:a37:9c8f:: with SMTP id f137mr15694536qke.63.1593442220350; Mon, 29 Jun 2020 07:50:20 -0700 (PDT) Received: from gateway.1015granger.net (c-68-61-232-219.hsd1.mi.comcast.net. [68.61.232.219]) by smtp.gmail.com with ESMTPSA id x14sm21226qki.65.2020.06.29.07.50.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2020 07:50:19 -0700 (PDT) Received: from klimt.1015granger.net (klimt.1015granger.net [192.168.1.55]) by gateway.1015granger.net (8.14.7/8.14.7) with ESMTP id 05TEoJFF006205; Mon, 29 Jun 2020 14:50:19 GMT Subject: [PATCH v2 4/8] svcrdma: Add a @status parameter to svc_rdma_send_error_msg() From: Chuck Lever To: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Date: Mon, 29 Jun 2020 10:50:19 -0400 Message-ID: <20200629145019.15024.1404.stgit@klimt.1015granger.net> In-Reply-To: <20200629144802.15024.30635.stgit@klimt.1015granger.net> References: <20200629144802.15024.30635.stgit@klimt.1015granger.net> User-Agent: StGit/0.22-31-g4b47 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org The common "send RDMA_ERR" function should be in svc_rdma_sendto.c, since that is where the other Send-related functions are located. So from here, I will beef up svc_rdma_send_error_msg() and deprecate svc_rdma_send_error(). A generic svc_rdma_send_error_msg() will need to handle both ERR_CHUNK and ERR_VERS. Copy that logic from svc_rdma_send_error() to svc_rdma_send_error_msg(). Signed-off-by: Chuck Lever --- net/sunrpc/xprtrdma/svc_rdma_sendto.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index 47ada61411c3..73fe7a213169 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c @@ -812,7 +812,8 @@ static int svc_rdma_send_reply_msg(struct svcxprt_rdma *rdma, */ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, struct svc_rdma_send_ctxt *sctxt, - struct svc_rdma_recv_ctxt *rctxt) + struct svc_rdma_recv_ctxt *rctxt, + int status) { __be32 *rdma_argp = rctxt->rc_recv_buf; __be32 *p; @@ -821,16 +822,35 @@ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, xdr_init_encode(&sctxt->sc_stream, &sctxt->sc_hdrbuf, sctxt->sc_xprt_buf, NULL); - p = xdr_reserve_space(&sctxt->sc_stream, RPCRDMA_HDRLEN_ERR); + p = xdr_reserve_space(&sctxt->sc_stream, + rpcrdma_fixed_maxsz * sizeof(*p)); if (!p) return -ENOMSG; *p++ = *rdma_argp; *p++ = *(rdma_argp + 1); *p++ = rdma->sc_fc_credits; - *p++ = rdma_error; - *p = err_chunk; - trace_svcrdma_err_chunk(*rdma_argp); + *p = rdma_error; + + switch (status) { + case -EPROTONOSUPPORT: + p = xdr_reserve_space(&sctxt->sc_stream, 3 * sizeof(*p)); + if (!p) + return -ENOMSG; + + *p++ = err_vers; + *p++ = rpcrdma_version; + *p = rpcrdma_version; + trace_svcrdma_err_vers(*rdma_argp); + break; + default: + p = xdr_reserve_space(&sctxt->sc_stream, sizeof(*p)); + if (!p) + return -ENOMSG; + + *p = err_chunk; + trace_svcrdma_err_chunk(*rdma_argp); + } sctxt->sc_send_wr.num_sge = 1; sctxt->sc_send_wr.opcode = IB_WR_SEND; @@ -930,7 +950,7 @@ int svc_rdma_sendto(struct svc_rqst *rqstp) * of previously posted RDMA Writes. */ svc_rdma_save_io_pages(rqstp, sctxt); - ret = svc_rdma_send_error_msg(rdma, sctxt, rctxt); + ret = svc_rdma_send_error_msg(rdma, sctxt, rctxt, ret); if (ret < 0) goto err1; return 0; From patchwork Mon Jun 29 14:50:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 11631823 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3DEAB913 for ; Mon, 29 Jun 2020 19:38:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C20220702 for ; Mon, 29 Jun 2020 19:38:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fteY9yrm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730935AbgF2Ti1 (ORCPT ); Mon, 29 Jun 2020 15:38:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387448AbgF2Tho (ORCPT ); Mon, 29 Jun 2020 15:37:44 -0400 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEDDDC02F017; Mon, 29 Jun 2020 07:50:26 -0700 (PDT) Received: by mail-qk1-x743.google.com with SMTP id c139so15424912qkg.12; Mon, 29 Jun 2020 07:50:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=zQeMNl3XW1m0/k9561YNZvuwp+BUiHHSMSMoXCctjAY=; b=fteY9yrmObX4mSz+9DAjhBwIQO1aR5+6JXcgsnGcCdSdyscNYokNx0AbzeCDGz41w1 h3tkrEvNYEpYiO4T8Pa8k+QuP6NE8afZ6vxq+fWlhRrdJoag0+0YFBWMmEV9TCb8qBMG Dv0nbM6Y3sBOmVPBIwyg15+hYgFU+4LrsKHBfBhW26q89+ZKd6oRgfl9Rd3SaIwVZtCv d0iVpOuMz+fV9EFNhSrAvPnN4adi4boFxdRGS/lBGi5EkO47csJ3RZq6jcnxQEStnbNt FWzwL5U+8xinReGz/blY4DU6kH/2u6shQO7vDNYpR9cn2Hnd2u0HA7RMoEkhduC2cNoR BOXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=zQeMNl3XW1m0/k9561YNZvuwp+BUiHHSMSMoXCctjAY=; b=d0tLSdw8V7GeMEn0YFy6luNgi3dUFi7xHj9R28I6sxY++jDTe3KnjsCtqwthfccKWK Rc7C/NB9kWAoeXKfHDHav8ULtZHKMvixxnZfs8iY86Beo5hr77YIFEQHmRySK6HCf4vF Xu9QFQdZrqJfPg7adh9FGO+jsELC2PQWeFyRBUb/4EGY49bQT1BmV3FlfTpJ7YZvr1IO JVZjioCPkkc1F5YtHsaJa+mtpDo868HsqaRrR58w0JLChAr2ZdZb2OwFDvEb0aJsn2O8 RMIKg8UG3JQaM33RKiy9YPQ9q5t8xjsUfSFKqARU1H+IJTCeheumqZgiHj3nkJEGq1Vx mvxg== X-Gm-Message-State: AOAM531k/cZc7gInDuDuHLhJ9HfxnS3bl/q1HjWv0ky95KoQbxLoVVrH B/OGnPiEnN7lyNCetXbyNknBJr9v X-Google-Smtp-Source: ABdhPJy4g8zk+wKpeI1ov7aVSY81UDwBsYsDQ0lf9pPxaWCd6XQ0c10U/gMH6vHEdYUj8D6bQM8Dxg== X-Received: by 2002:a37:9a01:: with SMTP id c1mr15180277qke.111.1593442225385; Mon, 29 Jun 2020 07:50:25 -0700 (PDT) Received: from gateway.1015granger.net (c-68-61-232-219.hsd1.mi.comcast.net. [68.61.232.219]) by smtp.gmail.com with ESMTPSA id l67sm54079qkd.7.2020.06.29.07.50.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2020 07:50:25 -0700 (PDT) Received: from klimt.1015granger.net (klimt.1015granger.net [192.168.1.55]) by gateway.1015granger.net (8.14.7/8.14.7) with ESMTP id 05TEoOl8006208; Mon, 29 Jun 2020 14:50:24 GMT Subject: [PATCH v2 5/8] svcrdma: Eliminate return value for svc_rdma_send_error_msg() From: Chuck Lever To: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Date: Mon, 29 Jun 2020 10:50:24 -0400 Message-ID: <20200629145024.15024.2767.stgit@klimt.1015granger.net> In-Reply-To: <20200629144802.15024.30635.stgit@klimt.1015granger.net> References: <20200629144802.15024.30635.stgit@klimt.1015granger.net> User-Agent: StGit/0.22-31-g4b47 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Like svc_rdma_send_error(), have svc_rdma_send_error_msg() handle any error conditions internally, rather than duplicating that recovery logic at every call site. Signed-off-by: Chuck Lever --- net/sunrpc/xprtrdma/svc_rdma_sendto.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index 73fe7a213169..fb548b548c4b 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c @@ -810,10 +810,10 @@ static int svc_rdma_send_reply_msg(struct svcxprt_rdma *rdma, * * Remote Invalidation is skipped for simplicity. */ -static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, - struct svc_rdma_send_ctxt *sctxt, - struct svc_rdma_recv_ctxt *rctxt, - int status) +static void svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, + struct svc_rdma_send_ctxt *sctxt, + struct svc_rdma_recv_ctxt *rctxt, + int status) { __be32 *rdma_argp = rctxt->rc_recv_buf; __be32 *p; @@ -825,7 +825,7 @@ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, p = xdr_reserve_space(&sctxt->sc_stream, rpcrdma_fixed_maxsz * sizeof(*p)); if (!p) - return -ENOMSG; + goto put_ctxt; *p++ = *rdma_argp; *p++ = *(rdma_argp + 1); @@ -836,7 +836,7 @@ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, case -EPROTONOSUPPORT: p = xdr_reserve_space(&sctxt->sc_stream, 3 * sizeof(*p)); if (!p) - return -ENOMSG; + goto put_ctxt; *p++ = err_vers; *p++ = rpcrdma_version; @@ -846,7 +846,7 @@ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, default: p = xdr_reserve_space(&sctxt->sc_stream, sizeof(*p)); if (!p) - return -ENOMSG; + goto put_ctxt; *p = err_chunk; trace_svcrdma_err_chunk(*rdma_argp); @@ -855,7 +855,12 @@ static int svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, sctxt->sc_send_wr.num_sge = 1; sctxt->sc_send_wr.opcode = IB_WR_SEND; sctxt->sc_sges[0].length = sctxt->sc_hdrbuf.len; - return svc_rdma_send(rdma, &sctxt->sc_send_wr); + if (svc_rdma_send(rdma, &sctxt->sc_send_wr)) + goto put_ctxt; + return; + +put_ctxt: + svc_rdma_send_ctxt_put(rdma, sctxt); } /** @@ -950,9 +955,7 @@ int svc_rdma_sendto(struct svc_rqst *rqstp) * of previously posted RDMA Writes. */ svc_rdma_save_io_pages(rqstp, sctxt); - ret = svc_rdma_send_error_msg(rdma, sctxt, rctxt, ret); - if (ret < 0) - goto err1; + svc_rdma_send_error_msg(rdma, sctxt, rctxt, ret); return 0; err1: From patchwork Mon Jun 29 14:50:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 11631825 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D7A714B7 for ; Mon, 29 Jun 2020 19:38:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1003120786 for ; Mon, 29 Jun 2020 19:38:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C5orZIqJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733028AbgF2Til (ORCPT ); Mon, 29 Jun 2020 15:38:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387446AbgF2Tho (ORCPT ); Mon, 29 Jun 2020 15:37:44 -0400 Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78915C02F018; Mon, 29 Jun 2020 07:50:31 -0700 (PDT) Received: by mail-qt1-x841.google.com with SMTP id i16so13014619qtr.7; Mon, 29 Jun 2020 07:50:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=qI6XUHEnEM+k66AQNlTZ1Xi4+elDUxoiA9HIMNVsMuE=; b=C5orZIqJ+gphRsO4ZoZztVdz0FycN7X4vYQaaCAZ3yOqBYQhp4vnP7KTpsVMPGyuWR bvqSzWt6cH6nCf8PYM8QMenrjFElhGtM04t9Ivk5O9Uj4BHBP+5qqcWmVVGacJuSoFtV memyhCYuih+kjRwsTu+jZfFzezV1cS2wRe/Rq9GsKwNnBQ8qjbCUhkmKCIp2uhtNqFGe 9B38V193fkpplbcT8mm2GWSLZErhH1dorwrWjY1svRUwpsbcEiv78tWaVspUtQMa9MlQ 8CNh6faXE5x4N73RPWCys+JrcCUfXK+jxPGeUXnCe5HuqtbdpNS0A5z8HeAaJNbkwRT2 ncUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=qI6XUHEnEM+k66AQNlTZ1Xi4+elDUxoiA9HIMNVsMuE=; b=ZCeR2Ni3Zv5fMdieD650pbu1eA4M4JOvMmPnH7a2S8H3y4n60HMdfdnAVfIhEBQY4B xUUaKJr6GPsrjuQpKljfF4YJyxsmOZpAdOOZtAR2V9EXgdsxL1HQZa4t4CtRcRR4VT8S EswSoq4g+GMwn+rIA8+irAOLPtL2C9tUJgUE4SRWHUP8MADE8nv8EtHpo308OJx/GXNX UtKBX0otJhdMkJ28/7vYwh1V5x/eLhydGAXzTQ0bWuIUWzhlM5RoHrUswDPZ9wb+BMHb EdA6nkWmsZZ/txZ4iow+uzmNLxAt4B4CEW2gpM6PElXuOQq02nfMpJMwIeI3MoC3XpiD D15A== X-Gm-Message-State: AOAM530zOfB3tTZ26KGLoBwB+zO1xtsotb5Wsy58ieAwSVlPpogzYHXK aKk6wddtqmOT6/lG+FoOik26I8GM X-Google-Smtp-Source: ABdhPJz5Y0EB3juFl3jtP7nrwuDxGBKOY5CqVCUlkT383wBHFoktsI/+pUUMqW6ogMTBs8ctXnfYFw== X-Received: by 2002:ac8:544d:: with SMTP id d13mr16517331qtq.375.1593442230447; Mon, 29 Jun 2020 07:50:30 -0700 (PDT) Received: from gateway.1015granger.net (c-68-61-232-219.hsd1.mi.comcast.net. [68.61.232.219]) by smtp.gmail.com with ESMTPSA id p66sm25096qkf.58.2020.06.29.07.50.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2020 07:50:30 -0700 (PDT) Received: from klimt.1015granger.net (klimt.1015granger.net [192.168.1.55]) by gateway.1015granger.net (8.14.7/8.14.7) with ESMTP id 05TEoToc006211; Mon, 29 Jun 2020 14:50:29 GMT Subject: [PATCH v2 6/8] svcrdma: Make svc_rdma_send_error_msg() a global function From: Chuck Lever To: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Date: Mon, 29 Jun 2020 10:50:29 -0400 Message-ID: <20200629145029.15024.95030.stgit@klimt.1015granger.net> In-Reply-To: <20200629144802.15024.30635.stgit@klimt.1015granger.net> References: <20200629144802.15024.30635.stgit@klimt.1015granger.net> User-Agent: StGit/0.22-31-g4b47 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Prepare for svc_rdma_send_error_msg() to be invoked from another source file. Signed-off-by: Chuck Lever --- include/linux/sunrpc/svc_rdma.h | 4 ++++ net/sunrpc/xprtrdma/svc_rdma_sendto.c | 28 +++++++++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h index 7ed82625dc0b..1579f7a14ab4 100644 --- a/include/linux/sunrpc/svc_rdma.h +++ b/include/linux/sunrpc/svc_rdma.h @@ -195,6 +195,10 @@ extern int svc_rdma_map_reply_msg(struct svcxprt_rdma *rdma, struct svc_rdma_send_ctxt *sctxt, const struct svc_rdma_recv_ctxt *rctxt, struct xdr_buf *xdr); +extern void svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, + struct svc_rdma_send_ctxt *sctxt, + struct svc_rdma_recv_ctxt *rctxt, + int status); extern int svc_rdma_sendto(struct svc_rqst *); extern int svc_rdma_read_payload(struct svc_rqst *rqstp, unsigned int offset, unsigned int length); diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index fb548b548c4b..57041298fe4f 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c @@ -804,16 +804,25 @@ static int svc_rdma_send_reply_msg(struct svcxprt_rdma *rdma, return svc_rdma_send(rdma, &sctxt->sc_send_wr); } -/* Given the client-provided Write and Reply chunks, the server was not - * able to form a complete reply. Return an RDMA_ERROR message so the - * client can retire this RPC transaction. - * - * Remote Invalidation is skipped for simplicity. +/** + * svc_rdma_send_error_msg - Send an RPC/RDMA v1 error response + * @rdma: controlling transport context + * @sctxt: Send context for the response + * @rctxt: Receive context for incoming bad message + * @status: negative errno indicating error that occurred + * + * Given the client-provided Read, Write, and Reply chunks, the + * server was not able to parse the Call or form a complete Reply. + * Return an RDMA_ERROR message so the client can retire the RPC + * transaction. + * + * The caller does not have to release @sctxt. It is released by + * Send completion, or by this function on error. */ -static void svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, - struct svc_rdma_send_ctxt *sctxt, - struct svc_rdma_recv_ctxt *rctxt, - int status) +void svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, + struct svc_rdma_send_ctxt *sctxt, + struct svc_rdma_recv_ctxt *rctxt, + int status) { __be32 *rdma_argp = rctxt->rc_recv_buf; __be32 *p; @@ -852,6 +861,7 @@ static void svc_rdma_send_error_msg(struct svcxprt_rdma *rdma, trace_svcrdma_err_chunk(*rdma_argp); } + /* Remote Invalidation is skipped for simplicity. */ sctxt->sc_send_wr.num_sge = 1; sctxt->sc_send_wr.opcode = IB_WR_SEND; sctxt->sc_sges[0].length = sctxt->sc_hdrbuf.len; From patchwork Mon Jun 29 14:50:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 11631847 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CBC68913 for ; Mon, 29 Jun 2020 19:39:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B425420672 for ; Mon, 29 Jun 2020 19:39:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D4umD+4r" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733301AbgF2Tjd (ORCPT ); Mon, 29 Jun 2020 15:39:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387429AbgF2Thm (ORCPT ); Mon, 29 Jun 2020 15:37:42 -0400 Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 805DAC02F019; Mon, 29 Jun 2020 07:50:36 -0700 (PDT) Received: by mail-qk1-x741.google.com with SMTP id k18so15453556qke.4; Mon, 29 Jun 2020 07:50:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=Knp7Z7LBJqUcvyZ/FlOarstqHDZMyihmvlYEWQ67HgI=; b=D4umD+4rtVvPhzz6LyLvgFFqciygyHdgaWeO4RSzC/xpBnKvMAKrc+/Ib10NkKQrCh LfbZ3VkUWK2b+5RRkF2vOvAHo0GJ3ovuok7LAmNZuPc8RP6t2rsp4qUp407FlnEawAuw EAGprvbIC8XS+tEAYZ3ybGyp8Eu38bmV0qEYLuK+tnHmFR47VCyfX4t/W3dLBb7KfsuN 0Gsq64Ml2gFgQq0iMVQxqjZqIR2yVkrronasFD4JdufftiKFrMIAU3i3MRYYyFijP1PL S+K6Zb71alSIIM4ra72gZcTfXDwqXmKcp1rxvqrWZ1uNQC2I/uWmLokbPPMWQiOB75mF Tgww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=Knp7Z7LBJqUcvyZ/FlOarstqHDZMyihmvlYEWQ67HgI=; b=Mii7ahgcAsZ6D1zCV7kT1674NxJsIG6IzGPlf5WHtiXWgl5Er/q+p6zYhHd2lauaIK EJhiBR1HTlb3gEizvsWmWzpTtKTslqzAoDRwKDfqwCrBXjKIG5IRuPxfwnoRYUGuqVNj aOjb1peex6tiAY8xOEQexwPD4ENNlTyJZA+cGODM4tTGyg50ahMMSNfVMcdgIx175WQp fDgMoVXF9gk55j46FcQYAk4TDElKTunBBezWfXWXhSIrmXdsg1ztSGHVgA+RrM/v59hW ZatnHjSYd3iYewd+yzgsG15ewUJCljZL8HYSbenmGA7fPHiTyHMlvVl8DqFZfIy2e7bw dvvg== X-Gm-Message-State: AOAM532zWkDRXMFPcqPx1riTWIkZE6Qqau+YIhUjBaJf7bZlQu8BeAQH d/Ic3uGZqVGdq3VF0JliJP3cBUm4 X-Google-Smtp-Source: ABdhPJyglQjjlOJ63CgAggF4qRPdlvCH/NMt6ny94quAklA6YXQCLO4Cuk81DyKUDqo4+oq4l3K0GA== X-Received: by 2002:a37:9dd3:: with SMTP id g202mr14545468qke.432.1593442235607; Mon, 29 Jun 2020 07:50:35 -0700 (PDT) Received: from gateway.1015granger.net (c-68-61-232-219.hsd1.mi.comcast.net. [68.61.232.219]) by smtp.gmail.com with ESMTPSA id b186sm42570qkd.28.2020.06.29.07.50.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2020 07:50:35 -0700 (PDT) Received: from klimt.1015granger.net (klimt.1015granger.net [192.168.1.55]) by gateway.1015granger.net (8.14.7/8.14.7) with ESMTP id 05TEoYZq006214; Mon, 29 Jun 2020 14:50:34 GMT Subject: [PATCH v2 7/8] svcrdma: Consolidate send_error helper functions From: Chuck Lever To: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Date: Mon, 29 Jun 2020 10:50:34 -0400 Message-ID: <20200629145034.15024.54133.stgit@klimt.1015granger.net> In-Reply-To: <20200629144802.15024.30635.stgit@klimt.1015granger.net> References: <20200629144802.15024.30635.stgit@klimt.1015granger.net> User-Agent: StGit/0.22-31-g4b47 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Final refactor: Replace internals of svc_rdma_send_error() with a simple call to svc_rdma_send_error_msg(). Signed-off-by: Chuck Lever --- net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | 52 +++---------------------------- 1 file changed, 5 insertions(+), 47 deletions(-) diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c index 60d855116ae7..c072ce61b393 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c @@ -714,58 +714,16 @@ static void rdma_read_complete(struct svc_rqst *rqstp, rqstp->rq_arg.buflen = head->rc_arg.buflen; } -static void svc_rdma_send_error(struct svcxprt_rdma *xprt, +static void svc_rdma_send_error(struct svcxprt_rdma *rdma, struct svc_rdma_recv_ctxt *rctxt, int status) { - __be32 *p, *rdma_argp = rctxt->rc_recv_buf; - struct svc_rdma_send_ctxt *ctxt; - int ret; + struct svc_rdma_send_ctxt *sctxt; - ctxt = svc_rdma_send_ctxt_get(xprt); - if (!ctxt) + sctxt = svc_rdma_send_ctxt_get(rdma); + if (!sctxt) return; - - p = xdr_reserve_space(&ctxt->sc_stream, - rpcrdma_fixed_maxsz * sizeof(*p)); - if (!p) - goto put_ctxt; - - *p++ = *rdma_argp; - *p++ = *(rdma_argp + 1); - *p++ = xprt->sc_fc_credits; - *p = rdma_error; - - switch (status) { - case -EPROTONOSUPPORT: - p = xdr_reserve_space(&ctxt->sc_stream, 3 * sizeof(*p)); - if (!p) - goto put_ctxt; - - *p++ = err_vers; - *p++ = rpcrdma_version; - *p = rpcrdma_version; - trace_svcrdma_err_vers(*rdma_argp); - break; - default: - p = xdr_reserve_space(&ctxt->sc_stream, sizeof(*p)); - if (!p) - goto put_ctxt; - - *p = err_chunk; - trace_svcrdma_err_chunk(*rdma_argp); - } - - ctxt->sc_send_wr.num_sge = 1; - ctxt->sc_send_wr.opcode = IB_WR_SEND; - ctxt->sc_sges[0].length = ctxt->sc_hdrbuf.len; - ret = svc_rdma_send(xprt, &ctxt->sc_send_wr); - if (ret) - goto put_ctxt; - return; - -put_ctxt: - svc_rdma_send_ctxt_put(xprt, ctxt); + svc_rdma_send_error_msg(rdma, sctxt, rctxt, status); } /* By convention, backchannel calls arrive via rdma_msg type From patchwork Mon Jun 29 14:50:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever III X-Patchwork-Id: 11631839 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9223214E3 for ; Mon, 29 Jun 2020 19:39:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7AD8A206E2 for ; Mon, 29 Jun 2020 19:39:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ccjyw880" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729414AbgF2Ti7 (ORCPT ); Mon, 29 Jun 2020 15:38:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387436AbgF2Thn (ORCPT ); Mon, 29 Jun 2020 15:37:43 -0400 Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1A32C02F01A; Mon, 29 Jun 2020 07:50:41 -0700 (PDT) Received: by mail-qk1-x741.google.com with SMTP id l6so15463459qkc.6; Mon, 29 Jun 2020 07:50:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:from:to:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=LWt5VMn1ZcxMt7yWNpPg3kaN13riF8TpEU0Yu+hqL4g=; b=ccjyw880bYOMUMlLYUJASpm7Uk5pS9wnGKxzE+DbQa40GfqrGPpTRszSPNkXa8b/YC OaYvt1onN5YcGk1nPbyE7a5Qejultg5eh7U2ETBkutilyNVSjQgj72p5CcC/BCuKD34G d9nsBg6pu5S70U2E426HJUPV/OHUmO4DGnXehISUJmdaqdojuLoPBW8KfnFU+pFYJbrM WVE4CFseNL5ELKqAvP9EL3Z+q/Sb07y1sWOBkSi+8bl0ykUSxUQSsZZy0SaACtpUjc4W kbqEfiWvrSn43srFDw620704IvfZzQlYZElZT49ecN7t53y9X1BSqCs9Af0/vRHBxqOM mAjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:from:to:date:message-id :in-reply-to:references:user-agent:mime-version :content-transfer-encoding; bh=LWt5VMn1ZcxMt7yWNpPg3kaN13riF8TpEU0Yu+hqL4g=; b=WLAqYG2u9K0h7+BviTM9D6uhPNncabasUheE2cxGqWR+058YRc+xZnv/QSklwnTFSi yVRpoYgvNP8YoRCWhj24RWHZWtzjVxsRPE/n0rdDm4HgU3SAlkYlDqSw4L6kuiZs8ISa Zdw5bz/YvLCm8nzwatyHX5JM+oYXRnATHJ+937Br+B0N8UuAec0oWaRFj+4Ye8ohhfHT +g73NS39WFZoMYHtlpAeaKEF/6qkJLuFHZZgUR6ujq4JJ9J2EynmuioP5gTbVaHfs3DH XuuYE2tH8HGw91VC7HBOTLPH296lsOX+eVm2EeqROKIPpt/Rj+3eKPeS4Rvr2e3OtbL6 lC4Q== X-Gm-Message-State: AOAM533jneX5IlQ2aSmoL+ynFR4uPLdPUphe7ygXMXu9WV8FSWQQ8/S3 jN89fTkdgg0VLeCscdDWBZyHfoi0 X-Google-Smtp-Source: ABdhPJyeI9bYwpLT95splv3y7nUwweZcX52raR3yvgz164QAerGqzsI08DlQyoTcU27H3U0O+8Oz+Q== X-Received: by 2002:ae9:c113:: with SMTP id z19mr15283187qki.355.1593442240871; Mon, 29 Jun 2020 07:50:40 -0700 (PDT) Received: from gateway.1015granger.net (c-68-61-232-219.hsd1.mi.comcast.net. [68.61.232.219]) by smtp.gmail.com with ESMTPSA id x26sm17078453qtr.4.2020.06.29.07.50.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jun 2020 07:50:40 -0700 (PDT) Received: from klimt.1015granger.net (klimt.1015granger.net [192.168.1.55]) by gateway.1015granger.net (8.14.7/8.14.7) with ESMTP id 05TEodhA006217; Mon, 29 Jun 2020 14:50:39 GMT Subject: [PATCH v2 8/8] svcrdma: Clean up trace_svcrdma_send_failed() tracepoint From: Chuck Lever To: linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org Date: Mon, 29 Jun 2020 10:50:39 -0400 Message-ID: <20200629145039.15024.6023.stgit@klimt.1015granger.net> In-Reply-To: <20200629144802.15024.30635.stgit@klimt.1015granger.net> References: <20200629144802.15024.30635.stgit@klimt.1015granger.net> User-Agent: StGit/0.22-31-g4b47 MIME-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org - Use the _err naming convention instead - Remove display of kernel memory address of the controlling xprt Signed-off-by: Chuck Lever --- include/trace/events/rpcrdma.h | 7 ++----- net/sunrpc/xprtrdma/svc_rdma_sendto.c | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/trace/events/rpcrdma.h b/include/trace/events/rpcrdma.h index 0f05a6e2b9cb..0eff80dee066 100644 --- a/include/trace/events/rpcrdma.h +++ b/include/trace/events/rpcrdma.h @@ -1716,7 +1716,7 @@ TRACE_EVENT(svcrdma_send_pullup, TP_printk("len=%u", __entry->len) ); -TRACE_EVENT(svcrdma_send_failed, +TRACE_EVENT(svcrdma_send_err, TP_PROTO( const struct svc_rqst *rqst, int status @@ -1727,19 +1727,16 @@ TRACE_EVENT(svcrdma_send_failed, TP_STRUCT__entry( __field(int, status) __field(u32, xid) - __field(const void *, xprt) __string(addr, rqst->rq_xprt->xpt_remotebuf) ), TP_fast_assign( __entry->status = status; __entry->xid = __be32_to_cpu(rqst->rq_xid); - __entry->xprt = rqst->rq_xprt; __assign_str(addr, rqst->rq_xprt->xpt_remotebuf); ), - TP_printk("xprt=%p addr=%s xid=0x%08x status=%d", - __entry->xprt, __get_str(addr), + TP_printk("addr=%s xid=0x%08x status=%d", __get_str(addr), __entry->xid, __entry->status ) ); diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index 57041298fe4f..f985f548346a 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c @@ -971,7 +971,7 @@ int svc_rdma_sendto(struct svc_rqst *rqstp) err1: svc_rdma_send_ctxt_put(rdma, sctxt); err0: - trace_svcrdma_send_failed(rqstp, ret); + trace_svcrdma_send_err(rqstp, ret); set_bit(XPT_CLOSE, &xprt->xpt_flags); return -ENOTCONN; }