Skip to contentSkip to conversation

Squash to "mptcp: refactor push_pending logic" v19

PATCH In review Geliang Tang 2 participants 2 messages Nov 12, 2022 – Nov 16, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Squash to "mptcp: refactor push_pending logic" v19

In the "msk->snd_burst <= 0" block, copied will never be 0, so err will never be EAGAIN, drop it.

The orignal code only checks EAGAIN in __mptcp_push_pending, so drop this check in __mptcp_subflow_push_pending.

---
 net/mptcp/protocol.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
net/mptcp/protocol.c +2 -5
index a60961d0676d..2e60165c0eb2 100644
@@ -1548,7 +1548,7 @@ static int __subflow_push_pending(struct sock *sk, struct sock *ssk,
 		if (msk->snd_burst <= 0 ||
 		    !sk_stream_memory_free(ssk) ||
 		    !mptcp_subflow_active(mptcp_subflow_ctx(ssk))) {
-			err = copied ? : -EAGAIN;
+			err = copied;
 			goto out;
 		}
 		mptcp_set_timeout(sk);
@@ -1638,11 +1638,8 @@ static void __mptcp_subflow_push_pending(struct sock *sk, struct sock *ssk, bool
 
 		ret = __subflow_push_pending(sk, ssk, &info);
 		first = false;
-		if (ret <= 0) {
-			if (ret == -EAGAIN)
-				continue;
+		if (ret <= 0)
 			break;
-		}
 		copied += ret;
 	}
 
Signature · 1 line
2.35.3
#1 lore raw
Quoted 7 lines · Geliang Tang

In the "msk->snd_burst <= 0" block, copied will never be 0, so err will never be EAGAIN, drop it.

The orignal code only checks EAGAIN in __mptcp_push_pending, so drop this check in __mptcp_subflow_push_pending.

Looks good to squash, thanks.

- Mat

Quoted 35 lines

---
net/mptcp/protocol.c | 7 ++-----

1 file changed, 2 insertions(+), 5 deletions(-)
net/mptcp/protocol.c +2 -5
index a60961d0676d..2e60165c0eb2 100644
@@ -1548,7 +1548,7 @@ static int __subflow_push_pending(struct sock *sk, struct sock *ssk,
 		if (msk->snd_burst <= 0 ||
 		    !sk_stream_memory_free(ssk) ||
 		    !mptcp_subflow_active(mptcp_subflow_ctx(ssk))) {
-			err = copied ? : -EAGAIN;
+			err = copied;
 			goto out;
 		}
 		mptcp_set_timeout(sk);
@@ -1638,11 +1638,8 @@ static void __mptcp_subflow_push_pending(struct sock *sk, struct sock *ssk, bool
 
 		ret = __subflow_push_pending(sk, ssk, &info);
 		first = false;
-		if (ret <= 0) {
-			if (ret == -EAGAIN)
-				continue;
+		if (ret <= 0)
 			break;
-		}
 		copied += ret;
 	}
 
Signature · 1 line
2.35.3

--
Mat Martineau
Intel