All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Krystad <peter.krystad at linux.intel.com>
To: mptcp at lists.01.org
Subject: [MPTCP] [PATCH v3 07/10] Move setting request_ fields of subflow to MPTCP layer helper
Date: Wed, 07 Aug 2019 15:44:31 -0700	[thread overview]
Message-ID: <20190807224434.2829-8-peter.krystad@linux.intel.com> (raw)
In-Reply-To: 20190807224434.2829-1-peter.krystad@linux.intel.com

[-- 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


             reply	other threads:[~2019-08-07 22:44 UTC|newest]

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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190807224434.2829-8-peter.krystad@linux.intel.com \
    --to=unknown@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.