From patchwork Tue Nov 7 08:54:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Long Li X-Patchwork-Id: 835196 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yWNlj6xMcz9s7C for ; Tue, 7 Nov 2017 20:04:17 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753206AbdKGI5J (ORCPT ); Tue, 7 Nov 2017 03:57:09 -0500 Received: from a2nlsmtp01-02.prod.iad2.secureserver.net ([198.71.225.36]:34050 "EHLO a2nlsmtp01-02.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752180AbdKGI5G (ORCPT ); Tue, 7 Nov 2017 03:57:06 -0500 Received: from linuxonhyperv.com ([107.180.71.197]) by : HOSTING RELAY : with SMTP id BzfdebYupOdJ4BzfdeYobp; Tue, 07 Nov 2017 01:56:05 -0700 x-originating-ip: 107.180.71.197 Received: from longli by linuxonhyperv.com with local (Exim 4.89) (envelope-from ) id 1eBzfd-0003JS-22; Tue, 07 Nov 2017 01:55:45 -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 00/22] CIFS: Implement SMB Direct protocol Date: Tue, 7 Nov 2017 01:54:52 -0700 Message-Id: <20171107085514.12693-1-longli@exchange.microsoft.com> X-Mailer: git-send-email 2.14.1 X-CMAE-Envelope: MS4wfKipmAxzaSlp55LBvBksFMnxPMQdG6tce0Ixn5uJyuzfMTeqNVvXxCp76VOOd7eUlpiUEA0woNYacwMxi8UhcZzEATfMY43kHUw8iyMsctgWtqI6K7bt iIXbOSrad7KDTHKphDTODRcliR07nw9D+TGCMF7LwZIEtHkjwuy1t/xsHDfV1tPlolIN80WaeLWiCk1PrmHJWGw/IQzrDCCfVGJsl6VtpakehnKuv8BbOaW1 NtcNO2LnpTqOBYfmiNNvGRKHl0zyG+TVgFccUOWLYM8wArjceKBCB7n7P4h0aFEyLZ+P6NapJe5ZItVCMaDOquxX0DBtJ39UTOG22QvtMsw+Hvivm4CVYbrj zsVvIaQyhPV6C7XQF0AjtgDSU6st5ube6geb3ucMM688OVLC6H3+Zy81D7p3UkebyR+kT74MqbxrDt/h0naYRpVVem+FEzvaqe7UBmf8GR/1eNu5xi8sfA7W gWtlj310c04I6ulsLLMJOhK9di1fq+X1sEVbog== Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org From: Long Li Starting with SMB2 dialect 3.0, Microsoft introduced SMB Direct transport protocol for transferring upper layer (SMB2) payload over RDMA via Infiniband, RoCE or iWARP. The prococol is published in [MS-SMBD] (https://msdn.microsoft.com/en-us/library/hh536346.aspx). Change log: v2: Implemented RDMA read/write via memory registration. Re-arranged patches for review [Christoph Hellwig ]. Restructured the code and fixed bugs on protocol timer and keepalive [Tom Talpey ]. v3: Improved performance by introducing an additional queue for handling empty packets and reducing lock contention on IRQ path. Added light weight profiling by reading TSC. Improved the code for checking SMB versions when mounting with rdma option [Leon Romanovsky ]. Moved to use pages instead of buffers for passing I/O for RDMA [Christoph Hellwig ]. Removed redundant code and refactored I/O code paths [Christoph Hellwig , Tom Talpey ]. v4: Fixed connectivity issues with iWAPR devices. Exported configurable protocol parameters to /proc/fs/cifs [Steve French ] Re-arranged patches for review [Pavel Shilovsky ]. v5: Fixed compiling errors on ia64, i386 and when INFINIBAND is not configured. [kbuild test robot] Profiling is removed and will be introduced in a seperate patch. v6: Report internal code error via WARN_ON(). Change description in Kconfig [Pavel Shilovsky ]. v7: Removed the use of #ifdef CONFIG_CIFS_SMB_DIRECT in upper layer code calling transport I/O. [Matthew Wilcox , Tom Talpey ] Long Li (22): CIFS: SMBD: Add parameter rdata to smb2_new_read_req CIFS: SMBD: Introduce kernel config option CONFIG_CIFS_SMB_DIRECT CIFS: SMBD: Add rdma mount option CIFS: SMBD: Add SMB Direct protocol initial values and constants CIFS: SMBD: Establish SMB Direct connection CIFS: SMBD: export protocol initial values CIFS: SMBD: Implement function to create a SMB Direct connection CIFS: SMBD: Upper layer connects to SMBDirect session CIFS: SMBD: Implement function to reconnect to a SMB Direct transport CIFS: SMBD: Upper layer reconnects to SMB Direct session CIFS: SMBD: Implement function to destroy a SMB Direct connection CIFS: SMBD: Upper layer destroys SMB Direct session on shutdown or umount CIFS: SMBD: Set SMB Direct maximum read or write size for I/O CIFS: SMBD: Implement function to receive data via RDMA receive CIFS: SMBD: Upper layer receives data via RDMA receive CIFS: SMBD: Implement function to send data via RDMA send CIFS: SMBD: Upper layer sends data via RDMA send CIFS: SMBD: Implement RDMA memory registration CIFS: SMBD: Upper layer performs SMB write via RDMA read through memory registration CIFS: SMBD: Read correct returned data length for RDMA write (SMB read) I/O CIFS: SMBD: Upper layer performs SMB read via RDMA write through memory registration CIFS: SMBD: Add SMB Direct debug counters fs/cifs/Kconfig | 8 + fs/cifs/Makefile | 2 + fs/cifs/cifs_debug.c | 147 +++ fs/cifs/cifsfs.c | 2 + fs/cifs/cifsglob.h | 21 +- fs/cifs/cifssmb.c | 15 +- fs/cifs/connect.c | 53 +- fs/cifs/file.c | 17 +- fs/cifs/smb1ops.c | 4 +- fs/cifs/smb2ops.c | 24 +- fs/cifs/smb2pdu.c | 127 ++- fs/cifs/smbdirect.c | 2617 ++++++++++++++++++++++++++++++++++++++++++++++++++ fs/cifs/smbdirect.h | 330 +++++++ fs/cifs/transport.c | 8 +- 14 files changed, 3344 insertions(+), 31 deletions(-) create mode 100644 fs/cifs/smbdirect.c create mode 100644 fs/cifs/smbdirect.h