Re: [RFC PATCH 00/31] netfs: [WIP] Allow the use of MSG_SPLICE_PAGES and use netmem allocator

From: Enzo Matsumiya
Date: Fri Aug 08 2025 - 10:15:36 EST


Hi David,

On 08/06, David Howells wrote:
(3) Rewrite the base TCP transmission to be able to use MSG_SPLICE_PAGES.

(a) Copy all the data involved in a message into a big buffer formed
of a sequence of pages attached to a bvecq.

Nice!

(b) If encrypting the message just encrypt this buffer. Converting
this to a scatterlist is much simpler (and uses less memory) than
encrypting from the protocol elements.

This could've been done a long ago, but since you're on it... crypto API
supports in-place ops (src == dst), so you can save yet another allocation
here.

This is also possible from SMB2 side because the spec says if encryption
fails, the request should be failed as a whole.

(d) Compression should be a matter of vmap()'ing these pages to form
the source buffer, allocating a second buffer of pages to form a
dest buffer, also in a bvecq, vmapping that and then doing the
compression. The first buffer can then just be replaced by the
second.

OTOH, compression can't be in-place because SMB2 says that if
compression fails, the original uncompressed request must be sent (i.e.
src must be left untouched until smb_compress() finishes).

I don't know how relevant these comments are for you and your patches,
but HTH.

Directly related to the patches: it would be great if you could handle
commented out code, either by completely removing them, or by providing
some in-code fallback mechanism (I'll reply to the patches).

Other than that, +1 for the cleanup/refactoring; I really like the new
smb_message/transport infrastructure!


Cheers,

Enzo