From patchwork Tue Nov 7 08:55:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 10045993 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 B2E7360247 for ; Tue, 7 Nov 2017 09:00:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5CE228783 for ; Tue, 7 Nov 2017 09:00:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9AD8B29B91; Tue, 7 Nov 2017 09:00:48 +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 8EEF728783 for ; Tue, 7 Nov 2017 09:00:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753440AbdKGJAb (ORCPT ); Tue, 7 Nov 2017 04:00:31 -0500 Received: from a2nlsmtp01-03.prod.iad2.secureserver.net ([198.71.225.37]:47136 "EHLO a2nlsmtp01-03.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753431AbdKGI5K (ORCPT ); Tue, 7 Nov 2017 03:57:10 -0500 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id BzfreqGQCKv33BzfrejPjP; Tue, 07 Nov 2017 01:56:08 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1eBzfr-0003Lh-2s; Tue, 07 Nov 2017 01:55:59 -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 v7 15/22] CIFS: SMBD: Upper layer receives data via RDMA receive Date: Tue, 7 Nov 2017 01:55:07 -0700 Message-Id: <20171107085514.12693-16-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171107085514.12693-1-longli@exchange.microsoft.com> References: <20171107085514.12693-1-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfMMdhH5AVEt7Wy64WahBNKWcqMc9soy3/LLEOcmp03tQvQShtWn7zfWK8EnTr6fenuaDV2F5Y6Z4FBSXFubUUMyCR8Hnqy9x64Tugx2J75RvvUZLWIQq 4CNLwE/Sq8WWZkrqycDH0UXNyTcbPnpeb8dQU7DmzgaTuPzyFlpSAIyx7FoSUK7UttMaIrpPY79EaqvOAg4sMkqobme54K2ynELQmKVly3MHSCVs2a7YLezt bovkLtMxmFKvfaOdsWJlj5l5von7/xRbKAqMo2P8Uml6ULzyY1afU2MPZgF441iOeRjDonnqjcF3wyCyEPoxVoFIYyC6V71JT97y7H2P9B2UFFaLPuHVSeA6 iTunTS2hwasEh4cpdqS4QDx8PVoIO6JC+utl8CdGfVO3oArNXReVCcohQCsBMnhhXdsP0eOJPlJg4jEfIOl/BiPZ2V7P0Sg2f2YaLNT06bznjo0l4Pw6Qrl2 Ga/I52GZRR8GAepCKDWzc1KVDl2H6S6+zdkPvg== 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 3d74983..fcd01df 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -539,8 +539,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;