From owner-freebsd-arm@FreeBSD.ORG Fri Oct 2 09:35:47 2009 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DF7A106568F; Fri, 2 Oct 2009 09:35:47 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id EFB858FC18; Fri, 2 Oct 2009 09:35:46 +0000 (UTC) Received: from orion.SpringDaemons.com (unknown [77.232.3.143]) by mx0.deglitch.com (Postfix) with ESMTPA id AD4668FC45; Fri, 2 Oct 2009 13:35:45 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id BC35239C4E; Fri, 2 Oct 2009 13:35:59 +0400 (MSD) Date: Fri, 2 Oct 2009 13:35:59 +0400 From: Stanislav Sedov To: Yohanes Nugroho Message-Id: <20091002133559.283d377f.stas@FreeBSD.org> In-Reply-To: <260bb65e0910012258w7c569505xa8cac5bd8bbd2aaa@mail.gmail.com> References: <260bb65e0910012258w7c569505xa8cac5bd8bbd2aaa@mail.gmail.com> Organization: The FreeBSD Project X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Fri__2_Oct_2009_13_35_59_+0400_1VFBUD8wRLAxVTXc" Cc: freebsd-net@freebsd.org, freebsd-arm@freebsd.org Subject: Re: FreeBSD ARM network speed X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2009 09:35:47 -0000 --Signature=_Fri__2_Oct_2009_13_35_59_+0400_1VFBUD8wRLAxVTXc Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, 2 Oct 2009 12:58:38 +0700 Yohanes Nugroho mentioned: > I have two question: > 1. Is the network speed in Freebsd ARM currently slower than Linux ARM? > I don't think so. Our network stack is arch-independent and should perform equally well on all platforms. I've been able to acchieve speeds up to 70 Mbps on my 180Mhz AT91 based board which uses very plain and dumb ethernet controller (although, DMA is supported). > Here is how the sending part works on STR9104: >=20 > - In the initialization part, I allocate a ring, the size of the ring > is 256 entries (same as Linux version). > - When being asked to send a packet, I will do the following thing: > - stop the network TX DMA > - put the address of each segment of the packet to the ring, and set > a flag so that the entry in the ring will be sent by hardware > - start the network TX DMA >=20 This looks weird. Why do you stop the TX engine to add more packets in the ring? This thing definitely can kill the network performace as the controller unable to transmit anything during the time you're filling the ring. You should not also generally transmit only one packet a time as in this case your driver will do a lot of extra work and, considering that you're stopping the TX engine when filling the ring, will prevent the adapter doing any useful work. The main strategy of the driver should be to keep the ring filled, waking up when some reasonable amount of space in the ring become available, and sleeping all other time when the adapter is working. I'm not sure why Linux doesn't use interrupt, but this looks really wrong. I'd suggest you to ananlyze the performance of network driver either by using the profiling tools available (kgmon, hardware counters (if any)) or/and via system monitoring tools (top, etc). Top, in particular, will allow you to see where all the CPU time=20 went. --=20 Stanislav Sedov ST4096-RIPE --Signature=_Fri__2_Oct_2009_13_35_59_+0400_1VFBUD8wRLAxVTXc Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIcBAEBAgAGBQJKxcl/AAoJEKN82nOYvCd0tLIP/A5SMA8ESLfUMJ+dUtomjNFx Gysrhnsdn9q03R/TeD9wjkyiOGgTdL6NWYPtfV6yH+zJ2nFo0JoPaPT35KRlwzXO 7xXlqQjD5Sp+S4Quc0VHIyDYDDDOxEP3Bp6DkuhTv8J+xHJo1x0pC+yfunpkMygc /rzzWzj4C2hiIgwvn4I9zAPp4AKhzIZNbOAIdL9iHX0v2dnoH1zh15vVB7hTTLsV 8JX1u214Oyi/58E04MDVmMa1mKKnGpzSw3/xo023iCTJt9CTcIyJepsa7LugZaJH BBgurRD7o05uIEY1AaZ/x5KpHAHcBklZ0SY7PSaznDVSuQygRGWNInKnK5vGUmUc 8tQ56GprQNLNsWsN1ABHKhLaPfGZtpFXS4t7e1rD4E26WZ/2qQodzcYjIt8JCbm+ sWIiboYVh7JyEJomUHrkjDw0gfN6i/gEeR0+64V5WLQLt0W8MFZxNwL5EDG61lTY Ikuoi/hIoWLvinAW3rlz6RkXQX3XCxIQGOyBtZvPBOpN+7PoGAq6KKGce4Q/KWJT uM6wO2W0+M1U08Xfu9jdjlN1fIVeTbnic22pFmePzzC8vW1CtQdLIOsHY1f9EiOs pAxgMF8Socd3AZJm4nK+zcrnwH2zzbomTV3we7AfLqUombm9axl4B1YmV+1ICXvF rHMHjekU6zvV7O/P7VrF =TnRO -----END PGP SIGNATURE----- --Signature=_Fri__2_Oct_2009_13_35_59_+0400_1VFBUD8wRLAxVTXc--