Received: by 10.213.65.68 with SMTP id h4csp102866imn; Fri, 30 Mar 2018 15:22:02 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/jq+g8nq/L9UDlGUzO7JIr6vyz5qemcBu2ynEu7U88WJGLdbLz0dZjVfCj6z7mgBVfOHWo X-Received: by 2002:a17:902:a5c2:: with SMTP id t2-v6mr777180plq.160.1522448522514; Fri, 30 Mar 2018 15:22:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522448522; cv=none; d=google.com; s=arc-20160816; b=o6ar08tqY0e9bbH5xaSExsjli7cCepcFjCnK1hMtl8hYMlRX0YASTPF/2MoAtxC7A+ NU2fB9N/7G8nHp0x1JMumgT06e/C0ZszDQkUcL40jrpIuGWtV99zAOiwBVDQGitV85Da HEyUpsFkEnMM4nTlBycAfVNjlvs9jy/rFI1wWf4WGJkvFb8aaKwxnhwFBAP4u768JAKa PQ9ipAECZRpOWSK/LYVvh75ZJX5r3niI7Cni487LoRnHL6f5u46tB51mh8Gh/fStbEv6 sbDsDm0rrqhGm+ewJrT8yxfDs72S0E+KPXs+ZGbPhhrC1zZIZkja4zJ7eEZ5AJBTTA6+ jlvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=oErF2xj/odOSGzEKBidQagKs/ngou4Up2MuPFw262do=; b=sKSt25089KOYCnC9s1ztW4MHzCxOTDIg+mna6zZR6RLjISTHtPBNtMzGrP/Nd4MUcb 7Ny0PCSQb99adI5Thmbo9/uSM78sax6I2CqAteAbplYvlQLRnd018RdtuMyNgAB4Pq/O gV/NqG3FYE0vRD5Ttkhg6WnRl3mLlMFExcm+1yem+jXyeKh6scP1dI8wxwdhlsRKV6Kq 5o/xuhLy4J/QgbSmvC+nrzaZWZVDDNMsK4fvX5Zr8JjdfjVuLShT199POUhgyr61nqVB AUyA1aVNqtCYa5nwngED1/5dmCNKW5f70uKnOYXnBwORqIWyaO6eAx42IkD2OGBVywCF sBYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si3751475pgt.385.2018.03.30.15.21.17; Fri, 30 Mar 2018 15:22:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752811AbeC3WSE (ORCPT + 99 others); Fri, 30 Mar 2018 18:18:04 -0400 Received: from a2nlsmtp01-03.prod.iad2.secureserver.net ([198.71.225.37]:51790 "EHLO a2nlsmtp01-03.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752478AbeC3WSB (ORCPT ); Fri, 30 Mar 2018 18:18:01 -0400 Received: from linuxonhyperv2.linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id 22KBfJPOAzDeH22KBfKODw; Fri, 30 Mar 2018 15:17:00 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv2.linuxonhyperv.com with local (Exim 4.89_1) (envelope-from ) id 1f22KB-0008TC-Dy; Fri, 30 Mar 2018 15:16:43 -0700 From: Long Li To: Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org Cc: Long Li Subject: [PATCH 2/2] cifs: smbd: disconnect transport on RDMA errors Date: Fri, 30 Mar 2018 15:16:36 -0700 Message-Id: <20180330221636.32512-2-longli@linuxonhyperv.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180330221636.32512-1-longli@linuxonhyperv.com> References: <20180330221636.32512-1-longli@linuxonhyperv.com> Reply-To: longli@microsoft.com X-CMAE-Envelope: MS4wfOk9/GjI/YXBjbKCG+YrISH5CJBlpV5FjFxjVk1KcKuTihwxZNW6ASWujcNaHjG81LxNzrdzJquDLgEcGsEeDVkUat4rooOv15ucu+7chNBurPgV3KCt e6RS57aL3YOiiolbCS1pzaJVmB7Zh9tQLeHpVYJLmRYEJe5+8LAJMTX9Ej1jxI+H8v9HrWWGGfux6c61zmZcNKJLyd7Jk9qdpVe3J2P97c5yus0+V7zxw7mC 4xqhAT/1RH5WD2riCyH/NWHYG64tg/hatJ4mSoGxu29SWO5Mr10pJBpKRpzp3xGvTaLd5C4qyDB5IZsaUTLfuXCw+/Q5WAYSUdsVEZxS9mHrxoCOPVeXQSu/ 6+PZRa0+3p0AYKnXvdDHSO/vK+73xA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Long Li On RDMA errors, transport should disconnect the RDMA CM connection. This will notify the upper layer, and it will attempt transport reconnect. Signed-off-by: Long Li --- fs/cifs/smbdirect.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index 3f7883e..5008af5 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -862,6 +862,8 @@ static int smbd_post_send_negotiate_req(struct smbd_connection *info) ib_dma_unmap_single(info->id->device, request->sge[0].addr, request->sge[0].length, DMA_TO_DEVICE); + smbd_disconnect_rdma_connection(info); + dma_mapping_failed: mempool_free(request, info->request_mempool); return rc; @@ -1061,6 +1063,7 @@ static int smbd_post_send(struct smbd_connection *info, if (atomic_dec_and_test(&info->send_pending)) wake_up(&info->wait_send_pending); } + smbd_disconnect_rdma_connection(info); } else /* Reset timer for idle connection after packet is sent */ mod_delayed_work(info->workqueue, &info->idle_timer_work, @@ -1202,7 +1205,7 @@ static int smbd_post_recv( if (rc) { ib_dma_unmap_single(info->id->device, response->sge.addr, response->sge.length, DMA_FROM_DEVICE); - + smbd_disconnect_rdma_connection(info); log_rdma_recv(ERR, "ib_post_recv failed rc=%d\n", rc); } @@ -2546,6 +2549,8 @@ struct smbd_mr *smbd_register_mr( if (atomic_dec_and_test(&info->mr_used_count)) wake_up(&info->wait_for_mr_cleanup); + smbd_disconnect_rdma_connection(info); + return NULL; } -- 2.7.4