Received: by 10.223.164.202 with SMTP id h10csp102139wrb; Wed, 22 Nov 2017 16:43:42 -0800 (PST) X-Google-Smtp-Source: AGs4zMYiqq6hKXE/mQ4ZNnzYOQ5zBdsfQFZWlIDbo/yh3fUCS9Kkl6ubnA1AE8yb3rUyzDF8B3Rl X-Received: by 10.84.175.3 with SMTP id s3mr22634736plb.279.1511397822298; Wed, 22 Nov 2017 16:43:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511397822; cv=none; d=google.com; s=arc-20160816; b=fTgRBXCVskj7NfOJE3ZiW4Osu4QSSoq+n+C3cHrrn1nFAALtMb6fEm1CE0gFA85OX/ Jo6VX4jWr9h1xxxBeKn0zLBXsg2Ac8LjFgANmcjeW0WcjJk34UtXCSkQdJsQ+zsrZ10W /J3B761A/Oum/TD4Mt/4A/7AA9v0Ps/tS482griXDNdjuub5SEXDdmndIf4rmIwH6cLH ErP1N+fx1kPtvbdr0Mrsh1NP79nRjMQdLfRCURYqWgK3xibbhNFTh+MgffJGUQBogSad Nq0Tfmr7aam60DhhNGpD4W7YoUlU/f1F94d8HOhSGgfBMCJkzkgUyu8+M5X4r0qieGhI 7tng== 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=Kl8gdT7RqS4Ru0VELCaT+AmcrSSl9CmRDcSFNIfhAsQ=; b=rZT1qUU3ETzBeafoWUvCvtqmAOlrTTIiITdzBMDhZ5VSCc0fB+H8Ij3n0jvaIf72I+ OxDuBj4T1jRH1FdwkKZDxIB6KKEtPnlMflZr+rid5PJLBzmthwHUUTdKJd9Kd/SGlNM9 M8NnmHjm4uMFHLZ/9IRXcCVg7bddSXm7xBCCqPnhkq2QZBSF8BFi6uqrBn1Jz692BQ6p 1CrIIhrsEIpaiiiKFwkG/+NEvP9BYyOlP62oe9WJf68EqFRv7Z3RWhhrNb6+cCJ8A2T0 gxQUb/rMhMtajZtODEZkTPPaibIHYLjJY9tC3myR6e4jmk0v4QGD3I3FB+8vr6qKstUL p1hw== 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 x11si12775908plm.827.2017.11.22.16.43.31; Wed, 22 Nov 2017 16:43:42 -0800 (PST) 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 S1753148AbdKWAms (ORCPT + 76 others); Wed, 22 Nov 2017 19:42:48 -0500 Received: from a2nlsmtp01-03.prod.iad2.secureserver.net ([198.71.225.37]:49494 "EHLO a2nlsmtp01-03.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752485AbdKWAkR (ORCPT ); Wed, 22 Nov 2017 19:40:17 -0500 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id HfXbeuu1yNCjBHfXbeqkwu; Wed, 22 Nov 2017 17:39:15 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1eHfXb-0004Sw-9t; Wed, 22 Nov 2017 17:38:55 -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 v8 04/16] CIFS: SMBD: Implement function to destroy a SMB Direct connection Date: Wed, 22 Nov 2017 17:38:37 -0700 Message-Id: <20171123003849.17093-5-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171123003849.17093-1-longli@exchange.microsoft.com> References: <20171123003849.17093-1-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfEbZKhQiHN8OLB28r3CvcgqLLfjDxLESX+ahKVs3OiynOvtldvmSlEp1r2OHeDxi7RmbX3+k5HBORgrVtxUS5jehYlBlPauU1hMxdwdTTIBbZXi19vxo i7yguTPDS0OKPvf/CPDuN9hqFGKQWQipim7LZJkcYqOgmHhIoZg/PPGuEsi1Lh+prktIMYtwis153HCUPz2MTsD8sWKgNgvJt1qxvJAK84O9zv/Py4m0vCeK W3aFFxcRBypKIuxmVYPuPwnmtvoZVLjrdfgvpJhEtXjVA58Ejnxk7JJYIrwpzxbFR+kkUIrV8Gf2yoeIFAj+KVQ67pgCe0FHy+1c6kOKqeQ1l77JIVbJnFY1 CzVpLjpHPqcgcMjQncpSFpa/ijYwtbLyZE/lSTfjxMci2lNPgOvZ6juKtAKqZmLE9kAHq32KQh6tM8rd+0SuW+3OOkcV8wCdQM3mC+l9zDScZj+TDq9BVvkt 7QZ0pPjh0m6I+lHiqJFfDMM+zqjwLNXHr6jBBQ== 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 ++++++++++++++++ fs/cifs/smbdirect.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index a96058a..b462a2f 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -1387,6 +1387,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 diff --git a/fs/cifs/smbdirect.h b/fs/cifs/smbdirect.h index 8948f06..61bb649 100644 --- a/fs/cifs/smbdirect.h +++ b/fs/cifs/smbdirect.h @@ -249,6 +249,8 @@ struct smbd_connection *smbd_get_connection( /* Reconnect SMBDirect session */ int smbd_reconnect(struct TCP_Server_Info *server); +/* Destroy SMBDirect session */ +void smbd_destroy(struct smbd_connection *info); #else #define cifs_rdma_enabled(server) 0 @@ -256,6 +258,7 @@ struct smbd_connection {}; static inline void *smbd_get_connection( struct TCP_Server_Info *server, struct sockaddr *dstaddr) {return NULL;} static inline int smbd_reconnect(struct TCP_Server_Info *server) {return -1;} +static inline void smbd_destroy(struct smbd_connection *info) {} #endif #endif -- 2.7.4 From 1585178437155148838@xxx Mon Nov 27 00:52:42 +0000 2017 X-GM-THRID: 1585178437155148838 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread