From owner-freebsd-net Fri Jul 28 15:44:12 2000 Delivered-To: freebsd-net@freebsd.org Received: from bubba.whistle.com (bubba.whistle.com [207.76.205.7]) by hub.freebsd.org (Postfix) with ESMTP id 95D3237B63A; Fri, 28 Jul 2000 15:44:05 -0700 (PDT) (envelope-from archie@whistle.com) Received: (from archie@localhost) by bubba.whistle.com (8.9.3/8.9.3) id PAA28204; Fri, 28 Jul 2000 15:44:03 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200007282244.PAA28204@bubba.whistle.com> Subject: Re: sub-optimal tcp_ouput() performance in the face of ENOBUFS In-Reply-To: from Mike Silbersack at "Jul 27, 2000 09:35:57 pm" To: freebsd-net@freebsd.org Date: Fri, 28 Jul 2000 15:44:03 -0700 (PDT) Cc: silby@silby.com, jlemon@freebsd.org, wollman@khavrinen.lcs.mit.edu X-Mailer: ELM [version 2.4ME+ PL68 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Mike Silbersack writes: > > It seems like there is sub-optimal behaviour in tcp_output(), > > and I'm wondering what other people think. > > > > Consider an output interface whose transmit queue is full. > > tcp_output() calls ip_output(), and it will return ENOBUFS. > > Here's where this is handled (tcp_output, line 863): OK, here's a first stab at a patch.. reviews requested.. This dramatically improves performance for me when I lower the max queue length. Still get good throughput even with 25% of the transmitted packets returning ENOBUFS. However, I haven't tested the edge conditions: SYN and FIN, persist state, etc. Thanks, -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com Index: tcp_output.c =================================================================== RCS file: /home/ncvs/src/sys/netinet/tcp_output.c,v retrieving revision 1.39.2.4 diff -u -r1.39.2.4 tcp_output.c --- tcp_output.c 2000/07/15 07:14:31 1.39.2.4 +++ tcp_output.c 2000/07/28 22:25:21 @@ -860,6 +860,21 @@ (so->so_options & SO_DONTROUTE), 0); } if (error) { + + /* + * We know that the packet was lost, so back out the + * sequence number advance, if any. + */ + if (tp->t_force == 0 || !callout_active(tp->tt_persist)) { + /* + * No need to check for TH_FIN here because + * the TF_SENTFIN flag handles that case. + */ + if (flags & TH_SYN) + tp->snd_nxt--; + tp->snd_nxt -= len; + } + out: if (error == ENOBUFS) { if (!callout_active(tp->tt_rexmt) && To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message