Skip to content

splice, net: Handle MSG_SPLICE_PAGES in AF_TLS

David Howells bpf linux-block linux-fsdevel linux-mm lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest6 patches 4 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6splice, net: Fix MSG_MORE signalling in splice_direct_to_actor()fs/splice.c+14 -30 replies
2/6net: Block MSG_SENDPAGE_* from being passed to sendmsg() by userspaceinclude/linux/socket.h+3 -14 replies
3/6tls/sw: Support MSG_SPLICE_PAGESnet/tls/tls_sw.c+45 -10 replies
4/6tls/sw: Convert tls_sw_sendpage() to use MSG_SPLICE_PAGESnet/tls/tls_sw.c+31 -1340 replies
5/6tls/device: Support MSG_SPLICE_PAGESnet/tls/tls_device.c+26 -00 replies
6/6tls/device: Convert tls_device_sendpage() to use MSG_SPLICE_PAGESnet/tls/tls_device.c+20 -640 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH net-next v2 0/6] splice, net: Handle MSG_SPLICE_PAGES in AF_TLS

Here are patches to make AF_TLS handle the MSG_SPLICE_PAGES internal sendmsg flag. MSG_SPLICE_PAGES is an internal hint that tells the protocol that it should splice the pages supplied if it can. Its sendpage implementations are then turned into wrappers around that.

The following changes are made:

(1) The first patch fixes MSG_MORE signalling in splice_direct_to_actor().

The problem is that MSG_MORE is asserted if a short splice from a file occurs because we hit the EOF[1]. This is fixed by checking the EOF if the file is seekable.

(2) Implement MSG_SPLICE_PAGES support in the AF_TLS-sw sendmsg and make tls_sw_sendpage() just a wrapper around sendmsg().

(3) Implement MSG_SPLICE_PAGES support in AF_TLS-device and make tls_device_sendpage() just a wrapper around sendmsg().

I've pushed the patches here also:

https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=sendpage-2-tls

David

Changes
=======
ver #2)
- Dropped the slab data copying.
- "rls_" should be "tls_".
- Attempted to fix splice_direct_to_actor().
- Blocked MSG_SENDPAGE_* from being set by userspace.

David Howells (6):
splice, net: Fix MSG_MORE signalling in splice_direct_to_actor()
net: Block MSG_SENDPAGE_* from being passed to sendmsg() by userspace tls/sw: Support MSG_SPLICE_PAGES
tls/sw: Convert tls_sw_sendpage() to use MSG_SPLICE_PAGES tls/device: Support MSG_SPLICE_PAGES
tls/device: Convert tls_device_sendpage() to use MSG_SPLICE_PAGES

 fs/splice.c            |  17 +++-
 include/linux/socket.h |   4 +-
 net/tls/tls_device.c   |  94 ++++++++----------
 net/tls/tls_sw.c       | 211 +++++++++++++++--------------------------
 4 files changed, 131 insertions(+), 195 deletions(-)