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

Paolo Abeni
2026-03-04T09:16:20Z

On 2/28/26 10:12 AM, Geliang Tang wrote:
> 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".

Note that adding a trailing filed will still increases the struct
mptcp_data_frag effective size by 8 bytes.

The maximum value that can land into the 'overhead' field is
'sizeof(struct mptcp_data_frag)' + 7; we can shrink such field to u8 and
move the new one in the created hole. This will prevent struct
mptcp_data_frag size increase.

An eventual build time check on the max 'overhead' value could be a
plus, but it's probably too conservative, given that max is currently 47
and should not increase.

/P