From patchwork Sun Aug 20 19:04:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 9911381 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 CCDC5603F9 for ; Sun, 20 Aug 2017 19:09:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC9D62872A for ; Sun, 20 Aug 2017 19:09:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B138328739; Sun, 20 Aug 2017 19:09:40 +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 66DAF28705 for ; Sun, 20 Aug 2017 19:09:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753607AbdHTTGj (ORCPT ); Sun, 20 Aug 2017 15:06:39 -0400 Received: from a2nlsmtp01-03.prod.iad2.secureserver.net ([198.71.225.37]:44452 "EHLO a2nlsmtp01-03.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753597AbdHTTGh (ORCPT ); Sun, 20 Aug 2017 15:06:37 -0400 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id jVXUdL2wWyEu9jVXUdOWRc; Sun, 20 Aug 2017 12:05:36 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1djVXU-0000oc-Eo; Sun, 20 Aug 2017 12:05:36 -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 v2 09/19] CIFS: SMBD: Read data from SMBDirect Date: Sun, 20 Aug 2017 12:04:33 -0700 Message-Id: <1503255883-3041-10-git-send-email-longli@exchange.microsoft.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1503255883-3041-1-git-send-email-longli@exchange.microsoft.com> References: <1503255883-3041-1-git-send-email-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfMG+hnwXvPwozBqy1nyXJG3tHHbVGe4JitRFE6uLxvwJix2/FAnh3yvRyjABWmQMNis8NO+Jyd561yZk/6Q+MZXUG1lFVhjhmPstiIHyFzxBMBH92dNl pyOZcptpJxOI4A68QbymTBR1t/kxZQPW5PKDPQPelW8rBSrzxgQjGoL6SgZmUessbF6aYpUOXT3PNi1rsta5RrQAFT0LTV4lmIdQyMLdUSSnSAZQfdBJCwU3 lEZ+RCfj5zhkoxyc/4+pjD74h/ARw0VPOcrwyB8JT46dVdxGmaDq6x4f3ciprvKa/c9zHi4ebINj2REqG/EKvJ8aWdG98UGAsY6K1AsyrectJyJP/cjNp2Ju LER2A/TuNFhF8/Ox9USSw38NfJ7Wf/AtB2ojCeaMDie6/koOUVTQV3LhNGCkCQcl8YyspFx06ymn7DSH7S6OUQ0wVZ3TrwP5OVJ6ju0Nk1xyY0d1CvK/uCJc PCop3b3VGEj/ffM8 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 receiving data via RDMA recv. Signed-off-by: Long Li --- fs/cifs/connect.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index f65950f..9b0da7f 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -584,6 +584,10 @@ cifs_read_from_socket(struct TCP_Server_Info *server, char *buf, { struct msghdr smb_msg; struct kvec iov = {.iov_base = buf, .iov_len = to_read}; + + if (server->smbd_conn) + return smbd_recv(server->smbd_conn, buf, to_read); + iov_iter_kvec(&smb_msg.msg_iter, READ | ITER_KVEC, &iov, 1, to_read); return cifs_readv_from_socket(server, &smb_msg); @@ -595,6 +599,10 @@ cifs_read_page_from_socket(struct TCP_Server_Info *server, struct page *page, { struct msghdr smb_msg; struct bio_vec bv = {.bv_page = page, .bv_len = to_read}; + + if (server->smbd_conn) + return smbd_recv_page(server->smbd_conn, page, to_read); + iov_iter_bvec(&smb_msg.msg_iter, READ | ITER_BVEC, &bv, 1, to_read); return cifs_readv_from_socket(server, &smb_msg); }