tls: Allow MSG_SPLICE_PAGES but treat it as normal sendmsg
authorDavid Howells <dhowells@redhat.com>
Wed, 7 Jun 2023 18:19:08 +0000 (19:19 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 9 Jun 2023 02:40:30 +0000 (19:40 -0700)
Allow MSG_SPLICE_PAGES to be specified to sendmsg() but treat it as normal
sendmsg for now.  This means the data will just be copied until
MSG_SPLICE_PAGES is handled.

Signed-off-by: David Howells <dhowells@redhat.com>
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_device.c
net/tls/tls_sw.c

index a959572..9ef766e 100644 (file)
@@ -447,7 +447,8 @@ static int tls_push_data(struct sock *sk,
        long timeo;
 
        if (flags &
-           ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | MSG_SENDPAGE_NOTLAST))
+           ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL | MSG_SENDPAGE_NOTLAST |
+             MSG_SPLICE_PAGES))
                return -EOPNOTSUPP;
 
        if (unlikely(sk->sk_err))
index 1a53c8f..38acc27 100644 (file)
@@ -955,7 +955,7 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
        int pending;
 
        if (msg->msg_flags & ~(MSG_MORE | MSG_DONTWAIT | MSG_NOSIGNAL |
-                              MSG_CMSG_COMPAT))
+                              MSG_CMSG_COMPAT | MSG_SPLICE_PAGES))
                return -EOPNOTSUPP;
 
        ret = mutex_lock_interruptible(&tls_ctx->tx_lock);