add MP_PRIO, MP_FAIL and MP_FASTCLOSE suboptions handling
Subsystems (3)
cover add MP_PRIO, MP_FAIL and MP_FASTCLOSE suboptions handling
Add handling for sending and receiving the MP_PRIO, MP_FAIL, and MP_FASTCLOSE suboptions.
Geliang Tang (3):
mptcp: add MP_PRIO suboption handling
mptcp: add MP_FAIL suboption handling
mptcp: add MP_FASTCLOSE suboption handling
net/mptcp/options.c | 48 ++++++++++++++++++++++++++++++++++++++++++++ net/mptcp/protocol.h | 9 +++++++++ 2 files changed, 57 insertions(+)
Signature · 1 line
2.17.1
PATCH 1/3 mptcp: add MP_PRIO suboption handling
Add handling for sending and receiving MP_PRIO suboption.
--- net/mptcp/options.c | 14 ++++++++++++++ net/mptcp/protocol.h | 5 +++++ 2 files changed, 19 insertions(+)
net/mptcp/options.c +14 -0
@@ -280,6 +280,14 @@ static void mptcp_parse_option(const struct sk_buff *skb,pr_debug ("RM_ADDR: id=%d" , mp_opt->rm_id);break ; +case MPTCPOPT_MP_PRIO : +if (opsize !=TCPOLEN_MPTCP_PRIO ) +break ; + + mp_opt->backup = (*ptr++) &MPTCP_PRIO_BACKUP ; +pr_debug ("MP_PRIO: backup=%d" , mp_opt->backup); +break ; +default :break ; }
@@ -961,6 +969,12 @@ void mptcp_write_options(__be32 *ptr, struct mptcp_out_options *opts) 0, opts->rm_id); } +if (OPTION_MPTCP_PRIO & opts->suboptions) { + *ptr++ =mptcp_option (MPTCPOPT_MP_PRIO , +TCPOLEN_MPTCP_PRIO , + opts->backup,0 ); + } +if (OPTION_MPTCP_MPJ_SYN & opts->suboptions) { *ptr++ = mptcp_option(MPTCPOPT_MP_JOIN, TCPOLEN_MPTCP_MPJ_SYN,
net/mptcp/protocol.h +5 -0
@@ -23,6 +23,7 @@#define OPTION_MPTCP_ADD_ADDR BIT(6)#define OPTION_MPTCP_ADD_ADDR6 BIT(7)#define OPTION_MPTCP_RM_ADDR BIT(8) +#define OPTION_MPTCP_PRIO BIT(9)/* MPTCP option subtypes */ #define MPTCPOPT_MP_CAPABLE 0
@@ -58,6 +59,7 @@#define TCPOLEN_MPTCP_ADD_ADDR6_BASE_PORT 22#define TCPOLEN_MPTCP_PORT_LEN 2#define TCPOLEN_MPTCP_RM_ADDR_BASE 4 +#define TCPOLEN_MPTCP_PRIO 3/* MPTCP MP_JOIN flags */ #define MPTCPOPT_BACKUP BIT(0)
@@ -84,6 +86,9 @@#define MPTCP_ADDR_IPVERSION_4 4#define MPTCP_ADDR_IPVERSION_6 6 +/* MPTCP MP_PRIO flags */ +#define MPTCP_PRIO_BACKUP BIT(0) +/* MPTCP socket flags */ #define MPTCP_DATA_READY 0#define MPTCP_SEND_SPACE 1
Signature · 1 line
2.17.1
PATCH 2/3 mptcp: add MP_FAIL suboption handling
In reply to Geliang TangAdd handling for sending and receiving MP_FAIL suboption.
--- net/mptcp/options.c | 18 ++++++++++++++++++ net/mptcp/protocol.h | 2 ++ 2 files changed, 20 insertions(+)
net/mptcp/options.c +18 -0
@@ -288,6 +288,15 @@ static void mptcp_parse_option(const struct sk_buff *skb,pr_debug ("MP_PRIO: backup=%d" , mp_opt->backup);break ; +case MPTCPOPT_MP_FAIL : +if (opsize !=TCPOLEN_MPTCP_FAIL ) +break ; + + ptr +=2 ; + mp_opt->data_seq =get_unaligned_be64 (ptr); +pr_debug ("MP_FAIL: data_seq=%lld" , mp_opt->data_seq); +break ; +default :break ; }
@@ -975,6 +984,15 @@ void mptcp_write_options(__be32 *ptr, struct mptcp_out_options *opts) opts->backup, 0); } +if (OPTION_MPTCP_FAIL & opts->suboptions) { +struct mptcp_ext *mpext = &opts->ext_copy; + + *ptr++ =mptcp_option (MPTCPOPT_MP_FAIL , +TCPOLEN_MPTCP_FAIL , +0 ,0 ); +put_unaligned_be64 (mpext->data_seq, ptr); + } +if (OPTION_MPTCP_MPJ_SYN & opts->suboptions) { *ptr++ = mptcp_option(MPTCPOPT_MP_JOIN, TCPOLEN_MPTCP_MPJ_SYN,
net/mptcp/protocol.h +2 -0
@@ -24,6 +24,7 @@#define OPTION_MPTCP_ADD_ADDR6 BIT(7)#define OPTION_MPTCP_RM_ADDR BIT(8)#define OPTION_MPTCP_PRIO BIT(9) +#define OPTION_MPTCP_FAIL BIT(10)/* MPTCP option subtypes */ #define MPTCPOPT_MP_CAPABLE 0
@@ -60,6 +61,7 @@#define TCPOLEN_MPTCP_PORT_LEN 2#define TCPOLEN_MPTCP_RM_ADDR_BASE 4#define TCPOLEN_MPTCP_PRIO 3 +#define TCPOLEN_MPTCP_FAIL 12/* MPTCP MP_JOIN flags */ #define MPTCPOPT_BACKUP BIT(0)
Signature · 1 line
2.17.1
PATCH 3/3 mptcp: add MP_FASTCLOSE suboption handling
In reply to Geliang TangAdd handling for sending and receiving MP_FASTCLOSE suboption.
--- net/mptcp/options.c | 16 ++++++++++++++++ net/mptcp/protocol.h | 2 ++ 2 files changed, 18 insertions(+)
net/mptcp/options.c +16 -0
@@ -297,6 +297,15 @@ static void mptcp_parse_option(const struct sk_buff *skb,pr_debug ("MP_FAIL: data_seq=%lld" , mp_opt->data_seq);break ; +case MPTCPOPT_MP_FASTCLOSE : +if (opsize !=TCPOLEN_MPTCP_FASTCLOSE ) +break ; + + ptr +=2 ; + mp_opt->rcvr_key =get_unaligned_be64 (ptr); +pr_debug ("MP_FASTCLOSE: rcvr_key=%lld" , mp_opt->rcvr_key); +break ; +default :break ; }
@@ -993,6 +1002,13 @@ void mptcp_write_options(__be32 *ptr, struct mptcp_out_options *opts)put_unaligned_be64 (mpext->data_seq, ptr); } +if (OPTION_MPTCP_FASTCLOSE & opts->suboptions) { + *ptr++ =mptcp_option (MPTCPOPT_MP_FASTCLOSE , +TCPOLEN_MPTCP_FASTCLOSE , +0 ,0 ); +put_unaligned_be64 (opts->rcvr_key, ptr); + } +if (OPTION_MPTCP_MPJ_SYN & opts->suboptions) { *ptr++ = mptcp_option(MPTCPOPT_MP_JOIN, TCPOLEN_MPTCP_MPJ_SYN,
net/mptcp/protocol.h +2 -0
@@ -25,6 +25,7 @@#define OPTION_MPTCP_RM_ADDR BIT(8)#define OPTION_MPTCP_PRIO BIT(9)#define OPTION_MPTCP_FAIL BIT(10) +#define OPTION_MPTCP_FASTCLOSE BIT(11)/* MPTCP option subtypes */ #define MPTCPOPT_MP_CAPABLE 0
@@ -62,6 +63,7 @@#define TCPOLEN_MPTCP_RM_ADDR_BASE 4#define TCPOLEN_MPTCP_PRIO 3#define TCPOLEN_MPTCP_FAIL 12 +#define TCPOLEN_MPTCP_FASTCLOSE 12/* MPTCP MP_JOIN flags */ #define MPTCPOPT_BACKUP BIT(0)
Signature · 1 line
2.17.1
Hi Geliang
Quoted 2 lines · Geliang Tang
Add handling for sending and receiving the
MP_PRIO,MP_FAIL, andMP_FASTCLOSEsuboptions.
Thank you for the patches!
Unfortunately, I don't think it would be wise to accept them now: for the moment, these suboptions are ignored at the reception. If we accept them and change some variables like you did, we would need to make sure the kernel is still acting correctly. In other words, we would need tests:
* For MP_PRIO, there are still quite some works to do regarding the scheduling of the packets between the different MPTCP subflows to do before supporting this.
* For MP_FAIL, we should forward the info to the path manager.
* For MP_FASTCLOSE, we should close connections and ACK this.
Also, net-next is closed for the moment:
http://vger.kernel.org/~davem/net-next.html
I would suggest you to discuss about that on MPTCP mailing list. We also have meetings every Thursday. New devs are always welcome to contribute to new features and bug-fixes!
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
Quoted 18 lines · Matthieu Baerts
Hi Geliang
Quoted 2 lines · Geliang Tang
Add handling for sending and receiving the
MP_PRIO,MP_FAIL, andMP_FASTCLOSEsuboptions.Thank you for the patches!
Unfortunately, I don't think it would be wise to accept them now: for the moment, these suboptions are ignored at the reception. If we accept them and change some variables like you did, we would need to make sure the kernel is still acting correctly. In other words, we would need tests:
* ForMP_PRIO, there are still quite some works to do regarding the scheduling of the packets between the different MPTCP subflows to do before supporting this.
* ForMP_FAIL, we should forward the info to the path manager.
* ForMP_FASTCLOSE, we should close connections and ACK this.
Quoted 7 lines
Also, net-next is closed for the moment:
http://vger.kernel.org/~davem/net-next.htmlI would suggest you to discuss about that on MPTCP mailing list. We also have meetings every Thursday. New devs are always welcome to contribute to new features and bug-fixes!
Hi Matt,
Thanks for your reply. I will do these tests and improve my patches.
-Geliang
Quoted 5 lines
Cheers,
MattSignature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net
Hi Geliang,
Quoted 8 lines · Geliang Tang
Quoted 5 lines · Matthieu Baerts
On 16/06/2020 08:47, Geliang Tang wrote:
I would suggest you to discuss about that on MPTCP mailing list. We also have meetings every Thursday. New devs are always welcome to contribute to new features and bug-fixes!
Thanks for your reply. I will do these tests and improve my patches.
Great, thank you! Looking forward to see new kernel selftests and/or packetdrill tests!
For any new features related to MPTCP or bug fixes involving significant code modifications, please send it first to the MPTCP Upstream mailing list only: mptcp(a)lists.01.org
We will be able to give a first review without involving the whole netdev community and if needed, we can "park" patches in our mptcp-next repo.
For more details about the project, please check:
https://github.com/multipath-tcp/mptcp_net-next/wiki
Cheers,
Matt
Signature · 2 lines
Tessares | Belgium | Hybrid Access Solutions www.tessares.net