Skip to contentSkip to conversation

mptcp: Use sk_family field in the mptcp_sock for address family.

PATCH In review Peter Krystad 4 participants 4 messages Nov 5, 2019 – Nov 6, 2019

Subsystems (2)
lore
Share & tools
lore

Peter Krystad

author
#0 lore raw

PATCH 1/1 mptcp: Use sk_family field in the mptcp_sock for address family.

It was not necessary to add a family field to mptcp_sock as it is a wrapper around a struct sock, and sk_family is set correctly when the msk is created as a result of a socket() call.

squashto: Associate MPTCP context with TCP socket
mptcp: Implement basic path manager

Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>
---
 net/mptcp/basic.c    | 5 +++--
 net/mptcp/protocol.c | 1 -
 net/mptcp/protocol.h | 1 -
 3 files changed, 3 insertions(+), 4 deletions(-)
net/mptcp/basic.c +3 -2
index 67a93aff500e..03afb1263f3d 100644
@@ -185,6 +185,7 @@ static void announce_addr_worker(struct work_struct *work)
 	struct mptcp_pm_data *pm = container_of(work, struct mptcp_pm_data,
 						addr_work);
 	struct mptcp_sock *msk = container_of(pm, struct mptcp_sock, pm);
+	struct sock *sk = (struct sock *)msk;
 	struct basic_pernet *pernet;
 
 	pernet = net_generic(sock_net((struct sock *)msk), basic_pernet_id);
@@ -193,11 +194,11 @@ static void announce_addr_worker(struct work_struct *work)
 	 * When the listening socket can accept connections from both
 	 * families this restriction may be removed.
 	 */
-	if (pernet->has_announce_v4 && msk->family == AF_INET)
+	if (pernet->has_announce_v4 && sk->sk_family == AF_INET)
 		mptcp_pm_announce_addr(pm->token, 1,
 				       &pernet->announce_v4_addr);
 #if IS_ENABLED(CONFIG_IPV6)
-	else if (pernet->has_announce_v6 && msk->family == AF_INET6)
+	else if (pernet->has_announce_v6 && sk->sk_family == AF_INET6)
 		mptcp_pm_announce_addr6(pm->token, 1,
 					&pernet->announce_v6_addr);
 #endif
net/mptcp/protocol.c +0 -1
index 3af5f121af9e..c2b29f8d0377 100644
@@ -1091,7 +1091,6 @@ static struct socket *mptcp_socket_create_get(struct mptcp_sock *msk)
 	}
 
 	msk->subflow = ssock;
-	msk->family = ssock->sk->sk_family;
 	subflow = mptcp_subflow_ctx(msk->subflow->sk);
 	subflow->request_mptcp = 1; /* @@ if MPTCP enabled */
 	subflow->request_version = 0; /* currently only v0 supported */
net/mptcp/protocol.h +0 -1
index 8fe5f9383d38..791f2c19cfb8 100644
@@ -133,7 +133,6 @@ struct mptcp_sock {
 	u32		token;
 	unsigned long	flags;
 	u16		dport;
-	sa_family_t	family;
 	struct work_struct rtx_work;
 	struct list_head conn_list;
 	struct list_head rtx_queue;
Signature · 1 line
2.17.2
#1 lore raw
Quoted 8 lines · Peter Krystad

It was not necessary to add a family field to mptcp_sock as it is a wrapper around a struct sock, and sk_family is set correctly when the msk is created as a result of a socket() call.

squashto: Associate MPTCP context with TCP socket
mptcp: Implement basic path manager

Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>

LGTM, nice cleanup, thanks!

It's unclear to me if I should update patchwork status, too ("Under review"? would that help?)

Paolo

#2 lore raw
Quoted 8 lines · Paolo Abeni
Quoted 7 lines · Peter Krystad

It was not necessary to add a family field to mptcp_sock as it is a wrapper around a struct sock, and sk_family is set correctly when the msk is created as a result of a socket() call.

squashto: Associate MPTCP context with TCP socket
mptcp: Implement basic path manager

Quoted 7 lines
Quoted 1 line
Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>

LGTM, nice cleanup, thanks!

It's unclear to me if I should update patchwork status, too ("Under review"? would that help?)

Looks good to me, too.

For handling patchwork status, I went to the upcoming meeting page to create a proposal - and found that Matthieu has already done it :)

--
Mat Martineau
Intel

#3 lore raw

Hi Peter, Paolo, Mat,

Quoted 13 lines · Mat Martineau
Quoted 10 lines · Paolo Abeni
Quoted 8 lines · Peter Krystad

It was not necessary to add a family field to mptcp_sock as it is a wrapper around a struct sock, and sk_family is set correctly when the msk is created as a result of a socket() call.

squashto: Associate MPTCP context with TCP socket
          mptcp: Implement basic path manager

Signed-off-by Peter Krystad <peter.krystad(a)linux.intel.com>
Quoted 7 lines
Quoted 5 lines

LGTM, nice cleanup, thanks!

It's unclear to me if I should update patchwork status, too ("Under review"? would that help?)

Looks good to me, too.

Thank you for the patch and the review!

- 7c4096766c23: "squashed" part 1 in "mptcp: Associate MPTCP context with TCP socket"
- already has the signed-off
- f9b323be35cf: conflict in t/mptcp-Handle-MP_CAPABLE-options-for-outgoing-connections
- ad05f6b594bc: conflict in t/mptcp-Add-key-generation-and-token-tree
- 94ddaeb75bd3: conflict in t/mptcp-Implement-MPTCP-receive-path
- d1db9d0195b3: conflict in t/mptcp-Add-handling-of-outgoing-MP_JOIN-requests
- 55b5be5a8eea: conflict in t/mptcp-implement-and-use-MPTCP-level-retransmission
- b8de8670bd8c: "squashed" part 2 in "mptcp: Implement basic path manager"
- 3b6112deb337..1b8d767c5872: result

Quoted 2 lines

For handling patchwork status, I went to the upcoming meeting page to create a proposal - and found that Matthieu has already done it :)

:)
Yes we can talk about that tomorrow.

I will apply the other patches tomorrow.

Cheers,
Matt

Signature · 5 lines
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