tls/sw: Convert tls_sw_sendpage() to use MSG_SPLICE_PAGES
authorDavid Howells <dhowells@redhat.com>
Wed, 7 Jun 2023 18:19:18 +0000 (19:19 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 9 Jun 2023 02:40:31 +0000 (19:40 -0700)
commit45e5be844ab6b2845b6d2935b61278c5ecae7d38
treec4c567b09eac8c365ec6a4a85c26d407a64f72b5
parentfe1e81d4f73b6cbaed4fcc476960d26770642842
tls/sw: Convert tls_sw_sendpage() to use MSG_SPLICE_PAGES

Convert tls_sw_sendpage() and tls_sw_sendpage_locked() to use sendmsg()
with MSG_SPLICE_PAGES rather than directly splicing in the pages itself.

[!] Note that tls_sw_sendpage_locked() appears to have the wrong locking
    upstream.  I think the caller will only hold the socket lock, but it
    should hold tls_ctx->tx_lock too.

This allows ->sendpage() to be replaced by something that can handle
multiple multipage folios in a single transaction.

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
cc: Chuck Lever <chuck.lever@oracle.com>
cc: Boris Pismenny <borisp@nvidia.com>
cc: John Fastabend <john.fastabend@gmail.com>
cc: Jens Axboe <axboe@kernel.dk>
cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tls/tls_sw.c