From: Stefan Baranoff <sbaranoff@gmail.com>
To: netdev@vger.kernel.org
Cc: Andrey Vagin <avagin@virtuozzo.com>,
Pavel Emelyanov <xemul@virtuozzo.com>,
Stefan Baranoff <sbaranoff@gmail.com>,
Eric Dumazet <edumazet@google.com>,
"David S. Miller" <davem@davemloft.net>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
Subject: [PATCH] tcp: allow user to create repair socket without window probes
Date: Tue, 10 Jul 2018 17:31:10 -0400 [thread overview]
Message-ID: <1531258270-1046-1-git-send-email-sbaranoff@gmail.com> (raw)
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
next reply other threads:[~2018-07-10 21:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-10 21:31 Stefan Baranoff [this message]
2018-07-12 21:34 ` [PATCH] tcp: allow user to create repair socket without window probes David Miller
2018-07-13 16:30 ` Eric Dumazet
[not found] ` <CAHzKxpbnNOSafBEJRoS3RsL4rywLrgEdhyQqVppBbATwfT4OrQ@mail.gmail.com>
2018-07-13 21:42 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1531258270-1046-1-git-send-email-sbaranoff@gmail.com \
--to=sbaranoff@gmail.com \
--cc=avagin@virtuozzo.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=xemul@virtuozzo.com \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).