From owner-freebsd-current@FreeBSD.ORG Sat Jan 12 10:38:01 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4561B16A419 for ; Sat, 12 Jan 2008 10:38:01 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.180]) by mx1.freebsd.org (Postfix) with ESMTP id 0C9EE13C45D for ; Sat, 12 Jan 2008 10:38:00 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so2510257waf.3 for ; Sat, 12 Jan 2008 02:38:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:received:date:from:to:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; bh=ld+SS5+355xS4tBbfGHfevnfMsXgDY0OW4Yu3CCIQiI=; b=jNCAFhjLX3Mnibu4xJgHsl6zg+4+/X5Oi7uSduXgwFMpYUWr42bqWv8b1HzBy1Y+6gG+JlywBPtw5hsVjkfaYAb9QC5LrenE1qSF4XWsJcCP8wVup8tUa8f6fInnHWXkntdczGXVK1d59HQ4tgPwHwfZ3eY9FjAZMH1ZBiCE/L4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=eGPNrRJjWViA3M17h04xxEKoagL4klhmd2KTdgUUR3bSWz4uBCIlJxwp+iDyagcFV7XLp/+2KMiwSGFDxInPvUU3/5VzscVA13NkNsjvkpMdb5uibgkfuBeFf5waCniXQTzJ+rHYrikQRUKEnNfWFFpRRuyhAAxtyygUyEaOeoA= Received: by 10.114.199.1 with SMTP id w1mr1020615waf.38.1200134279670; Sat, 12 Jan 2008 02:37:59 -0800 (PST) Received: from michelle.cdnetworks.co.kr ( [211.53.35.84]) by mx.google.com with ESMTPS id l22sm10251462waf.10.2008.01.12.02.37.57 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 12 Jan 2008 02:37:58 -0800 (PST) Received: from michelle.cdnetworks.co.kr (localhost.cdnetworks.co.kr [127.0.0.1]) by michelle.cdnetworks.co.kr (8.13.5/8.13.5) with ESMTP id m0CAXEXM069885 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 12 Jan 2008 19:33:14 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.cdnetworks.co.kr (8.13.5/8.13.5/Submit) id m0CAXE62069884 for freebsd-current@freebsd.org; Sat, 12 Jan 2008 19:33:14 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Sat, 12 Jan 2008 19:33:14 +0900 From: Pyun YongHyeon To: freebsd-current@freebsd.org Message-ID: <20080112103314.GB69661@cdnetworks.co.kr> References: <20080102033939.GB27551@cdnetworks.co.kr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080102033939.GB27551@cdnetworks.co.kr> User-Agent: Mutt/1.4.2.1i Subject: Re: CFT: sf(4) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2008 10:38:01 -0000 On Wed, Jan 02, 2008 at 12:39:39PM +0900, To freebsd-current@freebsd.org wrote: > Hi, > > I had been using the following overhauled sf(4) for serveral months > without issues. It would be really great sf(4) users can test the > driver and report back how it works on his/her box. Basically the > driver does the following thing. > - bus_dma(9) conversion and endianness support : Now sf(4) should > work on all architectures that FreeBSD runs. > - Performance optimization : switch to type 2 Tx descriptor and > removed lots of PCI register access. Rx alignment fixup is only > called on strict-alignment architectures so i386/amd64 would > get instant Rx performance boost. > - AIC-6915 supports Rx/Tx checksum offload as well as hardware VLAN > tag insertion/stripping if firmware is loaded into frame > processor. Unfortunately the firmware is not available under BSD > license so these additional hardware accelerations are not > available yet on FreeBSD. :-( > - Code cleanup & misc bug fixes. > A couple of days ago brueffer@ sent me a Starfire firmware. He said gibbs@ sent him the firmware but checksum offload capability was not added into driver at that time. So I took the firmware and wrote a download routine from the information in datasheet. But the firmware had a bug that prevents hardware from computing Tx checksumm. Fortunately, I managed to analyze the bug and fixed it by hand. :-) I've updated the overhauled sf(4) to use the firmware and fixed several minor bugs in it. If there are no objections I'll commit it in two weeks. The overhauled sf(4) has two sysctl variables not present in stock version. dev.sf.N.stats : N indicates instance number of driver. With 'sysctl dev.sf.0.stats=1' command, you can see lots of useful counters maintained by driver. Most counters are 32bit value but number of Tx/Rx frames/octets and Rx bytes associated with packet length are 64bit value. dev.sf.N.int_mod : N indicates instance number of driver. This controls how long sf(4) delays interrupt processing. Accepted range is 0 to 31. Actual interrupt delay time is comuted by the following expression. delay = dev.sf.N.int_mod * 102.4us The default value is 1(e.g. 102.4us). 0 completely disables the interrupt modertation. Install: http://people.freebsd.org/~yongari/sf/if_sf.c http://people.freebsd.org/~yongari/sf/if_sfreg.h http://people.freebsd.org/~yongari/sf/starfire_rx.h http://people.freebsd.org/~yongari/sf/starfire_tx.h Download and copy the above files to /usr/src/sys/pci directory and rebuild sf(4). Because I removed unnecessary copy operation in Rx path you should see instant performance boost on i386/amd64. sparc64 still need the copy operation, though. If you find any regression please let me know. Thank you! -- Regards, Pyun YongHyeon