From owner-freebsd-net@FreeBSD.ORG Mon Feb 6 04:55:15 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org 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 2C4D816A420 for ; Mon, 6 Feb 2006 04:55:15 +0000 (GMT) (envelope-from nielsen-list@memberwebs.com) Received: from mail.npubs.com (mail.npubs.com [209.66.100.224]) by mx1.FreeBSD.org (Postfix) with ESMTP id ED51543D45 for ; Mon, 6 Feb 2006 04:55:14 +0000 (GMT) (envelope-from nielsen-list@memberwebs.com) From: Nate Nielsen User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051013) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sam Leffler References: <20060205011931.E5F08DCA99E@mail.npubs.com> <43E63FC3.2030409@errno.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-Id: <20060206050301.AC895DCAA3F@mail.npubs.com> X-Virus-Scanned: ClamAV using ClamSMTP Date: Mon, 6 Feb 2006 05:03:02 +0000 (GMT) Cc: "freebsd-net@FreeBSD.org" Subject: Re: Polling for ath driver X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: nielsen@memberwebs.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2006 04:55:15 -0000 Sam Leffler wrote: > You might try explaining why you think polling helps your performance. > Unless you've significantly restructured the interrupt handling in the > driver most work is deferred to a non-interrupt context. Yes, I saw that. However the interrupts themselves when they are fired at upwards of a thousand per second do greatly affect performance and scheduling on a slow box. I understand that it may not seem intuitive on faster systems which are completely capable of handling such a small interrupt load. But these embedded systems are slow little puppies, running between 133 and 266 Mhz (586 class chip). Adding polling to this driver does increase performance on embedded systems. With my current patch (on a 233Mhz system), the throughput (in this case a simple TCP stream) goes up by ~6Mbits, from 18Mbits to 24Mbits. But that's not the main benefit. The main thing is the scheduling. Without having the thousands of interrupts, the box is better able to balance the RX/TX with the other aspects, such as encapsulation, packet filtering and other activities. When the entire box is polling driven, it's total throughput (ethernet, encapsulation, hardware encryption, wireless) increases greatly and does not exhibit livelock symptoms. Without polling, these slow systems easily exhibit livelock. This is where incoming traffic can cause so many interrupts that outgoing traffic is completely halted and the throughput drops to zero or near zero. Under these conditions userland processes also run barely or not at all. The scheduler has no say in what's going on in the system, as interrupts overwhelm all other activity. > Also the > driver in 6.0 and later does tx interrupt mitigation and rx interrupt > coalescing so I wouldn't expect interrupt handling to be a performance > limitation. Interesting. If there's an option to enable it, I very well may have missed it. However it should be noted, that the default behaviour (in 6.0 release) seems to be that the hardware generates about around 2000 interrupts per second at around 15 - 18 Mbits throughput. > There are other issues that can affect performance but you > haven't mentioned them... Obviously these are not mainstream performance issues for people just trying to connect to an access point. But when the atheros cards are used in backhaul applications and are running in the low power embedded systems you typically see on an antenna mast, polling makes a big difference. Cheers, Nate