Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753297AbdHBUN2 (ORCPT ); Wed, 2 Aug 2017 16:13:28 -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 x-originating-ip: 107.180.71.197 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1502 Lines: 54 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(). -- 2.7.4