All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Steve French <smfrench@gmail.com>, Al Viro <viro@zeniv.linux.org.uk>
Cc: Rohith Surabattula <rohiths.msft@gmail.com>,
	Steve French <sfrench@samba.org>,
	Shyam Prasad N <nspmangalore@gmail.com>,
	linux-cifs@vger.kernel.org, dhowells@redhat.com,
	Shyam Prasad N <nspmangalore@gmail.com>,
	Rohith Surabattula <rohiths.msft@gmail.com>,
	Tom Talpey <tom@talpey.com>,
	Christoph Hellwig <hch@infradead.org>,
	Matthew Wilcox <willy@infradead.org>,
	Jeff Layton <jlayton@kernel.org>,
	linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [RFC PATCH 0/9] smb3: Add iter helpers and use iov_iters down to the network transport
Date: Fri, 28 Oct 2022 16:55:44 +0100	[thread overview]
Message-ID: <166697254399.61150.1256557652599252121.stgit@warthog.procyon.org.uk> (raw)


Hi Steve, Al, Christoph,

Here's an updated version of a subset of my branch to make the cifs/smb3
driver pass iov_iters down to the lowest layers where they can be passed to
the network transport.

Al, Christoph: Could you look at the first four patches and see if you're okay
with them - at least on a temporary basis so that I can get this moving?

Note that patch (4) uses kmap_local_folio() to map an entire folio - this is
wrong.  I'm going to try using Willy's vmap_folio() code - but I haven't done
that yet.

The first two patches are placed in netfslib as I have patches for netfslib
that will want to use them:

 (1) Add a function to extract part of an IOVEC-/UBUF-type iterator into a
     BVEC-type iterator.  Refs are taken on the pages to prevent them from
     evaporating.

 (2) Add a function to extract part of an iterator into a scatterlist.  If
     extracting from an IOVEC-/UBUF-type iterator, the pages have refs taken on
     them; any other type and they don't.

     It might be worth splitting this into two separate functions, one for
     IOVEC/UBUF that refs and one for the others that doesn't.

The other patches are placed in cifs as they're only used by cifs for now.

 (3) Add a function to build an RDMA SGE list from a BVEC-, KVEC- or
     XARRAY-type iterator.  It's left to the caller to make sure they don't
     evaporate.

 (4) Add a function to hash part of the contents of a BVEC-, KVEC- or
     XARRAY-type iterator.

I will need to make use of thew proposed page pinning when it becomes
available, but that's not yet.

Changes made in a later patch in the series make the upper layers convert an
IOVEC-/UBUF-iterator to a BVEC-type iterator in direct/unbuffered I/O so that
the signing, crypt and RDMA code see the BVEC instead of user buffers.

Note also that I haven't managed to test all the combinations of transport.
Samba doesn't support RDMA and ksmbd doesn't support encryption.  I can test
them separately, but not together.  That said, rdma, sign, seal and sign+seal
seem to work.

I've pushed the patches here also:

	https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=cifs-for-viro

David
---
David Howells (9):
      netfs: Add a function to extract a UBUF or IOVEC into a BVEC iterator
      netfs: Add a function to extract an iterator into a scatterlist
      cifs: Add a function to build an RDMA SGE list from an iterator
      cifs: Add a function to Hash the contents of an iterator
      cifs: Add some helper functions
      cifs: Add a function to read into an iter from a socket
      cifs: Change the I/O paths to use an iterator rather than a page list
      cifs: Build the RDMA SGE list directly from an iterator
      cifs: Remove unused code


 fs/cifs/cifsencrypt.c |  167 +++-
 fs/cifs/cifsfs.h      |    3 +
 fs/cifs/cifsglob.h    |   30 +-
 fs/cifs/cifsproto.h   |   11 +-
 fs/cifs/cifssmb.c     |   13 +-
 fs/cifs/connect.c     |   16 +
 fs/cifs/file.c        | 1700 ++++++++++++++++++-----------------------
 fs/cifs/fscache.c     |   22 +-
 fs/cifs/fscache.h     |   10 +-
 fs/cifs/misc.c        |  110 +--
 fs/cifs/smb2ops.c     |  378 +++++----
 fs/cifs/smb2pdu.c     |   44 +-
 fs/cifs/smbdirect.c   |  503 +++++++-----
 fs/cifs/smbdirect.h   |    4 +-
 fs/cifs/transport.c   |   57 +-
 fs/netfs/Makefile     |    1 +
 fs/netfs/iterator.c   |  347 +++++++++
 include/linux/netfs.h |    5 +
 18 files changed, 1835 insertions(+), 1586 deletions(-)
 create mode 100644 fs/netfs/iterator.c



             reply	other threads:[~2022-10-28 15:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-28 15:55 David Howells [this message]
2022-10-28 15:55 ` [RFC PATCH 1/9] netfs: Add a function to extract a UBUF or IOVEC into a BVEC iterator David Howells
2022-10-28 15:55 ` [RFC PATCH 2/9] netfs: Add a function to extract an iterator into a scatterlist David Howells
2022-10-28 15:56 ` [RFC PATCH 3/9] cifs: Add a function to build an RDMA SGE list from an iterator David Howells
2022-10-28 15:56 ` [RFC PATCH 4/9] cifs: Add a function to Hash the contents of " David Howells
2022-10-28 15:56 ` [RFC PATCH 5/9] cifs: Add some helper functions David Howells
2022-10-28 15:56 ` [RFC PATCH 6/9] cifs: Add a function to read into an iter from a socket David Howells
2022-10-28 15:56 ` [RFC PATCH 7/9] cifs: Change the I/O paths to use an iterator rather than a page list David Howells
2022-10-28 15:56 ` [RFC PATCH 8/9] cifs: Build the RDMA SGE list directly from an iterator David Howells
2022-10-28 15:56 ` [RFC PATCH 9/9] cifs: Remove unused code David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=166697254399.61150.1256557652599252121.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=hch@infradead.org \
    --cc=jlayton@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nspmangalore@gmail.com \
    --cc=rohiths.msft@gmail.com \
    --cc=sfrench@samba.org \
    --cc=smfrench@gmail.com \
    --cc=tom@talpey.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.