All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-next] Squash to "mptcp: infinite mapping receiving"
@ 2021-10-21  6:06 Geliang Tang
  2021-10-21  6:16 ` Squash to "mptcp: infinite mapping receiving": Build Failure MPTCP CI
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Geliang Tang @ 2021-10-21  6:06 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

Please update the commit log too:

'''
This patch added the infinite mapping receiving logic.

In mptcp_incoming_options(), invoke the new helper function
mptcp_infinite_map_received() to check whether the infinite mapping
is received. If it is, set the infinite_map flag of struct mptcp_ext.

In get_mapping_status(), if the infinite mapping is received, set the
map_data_len of the subflow to 0.

In subflow_check_data_avail(), only reset the subflow when the map_data_len
of the subflow is non-zero.
'''

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 net/mptcp/options.c | 16 +++++++++++++---
 net/mptcp/subflow.c |  2 +-
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index f4591421ed22..0144cc97a123 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -1077,6 +1077,14 @@ static bool add_addr_hmac_valid(struct mptcp_sock *msk,
 	return hmac == mp_opt->ahmac;
 }
 
+static bool mptcp_infinite_map_received(struct mptcp_options_received *mp_opt)
+{
+	if (mp_opt->use_map && !mp_opt->data_len)
+		return true;
+
+	return false;
+}
+
 /* Return false if a subflow has been reset, else return true */
 bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
 {
@@ -1085,7 +1093,9 @@ bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
 	struct mptcp_options_received mp_opt;
 	struct mptcp_ext *mpext;
 
-	if (__mptcp_check_fallback(msk)) {
+	mptcp_get_options(sk, skb, &mp_opt);
+
+	if (__mptcp_check_fallback(msk) && !mptcp_infinite_map_received(&mp_opt)) {
 		/* Keep it simple and unconditionally trigger send data cleanup and
 		 * pending queue spooling. We will need to acquire the data lock
 		 * for more accurate checks, and once the lock is acquired, such
@@ -1099,8 +1109,6 @@ bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
 		return true;
 	}
 
-	mptcp_get_options(sk, skb, &mp_opt);
-
 	/* The subflow can be in close state only if check_fully_established()
 	 * just sent a reset. If so, tell the caller to ignore the current packet.
 	 */
@@ -1202,6 +1210,8 @@ bool mptcp_incoming_options(struct sock *sk, struct sk_buff *skb)
 
 		if (mpext->csum_reqd)
 			mpext->csum = mp_opt.csum;
+		if (mptcp_infinite_map_received(&mp_opt))
+			mpext->infinite_map = 1;
 	}
 
 	return true;
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 9e54122f18f4..bb7d8685ffd4 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -938,7 +938,7 @@ static enum mapping_status get_mapping_status(struct sock *ssk,
 	if (!skb)
 		return MAPPING_EMPTY;
 
-	if (mptcp_check_fallback(ssk))
+	if (mptcp_check_fallback(ssk) && !mptcp_check_infinite_map(skb))
 		return MAPPING_DUMMY;
 
 	mpext = mptcp_get_ext(skb);
-- 
2.26.2


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

end of thread, other threads:[~2021-10-22 17:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-21  6:06 [PATCH mptcp-next] Squash to "mptcp: infinite mapping receiving" Geliang Tang
2021-10-21  6:16 ` Squash to "mptcp: infinite mapping receiving": Build Failure MPTCP CI
2021-10-21  6:43   ` Matthieu Baerts
2021-10-21 13:42 ` [PATCH mptcp-next] Squash to "mptcp: infinite mapping receiving" kernel test robot
2021-10-21 13:42   ` kernel test robot
2021-10-22  1:06 ` Mat Martineau
2021-10-22 16:10   ` Christoph Paasch

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.