Date: Fri, 2 Oct 2009 13:35:59 +0400 From: Stanislav Sedov <stas@FreeBSD.org> To: Yohanes Nugroho <yohanes@gmail.com> Cc: freebsd-net@freebsd.org, freebsd-arm@freebsd.org Subject: Re: FreeBSD ARM network speed Message-ID: <20091002133559.283d377f.stas@FreeBSD.org> In-Reply-To: <260bb65e0910012258w7c569505xa8cac5bd8bbd2aaa@mail.gmail.com> References: <260bb65e0910012258w7c569505xa8cac5bd8bbd2aaa@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <yohanes@gmail.com> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091002133559.283d377f.stas>