From patchwork Wed Aug 2 20:10:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 9877503 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 81945602BC for ; Wed, 2 Aug 2017 20:14:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7308E27CAF for ; Wed, 2 Aug 2017 20:14:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67D5028760; Wed, 2 Aug 2017 20:14:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00C9A27CAF for ; Wed, 2 Aug 2017 20:14:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753240AbdHBUNX (ORCPT ); Wed, 2 Aug 2017 16:13:23 -0400 Received: from a2nlsmtp01-05.prod.iad2.secureserver.net ([198.71.225.49]:48122 "EHLO a2nlsmtp01-05.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753076AbdHBUM1 (ORCPT ); Wed, 2 Aug 2017 16:12:27 -0400 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id czzKd3WIR80gSczzKdCUna; Wed, 02 Aug 2017 13:11:26 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1dczzK-0005It-8g; Wed, 02 Aug 2017 13:11:26 -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 v1] 33/37] [CIFS] Connect to SMBD transport when specified in mount option Date: Wed, 2 Aug 2017 13:10:44 -0700 Message-Id: <1501704648-20159-34-git-send-email-longli@exchange.microsoft.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1501704648-20159-1-git-send-email-longli@exchange.microsoft.com> References: <1501704648-20159-1-git-send-email-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfLTrSqnvflwxjhGnzGF27jlvOvSpGGCSkbDGudUAVNbfRIkns/d+GcoNeFfqXSsGvbwImBhay1vML1vlai1/W445+lnHf7JIIJwDCHaU3YgkitilrBHK VEGcDChT8je5E2rETVp0oSu32E7pv6S9DnBCkAKb6bmUSq2mhGdUzzmqe1pBPN1aR2EEMo/DBdwdMOVu79fh6zSA9y3jlYtU1NYS6QcpmjJp1AjW+/cRr0Gx TZi3/OM5QjnYq2qnAKzTM5Y5aHymv5Vo8qupclFm6NngLacAVjmnnPbDGRwDKFAfe3RtVMD+qYe70E7xnOSHXxmv9KPvIBN+4kezKLDihPE= Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Long Li When "-o rdma" is specified, attempt to connect to SMB server via SMBD. Signed-off-by: Long Li --- fs/cifs/connect.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 0dc942c..1ba5b92 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -45,6 +45,7 @@ #include #include +#include "cifsrdma.h" #include "cifspdu.h" #include "cifsglob.h" #include "cifsproto.h" @@ -2284,12 +2285,26 @@ cifs_get_tcp_session(struct smb_vol *volume_info) else tcp_ses->echo_interval = SMB_ECHO_INTERVAL_DEFAULT * HZ; - rc = ip_connect(tcp_ses); - if (rc < 0) { - cifs_dbg(VFS, "Error connecting to socket. Aborting operation.\n"); - goto out_err_crypto_release; + if (tcp_ses->rdma) { + tcp_ses->rdma_ses = cifs_create_rdma_session(tcp_ses, (struct sockaddr *)&volume_info->dstaddr); + if (tcp_ses->rdma_ses) { + cifs_dbg(VFS, "%s: RDMA transport established\n", __func__); + rc = 0; + goto connected; + } + else { + rc = -ENOENT; + goto out_err_crypto_release; + } + } + + rc = ip_connect(tcp_ses); + if (rc < 0) { + cifs_dbg(VFS, "Error connecting to socket. Aborting operation.\n"); + goto out_err_crypto_release; } +connected: /* * since we're in a cifs function already, we know that * this will succeed. No need for try_module_get().