diff options
author | Paolo Abeni <pabeni@redhat.com> | 2020-03-27 22:48:51 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-30 07:14:49 +0200 |
commit | 01cacb00b35cb62b139f07d5f84bcf0eeda8eff6 (patch) | |
tree | 8d96829b4d6ca609c66fadf6d4f84a30f8380b81 /net/mptcp/pm.c | |
parent | mptcp: add and use MIB counter infrastructure (diff) | |
download | linux-01cacb00b35cb62b139f07d5f84bcf0eeda8eff6.tar.xz linux-01cacb00b35cb62b139f07d5f84bcf0eeda8eff6.zip |
mptcp: add netlink-based PM
Expose a new netlink family to userspace to control the PM, setting:
- list of local addresses to be signalled.
- list of local addresses used to created subflows.
- maximum number of add_addr option to react
When the msk is fully established, the PM netlink attempts to
announce the 'signal' list via the ADD_ADDR option. Since we
currently lack the ADD_ADDR echo (and related event) only the
first addr is sent.
After exhausting the 'announce' list, the PM tries to create
subflow for each addr in 'local' list, waiting for each
connection to be completed before attempting the next one.
Idea is to add an additional PM hook for ADD_ADDR echo, to allow
the PM netlink announcing multiple addresses, in sequence.
Co-developed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp/pm.c')
-rw-r--r-- | net/mptcp/pm.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 3aedad58778c..064639f72487 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -176,7 +176,7 @@ out_unlock: int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc) { - return 0; + return mptcp_pm_nl_get_local_id(msk, skc); } static void pm_worker(struct work_struct *work) @@ -192,12 +192,15 @@ static void pm_worker(struct work_struct *work) pr_debug("msk=%p status=%x", msk, pm->status); if (pm->status & BIT(MPTCP_PM_ADD_ADDR_RECEIVED)) { pm->status &= ~BIT(MPTCP_PM_ADD_ADDR_RECEIVED); + mptcp_pm_nl_add_addr_received(msk); } if (pm->status & BIT(MPTCP_PM_ESTABLISHED)) { pm->status &= ~BIT(MPTCP_PM_ESTABLISHED); + mptcp_pm_nl_fully_established(msk); } if (pm->status & BIT(MPTCP_PM_SUBFLOW_ESTABLISHED)) { pm->status &= ~BIT(MPTCP_PM_SUBFLOW_ESTABLISHED); + mptcp_pm_nl_subflow_established(msk); } spin_unlock_bh(&msk->pm.lock); @@ -219,6 +222,8 @@ void mptcp_pm_data_init(struct mptcp_sock *msk) spin_lock_init(&msk->pm.lock); INIT_WORK(&msk->pm.work, pm_worker); + + mptcp_pm_nl_data_init(msk); } void mptcp_pm_close(struct mptcp_sock *msk) @@ -232,4 +237,6 @@ void mptcp_pm_init(void) pm_wq = alloc_workqueue("pm_wq", WQ_UNBOUND | WQ_MEM_RECLAIM, 8); if (!pm_wq) panic("Failed to allocate workqueue"); + + mptcp_pm_nl_init(); } |