From patchwork Mon Oct 2 02:30:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 9980119 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 9433260365 for ; Mon, 2 Oct 2017 02:34:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C66D2022B for ; Mon, 2 Oct 2017 02:34:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FB0128754; Mon, 2 Oct 2017 02:34:03 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 01B942022B for ; Mon, 2 Oct 2017 02:34:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752063AbdJBCb4 (ORCPT ); Sun, 1 Oct 2017 22:31:56 -0400 Received: from a2nlsmtp01-02.prod.iad2.secureserver.net ([198.71.225.36]:43312 "EHLO a2nlsmtp01-02.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751534AbdJBCbx (ORCPT ); Sun, 1 Oct 2017 22:31:53 -0400 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id yqVIdsk5JiuNpyqVIdg8uG; Sun, 01 Oct 2017 19:30:51 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1dyqVI-0000xu-HM; Sun, 01 Oct 2017 19:30:44 -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 v4 15/22] CIFS: SMBD: Upper layer sends data via RDMA send Date: Sun, 1 Oct 2017 19:30:23 -0700 Message-Id: <20171002023030.3582-16-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171002023030.3582-1-longli@exchange.microsoft.com> References: <20171002023030.3582-1-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfNOCeAxPyG/VxwBwxwlzqFPI0uGDOOZwk0k2bcin23FEr+xfhtzOPvMB4144110CGuNkYQTftlE+ojPzqTBzOVQa0nQxo1vkLyWkbhjCh4spqWkeM9Ah h3gbJZvTHnA6d7x03I9HES9kV4Z7mmVosYbopPlv7aEhCEIO+jH24ngvSpWalyfHjmufUICdeILUA7IKFxglruTNKAE85zN3QJUpDyhZy7FSJAtRnaJe3B54 lcs2PU6/XM4PvFR/x/UfPXvsQ8vFIx41QQ/VT7s7AWcp2fXBYN6kokEPTYx87GX+siKOdTufaOqAQp+zc8WN4insSZFF2PA6TDQ+r8i6NWQeHaWCatZxyS25 Bis50yJEybHdaPrPwrpUTvMcdjAed7r7Sk24r5PGbjILlDKREHSOqEVBwI2cn4CS+NqAHcgWIOSH39cZ8g9Rv9ZvAySvVM77L0A/2KnyEAwgE3+YyiXgCyMK oqekXqbPvtRexXMA 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 7efbab0..3a9b5a0 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);