From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1a604a-0004jk-KG for mharc-grub-devel@gnu.org; Mon, 07 Dec 2015 12:59:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a604X-0004iu-TT for grub-devel@gnu.org; Mon, 07 Dec 2015 12:59:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a604U-0005xn-Df for grub-devel@gnu.org; Mon, 07 Dec 2015 12:59:37 -0500 Received: from mail-lf0-x22c.google.com ([2a00:1450:4010:c07::22c]:36609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a604U-0005xj-63 for grub-devel@gnu.org; Mon, 07 Dec 2015 12:59:34 -0500 Received: by lfs39 with SMTP id 39so143779903lfs.3 for ; Mon, 07 Dec 2015 09:59:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=hL/ts9Zj3Hsb8CPzEJJIXZcr9oIWUQjwvEEQv28DdcU=; b=WjUzMuiR6iUOV3qi6F+ftvh37yA6iZnb3rF2dHFDpcWE2sSDafYCwWhFFxMSBQi5cj QLcR1ETza5IgvldKqUn6LjvJsHHzXMlKDwTbkgVdbhvfFRIbtiwixIBSBId5SACNmhZO roKc6rZVwxTMSx/qTetDdqNsLAvMMsICYdUsfxPGBqw1lvvxad7O1WEfUpbHXB88udVd wGmh2x+jHObEl93kw+k7qSmJqpwPhF9pOi/qofXlYgTUhB5bi2sHksaSkSkQvd29aPkn wXr+08Nk/ca06GN3VBdN31Qd3BXj6eBB0Xqy9dfCm5tfQu/1Dic+fAnGCj3e77C/laUT yr/w== X-Received: by 10.25.38.84 with SMTP id m81mr14909823lfm.50.1449511173302; Mon, 07 Dec 2015 09:59:33 -0800 (PST) Received: from [192.168.1.41] (ppp91-76-25-247.pppoe.mtu-net.ru. [91.76.25.247]) by smtp.gmail.com with ESMTPSA id t82sm5146889lfe.14.2015.12.07.09.59.31 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Dec 2015 09:59:32 -0800 (PST) Subject: Re: [PATCH] tcp: ack when we get an OOO/lost packet To: The development of GNU GRUB , kernel-team@fb.com References: <1439392582-3172342-1-git-send-email-jbacik@fb.com> From: Andrei Borzenkov X-Enigmail-Draft-Status: N1110 Message-ID: <5665C901.3040605@gmail.com> Date: Mon, 7 Dec 2015 20:59:29 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1439392582-3172342-1-git-send-email-jbacik@fb.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::22c Cc: Josef Bacik X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 17:59:39 -0000 12.08.2015 18:16, Josef Bacik пишет: > While adding tcp window scaling support I was finding that I'd get some packet > loss or reordering when transferring from large distances and grub would just > timeout. This is because we weren't ack'ing when we got our OOO packet, so the > sender didn't know it needed to retransmit anything, so eventually it would fill > the window and stop transmitting, and we'd time out. Fix this by ACK'ing when > we don't find our next sequence numbered packet. With this fix I no longer time > out. Thanks, > Applied. Sorry, it somehow slipped through. More ideas in the same direction. 1. GRUB timeout for receiving currently is ~33 seconds. It is too small comparing with anything else. I am pretty sure in situation from tcpdump you sent me we could recover if timeout was in order of several minutes :) 2. We may consider sending ACK in grub_net_tcp_retransmit() additionally, although it probably needs proper rate-limiting based on RTT. 3. Using timestamp option may improve RTT detection for partner and is pretty cheap to implement. > Signed-off-by: Josef Bacik > --- > grub-core/net/tcp.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/grub-core/net/tcp.c b/grub-core/net/tcp.c > index 25720b1..6b411dd 100644 > --- a/grub-core/net/tcp.c > +++ b/grub-core/net/tcp.c > @@ -902,7 +902,10 @@ grub_net_recv_tcp_packet (struct grub_net_buff *nb, > grub_priority_queue_pop (sock->pq); > } > if (grub_be_to_cpu32 (tcph->seqnr) != sock->their_cur_seq) > - return GRUB_ERR_NONE; > + { > + ack (sock); > + return GRUB_ERR_NONE; > + } > while (1) > { > nb_top_p = grub_priority_queue_top (sock->pq); >