mptcp: introduce MPTCP_FULL_INFO getsockopt
A message that is not in the archive (sent off-list or not yet received): [email protected]
oops, Matttbe noted I omitted a few recipients, re-sending...
-------- Forwarded Message --------
From: Paolo Abeni <[email protected]>
To: Matthieu Baerts <[email protected]>
Subject: Re: [PATCH v3 mptcp-next 2/6] mptcp: introduce MPTCP_FULL_INFO getsockopt
Date: 05/24/2023 12:20:25 PM
Quoted 9 lines · Matthieu Baerts
Quoted 8 lines · Paolo Abeni
Quoted 6 lines · Matthieu Baerts
(If we add
mptcp_info(cf Paolo's email), better to strip 'subflow')Quoted 1 line
__u32size_subflow_full_info; /* size of this structure in userspace */Why do we need this field? Can we not use the option length (int
__user*optlen) provided by the userspace?
Quoted 7 lines
Quoted 1 line
With this we can append arbitrary/variable size
mptcp_infoat the end.I guess either we use a dedicated field for
mptcp_infoor we infer its value by looking atsize_full_infoor optlen. It looks clearer to me from the userspace point of view to have a dedicated size formptcp_infothan giving twicesizeof(mptcp_subflow_tcp_info)but I'm probably missing something :)
Currently, with the existing sockopt we have the optvat pointing to something alike:
Quoted 1 line
hdr_size| hdr | more storage |
and optlen specifying the whole optval data. We need the explicit the header size field, as optval must specify the whole size of the user- provided buffer and we need to know which part of such buffer has been filled by the user-space.
In this case:
"hdr_size" == mptcp_subflow_full_info.size_subflow_full_info "hdr" == mptcp_subflow_full_info
"more storage" == mptcp_info
We could add a (rendundant) field inside mptcp_subflow_full_info to specify the user-space mptcp_info size, but that would be ... rendundant. Unless we drop the hdr_size and we compute that from optlen and the new mptcp_indo_size_user field, but that would be IMHO counter- intuitive.
Cheers,
Paolo
Hi Paolo,
Quoted 43 lines · Paolo Abeni
oops, Matttbe noted I omitted a few recipients, re-sending...
-------- Forwarded Message --------
From: Paolo Abeni <[email protected]>
To: Matthieu Baerts <[email protected]>
Subject: Re: [PATCH v3 mptcp-next 2/6] mptcp: introduceMPTCP_FULL_INFOgetsockopt
Date: 05/24/2023 12:20:25 PMQuoted 9 lines · Matthieu Baerts
Quoted 8 lines · Paolo Abeni
Quoted 6 lines · Matthieu Baerts
(If we add
mptcp_info(cf Paolo's email), better to strip 'subflow')Quoted 1 line
__u32size_subflow_full_info; /* size of this structure in userspace */Why do we need this field? Can we not use the option length (int
__user*optlen) provided by the userspace?Quoted 7 lines
Quoted 1 line
With this we can append arbitrary/variable size
mptcp_infoat the end.I guess either we use a dedicated field for
mptcp_infoor we infer its value by looking atsize_full_infoor optlen. It looks clearer to me from the userspace point of view to have a dedicated size formptcp_infothan giving twicesizeof(mptcp_subflow_tcp_info)but I'm probably missing something :)Currently, with the existing sockopt we have the optvat pointing to something alike:
Quoted 1 line
hdr_size| hdr | more storage |and optlen specifying the whole optval data. We need the explicit the header size field, as optval must specify the whole size of the user- provided buffer and we need to know which part of such buffer has been filled by the user-space.
In this case:
"
hdr_size" == mptcp_subflow_full_info.size_subflow_full_info "hdr" ==mptcp_subflow_full_info
"more storage" ==mptcp_info
Quoted 5 lines
We could add a (rendundant) field inside
mptcp_subflow_full_infoto specify the user-spacemptcp_infosize, but that would be ... rendundant. Unless we drop thehdr_sizeand we compute that from optlen and the newmptcp_indo_size_userfield, but that would be IMHO counter- intuitive.
Thank you for the explanation!
I think what I'm missing is how the 'mptcp_full_info' structure will look like at the end.
I thought that the idea was to have 'struct mptcp_info' embedded in 'struct mptcp_full_info':
struct mptcp_full_info {
__u32 num_subflows_user;
(...)
struct mptcp_info mptcp_info;
};In this case, it looks strange to have "size_full_info" being "sizeof(struct mptcp_full_info)", what we would also give to the option length, no?
Or the option length should take into account a separated space for the subflow info and thus use something like this?
sizeof(struct mptcp_full_info) +
sizeof(mptcp_subflow_full_info) * num_subflows_user"
where "struct mptcp_subflow_full_info contains:
- mptcp_subflow_info (subflow id + mptcp_subflow_addrs + maybe more
in the future)
- tcp_info (which can grow as well later)
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net