All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [PATCH v3 07/10] Move setting request_ fields of subflow to MPTCP layer helper
@ 2019-08-07 22:44 Peter Krystad
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Krystad @ 2019-08-07 22:44 UTC (permalink / raw)
  To: mptcp 

[-- Attachment #1: Type: text/plain, Size: 2717 bytes --]

For secondary subflows different request_ fields will
be added that will be set differently based on subflow type
(initial vs secondary).

squashto: Associate MPTCP context with TCP socket

Signed-off-by: Peter Krystad <peter.krystad(a)linux.intel.com>
---
 net/mptcp/protocol.c | 6 ++++++
 net/mptcp/protocol.h | 2 +-
 net/mptcp/subflow.c  | 7 ++-----
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 8a841d489b52..fce5eea729ba 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -860,6 +860,7 @@ static struct proto mptcp_prot = {
 static struct socket *mptcp_socket_create_get(struct mptcp_sock *msk)
 {
 	struct sock *sk = (struct sock *)msk;
+	struct subflow_context *subflow;
 	struct socket *ssock;
 	int err;
 
@@ -875,6 +876,11 @@ static struct socket *mptcp_socket_create_get(struct mptcp_sock *msk)
 	}
 
 	msk->subflow = ssock;
+	subflow = subflow_ctx(msk->subflow->sk);
+	subflow->request_mptcp = 1; /* @@ if MPTCP enabled */
+	subflow->request_cksum = 0; /* checksum not supported */
+	subflow->request_version = 0; /* only v0 supported */
+
 	sock_hold(ssock->sk);
 
 release:
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 1d1e89109e98..9774ff5a5481 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -168,10 +168,10 @@ struct subflow_context {
 	u16	map_data_len;
 	u16	request_mptcp : 1,  /* send MP_CAPABLE */
 		request_cksum : 1,
+		request_version : 4,
 		mp_capable : 1,     /* remote is MPTCP capable */
 		mp_join : 1,        /* remote is JOINing */
 		fourth_ack : 1,     /* send initial DSS */
-		version : 4,
 		conn_finished : 1,
 		use_checksum : 1,
 		map_valid : 1,
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 9d91014c0d1b..678fca99c23a 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -62,8 +62,8 @@ static void subflow_v4_init_req(struct request_sock *req,
 
 	if (rx_opt.mptcp.mp_capable && listener->request_mptcp) {
 		subflow_req->mp_capable = 1;
-		if (rx_opt.mptcp.version >= listener->version)
-			subflow_req->version = listener->version;
+		if (rx_opt.mptcp.version >= listener->request_version)
+			subflow_req->version = listener->request_version;
 		else
 			subflow_req->version = rx_opt.mptcp.version;
 		if ((rx_opt.mptcp.flags & MPTCP_CAP_CHECKSUM_REQD) ||
@@ -218,9 +218,6 @@ int subflow_create_socket(struct sock *sk, struct socket **new_sock)
 
 	*new_sock = sf;
 	subflow->conn = sk;
-	subflow->request_mptcp = 1; // @@ if MPTCP enabled
-	subflow->request_cksum = 1; // @@ if checksum enabled
-	subflow->version = 0;
 
 	return 0;
 }
-- 
2.17.2


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

* Re: [MPTCP] [PATCH v3 07/10] Move setting request_ fields of subflow to MPTCP layer helper
@ 2019-08-12 19:36 Matthieu Baerts
  0 siblings, 0 replies; 2+ messages in thread
From: Matthieu Baerts @ 2019-08-12 19:36 UTC (permalink / raw)
  To: mptcp 

[-- Attachment #1: Type: text/plain, Size: 1147 bytes --]

Hi Peter, Paolo, Mat,

On 08/08/2019 00:44, Peter Krystad wrote:
> For secondary subflows different request_ fields will
> be added that will be set differently based on subflow type
> (initial vs secondary).
> 
> squashto: Associate MPTCP context with TCP socket

Thank you for the patch and the reviews!

I had to split it in 3 parts:
- a831a5f64a0d: part 1: "squashed" in "mptcp: Associate MPTCP context
with TCP socket"
- 4dff4a3c37ec: conflict in
t/mptcp-Handle-MP_CAPABLE-options-for-outgoing-connections
- 7a108cfff657: part 2: "squashed" in "mptcp: Create SUBFLOW socket for
incoming connections"
- ff3b994f4b4c: conflict in
t/mptcp-Write-MPTCP-DSS-headers-to-outgoing-data-packets
- 987b6d7366be: conflict in
t/mptcp-Add-handling-of-incoming-MP_JOIN-requests
- b99045fe03e0: part 3: "squashed" in "mptcp: harmonize locking on all
socket operations."
- 64fb32edc6b2: signed-off
- b81ff8d90de3..f7938dd15948: result.

Cheers,
Matt
-- 
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

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

end of thread, other threads:[~2019-08-12 19:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-07 22:44 [MPTCP] [PATCH v3 07/10] Move setting request_ fields of subflow to MPTCP layer helper Peter Krystad
  -- strict thread matches above, loose matches on Subject: below --
2019-08-12 19:36 Matthieu Baerts

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.