lkml.org 
[lkml]   [2023]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC PATCH 03/28] tcp: Support MSG_SPLICE_PAGES
Date
Willem de Bruijn <willemdebruijn.kernel@gmail.com> wrote:

> David Howells wrote:
> > Willem de Bruijn <willemdebruijn.kernel@gmail.com> wrote:
> >
> > > The commit message mentions MSG_SPLICE_PAGES as an internal flag.
> > >
> > > It can be passed from userspace. The code anticipates that and checks
> > > preconditions.
> >
> > Should I add a separate field in the in-kernel msghdr struct for such internal
> > flags? That would also avoid putting an internal flag in the same space as
> > the uapi flags.
>
> That would work, if no cost to common paths that don't need it.

Actually, it might be tricky. __ip_append_data() doesn't take a msghdr struct
pointer per se. The "void *from" argument *might* point to one - but it
depends on seeing a MSG_SPLICE_PAGES or MSG_ZEROCOPY flag, otherwise we don't
know.

Possibly this changes if sendpage goes away.

> A not very pretty alternative would be to add an an extra arg to each
> sendmsg handler that is used only when called from sendpage.
>
> There are a few other internal MSG_.. flags, such as
> MSG_SENDPAGE_NOPOLICY. Those are all limited to sendpage, and ignored
> in sendmsg, I think. Which would explain why it was clearly safe to
> add them.

Should those be moved across to the internal flags with MSG_SPLICE_PAGES?

David

\
 
 \ /
  Last update: 2023-03-27 01:10    [W:0.298 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site