* [MPTCP][PATCH mptcp-next] Squash to "mptcp: remote addresses fullmesh"
@ 2021-07-28 9:16 Geliang Tang
2021-07-28 9:16 ` [MPTCP][PATCH mptcp-next] Squash to "mptcp: local " Geliang Tang
2021-07-29 0:20 ` [MPTCP][PATCH mptcp-next] Squash to "mptcp: remote " Mat Martineau
0 siblings, 2 replies; 4+ messages in thread
From: Geliang Tang @ 2021-07-28 9:16 UTC (permalink / raw)
To: mptcp, geliangtang; +Cc: Geliang Tang
From: Geliang Tang <geliangtang@xiaomi.com>
Fix the checkpatch.pl warning:
WARNING: networking block comments don't use an empty /* line, use /* Comment...
#63: FILE: net/mptcp/pm_netlink.c:427:
+/*
+ * Fill all the remote addresses into the array addrs[],
And some more cleanups.
Signed-off-by: Geliang Tang <geliangtang@xiaomi.com>
---
net/mptcp/pm_netlink.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index ecf43d45711a..8eeae401c83f 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -423,8 +423,7 @@ static bool lookup_address_in_vec(struct mptcp_addr_info *addrs, unsigned int nr
return false;
}
-/*
- * Fill all the remote addresses into the array addrs[],
+/* Fill all the remote addresses into the array addrs[],
* and return the array size.
*/
static unsigned int fill_remote_addresses_vec(struct mptcp_sock *msk, bool fullmesh,
@@ -440,7 +439,9 @@ static unsigned int fill_remote_addresses_vec(struct mptcp_sock *msk, bool fullm
pernet = net_generic(sock_net(sk), pm_nl_pernet_id);
subflows_max = mptcp_pm_get_subflows_max(msk);
- /* non-fullmesh, fill in the remote address */
+ /* Non-fullmesh endpoint, fill in the single entry
+ * corresponding to the primary MPC subflow remote address
+ */
if (!fullmesh) {
remote_address((struct sock_common *)sk, &remote);
msk->pm.subflows++;
@@ -505,14 +506,13 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk)
!READ_ONCE(msk->pm.remote_deny_join_id0)) {
local = select_local_address(pernet, msk);
if (local) {
+ bool fullmesh = !!(local->flags & MPTCP_PM_ADDR_FLAG_FULLMESH);
struct mptcp_addr_info addrs[MPTCP_PM_ADDR_MAX];
int i, nr;
msk->pm.local_addr_used++;
check_work_pending(msk);
- nr = fill_remote_addresses_vec(msk,
- local->flags & MPTCP_PM_ADDR_FLAG_FULLMESH,
- addrs);
+ nr = fill_remote_addresses_vec(msk, fullmesh, addrs);
spin_unlock_bh(&msk->pm.lock);
for (i = 0; i < nr; i++) {
__mptcp_subflow_connect(sk, &local->addr, &addrs[i],
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [MPTCP][PATCH mptcp-next] Squash to "mptcp: local addresses fullmesh"
2021-07-28 9:16 [MPTCP][PATCH mptcp-next] Squash to "mptcp: remote addresses fullmesh" Geliang Tang
@ 2021-07-28 9:16 ` Geliang Tang
2021-07-29 0:21 ` Mat Martineau
2021-07-29 0:20 ` [MPTCP][PATCH mptcp-next] Squash to "mptcp: remote " Mat Martineau
1 sibling, 1 reply; 4+ messages in thread
From: Geliang Tang @ 2021-07-28 9:16 UTC (permalink / raw)
To: mptcp, geliangtang; +Cc: Geliang Tang
From: Geliang Tang <geliangtang@xiaomi.com>
Fix the checkpatch.pl warning:
WARNING: networking block comments don't use an empty /* line, use /* Comment...
#28: FILE: net/mptcp/pm_netlink.c:542:
+/*
+ * Fill all the local addresses into the three arrays,
And some more cleanups.
Signed-off-by: Geliang Tang <geliangtang@xiaomi.com>
---
net/mptcp/pm_netlink.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 1b6c4adc5a8a..0b9fa7e6f743 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -538,8 +538,7 @@ static void mptcp_pm_nl_subflow_established(struct mptcp_sock *msk)
mptcp_pm_create_subflow_or_signal_addr(msk);
}
-/*
- * Fill all the local addresses into the three arrays,
+/* Fill all the local addresses into the three arrays,
* addr[], flags[] and ifindex[],
* and return the arrays size.
*/
@@ -583,7 +582,9 @@ static unsigned int fill_local_addresses_vec(struct mptcp_sock *msk,
}
rcu_read_unlock();
- /* if the array is empty, fill in the local address */
+ /* If the arrays are empty, fill in the single
+ * 'IPADDRANY' local address
+ */
if (!i) {
memset(&local, 0, sizeof(local));
local.family = msk->pm.remote.family;
@@ -631,6 +632,7 @@ static void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk)
if (msk->pm.add_addr_accepted >= add_addr_accept_max ||
msk->pm.subflows >= subflows_max)
WRITE_ONCE(msk->pm.accept_addr, false);
+
spin_unlock_bh(&msk->pm.lock);
for (i = 0; i < nr; i++)
__mptcp_subflow_connect(sk, &addr[i], &remote, flags[i], ifindex[i]);
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [MPTCP][PATCH mptcp-next] Squash to "mptcp: remote addresses fullmesh"
2021-07-28 9:16 [MPTCP][PATCH mptcp-next] Squash to "mptcp: remote addresses fullmesh" Geliang Tang
2021-07-28 9:16 ` [MPTCP][PATCH mptcp-next] Squash to "mptcp: local " Geliang Tang
@ 2021-07-29 0:20 ` Mat Martineau
1 sibling, 0 replies; 4+ messages in thread
From: Mat Martineau @ 2021-07-29 0:20 UTC (permalink / raw)
To: Geliang Tang; +Cc: mptcp, Geliang Tang
On Wed, 28 Jul 2021, Geliang Tang wrote:
> From: Geliang Tang <geliangtang@xiaomi.com>
>
> Fix the checkpatch.pl warning:
> WARNING: networking block comments don't use an empty /* line, use /* Comment...
> #63: FILE: net/mptcp/pm_netlink.c:427:
> +/*
> + * Fill all the remote addresses into the array addrs[],
>
> And some more cleanups.
>
> Signed-off-by: Geliang Tang <geliangtang@xiaomi.com>
Thanks Geliang.
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
> ---
> net/mptcp/pm_netlink.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> index ecf43d45711a..8eeae401c83f 100644
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -423,8 +423,7 @@ static bool lookup_address_in_vec(struct mptcp_addr_info *addrs, unsigned int nr
> return false;
> }
>
> -/*
> - * Fill all the remote addresses into the array addrs[],
> +/* Fill all the remote addresses into the array addrs[],
> * and return the array size.
> */
> static unsigned int fill_remote_addresses_vec(struct mptcp_sock *msk, bool fullmesh,
> @@ -440,7 +439,9 @@ static unsigned int fill_remote_addresses_vec(struct mptcp_sock *msk, bool fullm
> pernet = net_generic(sock_net(sk), pm_nl_pernet_id);
> subflows_max = mptcp_pm_get_subflows_max(msk);
>
> - /* non-fullmesh, fill in the remote address */
> + /* Non-fullmesh endpoint, fill in the single entry
> + * corresponding to the primary MPC subflow remote address
> + */
> if (!fullmesh) {
> remote_address((struct sock_common *)sk, &remote);
> msk->pm.subflows++;
> @@ -505,14 +506,13 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk)
> !READ_ONCE(msk->pm.remote_deny_join_id0)) {
> local = select_local_address(pernet, msk);
> if (local) {
> + bool fullmesh = !!(local->flags & MPTCP_PM_ADDR_FLAG_FULLMESH);
> struct mptcp_addr_info addrs[MPTCP_PM_ADDR_MAX];
> int i, nr;
>
> msk->pm.local_addr_used++;
> check_work_pending(msk);
> - nr = fill_remote_addresses_vec(msk,
> - local->flags & MPTCP_PM_ADDR_FLAG_FULLMESH,
> - addrs);
> + nr = fill_remote_addresses_vec(msk, fullmesh, addrs);
> spin_unlock_bh(&msk->pm.lock);
> for (i = 0; i < nr; i++) {
> __mptcp_subflow_connect(sk, &local->addr, &addrs[i],
> --
> 2.31.1
>
>
>
--
Mat Martineau
Intel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [MPTCP][PATCH mptcp-next] Squash to "mptcp: local addresses fullmesh"
2021-07-28 9:16 ` [MPTCP][PATCH mptcp-next] Squash to "mptcp: local " Geliang Tang
@ 2021-07-29 0:21 ` Mat Martineau
0 siblings, 0 replies; 4+ messages in thread
From: Mat Martineau @ 2021-07-29 0:21 UTC (permalink / raw)
To: Geliang Tang; +Cc: mptcp, Geliang Tang
On Wed, 28 Jul 2021, Geliang Tang wrote:
> From: Geliang Tang <geliangtang@xiaomi.com>
>
> Fix the checkpatch.pl warning:
> WARNING: networking block comments don't use an empty /* line, use /* Comment...
> #28: FILE: net/mptcp/pm_netlink.c:542:
> +/*
> + * Fill all the local addresses into the three arrays,
>
> And some more cleanups.
>
> Signed-off-by: Geliang Tang <geliangtang@xiaomi.com>
This one looks good to squash too.
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
> ---
> net/mptcp/pm_netlink.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> index 1b6c4adc5a8a..0b9fa7e6f743 100644
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -538,8 +538,7 @@ static void mptcp_pm_nl_subflow_established(struct mptcp_sock *msk)
> mptcp_pm_create_subflow_or_signal_addr(msk);
> }
>
> -/*
> - * Fill all the local addresses into the three arrays,
> +/* Fill all the local addresses into the three arrays,
> * addr[], flags[] and ifindex[],
> * and return the arrays size.
> */
> @@ -583,7 +582,9 @@ static unsigned int fill_local_addresses_vec(struct mptcp_sock *msk,
> }
> rcu_read_unlock();
>
> - /* if the array is empty, fill in the local address */
> + /* If the arrays are empty, fill in the single
> + * 'IPADDRANY' local address
> + */
> if (!i) {
> memset(&local, 0, sizeof(local));
> local.family = msk->pm.remote.family;
> @@ -631,6 +632,7 @@ static void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk)
> if (msk->pm.add_addr_accepted >= add_addr_accept_max ||
> msk->pm.subflows >= subflows_max)
> WRITE_ONCE(msk->pm.accept_addr, false);
> +
> spin_unlock_bh(&msk->pm.lock);
> for (i = 0; i < nr; i++)
> __mptcp_subflow_connect(sk, &addr[i], &remote, flags[i], ifindex[i]);
> --
> 2.31.1
>
>
>
--
Mat Martineau
Intel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-07-29 0:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-28 9:16 [MPTCP][PATCH mptcp-next] Squash to "mptcp: remote addresses fullmesh" Geliang Tang
2021-07-28 9:16 ` [MPTCP][PATCH mptcp-next] Squash to "mptcp: local " Geliang Tang
2021-07-29 0:21 ` Mat Martineau
2021-07-29 0:20 ` [MPTCP][PATCH mptcp-next] Squash to "mptcp: remote " Mat Martineau
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.