Date: Fri, 28 Jul 2000 15:44:03 -0700 (PDT) From: Archie Cobbs <archie@whistle.com> To: freebsd-net@freebsd.org Cc: silby@silby.com, jlemon@freebsd.org, wollman@khavrinen.lcs.mit.edu Subject: Re: sub-optimal tcp_ouput() performance in the face of ENOBUFS Message-ID: <200007282244.PAA28204@bubba.whistle.com> In-Reply-To: <Pine.BSF.4.21.0007272130290.16889-100000@achilles.silby.com> from Mike Silbersack at "Jul 27, 2000 09:35:57 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200007282244.PAA28204>