From owner-freebsd-net@FreeBSD.ORG Fri Oct 2 12:24:59 2009 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 000411065670; Fri, 2 Oct 2009 12:24:58 +0000 (UTC) (envelope-from yohanes@gmail.com) Received: from mail-pz0-f185.google.com (mail-pz0-f185.google.com [209.85.222.185]) by mx1.freebsd.org (Postfix) with ESMTP id BCD358FC15; Fri, 2 Oct 2009 12:24:58 +0000 (UTC) Received: by pzk15 with SMTP id 15so323433pzk.3 for ; Fri, 02 Oct 2009 05:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=DGpems6qWEVK0M/oILdZG1niZ7vCQ/dxLINbXzrFDNc=; b=Leld7TWZPVWg2ySzaGblDMzFMIYHyQfp/zPQxGuatdbZIMIpYaUn5IrW1GZKQZhUuS 9X3RrTexE3ziPUYeDoSXgG4BggHu/GFYrrontFDebyxjghBgo39ZF9es4OfV89S9mzJ/ qORwqPjxBO3uqyOH81fOziAj4kNeDt56J0OyE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=iZOVGDkYpfB1TvxGzMRI/H++CyHIt0XlLBBz5OntrBUMYcgJKhzSkHvEXM0VA2tcAP EdI8LCIlImZgPI3OQ8Tb+Grq+1FS4bxfSiC4wr8cr2222ijoqu0nFMsJzFLdkvMAuMsk EdKYkauuK/qL7uZR7YMY8rJ4EI0OMrZHatkgA= MIME-Version: 1.0 Received: by 10.142.61.41 with SMTP id j41mr322357wfa.335.1254486298370; Fri, 02 Oct 2009 05:24:58 -0700 (PDT) In-Reply-To: <20091002133559.283d377f.stas@FreeBSD.org> References: <260bb65e0910012258w7c569505xa8cac5bd8bbd2aaa@mail.gmail.com> <20091002133559.283d377f.stas@FreeBSD.org> From: Yohanes Nugroho Date: Fri, 2 Oct 2009 19:24:38 +0700 Message-ID: <260bb65e0910020524p374a7706r21c72a12b8ce93fb@mail.gmail.com> To: Stanislav Sedov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org, freebsd-arm@freebsd.org Subject: Re: FreeBSD ARM network speed X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2009 12:24:59 -0000 On Fri, Oct 2, 2009 at 4:35 PM, Stanislav Sedov wrote: > 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. =C2=A0Our network stack is arch-independent and should = perform > equally well on all platforms. =C2=A0I'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). Ok, glad to hear that :) because the first time I asked about a problem in the USB, it turns out that there was a problem in the latest source code in busdma, and I have spent several days thinking it was my bug. > > This looks weird. =C2=A0Why do you stop the TX engine to add more packets > in the ring? =C2=A0This thing definitely can kill the network performace yes, you are right, that is weird, I will have a look at it again. > 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. Thank you for your enlightenment. > I'm not sure why Linux doesn't use interrupt, but this looks really > wrong. It is because the driver comes from a vendor (very messy code), not in the mainline kernel yet. the background story: - I have a cheap chinese NAS device (Agestar NCB3AST, cost about $50, now you can get it for about $40), comes with linux kernel 2.4, no source code was given. SoC used is Starsemi 9104 - I found out that there is a Linux source code for this SoC but for different device (with different hardware around the SoC). - Based on the source code, I ported it to work on Linux kernel 2.6, I didn't bother to try to clean up the source code - I am thinking of trying to add my code to mainline kernel, I realized that I didn't understand most of the source code - Bruce Simpson offered a device with same SoC (NSD-100) and I tried to port FreeBSD to it, thinking that I will understand the SoC better when rewriting the code - Starsemi was bought by cavium, the SoC is renamed to Econa CNS1102, and the datasheet was released. The datasheet is not very clear, so I am still basing some of my code on the Linux code (just the logic, not copy pasting, I understand about the license implication). > 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 > went. I am testing in single user mode. Last time i tested using kgmon, it doesn't show any particular area that might cause the slowdown. Once again, thank you, I now have some ideas on what to do this weekend. --=20 Regards Yohanes http://yohan.es/