diff options
author | Long Li <longli@microsoft.com> | 2017-11-23 01:38:34 +0100 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2018-01-25 02:49:06 +0100 |
commit | 2f8946464b11822169b9f10c7cf58a2440b51d54 (patch) | |
tree | 619aafd4c101f586ecb001e55817bc38a69a79b2 /fs/cifs/connect.c | |
parent | cifs: fix build errors for SMB_DIRECT (diff) | |
download | linux-2f8946464b11822169b9f10c7cf58a2440b51d54.tar.xz linux-2f8946464b11822169b9f10c7cf58a2440b51d54.zip |
CIFS: SMBD: Upper layer connects to SMBDirect session
When "rdma" is specified in the mount option, make CIFS connect to
SMB Direct.
Signed-off-by: Long Li <longli@microsoft.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 64be6f9e54a2..fafaecb5fb18 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -44,7 +44,6 @@ #include <net/ipv6.h> #include <linux/parser.h> #include <linux/bvec.h> - #include "cifspdu.h" #include "cifsglob.h" #include "cifsproto.h" @@ -56,6 +55,7 @@ #include "rfc1002pdu.h" #include "fscache.h" #include "smb2proto.h" +#include "smbdirect.h" #define CIFS_PORT 445 #define RFC1001_PORT 139 @@ -2310,13 +2310,29 @@ cifs_get_tcp_session(struct smb_vol *volume_info) tcp_ses->echo_interval = volume_info->echo_interval * HZ; else tcp_ses->echo_interval = SMB_ECHO_INTERVAL_DEFAULT * HZ; - + if (tcp_ses->rdma) { +#ifndef CONFIG_CIFS_SMB_DIRECT + cifs_dbg(VFS, "CONFIG_CIFS_SMB_DIRECT is not enabled\n"); + rc = -ENOENT; + goto out_err_crypto_release; +#endif + tcp_ses->smbd_conn = smbd_get_connection( + tcp_ses, (struct sockaddr *)&volume_info->dstaddr); + if (tcp_ses->smbd_conn) { + cifs_dbg(VFS, "RDMA transport established\n"); + rc = 0; + goto smbd_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; } - +smbd_connected: /* * since we're in a cifs function already, we know that * this will succeed. No need for try_module_get(). |