mptcp: Remove request_version field from subflow_request_sock
Subsystems (2)
Peter Krystad
PATCH 1/1 mptcp: Remove request_version field from subflow_request_sock
Since only a single version is supported this fields presence is misleading, it dates from when it was thought the version would be configurable. The actual requested version is hard-coded in mptcp_write_options().
squashto: Associate MPTCP context with TCP socket
--- net/mptcp/protocol.c | 1 - net/mptcp/protocol.h | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-)
net/mptcp/protocol.c +0 -1
@@ -123,7 +123,6 @@ static struct socket *mptcp_socket_create_get(struct mptcp_sock *msk) msk->subflow = ssock; subflow =mptcp_subflow_ctx (msk->subflow->sk); subflow->request_mptcp =1 ;/* @@ if MPTCP enabled */ - subflow->request_version =0 ;/* currently only v0 supported */ sock_hold (ssock->sk);
net/mptcp/protocol.h +1 -2
@@ -48,8 +48,7 @@ static inline struct mptcp_sock *mptcp_sk(const struct sock *sk)/* MPTCP subflow context */ struct mptcp_subflow_context { -u32 request_mptcp :1 ,/* send MP_CAPABLE */ - request_version :4 ; +u32 request_mptcp :1 ;/* send MP_CAPABLE */ struct sock *tcp_sock;/* tcp sk backpointer */ struct sock *conn;/* parent mptcp_sock */ struct rcu_head rcu;
Signature · 1 line
2.17.2
Matthieu Baerts
Hi Peter, Paolo,
Quoted 6 lines · Peter Krystad
Since only a single version is supported this fields presence is misleading, it dates from when it was thought the version would be configurable. The actual requested version is hard-coded in
mptcp_write_options().squashto: Associate MPTCP context with TCP socket
Thank you for the patch and the review!
I just have a question below:
[...]
net/mptcp/protocol.h static inline struct mptcp_sock *mptcp_sk(const struct sock *sk) · line 51
Quoted 11 lines
net/mptcp/protocol.h +1
-2@@ -48,8 +48,7 @@ static inline struct mptcp_sock *mptcp_sk(const struct sock *sk)/* MPTCP subflow context */ struct mptcp_subflow_context { -u32 request_mptcp :1 ,/* send MP_CAPABLE */ - request_version :4 ; +u32 request_mptcp :1 ;/* send MP_CAPABLE */
When removing these 4 bits, at the end of the series, we now only use 13 bits. Should we switch to u16? I didn't check with pahole if it would really reduce the size of the structure, I don't think so and maybe we don't really need to reduce this bit field but I prefer to ask :)
Cheers,
Matt
Signature · 5 lines
Matthieu Baerts | R&D Engineer matthieu.baerts(a)tessares.net Tessares SA | Hybrid Access Solutions www.tessares.net 1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium
Matthieu Baerts
Hi Peter, Paolo
Quoted 11 lines · Matthieu Baerts
Hi Peter, Paolo,
Quoted 6 lines · Peter Krystad
Since only a single version is supported this fields presence is misleading, it dates from when it was thought the version would be configurable. The actual requested version is hard-coded in
mptcp_write_options().squashto: Associate MPTCP context with TCP socket
Thank you for the patch and the review!
- a63d1cdb5903: "squashed" in "mptcp: Associate MPTCP context with TCP socket"
- 053bccb0ca21: conflict in t/mptcp-Handle-MP_CAPABLE-options-for-outgoing-connections
- b9a183bde93e: conflict in t/mptcp-parse-and-emit-MP_CAPABLE-option-according-to-v1-spec
- e081b82c8850: conflict in t/mptcp-Add-handling-of-outgoing-MP_JOIN-requests
- d2dba972de89..55f1d621d32b: result
Cheers,
Matt
Signature · 5 lines
Matthieu Baerts | R&D Engineer matthieu.baerts(a)tessares.net Tessares SA | Hybrid Access Solutions www.tessares.net 1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium
Peter Krystad
Hi Matt -
Quoted 22 lines · Matthieu Baerts
Hi Peter, Paolo,
Quoted 6 lines · Peter Krystad
Since only a single version is supported this fields presence is misleading, it dates from when it was thought the version would be configurable. The actual requested version is hard-coded in
mptcp_write_options().squashto: Associate MPTCP context with TCP socket
Thank you for the patch and the review!
I just have a question below:
[...]
Quoted 6 lines
net/mptcp/protocol.h +0
-0@@ -48,8 +48,7 @@ static inline struct mptcp_sock *mptcp_sk(const struct sock *sk)
Quoted 10 lines
net/mptcp/protocol.h static inline struct mptcp_sock *mptcp_sk(const struct sock *sk) · line 51
Quoted 5 lines
net/mptcp/protocol.h +1
-2/* MPTCP subflow context */ struct mptcp_subflow_context { -u32 request_mptcp :1 ,/* send MP_CAPABLE */ - request_version :4 ; +u32 request_mptcp :1 ;/* send MP_CAPABLE */ When removing these 4 bits, at the end of the series, we now only use 13 bits. Should we switch to u16? I didn't check with pahole if it would really reduce the size of the structure, I don't think so and maybe we don't really need to reduce this bit field but I prefer to ask :)
We could go back to u16, but then I would want to move it to the end of the struct (or just before local_id), but that would create a lot of work resolving conflicts as the fields are introduced one by one. Size isn't as critical for subflow_context because it doesn't affect every tcp_sock, only MPTCP sockets.
Peter.
Quoted 2 lines
Cheers,
Matt
Matthieu Baerts
Hi Peter,
Quoted 7 lines · Peter Krystad
Hi Matt -
Quoted 3 lines · Matthieu Baerts
Hi Peter, Paolo,
On 12/12/2019 05:54, Peter Krystad wrote:
[...]
Quoted 18 lines
Quoted 7 lines
Quoted 7 lines
net/mptcp/protocol.h +0
-0@@ -48,8 +48,7 @@ static inline struct mptcp_sock *mptcp_sk(const struct sock *sk)Quoted 10 lines
net/mptcp/protocol.h static inline struct mptcp_sock *mptcp_sk(const struct sock *sk) · line 51
Quoted 5 lines
net/mptcp/protocol.h +1
-2/* MPTCP subflow context */ struct mptcp_subflow_context { -u32 request_mptcp :1 ,/* send MP_CAPABLE */ - request_version :4 ; +u32 request_mptcp :1 ;/* send MP_CAPABLE */ When removing these 4 bits, at the end of the series, we now only use 13 bits. Should we switch to u16? I didn't check with pahole if it would really reduce the size of the structure, I don't think so and maybe we don't really need to reduce this bit field but I prefer to ask :)
Quoted 5 lines
We could go back to u16, but then I would want to move it to the end of the struct (or just before
local_id), but that would create a lot of work resolving conflicts as the fields are introduced one by one. Size isn't as critical forsubflow_contextbecause it doesn't affect everytcp_sock, only MPTCP sockets.
If we think it is important to do that, I can do it, conflicts would be easy to resolve :)
But if in any cases, we don't reduce the full size of the structure, no reason to change!
Cheers,
Matt
Signature · 5 lines
Matthieu Baerts | R&D Engineer matthieu.baerts(a)tessares.net Tessares SA | Hybrid Access Solutions www.tessares.net 1 Avenue Jean Monnet, 1348 Louvain-la-Neuve, Belgium