linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] add MP_PRIO, MP_FAIL and MP_FASTCLOSE suboptions handling
@ 2020-06-16  6:47 Geliang Tang
  2020-06-16  6:47 ` [PATCH net-next 1/3] mptcp: add MP_PRIO suboption handling Geliang Tang
  2020-06-16 15:18 ` [PATCH net-next 0/3] add MP_PRIO, MP_FAIL and MP_FASTCLOSE suboptions handling Matthieu Baerts
  0 siblings, 2 replies; 7+ messages in thread
From: Geliang Tang @ 2020-06-16  6:47 UTC (permalink / raw)
  To: Mat Martineau, Matthieu Baerts, David S. Miller, Jakub Kicinski
  Cc: Geliang Tang, netdev, mptcp, linux-kernel

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH net-next 1/3] mptcp: add MP_PRIO suboption handling
  2020-06-16  6:47 [PATCH net-next 0/3] add MP_PRIO, MP_FAIL and MP_FASTCLOSE suboptions handling Geliang Tang
@ 2020-06-16  6:47 ` Geliang Tang
  2020-06-16  6:47   ` [PATCH net-next 2/3] mptcp: add MP_FAIL " Geliang Tang
  2020-06-16 15:18 ` [PATCH net-next 0/3] add MP_PRIO, MP_FAIL and MP_FASTCLOSE suboptions handling Matthieu Baerts
  1 sibling, 1 reply; 7+ messages in thread
From: Geliang Tang @ 2020-06-16  6:47 UTC (permalink / raw)
  To: Mat Martineau, Matthieu Baerts, David S. Miller, Jakub Kicinski
  Cc: Geliang Tang, netdev, mptcp, linux-kernel

Add handling for sending and receiving MP_PRIO suboption.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next 2/3] mptcp: add MP_FAIL suboption handling
  2020-06-16  6:47 ` [PATCH net-next 1/3] mptcp: add MP_PRIO suboption handling Geliang Tang
@ 2020-06-16  6:47   ` Geliang Tang
  2020-06-16  6:47     ` [PATCH net-next 3/3] mptcp: add MP_FASTCLOSE " Geliang Tang
  0 siblings, 1 reply; 7+ messages in thread
From: Geliang Tang @ 2020-06-16  6:47 UTC (permalink / raw)
  To: Mat Martineau, Matthieu Baerts, David S. Miller, Jakub Kicinski
  Cc: Geliang Tang, netdev, mptcp, linux-kernel

Add handling for sending and receiving MP_FAIL suboption.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next 3/3] mptcp: add MP_FASTCLOSE suboption handling
  2020-06-16  6:47   ` [PATCH net-next 2/3] mptcp: add MP_FAIL " Geliang Tang
@ 2020-06-16  6:47     ` Geliang Tang
  0 siblings, 0 replies; 7+ messages in thread
From: Geliang Tang @ 2020-06-16  6:47 UTC (permalink / raw)
  To: Mat Martineau, Matthieu Baerts, David S. Miller, Jakub Kicinski
  Cc: Geliang Tang, netdev, mptcp, linux-kernel

Add handling for sending and receiving MP_FASTCLOSE suboption.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 0/3] add MP_PRIO, MP_FAIL and MP_FASTCLOSE suboptions handling
  2020-06-16  6:47 [PATCH net-next 0/3] add MP_PRIO, MP_FAIL and MP_FASTCLOSE suboptions handling Geliang Tang
  2020-06-16  6:47 ` [PATCH net-next 1/3] mptcp: add MP_PRIO suboption handling Geliang Tang
@ 2020-06-16 15:18 ` Matthieu Baerts
  2020-06-18  6:27   ` Geliang Tang
  1 sibling, 1 reply; 7+ messages in thread
From: Matthieu Baerts @ 2020-06-16 15:18 UTC (permalink / raw)
  To: Geliang Tang, Mat Martineau, David S. Miller, Jakub Kicinski
  Cc: netdev, mptcp, linux-kernel

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
www.tessares.net

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 0/3] add MP_PRIO, MP_FAIL and MP_FASTCLOSE suboptions handling
  2020-06-16 15:18 ` [PATCH net-next 0/3] add MP_PRIO, MP_FAIL and MP_FASTCLOSE suboptions handling Matthieu Baerts
@ 2020-06-18  6:27   ` Geliang Tang
  2020-06-18  8:06     ` Matthieu Baerts
  0 siblings, 1 reply; 7+ messages in thread
From: Geliang Tang @ 2020-06-18  6:27 UTC (permalink / raw)
  To: Matthieu Baerts
  Cc: Mat Martineau, David S. Miller, Jakub Kicinski, netdev, mptcp,
	linux-kernel

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
> www.tessares.net

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next 0/3] add MP_PRIO, MP_FAIL and MP_FASTCLOSE suboptions handling
  2020-06-18  6:27   ` Geliang Tang
@ 2020-06-18  8:06     ` Matthieu Baerts
  0 siblings, 0 replies; 7+ messages in thread
From: Matthieu Baerts @ 2020-06-18  8:06 UTC (permalink / raw)
  To: Geliang Tang; +Cc: Mat Martineau, netdev, mptcp, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-06-18  8:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16  6:47 [PATCH net-next 0/3] add MP_PRIO, MP_FAIL and MP_FASTCLOSE suboptions handling Geliang Tang
2020-06-16  6:47 ` [PATCH net-next 1/3] mptcp: add MP_PRIO suboption handling Geliang Tang
2020-06-16  6:47   ` [PATCH net-next 2/3] mptcp: add MP_FAIL " Geliang Tang
2020-06-16  6:47     ` [PATCH net-next 3/3] mptcp: add MP_FASTCLOSE " Geliang Tang
2020-06-16 15:18 ` [PATCH net-next 0/3] add MP_PRIO, MP_FAIL and MP_FASTCLOSE suboptions handling Matthieu Baerts
2020-06-18  6:27   ` Geliang Tang
2020-06-18  8:06     ` Matthieu Baerts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).