Received: by 10.223.164.197 with SMTP id h5csp686341wrb; Sat, 4 Nov 2017 22:50:51 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RHfUYkuLVITsUuSj3b/F8mPqbphsSKZpSUX/NXrL0Fjii0Hl06FTTRIw1y4uxQ7HUifgYE X-Received: by 10.98.103.93 with SMTP id b90mr13072944pfc.2.1509861050938; Sat, 04 Nov 2017 22:50:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509861050; cv=none; d=google.com; s=arc-20160816; b=S5gIf68IiGrzKeX8jlo5ED5m58fQ2k3QAdCwfSb2KUtjDpYtcT6JEa+UV6p2vNNwWt Xn1XYM5WQbg5+Uf+VE1cpx45qefnl1mBuRMXo2QToqJsKma7vzY8t4BitHuuddf7fry0 27uVM39aYe91RMW42uQQzKJWVCBkglM+35xb6EiYyQjb6lUFDuI82l6sRx4Pug/TflAC eBpTlgJuerbKfEm48txVcLoIx56PzWf8G9ghdnFX0uptjC/3fjO7sVSaZT62dLiKykUp /QcTGuWt5oZVRhkWsVhG4jmdN2U44bjLAdRv6PvIDoz0QEKs/dEjiXoXoGOBHMtGUccz oH7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=RAIaQGGWAEW5TAAAAMGh0R1BbzGHL3+G2k8CRD95TAc=; b=SX7W9dN439BzbjsORY8jMHw5ivwqdKckJI0dXAIQpjYUiRzFI36DJCp2T4cvApYJR9 /W5d8u996G4Qc7cG/JstSS9lRllajxrkZyc83cUyaO7leNsaWHQIOlO8ccCvdAxEIyX6 xj6nr2APlqY6nxej7ahCl0B5YAlP13tFylSZM80YvhgGtIJWypUO6RMdMkq1OkjyPZqf 1ZWw59fTcmjjhYdwczsU5CjCmtR6FoJjJn1wPrGa02mw2skHvDmnnyjd0lm8yTyXdA6Z Tz5CnYq44q3+MRfS9FnN9JDutnp/tYAEt2Fecnf3A62eCQ+O8fOGMqvsgnoN1EsRYZF9 7kgg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=exchange.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n10si7625676plk.413.2017.11.04.22.50.37; Sat, 04 Nov 2017 22:50:50 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=exchange.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753349AbdKEFtK (ORCPT + 96 others); Sun, 5 Nov 2017 01:49:10 -0400 Received: from a2nlsmtp01-03.prod.iad2.secureserver.net ([198.71.225.37]:57418 "EHLO a2nlsmtp01-03.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750839AbdKEFpx (ORCPT ); Sun, 5 Nov 2017 01:45:53 -0400 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id BDjUelRlZKv33BDjUekKct; Sat, 04 Nov 2017 22:44:52 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1eBDjU-0006F0-Ne; Sat, 04 Nov 2017 22:44:32 -0700 From: Long Li To: Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Christoph Hellwig , Tom Talpey , Matthew Wilcox , Stephen Hemminger Cc: Long Li Subject: [Patch v6 11/22] CIFS: SMBD: Implement function to destroy a SMB Direct connection Date: Sat, 4 Nov 2017 22:43:53 -0700 Message-Id: <20171105054404.23886-12-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171105054404.23886-1-longli@exchange.microsoft.com> References: <20171105054404.23886-1-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfOydmL2V0YaE7d+okmNHChkgrrlfAE8j4yxuWyV5qMJzOUL6I/AbTzA9Xr2lwjXOmImfEdG//2hPv5J2Bxs6DCSWwagCPgyYESXWchWASy6Tvz6ebU9Y aBk0Wvik9oUpZXej5dxLJLYhuI6vyEmG9Sws5efV8VcHRFr7Dwsffb7wSIcu0RlOv6/cqJws8L1QSz91AJEK7mLDz5Mzt39QUxXHIWcfY+Dfwrqol7rShO7C qLYyIUzUS8YHM4h9MGQNjhVqBh1Wyj+HWCyReWpCIbIGCycCq3EQjks2Dx0AojgHeqyAUJ+WRwPQzf2VKJ3hpJ1R6JwwGZiRU906bFY3CwOckH96niZ/fvcf DpbVrbIKkAMg5YjF9kKE6fSzrOce7wjyPRm9D3scD2kNNsP0bTl8VhQOPtNmJhXEGTjEoS/LUQ3uOLde+whVOVHyFQUHK2JbXzxihygujPy4t6/fSIRMlGkT +yZ3vTr/+ShU9bepqxSqcN9S98OLApvmD6eBBA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Long Li Add function to tear down a SMB Direct connection. This is used by upper layer to free all SMB Direct connection and transport resources. Signed-off-by: Long Li --- fs/cifs/smbdirect.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index f3ae3dc..5952276 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -1393,6 +1393,22 @@ static void idle_connection_timer(struct work_struct *work) info->keep_alive_interval*HZ); } +/* Destroy this SMBD connection, called from upper layer */ +void smbd_destroy(struct smbd_connection *info) +{ + log_rdma_event(INFO, "destroying rdma session\n"); + + /* Kick off the disconnection process */ + smbd_disconnect_rdma_connection(info); + + log_rdma_event(INFO, "wait for transport being destroyed\n"); + wait_event(info->wait_destroy, + info->transport_status == SMBD_DESTROYED); + + destroy_workqueue(info->workqueue); + kfree(info); +} + /* * Reconnect this SMBD connection, called from upper layer * return value: 0 on success, or actual error code -- 2.7.4 From 1583316423859229057@xxx Mon Nov 06 11:36:48 +0000 2017 X-GM-THRID: 1583308423082113125 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread