From owner-freebsd-net@FreeBSD.ORG Tue Jan 20 13:09:15 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0E91616A4CE; Tue, 20 Jan 2004 13:09:15 -0800 (PST) Received: from mail1.cray.com (mail1.cray.com [136.162.0.111]) by mx1.FreeBSD.org (Postfix) with ESMTP id B49AB43D5E; Tue, 20 Jan 2004 13:08:58 -0800 (PST) (envelope-from dab@cray.com) Received: from relayb.mw.cray.com (relayb.us.cray.com [192.168.252.110]) i0KL8l7W002114; Tue, 20 Jan 2004 15:08:48 -0600 (CST) Received: from saffron.us.cray.com (saffron.mw.cray.com [172.31.27.14]) i0KL8ksB004506; Tue, 20 Jan 2004 15:08:46 -0600 (CST) Received: from [127.0.0.1] (troll [192.168.250.5])i0KL8juP4188597; Tue, 20 Jan 2004 15:08:45 -0600 (CST) In-Reply-To: <16397.38155.418523.634400@grasshopper.cs.duke.edu> References: <16397.36782.415899.626311@grasshopper.cs.duke.edu> <400D9271.1259CBC8@freebsd.org> <16397.38155.418523.634400@grasshopper.cs.duke.edu> Mime-Version: 1.0 (Apple Message framework v609) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: David Borman Date: Tue, 20 Jan 2004 15:08:32 -0600 To: Andrew Gallatin X-Mailer: Apple Mail (2.609) X-Cray-VirusStatus: clean cc: freebsd-net@freebsd.org cc: Andre Oppermann Subject: Re: tcp mss MCLBYTES restriction X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2004 21:09:15 -0000 On the sending side, you'll tend to get your best performance when the socket buffer is a multiple of the amount of TCP data per packet, and the users writes are a multiple of the socket buffer. This keeps everything neatly aligned, minimizing the number of data copies that need to be done, and improving the chance of doing page flips. Rounding down a 1500 byte ethernet packet to a 1K boundary looses too much data, but for larger MTUs, the win of keeping everything neatly aligned can exceed the cost of not packing each packet with the maximum amount of data. Since applications that are writing large amounts of data to a socket will tend to be using buffers aligned on a K boundary, using a K aligned amount of TCP data increases the chances that everything stays aligned. -David Borman, dab@cray.com On Jan 20, 2004, at 2:52 PM, Andrew Gallatin wrote: > > Andre Oppermann writes: >> When I was implementing the tcp_hostcache I reorganized/redid the >> tcp_mss() function and wondered about that too. I don't know if >> this rounding to MCLBYTES is still the right thing to do. > > I have the feeling its something from ancient days on vaxes. ;) > >>> Would it be OK if I made this code optional via a sysctl? >> >> Could you run some bechmarks with the current MCLBYTES rounding >> and without it on 100Mbit 1.5kMTU and GigE with 9k MTU? > > 1.5k MTU won't matter -- it doesn't hit the rounding case anyway. > But I can certainly run some tests with 9k. > > Drew > > > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"