Commit 522cd6ac authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag '6.16-rc-part2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull more smb client updates from Steve French:

 - multichannel/reconnect fixes

 - move smbdirect (smb over RDMA) defines to fs/smb/common so they will
   be able to be used in the future more broadly, and a documentation
   update explaining setting up smbdirect mounts

 - update email address for Paulo

* tag '6.16-rc-part2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
  cifs: update internal version number
  MAINTAINERS, mailmap: Update Paulo Alcantara's email address
  cifs: add documentation for smbdirect setup
  cifs: do not disable interface polling on failure
  cifs: serialize other channels when query server interfaces is pending
  cifs: deal with the channel loading lag while picking channels
  smb: client: make use of common smbdirect_socket_parameters
  smb: smbdirect: introduce smbdirect_socket_parameters
  smb: client: make use of common smbdirect_socket
  smb: smbdirect: add smbdirect_socket.h
  smb: client: make use of common smbdirect.h
  smb: smbdirect: add smbdirect.h with public structures
  smb: client: make use of common smbdirect_pdu.h
  smb: smbdirect: add smbdirect_pdu.h with protocol definitions
parents 538c429a 8e9d6efc
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -602,6 +602,12 @@ Paul Mackerras <paulus@ozlabs.org> <paulus@samba.org>
Paul Mackerras <paulus@ozlabs.org> <paulus@au1.ibm.com>
Paul Moore <paul@paul-moore.com> <paul.moore@hp.com>
Paul Moore <paul@paul-moore.com> <pmoore@redhat.com>
Paulo Alcantara <pc@manguebit.org> <pcacjr@zytor.com>
Paulo Alcantara <pc@manguebit.org> <paulo@paulo.ac>
Paulo Alcantara <pc@manguebit.org> <pc@cjr.nz>
Paulo Alcantara <pc@manguebit.org> <palcantara@suse.de>
Paulo Alcantara <pc@manguebit.org> <palcantara@suse.com>
Paulo Alcantara <pc@manguebit.org> <pc@manguebit.com>
Pavankumar Kondeti <quic_pkondeti@quicinc.com> <pkondeti@codeaurora.org>
Peter A Jonsson <pj@ludd.ltu.se>
Peter Oruba <peter.oruba@amd.com>
+1 −0
Original line number Diff line number Diff line
@@ -8,3 +8,4 @@ CIFS

   ksmbd
   cifsroot
   smbdirect
+103 −0
Original line number Diff line number Diff line
.. SPDX-License-Identifier: GPL-2.0

===========================
SMB Direct - SMB3 over RDMA
===========================

This document describes how to set up the Linux SMB client and server to
use RDMA.

Overview
========
The Linux SMB kernel client supports SMB Direct, which is a transport
scheme for SMB3 that uses RDMA (Remote Direct Memory Access) to provide
high throughput and low latencies by bypassing the traditional TCP/IP
stack.
SMB Direct on the Linux SMB client can be tested against KSMBD - a
kernel-space SMB server.

Installation
=============
- Install an RDMA device. As long as the RDMA device driver is supported
  by the kernel, it should work. This includes both software emulators (soft
  RoCE, soft iWARP) and hardware devices (InfiniBand, RoCE, iWARP).

- Install a kernel with SMB Direct support. The first kernel release to
  support SMB Direct on both the client and server side is 5.15. Therefore,
  a distribution compatible with kernel 5.15 or later is required.

- Install cifs-utils, which provides the `mount.cifs` command to mount SMB
  shares.

- Configure the RDMA stack

  Make sure that your kernel configuration has RDMA support enabled. Under
  Device Drivers -> Infiniband support, update the kernel configuration to
  enable Infiniband support.

  Enable the appropriate IB HCA support or iWARP adapter support,
  depending on your hardware.

  If you are using InfiniBand, enable IP-over-InfiniBand support.

  For soft RDMA, enable either the soft iWARP (`RDMA _SIW`) or soft RoCE
  (`RDMA_RXE`) module. Install the `iproute2` package and use the
  `rdma link add` command to load the module and create an
  RDMA interface.

  e.g. if your local ethernet interface is `eth0`, you can use:

    .. code-block:: bash

        sudo rdma link add siw0 type siw netdev eth0

- Enable SMB Direct support for both the server and the client in the kernel
  configuration.

    Server Setup

    .. code-block:: text

        Network File Systems  --->
            <M> SMB3 server support
                [*] Support for SMB Direct protocol

    Client Setup

    .. code-block:: text

        Network File Systems  --->
            <M> SMB3 and CIFS support (advanced network filesystem)
                [*] SMB Direct support

- Build and install the kernel. SMB Direct support will be enabled in the
  cifs.ko and ksmbd.ko modules.

Setup and Usage
================

- Set up and start a KSMBD server as described in the `KSMBD documentation
  <https://www.kernel.org/doc/Documentation/filesystems/smb/ksmbd.rst>`_.
  Also add the "server multi channel support = yes" parameter to ksmbd.conf.

- On the client, mount the share with `rdma` mount option to use SMB Direct
  (specify a SMB version 3.0 or higher using `vers`).

  For example:

    .. code-block:: bash

        mount -t cifs //server/share /mnt/point -o vers=3.1.1,rdma

- To verify that the mount is using SMB Direct, you can check dmesg for the
  following log line after mounting:

    .. code-block:: text

        CIFS: VFS: RDMA transport established

  Or, verify `rdma` mount option for the share in `/proc/mounts`:

    .. code-block:: bash

        cat /proc/mounts | grep cifs
+2 −2
Original line number Diff line number Diff line
@@ -5986,7 +5986,7 @@ X: drivers/clk/clkdev.c
COMMON INTERNET FILE SYSTEM CLIENT (CIFS and SMB3)
M:	Steve French <sfrench@samba.org>
M:	Steve French <smfrench@gmail.com>
R:	Paulo Alcantara <pc@manguebit.com> (DFS, global name space)
R:	Paulo Alcantara <pc@manguebit.org> (DFS, global name space)
R:	Ronnie Sahlberg <ronniesahlberg@gmail.com> (directory leases, sparse files)
R:	Shyam Prasad N <sprasad@microsoft.com> (multichannel)
R:	Tom Talpey <tom@talpey.com> (RDMA, smbdirect)
@@ -9280,7 +9280,7 @@ F: include/linux/iomap.h
FILESYSTEMS [NETFS LIBRARY]
M:	David Howells <dhowells@redhat.com>
M:	Paulo Alcantara <pc@manguebit.com>
M:	Paulo Alcantara <pc@manguebit.org>
L:	netfs@lists.linux.dev
L:	linux-fsdevel@vger.kernel.org
S:	Supported
+14 −9
Original line number Diff line number Diff line
@@ -362,6 +362,10 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
	c = 0;
	spin_lock(&cifs_tcp_ses_lock);
	list_for_each_entry(server, &cifs_tcp_ses_list, tcp_ses_list) {
#ifdef CONFIG_CIFS_SMB_DIRECT
		struct smbdirect_socket_parameters *sp;
#endif

		/* channel info will be printed as a part of sessions below */
		if (SERVER_IS_CHAN(server))
			continue;
@@ -383,25 +387,26 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
			seq_printf(m, "\nSMBDirect transport not available");
			goto skip_rdma;
		}
		sp = &server->smbd_conn->socket.parameters;

		seq_printf(m, "\nSMBDirect (in hex) protocol version: %x "
			"transport status: %x",
			server->smbd_conn->protocol,
			server->smbd_conn->transport_status);
			server->smbd_conn->socket.status);
		seq_printf(m, "\nConn receive_credit_max: %x "
			"send_credit_target: %x max_send_size: %x",
			server->smbd_conn->receive_credit_max,
			server->smbd_conn->send_credit_target,
			server->smbd_conn->max_send_size);
			sp->recv_credit_max,
			sp->send_credit_target,
			sp->max_send_size);
		seq_printf(m, "\nConn max_fragmented_recv_size: %x "
			"max_fragmented_send_size: %x max_receive_size:%x",
			server->smbd_conn->max_fragmented_recv_size,
			server->smbd_conn->max_fragmented_send_size,
			server->smbd_conn->max_receive_size);
			sp->max_fragmented_recv_size,
			sp->max_fragmented_send_size,
			sp->max_recv_size);
		seq_printf(m, "\nConn keep_alive_interval: %x "
			"max_readwrite_size: %x rdma_readwrite_threshold: %x",
			server->smbd_conn->keep_alive_interval,
			server->smbd_conn->max_readwrite_size,
			sp->keepalive_interval_msec * 1000,
			sp->max_read_write_size,
			server->smbd_conn->rdma_readwrite_threshold);
		seq_printf(m, "\nDebug count_get_receive_buffer: %x "
			"count_put_receive_buffer: %x count_send_empty: %x",
Loading