From patchwork Fri Mar 30 22:16:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 893590 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linuxonhyperv.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40Cbc4343vz9s2b for ; Sat, 31 Mar 2018 09:18:28 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752552AbeC3WSD (ORCPT ); Fri, 30 Mar 2018 18:18:03 -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-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@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; }