MPTCP Linux Development
 help / color / Atom feed
* [PATCH net] tcp: consistently disable header prediction for mptcp
@ 2021-06-30 11:42 Paolo Abeni
  2021-06-30 13:20 ` Eric Dumazet
  2021-07-01 20:36 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Abeni @ 2021-06-30 11:42 UTC (permalink / raw)
  To: netdev
  Cc: Eric Dumazet, David S. Miller, Jakub Kicinski, Davide Caratti,
	Mat Martineau, mptcp

The MPTCP receive path is hooked only into the TCP slow-path.
The DSS presence allows plain MPTCP traffic to hit that
consistently.

Since commit e1ff9e82e2ea ("net: mptcp: improve fallback to TCP"),
when an MPTCP socket falls back to TCP, it can hit the TCP receive
fast-path, and delay or stop triggering the event notification.

Address the issue explicitly disabling the header prediction
for MPTCP sockets.

Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/200
Fixes: e1ff9e82e2ea ("net: mptcp: improve fallback to TCP")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
Notes:
- I'm unable to disable header prediction consistently for MPTCP
  sockets touching only MPTCP code
- possible alternatives could be:
  - hook MPTCP in the TCP fastpath, too
  - try to pull again commit 45f119bf936b ("tcp: remove header prediction")
    avoiding the regression noded in 31770e34e43d ("tcp: Revert "tcp: remove
    header prediction"")
  I choose this option as the hopefully less invasive one.
---
 include/net/tcp.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index d05193cb0d99..b42b3e6731ed 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -682,6 +682,10 @@ static inline u32 __tcp_set_rto(const struct tcp_sock *tp)
 
 static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd)
 {
+	/* mptcp hooks are only on the slow path */
+	if (sk_is_mptcp((struct sock *)tp))
+		return;
+
 	tp->pred_flags = htonl((tp->tcp_header_len << 26) |
 			       ntohl(TCP_FLAG_ACK) |
 			       snd_wnd);
-- 
2.26.3


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

* Re: [PATCH net] tcp: consistently disable header prediction for mptcp
  2021-06-30 11:42 [PATCH net] tcp: consistently disable header prediction for mptcp Paolo Abeni
@ 2021-06-30 13:20 ` Eric Dumazet
  2021-07-01 20:36 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2021-06-30 13:20 UTC (permalink / raw)
  To: Paolo Abeni, netdev
  Cc: Eric Dumazet, David S. Miller, Jakub Kicinski, Davide Caratti,
	Mat Martineau, mptcp



On 6/30/21 1:42 PM, Paolo Abeni wrote:
> The MPTCP receive path is hooked only into the TCP slow-path.
> The DSS presence allows plain MPTCP traffic to hit that
> consistently.
> 
> Since commit e1ff9e82e2ea ("net: mptcp: improve fallback to TCP"),
> when an MPTCP socket falls back to TCP, it can hit the TCP receive
> fast-path, and delay or stop triggering the event notification.
> 
> Address the issue explicitly disabling the header prediction
> for MPTCP sockets.
> 
> Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/200
> Fixes: e1ff9e82e2ea ("net: mptcp: improve fallback to TCP")
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---

SGTM, thanks.

Reviewed-by: Eric Dumazet <edumazet@google.com>


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

* Re: [PATCH net] tcp: consistently disable header prediction for mptcp
  2021-06-30 11:42 [PATCH net] tcp: consistently disable header prediction for mptcp Paolo Abeni
  2021-06-30 13:20 ` Eric Dumazet
@ 2021-07-01 20:36 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-07-01 20:36 UTC (permalink / raw)
  To: Paolo Abeni
  Cc: netdev, edumazet, davem, kuba, dcaratti, mathew.j.martineau, mptcp

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Wed, 30 Jun 2021 13:42:13 +0200 you wrote:
> The MPTCP receive path is hooked only into the TCP slow-path.
> The DSS presence allows plain MPTCP traffic to hit that
> consistently.
> 
> Since commit e1ff9e82e2ea ("net: mptcp: improve fallback to TCP"),
> when an MPTCP socket falls back to TCP, it can hit the TCP receive
> fast-path, and delay or stop triggering the event notification.
> 
> [...]

Here is the summary with links:
  - [net] tcp: consistently disable header prediction for mptcp
    https://git.kernel.org/netdev/net/c/71158bb1f2d2

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-30 11:42 [PATCH net] tcp: consistently disable header prediction for mptcp Paolo Abeni
2021-06-30 13:20 ` Eric Dumazet
2021-07-01 20:36 ` patchwork-bot+netdevbpf

MPTCP Linux Development

Archives are clonable:
	git clone --mirror https://lore.kernel.org/mptcp/0 mptcp/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 mptcp mptcp/ https://lore.kernel.org/mptcp \
		mptcp@lists.linux.dev
	public-inbox-index mptcp

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/dev.linux.lists.mptcp


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git