Re: [RFC v2 mptcp-next] mptcp: support MSG_EOR in mptcp_sendmsg

Geliang Tang
2026-02-28T09:12:54Z

Hi Gang,

On Thu, 2026-02-12 at 10:04 +0100, Paolo Abeni wrote:
> On 2/3/26 3:30 AM, Gang Yan wrote:
> > diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> > index cd5266099993..8b243062009c 100644
> > --- a/net/mptcp/protocol.h
> > +++ b/net/mptcp/protocol.h
> > @@ -267,6 +267,7 @@ struct mptcp_data_frag {
> >   u16 overhead;
> >   u16 already_sent;
> >   struct page *page;
> > + u8 eor;  /* Is MSG_EOR marked? Prevents coalescing with
> > next frag */
>
> I'm sorry for the late feedback, but the above will waste quite a bit
> of
> memory due to alignment. I think you can change the 'overhead' size
> to
> u8 and place 'eor' after such field.

I completely agree.
I think it's better not to let 'eor' use all 8 bits here; just one bit
is
sufficient, leaving the other 7 bits for future use, similar to:

u8 eor:1,
__unused:7;

I changed the state of this patch as "Changes Requested".

Thanks,
-Geliang

>
> Such change could be paired with build time check vs 'overhead'
> overflow. i.e.
>
> BUILD_BUG_ON(ALIGN(1, sizeof(long)) + sizeof(struct
> mptcp_data_frag) >
> U8_MAX);
>
> /P
>