All of lore.kernel.org
 help / color / mirror / Atom feed
* [MPTCP] [PATCH net-next] Squash-to: "mptcp: allow picking different xmit subflows"
@ 2020-09-10 23:30 Paolo Abeni
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Abeni @ 2020-09-10 23:30 UTC (permalink / raw)
  To: mptcp

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

In case of fallback we still need to check for avail space
on the only subflow, or we will trigger issues/83.

Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
Note:
- I hope this also address issues/88, but it's just a wild guess
- the repro from issue/83 will block, as expected, but will now
  be responsive to signal
---
 net/mptcp/protocol.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 2abfe998ed05..d271cac7a1fb 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1092,8 +1092,10 @@ static struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk,
 		return NULL;
 
 	if (__mptcp_check_fallback(msk)) {
-		*sndbuf = msk->first ? msk->first->sk_sndbuf : 0;
-		return msk->first;
+		if (!msk->first)
+			return NULL;
+		*sndbuf = msk->first->sk_sndbuf;
+		return sk_stream_memory_free(msk->first) ? msk->first : NULL;
 	}
 
 	/* re-use last subflow, if the burst allow that */
-- 
2.26.2

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

* [MPTCP] [PATCH net-next] Squash-to: "mptcp: allow picking different xmit subflows"
@ 2020-09-11 17:40 Paolo Abeni
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Abeni @ 2020-09-11 17:40 UTC (permalink / raw)
  To: mptcp

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

unbreak 32 bits build avoid unsing '/' on 64 bits arguments.

Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
---
 net/mptcp/protocol.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index e5ef7227c914..d848ade67a4a 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1082,8 +1082,9 @@ static struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk,
 	struct subflow_send_info send_info[2];
 	struct mptcp_subflow_context *subflow;
 	int i, nr_active = 0;
-	int64_t ratio, pace;
 	struct sock *ssk;
+	u64 ratio;
+	u32 pace;
 
 	sock_owned_by_me((struct sock *)msk);
 
@@ -1128,7 +1129,8 @@ static struct sock *mptcp_subflow_get_send(struct mptcp_sock *msk,
 		if (!pace)
 			continue;
 
-		ratio = (int64_t)READ_ONCE(ssk->sk_wmem_queued) << 32 / pace;
+		ratio = div_u64((u64)READ_ONCE(ssk->sk_wmem_queued) << 32,
+				pace);
 		if (ratio < send_info[subflow->backup].ratio) {
 			send_info[subflow->backup].ssk = ssk;
 			send_info[subflow->backup].ratio = ratio;
-- 
2.26.2

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

end of thread, other threads:[~2020-09-11 17:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 23:30 [MPTCP] [PATCH net-next] Squash-to: "mptcp: allow picking different xmit subflows" Paolo Abeni
2020-09-11 17:40 Paolo Abeni

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.