lkml.org 
[lkml]   [2023]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC PATCH 3/3] net: Declare MSG_SPLICE_PAGES internal sendmsg() flag
    Date
    Declare MSG_SPLICE_PAGES, an internal sendmsg() flag, that hints to a
    network protocol that it should splice pages from the source iterator
    rather than copying the data if it can. This is set in msg->msg_kflags,
    not msg->msg_flags, thereby isolating it from the UAPI.

    This is intended as a replacement for the ->sendpage() op, allowing a way
    to splice in several multipage folios in one go.

    Signed-off-by: David Howells <dhowells@redhat.com>
    cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
    cc: "David S. Miller" <davem@davemloft.net>
    cc: Eric Dumazet <edumazet@google.com>
    cc: Jakub Kicinski <kuba@kernel.org>
    cc: Paolo Abeni <pabeni@redhat.com>
    cc: Jens Axboe <axboe@kernel.dk>
    cc: Matthew Wilcox <willy@infradead.org>
    cc: netdev@vger.kernel.org
    ---
    include/linux/socket.h | 3 +++
    1 file changed, 3 insertions(+)

    diff --git a/include/linux/socket.h b/include/linux/socket.h
    index 13c3a237b9c9..229f54484d3c 100644
    --- a/include/linux/socket.h
    +++ b/include/linux/socket.h
    @@ -72,6 +72,7 @@ struct msghdr {
    bool msg_control_is_user : 1;
    bool msg_get_inq : 1;/* return INQ after receive */
    unsigned int msg_flags; /* flags on received message */
    + unsigned int msg_kflags; /* Kernel internal flags */
    __kernel_size_t msg_controllen; /* ancillary data buffer length */
    struct kiocb *msg_iocb; /* ptr to iocb for async requests */
    struct ubuf_info *msg_ubuf;
    @@ -337,6 +338,8 @@ struct ucred {
    #define MSG_CMSG_COMPAT 0 /* We never have 32 bit fixups */
    #endif

    +/* Flags for msghdr::msg_kflags (all internal to the kernel) */
    +#define MSG_SPLICE_PAGES 0x00000001 /* Splice the pages from the iterator in sendmsg() */

    /* Setsockoptions(2) level. Thanks to BSD these must match IPPROTO_xxx */
    #define SOL_IP 0
    \
     
     \ /
      Last update: 2023-03-27 01:12    [W:4.521 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site