All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tcp: allow user to create repair socket without window probes
@ 2018-07-10 21:31 Stefan Baranoff
  2018-07-12 21:34 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Baranoff @ 2018-07-10 21:31 UTC (permalink / raw)
  To: netdev
  Cc: Andrey Vagin, Pavel Emelyanov, Stefan Baranoff, Eric Dumazet,
	David S. Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI

Under rare conditions where repair code may be used it is possible that
window probes are either unnecessary or undesired. If the user knows that
window probes are not wanted or needed this change allows them to skip
sending them when a socket comes out of repair.

Signed-off-by: Stefan Baranoff <sbaranoff@gmail.com>
---
 net/ipv4/tcp.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index e7b53d2a..728ae7a 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2821,14 +2821,16 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
 	case TCP_REPAIR:
 		if (!tcp_can_repair_sock(sk))
 			err = -EPERM;
-		else if (val == 1) {
-			tp->repair = 1;
+		/* 1 for normal repair, 2 for no window probes */
+		else if (val == 1 || val == 2) {
+			tp->repair = val;
 			sk->sk_reuse = SK_FORCE_REUSE;
 			tp->repair_queue = TCP_NO_QUEUE;
 		} else if (val == 0) {
 			tp->repair = 0;
 			sk->sk_reuse = SK_NO_REUSE;
-			tcp_send_window_probe(sk);
+			if (tp->repair == 1)
+				tcp_send_window_probe(sk);
 		} else
 			err = -EINVAL;
 
-- 
1.8.3.1

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

* Re: [PATCH] tcp: allow user to create repair socket without window probes
  2018-07-10 21:31 [PATCH] tcp: allow user to create repair socket without window probes Stefan Baranoff
@ 2018-07-12 21:34 ` David Miller
  2018-07-13 16:30   ` Eric Dumazet
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2018-07-12 21:34 UTC (permalink / raw)
  To: sbaranoff; +Cc: netdev, avagin, xemul, edumazet, kuznet, yoshfuji

From: Stefan Baranoff <sbaranoff@gmail.com>
Date: Tue, 10 Jul 2018 17:31:10 -0400

> Under rare conditions where repair code may be used it is possible that
> window probes are either unnecessary or undesired. If the user knows that
> window probes are not wanted or needed this change allows them to skip
> sending them when a socket comes out of repair.
> 
> Signed-off-by: Stefan Baranoff <sbaranoff@gmail.com>

Applied.

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

* Re: [PATCH] tcp: allow user to create repair socket without window probes
  2018-07-12 21:34 ` David Miller
@ 2018-07-13 16:30   ` Eric Dumazet
       [not found]     ` <CAHzKxpbnNOSafBEJRoS3RsL4rywLrgEdhyQqVppBbATwfT4OrQ@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2018-07-13 16:30 UTC (permalink / raw)
  To: David Miller, sbaranoff; +Cc: netdev, avagin, xemul, edumazet, kuznet, yoshfuji



On 07/12/2018 02:34 PM, David Miller wrote:
> From: Stefan Baranoff <sbaranoff@gmail.com>
> Date: Tue, 10 Jul 2018 17:31:10 -0400
> 
>> Under rare conditions where repair code may be used it is possible that
>> window probes are either unnecessary or undesired. If the user knows that
>> window probes are not wanted or needed this change allows them to skip
>> sending them when a socket comes out of repair.
>>
>> Signed-off-by: Stefan Baranoff <sbaranoff@gmail.com>
> 
> Applied.
> 


This buggy patch was added to net tree, it really should have been sent to net-next.

Stefan, please send a fix.

Thanks.

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

* Re: [PATCH] tcp: allow user to create repair socket without window probes
       [not found]     ` <CAHzKxpbnNOSafBEJRoS3RsL4rywLrgEdhyQqVppBbATwfT4OrQ@mail.gmail.com>
@ 2018-07-13 21:42       ` Eric Dumazet
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Dumazet @ 2018-07-13 21:42 UTC (permalink / raw)
  To: Stefan Baranoff
  Cc: David Miller, netdev, Andrey Vagin, Pavel Emelyanov,
	Eric Dumazet, Alexey Kuznetsov, Hideaki YOSHIFUJI



On 07/13/2018 02:36 PM, Stefan Baranoff wrote:

> 
> Before I put my foot in my mouth one more time and end up on everyone's naughty list - can someone help guide me on a couple of questions?
> 
> What is the correct way to resubmit this, just as a simple v2 or does it need cherry picked out and moved over to net-next somehow?
> Part of the fix is to remember to include my header file changes to increase the size of repair from 1 bit to 2 in include/linux/tcp.h - does that make this patch's change require any additional work, notices, etc?

Patch was officially merged, so there wont be a V2.

Please send a patch to fix the issue on top of current David net tree

Thanks.

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

end of thread, other threads:[~2018-07-13 21:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-10 21:31 [PATCH] tcp: allow user to create repair socket without window probes Stefan Baranoff
2018-07-12 21:34 ` David Miller
2018-07-13 16:30   ` Eric Dumazet
     [not found]     ` <CAHzKxpbnNOSafBEJRoS3RsL4rywLrgEdhyQqVppBbATwfT4OrQ@mail.gmail.com>
2018-07-13 21:42       ` Eric Dumazet

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.