Received: by 10.223.164.202 with SMTP id h10csp635702wrb; Tue, 7 Nov 2017 11:54:19 -0800 (PST) X-Google-Smtp-Source: ABhQp+TSPo9vKAg0c66jXk0pUbiPm6d9NJmVt17jskkdF2ttBfHFgU3VZDij9HaRrunfAR0u9OCo X-Received: by 10.159.250.132 with SMTP id k4mr18707251pls.61.1510084459744; Tue, 07 Nov 2017 11:54:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510084459; cv=none; d=google.com; s=arc-20160816; b=xXp//MmmtgobgdCfyASoo125GEg9kgVUdulmJWjygbrY9XAihG28i3IOSuWrhUE2PQ CjJ5dAvcl2BSBjJLoK92VhtMXTXmZ2oh2e8qRvmlqSVD5urxP6cSWKeF/oTEr5YesJob APpMluunnt8xVJe1u/RLMDvfSxeJ0wnqLvXncfCoFEDMKHLwC2e3s123VKRPP0UVE3a+ X18CtNLj9ahmz2kjio8RikTDC3/Tte9KC0J3K2tiqdZLuunooIXXonNXuMmzemeBYL8Z +rhHFpzO8F+Q0qJAOQZCeE5WnDY3rLPLtFCVoRlVuDiSQ7wHNzwvmSBrNozYLDw59zuR hPNA== 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=Jn7z81l73mRiiw3rjkmi8Xi28mL696OJdnEt8WCcXio=; b=FKECKSvtmF1NYxLhNJC16zB87dhJ9liYkvLcsPmqxmwvUDR6HJnN2fAbA4vLF07NSj QXMkJW/qUGVYoFriucOcJ/nCwDxXHJZ6QK29ZfQPw/53BYaYQUK/WAa8wxUCxwUDaPjG 77Owm1lIOARGFfAvE7W6qcKrRPfIzmjXLPI+BVVXcmF/wNIfw+7gtiZScIiR3ZXaznW9 ZY6e6Q2XrL5i5ApV7GAl1R2LgrMYu6iR7/cZcQxmDcw06/p/toH24U6DeU7FowLBFlrk OPWUZTNipKTG4x5GXY4yPqhRrsHlPX/y4F1lIdiFKy95OTNyt5vFGA7v5xlcjsYTLc9b oTzw== 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 w5si1950944plp.86.2017.11.07.11.54.07; Tue, 07 Nov 2017 11:54:19 -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 S1755298AbdKGI7b (ORCPT + 91 others); Tue, 7 Nov 2017 03:59:31 -0500 Received: from a2nlsmtp01-04.prod.iad2.secureserver.net ([198.71.225.38]:39006 "EHLO a2nlsmtp01-04.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753586AbdKGI5L (ORCPT ); Tue, 7 Nov 2017 03:57:11 -0500 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id BzfqeKNobV6DQBzfqe7rar; Tue, 07 Nov 2017 01:56:08 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1eBzfq-0003LJ-Ke; Tue, 07 Nov 2017 01:55:58 -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 v7 11/22] CIFS: SMBD: Implement function to destroy a SMB Direct connection Date: Tue, 7 Nov 2017 01:55:03 -0700 Message-Id: <20171107085514.12693-12-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171107085514.12693-1-longli@exchange.microsoft.com> References: <20171107085514.12693-1-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfFDz+lBD6TBUDNfRI/loEG3PAi9CERK9zARH2m0pBuhozPQuHCvI4u2mf05gHsdjdDpGYzfy8VP9eOy25xY+vH4ryVRgWfTA6ssHFmuo4orNDh6JKouY WWh2NmIzo0QpR0z/GK7lS9rXmpZ7tmtycRP8p7D8YIhLI5gESgpGaGM0CDvvY9NJ64SaQXcZOHFXdHsYiufzYcGlB/3t+Cceu7NgLBW4cUd2IlxREvN9FpmL KkqmY49CHoj/DhDuveYlyia4tQylCj7ihlqtu8D0ywr+IqV0nhyUSvodhGUkL18Qv7W6QwbgkAyXytVJEBxu2dDX1elntoZHeFfTj8Y5k2NFGwuMVzIQVoND 1GQBtRB8IlnFbGLCAAgSUOqrfErUJdT3J33goaYM9MfQksbu7+DyIXVUeVIpUUChdHJcCdc+fq13YExW4Qzd7ZMsLvF5BqE30a80Y0tnBt8WPj7L4h3/IHS4 aodbQTdMZEiLi9P44Mfb+eETY4/UGIaGg8b+/A== 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 9f23330..a8e7239 100644 --- a/fs/cifs/smbdirect.c +++ b/fs/cifs/smbdirect.c @@ -1392,6 +1392,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 1583425323418179690@xxx Tue Nov 07 16:27:42 +0000 2017 X-GM-THRID: 1582773328302129248 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread