From patchwork Thu Nov 23 00:38:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 10072157 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 1ABFB60595 for ; Thu, 23 Nov 2017 00:41:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CB8C29DBF for ; Thu, 23 Nov 2017 00:41:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 014F229DC8; Thu, 23 Nov 2017 00:41:45 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 B28DF29DBF for ; Thu, 23 Nov 2017 00:41:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752696AbdKWAlG (ORCPT ); Wed, 22 Nov 2017 19:41:06 -0500 Received: from a2nlsmtp01-03.prod.iad2.secureserver.net ([198.71.225.37]:49524 "EHLO a2nlsmtp01-03.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752852AbdKWAkR (ORCPT ); Wed, 22 Nov 2017 19:40:17 -0500 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id HfXbeuu2VNCjBHfXbeqkxQ; Wed, 22 Nov 2017 17:39:15 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1eHfXb-0004TK-NG; Wed, 22 Nov 2017 17:38:55 -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 v8 08/16] CIFS: SMBD: Upper layer receives data via RDMA receive Date: Wed, 22 Nov 2017 17:38:41 -0700 Message-Id: <20171123003849.17093-9-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171123003849.17093-1-longli@exchange.microsoft.com> References: <20171123003849.17093-1-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfCeGPnW/AzKIjCCopR0F02CWdY3rzOxTL4b5Ro4uNwta8PkRwWh3Li4MVEZHYAvxW1euiNnoJnsV1ou58Aw9BgbVnzWZH1yZpvPyUJpnLUigo+jIx+W+ 56+fWSa7QKJry/50Juws7gibODXdXnHXA2Q3eKyrahP/d+4IG16V5v3jBN9yrIXWHHGISYdo7PQecoXjWglWZgn1isEl4RqBD87yTzxSoLZWBhFcsrBUSCYU HnQBssl6A0ebRljEV++8/p7+Z+nUstvLi1E0wIvvMyjwgpepybJdgDGSxA2J0loszq1ZqBUpmC4AZpCAn5VJvcoQM3/JzpjsFSFnc5jboiUPfhKgZpND6GNo 1G2J+5n77pDOhHSTi6opPsr647XUoSHHl4OpZ4JVtie03Rc/F4Y+y5KtD6xxUDbHRQJEww1Pp0/xhJton3AUp7MO+5bFgdd6/f8Ephg6xXgtOBOnOqJp/uk0 437HPspElg7blwvE4PDB8HRleGhRdSPa6Hei2g== 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 With SMB Direct connected, use it for receiving data via RDMA receive. Signed-off-by: Long Li --- fs/cifs/connect.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index d8bfa89..1677401 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -542,8 +542,10 @@ cifs_readv_from_socket(struct TCP_Server_Info *server, struct msghdr *smb_msg) if (server_unresponsive(server)) return -ECONNABORTED; - - length = sock_recvmsg(server->ssocket, smb_msg, 0); + if (cifs_rdma_enabled(server) && server->smbd_conn) + length = smbd_recv(server->smbd_conn, smb_msg); + else + length = sock_recvmsg(server->ssocket, smb_msg, 0); if (server->tcpStatus == CifsExiting) return -ESHUTDOWN;