diff mbox series

[v5,13/21] CIFS: SMBD: Upper layer receives data via RDMA receive

Message ID 20171018230920.21042-14-longli@exchange.microsoft.com
State New
Headers show
Series CIFS: Implement SMB Direct protocol | expand

Commit Message

Long Li Oct. 18, 2017, 11:09 p.m. UTC
From: Long Li <longli@microsoft.com>

With SMB Direct connected, use it for receiving data via RDMA receive.

Signed-off-by: Long Li <longli@microsoft.com>
---
 fs/cifs/connect.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 23f10d1..6325062 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -545,8 +545,14 @@  cifs_readv_from_socket(struct TCP_Server_Info *server, struct msghdr *smb_msg)
 
 		if (server_unresponsive(server))
 			return -ECONNABORTED;
-
+#ifdef CONFIG_CIFS_SMB_DIRECT
+		if (server->smbd_conn)
+			length = smbd_recv(server->smbd_conn, smb_msg);
+		else
+			length = sock_recvmsg(server->ssocket, smb_msg, 0);
+#else
 		length = sock_recvmsg(server->ssocket, smb_msg, 0);
+#endif
 
 		if (server->tcpStatus == CifsExiting)
 			return -ESHUTDOWN;