Re: CFT: sf(4)

From: Pyun YongHyeon <pyunyh_at_gmail.com>
Date: Sat, 12 Jan 2008 19:33:14 +0900
On Wed, Jan 02, 2008 at 12:39:39PM +0900, To freebsd-current_at_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_at_ sent me a Starfire firmware. He said
gibbs_at_ 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
Received on Sat Jan 12 2008 - 09:38:01 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:25 UTC