[PATCH mptcp-next v3 0/3] setsockopt: allow reuseport and ip6only
by Florian Westphal
3rd iteration. I've incorporated feedback from Mat, so for
options other than reuseport/reuseaddr the generic handler gets called
instead of returning -EOPNOTSUPP.
I've tested that ssh restart works on a a modified kernel that
enables mptcp for all IPPROTO_TCP sockets.
8 months
[GIT] Sync with net-next on 20200625: conflicts
by Matthieu Baerts
Hello,
Recently, MPTCP-related patches from Eric Dumazet have been applied in
'net-next' repo:
- 9b9e2f250e3e ("tcp: move ipv4_specific to tcp include file")
- b03d2142bea8 ("tcp: move ipv6_specific declaration to remove a warning")
These created conflicts:
- 2c57fdd819ca: conflict in t/mptcp-add-__init-annotation-on-setup-functions
Tests are in progress. The "export" branch will be updated after the tests.
Cheers,
Matt
--
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net
8 months
We only have few weeks left
by Romario Sankante
Hello,
my name is Aneta. My son, Arthur born January 5th 2020, has an innate health concern, namely – the congenital malformation of the cranial suture. A head surgery is badly needed. It has to be preceded by a series of costly consultations, medical examinations and planned rehabilitation. We find it difficult to cover all the expenses on our own. We only have few weeks left!
We live modestly, we do not have our own place to live, and the usual payments to be made drain a large part of the household budget. We fight for Artur's health as fiercely as we can, but we will not manage to do it on our own. The little boy does not even know how much more he has to go through to regain full health …
charity site:
https://www.choose2help.org/arthur.html
Every day is vital. Time flies, and that is why we ask you from the bottom of our heart to help Artur recover. Your help is our only chance,
Aneta, the mother
--
The CEO of the Charity DOES NOT earn a salary for his executive work.
Choose to Help Foundation
Smolańska 3 Street
70-026 Szczecin,
Poland
Phone no.: +48-91-407-5830
charity(a)choose2help.org
https://www.choose2help.org/
TIN no.: 9552441037
REGON no.: 368295964
NCR no.: 0000695388
mBank IBAN: PL92 1140 2004 0000 3812 1128 1062 with a transfer title "For Arthur"
Terms and conditions of payments and donations https://choose2help.org/terms.html
Privacy Policy - https://choose2help.org/privacy-policy.html
8 months
accept() not returning on current export branch?
by Mat Martineau
Hello -
I was trying to run some connection tests between two VMs (not the self
tests) on the current export branch (tag export/20200624T164427), and ran
in to some odd behavior. Here's the strace from the server side:
socket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP) = 3
bind(3, {sa_family=AF_INET, sin_port=htons(55555), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
listen(3, 10) = 0
accept(3, ^C <--- hangs here when peer is trying to connect
After SIGINT the rest of the output for accept is printed:
{sa_family=AF_INET, sin_port=htons(57828), sin_addr=inet_addr("192.168.122.168")}, [128->16]) = 4
With additional debug output, I can see that the call to
ssock->ops->accept() in mptcp_accept isn't returning.
Self tests are working fine on this kernel, and the same test program has
been working fine with older MPTCP code and with IPPROTO_TCP on this
kernel. Sorry I haven't had a chance to bisect it yet or put together some
minimal userspace code to repro, I can send that tomorrow. Kernel config
is generated with 'make defconfig; make kvm_guest.config' and the required
config options for the mptcp self test.
Anyone seen similar issues recently with accept()?
--
Mat Martineau
Intel
8 months
[PATCH v3] mptcp: __mptcp_tcp_fallback() returns a struct sock
by Paolo Abeni
Currently __mptcp_tcp_fallback() always return NULL
on incoming connections, because MPTCP does not create
the additional socket for the first subflow.
Since the previous commit no __mptcp_tcp_fallback()
caller needs a struct socket, so let __mptcp_tcp_fallback()
return the first subflow sock and cope correctly even with
incoming connections.
Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
v2 -> v2:
- update commit message
---
net/mptcp/protocol.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 75a96d8665e9..fb1f78ef3213 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -76,14 +76,14 @@ static bool mptcp_is_tcpsk(struct sock *sk)
return false;
}
-static struct socket *__mptcp_tcp_fallback(struct mptcp_sock *msk)
+static struct sock *__mptcp_tcp_fallback(struct mptcp_sock *msk)
{
sock_owned_by_me((const struct sock *)msk);
if (likely(!__mptcp_check_fallback(msk)))
return NULL;
- return msk->subflow;
+ return msk->first;
}
static int __mptcp_socket_create(struct mptcp_sock *msk)
@@ -1605,7 +1605,7 @@ static int mptcp_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, unsigned int optlen)
{
struct mptcp_sock *msk = mptcp_sk(sk);
- struct socket *ssock;
+ struct sock *ssk;
pr_debug("msk=%p", msk);
@@ -1616,11 +1616,10 @@ static int mptcp_setsockopt(struct sock *sk, int level, int optname,
* to the one remaining subflow.
*/
lock_sock(sk);
- ssock = __mptcp_tcp_fallback(msk);
+ ssk = __mptcp_tcp_fallback(msk);
release_sock(sk);
- if (ssock)
- return tcp_setsockopt(ssock->sk, level, optname, optval,
- optlen);
+ if (ssk)
+ return tcp_setsockopt(ssk, level, optname, optval, optlen);
return -EOPNOTSUPP;
}
@@ -1629,7 +1628,7 @@ static int mptcp_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *option)
{
struct mptcp_sock *msk = mptcp_sk(sk);
- struct socket *ssock;
+ struct sock *ssk;
pr_debug("msk=%p", msk);
@@ -1640,11 +1639,10 @@ static int mptcp_getsockopt(struct sock *sk, int level, int optname,
* to the one remaining subflow.
*/
lock_sock(sk);
- ssock = __mptcp_tcp_fallback(msk);
+ ssk = __mptcp_tcp_fallback(msk);
release_sock(sk);
- if (ssock)
- return tcp_getsockopt(ssock->sk, level, optname, optval,
- option);
+ if (ssk)
+ return tcp_getsockopt(ssk, level, optname, optval, option);
return -EOPNOTSUPP;
}
--
2.26.2
8 months
[PATCH mptcp-next] mptcp: use mptcp worker for path management
by Florian Westphal
We can re-use the existing work queue to handle path management
instead of a dedicated work queue. Just move pm_worker to protocol.c,
call it from the mptcp worker and get rid of the msk lock (already held).
Signed-off-by: Florian Westphal <fw(a)strlen.de>
---
As a followup one could probably also merge 'status' and msk->flags,
might also be able to remove the 'pending' boolean.
I can have a look next week.
net/mptcp/pm.c | 44 +-------------------------------------------
net/mptcp/protocol.c | 27 ++++++++++++++++++++++++++-
net/mptcp/protocol.h | 3 ---
3 files changed, 27 insertions(+), 47 deletions(-)
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 7de09fdd42a3..a8ad20559aaa 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -10,8 +10,6 @@
#include <net/mptcp.h>
#include "protocol.h"
-static struct workqueue_struct *pm_wq;
-
/* path manager command handlers */
int mptcp_pm_announce_addr(struct mptcp_sock *msk,
@@ -78,7 +76,7 @@ static bool mptcp_pm_schedule_work(struct mptcp_sock *msk,
return false;
msk->pm.status |= BIT(new_status);
- if (queue_work(pm_wq, &msk->pm.work))
+ if (schedule_work(&msk->work))
sock_hold((struct sock *)msk);
return true;
}
@@ -181,35 +179,6 @@ int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc)
return mptcp_pm_nl_get_local_id(msk, skc);
}
-static void pm_worker(struct work_struct *work)
-{
- struct mptcp_pm_data *pm = container_of(work, struct mptcp_pm_data,
- work);
- struct mptcp_sock *msk = container_of(pm, struct mptcp_sock, pm);
- struct sock *sk = (struct sock *)msk;
-
- lock_sock(sk);
- spin_lock_bh(&msk->pm.lock);
-
- 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);
- release_sock(sk);
- sock_put(sk);
-}
-
void mptcp_pm_data_init(struct mptcp_sock *msk)
{
msk->pm.add_addr_signaled = 0;
@@ -223,22 +192,11 @@ void mptcp_pm_data_init(struct mptcp_sock *msk)
msk->pm.status = 0;
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)
-{
- if (cancel_work_sync(&msk->pm.work))
- sock_put((struct sock *)msk);
-}
-
void __init 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();
}
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index faa804f63c81..a349d8f06f20 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1237,6 +1237,29 @@ static unsigned int mptcp_sync_mss(struct sock *sk, u32 pmtu)
return 0;
}
+static void pm_work(struct mptcp_sock *msk)
+{
+ struct mptcp_pm_data *pm = &msk->pm;
+
+ spin_lock_bh(&msk->pm.lock);
+
+ 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);
+}
+
static void mptcp_worker(struct work_struct *work)
{
struct mptcp_sock *msk = container_of(work, struct mptcp_sock, work);
@@ -1253,6 +1276,9 @@ static void mptcp_worker(struct work_struct *work)
__mptcp_flush_join_list(msk);
__mptcp_move_skbs(msk);
+ if (msk->pm.status)
+ pm_work(msk);
+
if (test_and_clear_bit(MPTCP_WORK_EOF, &msk->flags))
mptcp_check_for_eof(msk);
@@ -1444,7 +1470,6 @@ static void mptcp_close(struct sock *sk, long timeout)
}
mptcp_cancel_work(sk);
- mptcp_pm_close(msk);
__skb_queue_purge(&sk->sk_receive_queue);
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 2c3deede2469..6d3fff97e3c6 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -174,8 +174,6 @@ struct mptcp_pm_data {
u8 local_addr_max;
u8 subflows_max;
u8 status;
-
- struct work_struct work;
};
struct mptcp_data_frag {
@@ -417,7 +415,6 @@ void mptcp_crypto_hmac_sha(u64 key1, u64 key2, u8 *msg, int len, void *hmac);
void __init mptcp_pm_init(void);
void mptcp_pm_data_init(struct mptcp_sock *msk);
-void mptcp_pm_close(struct mptcp_sock *msk);
void mptcp_pm_new_connection(struct mptcp_sock *msk, int server_side);
void mptcp_pm_fully_established(struct mptcp_sock *msk);
bool mptcp_pm_allow_new_subflow(struct mptcp_sock *msk);
--
2.26.2
8 months
To ~~~ mptcp@lists.01.org
by Ms Karen Ngui
Kindly confirm if you got my business collaboration In-mail sent to you via LinkedIn.
Thanks. Mrs. Ngui
8 months, 1 week