mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-21 11:13:30 +00:00
98cb733c67
MAKEDEV: Add MAKEDEV glue for the ti(4) device nodes. ti.4: Update the ti(4) man page to include information on the TI_JUMBO_HDRSPLIT and TI_PRIVATE_JUMBOS kernel options, and also include information about the new character device interface and the associated ioctls. man9/Makefile: Add jumbo.9 and zero_copy.9 man pages and associated links. jumbo.9: New man page describing the jumbo buffer allocator interface and operation. zero_copy.9: New man page describing the general characteristics of the zero copy send and receive code, and what an application author should do to take advantage of the zero copy functionality. NOTES: Add entries for ZERO_COPY_SOCKETS, TI_PRIVATE_JUMBOS, TI_JUMBO_HDRSPLIT, MSIZE, and MCLSHIFT. conf/files: Add uipc_jumbo.c and uipc_cow.c. conf/options: Add the 5 options mentioned above. kern_subr.c: Receive side zero copy implementation. This takes "disposable" pages attached to an mbuf, gives them to a user process, and then recycles the user's page. This is only active when ZERO_COPY_SOCKETS is turned on and the kern.ipc.zero_copy.receive sysctl variable is set to 1. uipc_cow.c: Send side zero copy functions. Takes a page written by the user and maps it copy on write and assigns it kernel virtual address space. Removes copy on write mapping once the buffer has been freed by the network stack. uipc_jumbo.c: Jumbo disposable page allocator code. This allocates (optionally) disposable pages for network drivers that want to give the user the option of doing zero copy receive. uipc_socket.c: Add kern.ipc.zero_copy.{send,receive} sysctls that are enabled if ZERO_COPY_SOCKETS is turned on. Add zero copy send support to sosend() -- pages get mapped into the kernel instead of getting copied if they meet size and alignment restrictions. uipc_syscalls.c:Un-staticize some of the sf* functions so that they can be used elsewhere. (uipc_cow.c) if_media.c: In the SIOCGIFMEDIA ioctl in ifmedia_ioctl(), avoid calling malloc() with M_WAITOK. Return an error if the M_NOWAIT malloc fails. The ti(4) driver and the wi(4) driver, at least, call this with a mutex held. This causes witness warnings for 'ifconfig -a' with a wi(4) or ti(4) board in the system. (I've only verified for ti(4)). ip_output.c: Fragment large datagrams so that each segment contains a multiple of PAGE_SIZE amount of data plus headers. This allows the receiver to potentially do page flipping on receives. if_ti.c: Add zero copy receive support to the ti(4) driver. If TI_PRIVATE_JUMBOS is not defined, it now uses the jumbo(9) buffer allocator for jumbo receive buffers. Add a new character device interface for the ti(4) driver for the new debugging interface. This allows (a patched version of) gdb to talk to the Tigon board and debug the firmware. There are also a few additional debugging ioctls available through this interface. Add header splitting support to the ti(4) driver. Tweak some of the default interrupt coalescing parameters to more useful defaults. Add hooks for supporting transmit flow control, but leave it turned off with a comment describing why it is turned off. if_tireg.h: Change the firmware rev to 12.4.11, since we're really at 12.4.11 plus fixes from 12.4.13. Add defines needed for debugging. Remove the ti_stats structure, it is now defined in sys/tiio.h. ti_fw.h: 12.4.11 firmware. ti_fw2.h: 12.4.11 firmware, plus selected fixes from 12.4.13, and my header splitting patches. Revision 12.4.13 doesn't handle 10/100 negotiation properly. (This firmware is the same as what was in the tree previously, with the addition of header splitting support.) sys/jumbo.h: Jumbo buffer allocator interface. sys/mbuf.h: Add a new external mbuf type, EXT_DISPOSABLE, to indicate that the payload buffer can be thrown away / flipped to a userland process. socketvar.h: Add prototype for socow_setup. tiio.h: ioctl interface to the character portion of the ti(4) driver, plus associated structure/type definitions. uio.h: Change prototype for uiomoveco() so that we'll know whether the source page is disposable. ufs_readwrite.c:Update for new prototype of uiomoveco(). vm_fault.c: In vm_fault(), check to see whether we need to do a page based copy on write fault. vm_object.c: Add a new function, vm_object_allocate_wait(). This does the same thing that vm_object allocate does, except that it gives the caller the opportunity to specify whether it should wait on the uma_zalloc() of the object structre. This allows vm objects to be allocated while holding a mutex. (Without generating WITNESS warnings.) vm_object_allocate() is implemented as a call to vm_object_allocate_wait() with the malloc flag set to M_WAITOK. vm_object.h: Add prototype for vm_object_allocate_wait(). vm_page.c: Add page-based copy on write setup, clear and fault routines. vm_page.h: Add page based COW function prototypes and variable in the vm_page structure. Many thanks to Drew Gallatin, who wrote the zero copy send and receive code, and to all the other folks who have tested and reviewed this code over the years.
309 lines
9.9 KiB
Groff
309 lines
9.9 KiB
Groff
.\" Copyright (c) 1997, 1998, 1999
|
|
.\" Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
|
|
.\"
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
.\" must display the following acknowledgement:
|
|
.\" This product includes software developed by Bill Paul.
|
|
.\" 4. Neither the name of the author nor the names of any co-contributors
|
|
.\" may be used to endorse or promote products derived from this software
|
|
.\" without specific prior written permission.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
|
|
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
|
.\" THE POSSIBILITY OF SUCH DAMAGE.
|
|
.\"
|
|
.\" $FreeBSD$
|
|
.\"
|
|
.Dd March 4, 1999
|
|
.Dt TI 4
|
|
.Os
|
|
.Sh NAME
|
|
.Nm ti
|
|
.Nd "Alteon Networks Tigon I and Tigon II gigabit ethernet driver"
|
|
.Sh SYNOPSIS
|
|
.Cd "device ti"
|
|
.Cd "options TI_PRIVATE_JUMBOS"
|
|
.Cd "options TI_JUMBO_HDRSPLIT"
|
|
.Sh DESCRIPTION
|
|
The
|
|
.Nm
|
|
driver provides support for PCI gigabit ethernet adapters based on
|
|
the Alteon Networks Tigon gigabit ethernet controller chip.
|
|
The Tigon
|
|
contains an embedded R4000 CPU, gigabit MAC, dual DMA channels and
|
|
a PCI interface unit.
|
|
The Tigon II contains two R4000 CPUs and other
|
|
refinements.
|
|
Either chip can be used in either a 32-bit or 64-bit PCI
|
|
slot.
|
|
Communication with the chip is achieved via PCI shared memory
|
|
and bus master DMA.
|
|
The Tigon I and II support hardware multicast
|
|
address filtering, VLAN tag extraction and insertion, and jumbo
|
|
ethernet frames sizes up to 9000 bytes.
|
|
Note that the Tigon I chipset
|
|
is no longer in active production: all new adapters should come equipped
|
|
with Tigon II chipsets.
|
|
.Pp
|
|
There are several PCI boards available from both Alteon and other
|
|
vendors that use the Tigon chipset under OEM contract.
|
|
The
|
|
.Nm
|
|
driver has been tested with the following Tigon-based adapters:
|
|
.Pp
|
|
.Bl -bullet -compact -offset indent
|
|
.It
|
|
The Alteon AceNIC V gigabit ethernet adapter (1000baseSX)
|
|
.It
|
|
The Alteon AceNIC V gigabit ethernet adapter (1000baseT)
|
|
.It
|
|
The 3Com 3c985-SX gigabit ethernet adapter (Tigon 1)
|
|
.It
|
|
The 3Com 3c985B-SX gigabit ethernet adapter (Tigon 2)
|
|
.It
|
|
The Netgear GA620 gigabit ethernet adapter (1000baseSX)
|
|
.It
|
|
The Netgear GA620T gigabit ethernet adapter (1000baseT)
|
|
.El
|
|
.Pp
|
|
The following should also be supported but have not yet been tested:
|
|
.Pp
|
|
.Bl -bullet -compact -offset indent
|
|
.It
|
|
The Digital EtherWORKS 1000SX PCI Gigabit Adapter
|
|
.It
|
|
Silicon Graphics PCI gigabit ethernet adapter
|
|
.It
|
|
Farallon PN9000SX Gigabit Ethernet adapter
|
|
.It
|
|
Asante PCI 1000BASE-SX Gigabit Ethernet Adapter
|
|
.It
|
|
Asante GigaNIX1000T Gigabit Ethernet Adapter
|
|
.El
|
|
.Pp
|
|
While the Tigon chipset supports 10, 100 and 1000Mbps speeds, support for
|
|
10 and 100Mbps speeds is only available on boards with the proper
|
|
transceivers.
|
|
Most adapters are only designed to work at 1000Mbps,
|
|
however the driver should support those NICs that work at lower speeds
|
|
as well.
|
|
.Pp
|
|
Support for jumbo frames is provided via the interface MTU setting.
|
|
Selecting an MTU larger than 1500 bytes with the
|
|
.Xr ifconfig 8
|
|
utility configures the adapter to receive and transmit jumbo frames.
|
|
Using jumbo frames can greatly improve performance for certain tasks,
|
|
such as file transfers and data streaming.
|
|
.Pp
|
|
Header splitting support for Tigon 2 boards (this option has no effect for
|
|
the Tigon 1) can be turned on with the
|
|
.Dv TI_JUMBO_HDRSPLIT
|
|
option. See
|
|
.Xr zero_copy 9
|
|
for more discussion on zero copy receive and header splitting.
|
|
.Pp
|
|
The
|
|
.Nm
|
|
driver normally uses jumbo receive buffers allocated by the
|
|
.Xr jumbo 9
|
|
buffer allocator, but can be configured to use its own private pool of
|
|
jumbo buffers that are contiguous instead of buffers from the jumbo
|
|
allocator, which are made up of multiple page sized chunks. To turn on
|
|
private jumbos, use the
|
|
.Dv TI_PRIVATE_JUMBOS
|
|
option.
|
|
.Pp
|
|
Support for vlans is also available using the
|
|
.Xr vlan 4
|
|
mechanism.
|
|
See the
|
|
.Xr vlan 4
|
|
man page for more details.
|
|
.Pp
|
|
The
|
|
.Nm
|
|
driver supports the following media types:
|
|
.Pp
|
|
.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
|
|
.It autoselect
|
|
Enable autoselection of the media type and options.
|
|
The user can manually override
|
|
the autoselected mode by adding media options to the
|
|
.Pa /etc/rc.conf
|
|
file.
|
|
.It 10baseT/UTP
|
|
Set 10Mbps operation.
|
|
The
|
|
.Ar mediaopt
|
|
option can also be used to select either
|
|
.Ar full-duplex
|
|
or
|
|
.Ar half-duplex
|
|
modes.
|
|
.It 100baseTX
|
|
Set 100Mbps (fast ethernet) operation.
|
|
The
|
|
.Ar mediaopt
|
|
option can also be used to select either
|
|
.Ar full-duplex
|
|
or
|
|
.Ar half-duplex
|
|
modes.
|
|
.It 1000baseSX
|
|
Set 1000Mbps (gigabit ethernet) operation.
|
|
Only full
|
|
.Ar full-duplex
|
|
mode is supported at this speed.
|
|
.El
|
|
.Pp
|
|
The
|
|
.Nm
|
|
driver supports the following media options:
|
|
.Pp
|
|
.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
|
|
.It full-duplex
|
|
Force full duplex operation
|
|
.It half-duplex
|
|
Force half duplex operation.
|
|
.El
|
|
.Pp
|
|
For more information on configuring this device, see
|
|
.Xr ifconfig 8 .
|
|
.Sh IOCTLS
|
|
In addition to the standard
|
|
.Xr socket 2
|
|
.Xr ioctl 2
|
|
calls implemented by most network drivers, the
|
|
.Nm
|
|
driver also includes a character device interface that can be used for
|
|
additional diagnostics, configuration and debugging. With this character
|
|
device interface, and a specially patched version of gdb, the user can
|
|
debug firmware running on the Tigon board.
|
|
.Pp
|
|
These ioctls and their arguments are defined in the
|
|
.Aq Pa sys/tiio.h
|
|
header file.
|
|
.Bl -tag -width ALT_WRITE_TG_MEM
|
|
.It Dv TIIOCGETSTATS
|
|
Return card statistics DMAed from the card into kernel memory approximately
|
|
every 2 seconds. (That time interval can be changed via the
|
|
.Dv TIIOCSETPARAMS
|
|
ioctl.) The argument is
|
|
.Va struct ti_stats .
|
|
.It Dv TIIOCGETPARAMS
|
|
Get various performance-related firmware parameters that largely affect how
|
|
interrupts are coalesced. The argument is
|
|
.Va struct ti_params .
|
|
.It Dv TIIOCSETPARAMS
|
|
Set various performance-related firmware parameters that largely affect how
|
|
interrupts are coalesced. The argument is
|
|
.Va struct ti_params .
|
|
.It Dv TIIOCSETTRACE
|
|
Tell the NIC to trace the requested types of information.
|
|
The argument is
|
|
.Va ti_trace_type .
|
|
.It Dv TIIOCGETTRACE
|
|
Dump the trace buffer from the card. The argument is
|
|
.Va struct ti_trace_buf .
|
|
.It Dv ALT_ATTACH
|
|
This ioctl is used for compatibility with Alteon's Solaris driver. They
|
|
apparantly only have one character interface for debugging, so they have
|
|
to tell it which Tigon instance they want to debug. This ioctl is a noop
|
|
for FreeBSD.
|
|
.It Dv ALT_READ_TG_MEM
|
|
Read the requested memory region from the Tigon board. The argument is
|
|
.Va struct tg_mem .
|
|
.It Dv ALT_WRITE_TG_MEM
|
|
Write to the requested memory region on the Tigon board. The argument is
|
|
.Va struct tg_mem .
|
|
.It Dv ALT_READ_TG_REG
|
|
Read the requested register on the Tigon board. The argument is
|
|
.Va struct tg_reg .
|
|
.It Dv ALT_WRITE_TG_REG
|
|
Write to the requested register on the Tigon board. The argument is
|
|
.Va struct tg_reg .
|
|
.El
|
|
.Sh FILES
|
|
.Bl -tag -width /dev/ti[0-255] -compact
|
|
.It Pa /dev/ti[0-255]
|
|
Tigon driver character interface.
|
|
.Sh DIAGNOSTICS
|
|
.Bl -diag
|
|
.It "ti%d: couldn't map memory"
|
|
A fatal initialization error has occurred.
|
|
.It "ti%d: couldn't map interrupt"
|
|
A fatal initialization error has occurred.
|
|
.It "ti%d: no memory for softc struct!"
|
|
The driver failed to allocate memory for per-device instance information
|
|
during initialization.
|
|
.It "ti%d: failed to enable memory mapping!"
|
|
The driver failed to initialize PCI shared memory mapping.
|
|
This might
|
|
happen if the card is not in a bus-master slot.
|
|
.It "ti%d: no memory for jumbo buffers!"
|
|
The driver failed to allocate memory for jumbo frames during
|
|
initialization.
|
|
.It "ti%d: bios thinks we're in a 64 bit slot, but we aren't"
|
|
The BIOS has programmed the NIC as though it had been installed in
|
|
a 64-bit PCI slot, but in fact the NIC is in a 32-bit slot.
|
|
This happens
|
|
as a result of a bug in some BIOSes.
|
|
This can be worked around on the
|
|
Tigon II, but on the Tigon I initialization will fail.
|
|
.It "ti%d: board self-diagnostics failed!"
|
|
The ROMFAIL bit in the CPU state register was set after system
|
|
startup, indicating that the on-board NIC diagnostics failed.
|
|
.It "ti%d: unknown hwrev"
|
|
The driver detected a board with an unsupported hardware revision.
|
|
The
|
|
.Nm
|
|
driver supports revision 4 (Tigon 1) and revision 6 (Tigon 2) chips
|
|
and has firmware only for those devices.
|
|
.It "ti%d: watchdog timeout"
|
|
The device has stopped responding to the network, or there is a problem with
|
|
the network connection (cable).
|
|
.El
|
|
.Sh SEE ALSO
|
|
.Xr arp 4 ,
|
|
.Xr netintro 4 ,
|
|
.Xr ng_ether 4 ,
|
|
.Xr vlan 4 ,
|
|
.Xr ifconfig 8 ,
|
|
.Xr zero_copy 9 ,
|
|
.Xr jumbo 9
|
|
.Rs
|
|
.%T Alteon Gigabit Ethernet/PCI NIC manuals
|
|
.%O http://sanjose.alteon.com/open.shtml
|
|
.Re
|
|
.Sh HISTORY
|
|
The
|
|
.Nm
|
|
device driver first appeared in
|
|
.Fx 3.0 .
|
|
.Sh AUTHORS
|
|
The
|
|
.Nm
|
|
driver was written by
|
|
.An Bill Paul Aq wpaul@bsdi.com .
|
|
The header splitting firmware modifications, character ioctl interface and
|
|
debugging support were written by
|
|
.An Kenneth Merry Aq ken@FreeBSD.org .
|
|
Initial zero copy support was written by
|
|
.An Andrew Gallatin Aq gallatin@FreeBSD.org .
|