From patchwork Tue Aug 29 19:29:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 9928113 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 D093A602B9 for ; Tue, 29 Aug 2017 19:35:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2F5428A3F for ; Tue, 29 Aug 2017 19:35:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6D7E28A44; Tue, 29 Aug 2017 19:35:46 +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=ham 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 6633028A3F for ; Tue, 29 Aug 2017 19:35:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751727AbdH2Tf3 (ORCPT ); Tue, 29 Aug 2017 15:35:29 -0400 Received: from a2nlsmtp01-02.prod.iad2.secureserver.net ([198.71.225.36]:33218 "EHLO a2nlsmtp01-02.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751656AbdH2Tao (ORCPT ); Tue, 29 Aug 2017 15:30:44 -0400 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id mmCldvmNmuGJpmmCldvcaM; Tue, 29 Aug 2017 12:29:43 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1dmmCk-0006ry-WC; Tue, 29 Aug 2017 12:29:43 -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 Cc: Long Li Subject: [Patch v3 10/19] CIFS: SMBD: Send data through SMBDirect Date: Tue, 29 Aug 2017 12:29:06 -0700 Message-Id: <20170829192915.26251-11-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170829192915.26251-1-longli@exchange.microsoft.com> References: <20170829192915.26251-1-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfI6h2+TVk/DZi5u7TULDFrXNyOMAovy+HWdMrHn+Igsyzl71D6SIbFmYLaucirXhWRRL5A0lGQeJUuJQKKWEbVBP87AroAGPI3xIRSjMu9g47aMVBKDD WlONBuJqbjyORLBbvzqwI+CLneWwG940uT8JS4GbNd5Io9Sc4XZJbMaii8xR183MlFgzulMT+lkVd/HejQyUxPrlvvqxr4HfwDD0UJ3WzuwpJIvGvfW1SmVJ z6/aC4rykpZ05b3VKh5l7fIuV6P4D5ELiJUY38Js4XF4gux8ity0GM0gCaIL3F9GNQ2yWTiJo/OpyZUBjUbed9FWR2rVzekF2M6n6Ta6HMk/0ItzjsJEmMA0 psZTRfHBOJHPph6pVkukN1B5d/0CVBG+ji4X2GOAblGCWWfSTyD6X2ih9GrH3pH67SyIRM3/DUbiq4ijaJB0R5yR73jryFSe9L8MeXNIli76foHDm00J8DYN EDQ5oJ426U8ZHpZ/ 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 SMBDirect connected, use it for sending data via RDMA send. Signed-off-by: Long Li --- fs/cifs/transport.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index ba62aaf..bddb699 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -37,6 +37,7 @@ #include "cifsglob.h" #include "cifsproto.h" #include "cifs_debug.h" +#include "smbdirect.h" void cifs_wake_up_task(struct mid_q_entry *mid) @@ -230,6 +231,11 @@ __smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst) struct msghdr smb_msg; int val = 1; + if (server->smbd_conn) { + rc = smbd_send(server->smbd_conn, rqst); + goto done; + } + if (ssocket == NULL) return -ENOTSOCK; @@ -299,6 +305,7 @@ __smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst) server->tcpStatus = CifsNeedReconnect; } +done: if (rc < 0 && rc != -EINTR) cifs_dbg(VFS, "Error %d sending data on socket to server\n", rc);