All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [MPTCP] [PATCH 7/9] Move setting request_ fields of subflow to MPTCP layer
@ 2019-07-18 17:49 Peter Krystad
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Krystad @ 2019-07-18 17:49 UTC (permalink / raw)
  To: mptcp

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

On Thu, 2019-07-18 at 09:31 +0200, Paolo Abeni wrote:
> On Wed, 2019-07-17 at 15:12 -0700, Peter Krystad wrote:
> > diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> > index 1664a69c8e30..fe73379a81df 100644
> > --- a/net/mptcp/protocol.c
> > +++ b/net/mptcp/protocol.c
> > @@ -853,6 +854,11 @@ static int mptcp_stream_connect(struct socket *sock, struct sockaddr *uaddr,
> >  			return err;
> >  	}
> >  
> > +	subflow = subflow_ctx(msk->subflow->sk);
> > +	subflow->request_mptcp = 1; /* @@ if MPTCP enabled */
> > +	subflow->request_cksum = 1; /* @@ if checksum enabled */
> > +	subflow->request_version = 0; /* only v0 supported */
> > +
> 
> Since this chunck is replicated a few lines below, and possibly some
> more code is going to be added to this section, with time, what about
> adding an helper for that?

OK, will do.

> 
> Cheers,
> 
> Paolo
> 


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

* Re: [MPTCP] [PATCH 7/9] Move setting request_ fields of subflow to MPTCP layer
@ 2019-07-18  7:31 Paolo Abeni
  0 siblings, 0 replies; 3+ messages in thread
From: Paolo Abeni @ 2019-07-18  7:31 UTC (permalink / raw)
  To: mptcp

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

On Wed, 2019-07-17 at 15:12 -0700, Peter Krystad wrote:
> diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
> index 1664a69c8e30..fe73379a81df 100644
> --- a/net/mptcp/protocol.c
> +++ b/net/mptcp/protocol.c
> @@ -853,6 +854,11 @@ static int mptcp_stream_connect(struct socket *sock, struct sockaddr *uaddr,
>  			return err;
>  	}
>  
> +	subflow = subflow_ctx(msk->subflow->sk);
> +	subflow->request_mptcp = 1; /* @@ if MPTCP enabled */
> +	subflow->request_cksum = 1; /* @@ if checksum enabled */
> +	subflow->request_version = 0; /* only v0 supported */
> +

Since this chunck is replicated a few lines below, and possibly some
more code is going to be added to this section, with time, what about
adding an helper for that?

Cheers,

Paolo


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

* [MPTCP] [PATCH 7/9] Move setting request_ fields of subflow to MPTCP layer
@ 2019-07-17 22:12 Peter Krystad
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Krystad @ 2019-07-17 22:12 UTC (permalink / raw)
  To: mptcp

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

For secondary subflows a different set of 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 | 13 +++++++++++++
 net/mptcp/protocol.h |  2 +-
 net/mptcp/subflow.c  |  7 ++-----
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 1664a69c8e30..fe73379a81df 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -840,6 +840,7 @@ static int mptcp_stream_connect(struct socket *sock, struct sockaddr *uaddr,
 				int addr_len, int flags)
 {
 	struct mptcp_sock *msk = mptcp_sk(sock->sk);
+	struct subflow_context *subflow;
 	int err = -ENOTSUPP;
 
 	pr_debug("msk=%p", msk);
@@ -853,6 +854,11 @@ static int mptcp_stream_connect(struct socket *sock, struct sockaddr *uaddr,
 			return err;
 	}
 
+	subflow = subflow_ctx(msk->subflow->sk);
+	subflow->request_mptcp = 1; /* @@ if MPTCP enabled */
+	subflow->request_cksum = 1; /* @@ if checksum enabled */
+	subflow->request_version = 0; /* only v0 supported */
+
 	return inet_stream_connect(msk->subflow, uaddr, addr_len, flags);
 }
 
@@ -902,6 +908,7 @@ static int mptcp_getname(struct socket *sock, struct sockaddr *uaddr,
 static int mptcp_listen(struct socket *sock, int backlog)
 {
 	struct mptcp_sock *msk = mptcp_sk(sock->sk);
+	struct subflow_context *subflow;
 	int err;
 
 	pr_debug("msk=%p", msk);
@@ -911,6 +918,12 @@ static int mptcp_listen(struct socket *sock, int backlog)
 		if (err)
 			return err;
 	}
+
+	subflow = subflow_ctx(msk->subflow->sk);
+	subflow->request_mptcp = 1; /* @@ if MPTCP enabled */
+	subflow->request_cksum = 1; /* @@ if checksum enabled */
+	subflow->request_version = 0; /* only v0 supported */
+
 	return inet_listen(msk->subflow, backlog);
 }
 
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index ff4f38da9276..1ce9130dee66 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 32652f7d1497..b9a40cdb1d4d 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) ||
@@ -224,9 +224,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] 3+ messages in thread

end of thread, other threads:[~2019-07-18 17:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-18 17:49 [MPTCP] [PATCH 7/9] Move setting request_ fields of subflow to MPTCP layer Peter Krystad
  -- strict thread matches above, loose matches on Subject: below --
2019-07-18  7:31 Paolo Abeni
2019-07-17 22:12 Peter Krystad

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.