From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: listen(2) backlog changes in or around Linux 3.1? Date: Mon, 22 Oct 2012 22:08:39 +0200 Message-ID: <1350936519.8609.1239.camel@edumazet-glaptop> References: <507C4401.7050500@oracle.com> <5080279F.80008@oracle.com> <5080340F.3050207@oracle.com> <1350629413.2293.157.camel@edumazet-glaptop> <1350634013.2293.262.camel@edumazet-glaptop> <1350642562.2293.411.camel@edumazet-glaptop> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: enh , Venkat Venkatsubra , netdev@vger.kernel.org To: Vijay Subramanian Return-path: Received: from mail-ea0-f174.google.com ([209.85.215.174]:65292 "EHLO mail-ea0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753331Ab2JVUIp (ORCPT ); Mon, 22 Oct 2012 16:08:45 -0400 Received: by mail-ea0-f174.google.com with SMTP id c13so951529eaa.19 for ; Mon, 22 Oct 2012 13:08:43 -0700 (PDT) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Mon, 2012-10-22 at 13:00 -0700, Vijay Subramanian wrote: > > > > If we send a SYNACK, then receive the ACK from client, and the acceptq > > is full, we should reset the connexion. Right now we have kind of stupid > > situation, were we drop the ACK, and leave the REQ in the SYN_RECV > > state, so we retransmit SYNACKS. > > > > > It seems the third ack is remembered in inet_rsk(req)->acked in > tcp_check_req(). However, because of the order in which the tests are performed, > server stills retransmits the synack needlessly. Following patch > (for review) prevents this synack retransmission if third ack has been > received. > > The request_sock will expire in around 30 seconds and will be dropped if it does > not move into accept_queue by then. Maybe we should also call > req->rsk_ops->send_reset(sk,skb); > when the request_sock expires and is dropped? > Not sure its needed, and we are under stress. > > net/ipv4/inet_connection_sock.c | 5 ++--- > 1 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c > index d34ce29..4e8e52e 100644 > --- a/net/ipv4/inet_connection_sock.c > +++ b/net/ipv4/inet_connection_sock.c > @@ -598,9 +598,8 @@ void inet_csk_reqsk_queue_prune(struct sock *parent, > &expire, &resend); > req->rsk_ops->syn_ack_timeout(parent, req); > if (!expire && > - (!resend || > - !req->rsk_ops->rtx_syn_ack(parent, req, NULL) || > - inet_rsk(req)->acked)) { > + (!resend || inet_rsk(req)->acked || > + !req->rsk_ops->rtx_syn_ack(parent, req, NULL))) { > unsigned long timeo; > > if (req->retrans++ == 0) I wonder then if we dont need to retransmit the synack when req moves into accept_queue then ? Or else how the client can 'knows' it can send data to server ? All these facilities sound very complex and not really usable by clients (ie users not willing to wait more than few seconds anyway)