2020-06-16 06:54:04

by Geliang Tang

[permalink] [raw]
Subject: [PATCH net-next 0/3] 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(+)

--
2.17.1


2020-06-16 06:54:21

by Geliang Tang

[permalink] [raw]
Subject: [PATCH net-next 1/3] mptcp: add MP_PRIO suboption handling

Add handling for sending and receiving MP_PRIO suboption.

Signed-off-by: Geliang Tang <[email protected]>
---
net/mptcp/options.c | 14 ++++++++++++++
net/mptcp/protocol.h | 5 +++++
2 files changed, 19 insertions(+)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 490b92534afc..cc3039f0ac43 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -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,
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index db56535dfc29..623c9a1c4343 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -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
--
2.17.1

2020-06-16 06:58:47

by Geliang Tang

[permalink] [raw]
Subject: [PATCH net-next 2/3] mptcp: add MP_FAIL suboption handling

Add handling for sending and receiving MP_FAIL suboption.

Signed-off-by: Geliang Tang <[email protected]>
---
net/mptcp/options.c | 18 ++++++++++++++++++
net/mptcp/protocol.h | 2 ++
2 files changed, 20 insertions(+)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index cc3039f0ac43..82b3d7c566b4 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -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,
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 623c9a1c4343..e6ae0a73716b 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -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)
--
2.17.1

2020-06-16 06:58:53

by Geliang Tang

[permalink] [raw]
Subject: [PATCH net-next 3/3] mptcp: add MP_FASTCLOSE suboption handling

Add handling for sending and receiving MP_FASTCLOSE suboption.

Signed-off-by: Geliang Tang <[email protected]>
---
net/mptcp/options.c | 16 ++++++++++++++++
net/mptcp/protocol.h | 2 ++
2 files changed, 18 insertions(+)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 82b3d7c566b4..a99b3989fec1 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -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,
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index e6ae0a73716b..a8faab61e7af 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -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)
--
2.17.1

2020-06-16 15:23:36

by Matthieu Baerts

[permalink] [raw]
Subject: Re: [PATCH net-next 0/3] add MP_PRIO, MP_FAIL and MP_FASTCLOSE suboptions handling

Hi Geliang

On 16/06/2020 08:47, Geliang Tang wrote:
> Add handling for sending and receiving the MP_PRIO, MP_FAIL, and
> MP_FASTCLOSE suboptions.

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
--
Tessares | Belgium | Hybrid Access Solutions
http://www.tessares.net

2020-06-18 06:32:29

by Geliang Tang

[permalink] [raw]
Subject: Re: [PATCH net-next 0/3] add MP_PRIO, MP_FAIL and MP_FASTCLOSE suboptions handling

On Tue, Jun 16, 2020 at 05:18:56PM +0200, Matthieu Baerts wrote:
> Hi Geliang
>
> On 16/06/2020 08:47, Geliang Tang wrote:
> > Add handling for sending and receiving the MP_PRIO, MP_FAIL, and
> > MP_FASTCLOSE suboptions.
>
> 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!
>

Hi Matt,

Thanks for your reply. I will do these tests and improve my patches.

-Geliang

> Cheers,
> Matt
> --
> Tessares | Belgium | Hybrid Access Solutions
> http://www.tessares.net

2020-06-18 08:13:19

by Matthieu Baerts

[permalink] [raw]
Subject: Re: [PATCH net-next 0/3] add MP_PRIO, MP_FAIL and MP_FASTCLOSE suboptions handling

Hi Geliang,

On 18/06/2020 08:27, Geliang Tang wrote:
> On Tue, Jun 16, 2020 at 05:18:56PM +0200, Matthieu Baerts wrote:
>> 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: [email protected]

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
--
Tessares | Belgium | Hybrid Access Solutions
http://www.tessares.net