xref: /freebsd/share/man/man4/ti.4 (revision 315ee00f)
1.\" Copyright (c) 1997, 1998, 1999
2.\"	Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by Bill Paul.
15.\" 4. Neither the name of the author nor the names of any co-contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"   without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
23.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
29.\" THE POSSIBILITY OF SUCH DAMAGE.
30.\"
31.Dd November 14, 2011
32.Dt TI 4
33.Os
34.Sh NAME
35.Nm ti
36.Nd "Alteon Networks Tigon I and Tigon II Gigabit Ethernet driver"
37.Sh SYNOPSIS
38To compile this driver into the kernel,
39place the following lines in your
40kernel configuration file:
41.Bd -ragged -offset indent
42.Cd "device ti"
43.Cd "options TI_SF_BUF_JUMBO"
44.Cd "options TI_JUMBO_HDRSPLIT"
45.Ed
46.Pp
47Alternatively, to load the driver as a
48module at boot time, place the following line in
49.Xr loader.conf 5 :
50.Bd -literal -offset indent
51if_ti_load="YES"
52.Ed
53.Sh DESCRIPTION
54The
55.Nm
56driver provides support for PCI Gigabit Ethernet adapters based on
57the Alteon Networks Tigon Gigabit Ethernet controller chip.
58The Tigon
59contains an embedded R4000 CPU, gigabit MAC, dual DMA channels and
60a PCI interface unit.
61The Tigon II contains two R4000 CPUs and other
62refinements.
63Either chip can be used in either a 32-bit or 64-bit PCI
64slot.
65Communication with the chip is achieved via PCI shared memory
66and bus master DMA.
67The Tigon I and II support hardware multicast
68address filtering, VLAN tag extraction and insertion, and jumbo
69Ethernet frames sizes up to 9000 bytes.
70Note that the Tigon I chipset
71is no longer in active production: all new adapters should come equipped
72with Tigon II chipsets.
73.Pp
74While the Tigon chipset supports 10, 100 and 1000Mbps speeds, support for
7510 and 100Mbps speeds is only available on boards with the proper
76transceivers.
77Most adapters are only designed to work at 1000Mbps,
78however the driver should support those NICs that work at lower speeds
79as well.
80.Pp
81Support for jumbo frames is provided via the interface MTU setting.
82Selecting an MTU larger than 1500 bytes with the
83.Xr ifconfig 8
84utility configures the adapter to receive and transmit jumbo frames.
85Using jumbo frames can greatly improve performance for certain tasks,
86such as file transfers and data streaming.
87.Pp
88Header splitting support for Tigon 2 boards (this option has no effect for
89the Tigon 1) can be turned on with the
90.Dv TI_JUMBO_HDRSPLIT
91option.
92See
93.Xr zero_copy 9
94for more discussion on zero copy receive and header splitting.
95.Pp
96The
97.Nm
98driver uses UMA backed jumbo receive buffers, but can be configured
99to use
100.Xr sendfile 2
101buffer allocator.
102To turn on
103.Xr sendfile 2
104buffer allocator, use the
105.Dv TI_SF_BUF_JUMBO
106option.
107.Pp
108Support for vlans is also available using the
109.Xr vlan 4
110mechanism.
111See the
112.Xr vlan 4
113man page for more details.
114.Pp
115The
116.Nm
117driver supports the following media types:
118.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
119.It autoselect
120Enable autoselection of the media type and options.
121The user can manually override
122the autoselected mode by adding media options to the
123.Pa /etc/rc.conf
124file.
125.It 10baseT/UTP
126Set 10Mbps operation.
127The
128.Ar mediaopt
129option can also be used to select either
130.Ar full-duplex
131or
132.Ar half-duplex
133modes.
134.It 100baseTX
135Set 100Mbps (Fast Ethernet) operation.
136The
137.Ar mediaopt
138option can also be used to select either
139.Ar full-duplex
140or
141.Ar half-duplex
142modes.
143.It 1000baseSX
144Set 1000Mbps (Gigabit Ethernet) operation.
145Only
146.Ar full-duplex
147mode is supported at this speed.
148.El
149.Pp
150The
151.Nm
152driver supports the following media options:
153.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
154.It full-duplex
155Force full-duplex operation.
156.It half-duplex
157Force half duplex operation.
158.El
159.Pp
160For more information on configuring this device, see
161.Xr ifconfig 8 .
162.Sh HARDWARE
163The
164.Nm
165driver supports Gigabit Ethernet adapters based on the
166Alteon Tigon I and II chips.
167The
168.Nm
169driver has been tested with the following adapters:
170.Pp
171.Bl -bullet -compact
172.It
1733Com 3c985-SX Gigabit Ethernet adapter (Tigon 1)
174.It
1753Com 3c985B-SX Gigabit Ethernet adapter (Tigon 2)
176.It
177Alteon AceNIC V Gigabit Ethernet adapter (1000baseSX)
178.It
179Alteon AceNIC V Gigabit Ethernet adapter (1000baseT)
180.It
181Digital EtherWORKS 1000SX PCI Gigabit adapter
182.It
183Netgear GA620 Gigabit Ethernet adapter (1000baseSX)
184.It
185Netgear GA620T Gigabit Ethernet adapter (1000baseT)
186.El
187.Pp
188The following adapters should also be supported but have
189not yet been tested:
190.Pp
191.Bl -bullet -compact
192.It
193Asante GigaNIX1000T Gigabit Ethernet adapter
194.It
195Asante PCI 1000BASE-SX Gigabit Ethernet adapter
196.It
197Farallon PN9000SX Gigabit Ethernet adapter
198.It
199NEC Gigabit Ethernet
200.It
201Silicon Graphics PCI Gigabit Ethernet adapter
202.El
203.Sh LOADER TUNABLES
204Tunables can be set at the
205.Xr loader 8
206prompt before booting the kernel or stored in
207.Xr loader.conf 5 .
208.Bl -tag -width "xxxxxx"
209.It Va hw.ti.%d.dac
210If this tunable is set to 0 it will disable DAC (Dual Address Cycle).
211The default value is 1 which means driver will use full 64bit
212DMA addressing.
213.El
214.Sh SYSCTL VARIABLES
215The following variables are available as both
216.Xr sysctl 8
217variables and
218.Xr loader 8
219tunables.
220The interface has to be brought down and up again before a
221change takes effect when any of the following tunables are
222changed.
223The one microsecond clock tick referenced below is a nominal
224time and the actual hardware may not provide granularity to
225this level.
226For example, on Tigon 2 (revision 6) cards with release 12.0
227the clock granularity is 5 microseconds.
228.Bl -tag -width "xxxxxx"
229.It Va dev.ti.%d.rx_coal_ticks
230This value, receive coalesced ticks, controls the number of clock
231ticks (of 1 microseconds each) that must elapse before the NIC DMAs
232the receive return producer pointer to the Host and generates an
233interrupt.
234This parameter works in conjunction with the rx_max_coal_bds,
235receive max coalesced BDs, tunable parameter.
236The NIC will return the receive return producer pointer to the Host
237when either of the thresholds is exceeded.
238A value of 0 means that this parameter is ignored and receive BDs
239will only be returned when the receive max coalesced BDs value is
240reached.
241The default value is 170.
242.It Va dev.ti.%d.rx_max_coal_bds
243This value, receive max coalesced BDs, controls the number of
244receive buffer descriptors that will be coalesced before the NIC
245updates the receive return ring producer index.
246If this value is set to 0 it will disable receive buffer descriptor
247coalescing.
248The default value is 64.
249.It Va dev.ti.%d.ti_tx_coal_ticks
250This value, send coalesced ticks, controls the number of clock
251ticks (of 1 microseconds each) that must elapse before the NIC DMAs
252the send consumer pointer to the Host and generates an interrupt.
253This parameter works in conjunction with the tx_max_coal_bds,
254send max coalesced BDs, tunable parameter.
255The NIC will return the send consumer pointer to the Host when
256either of the thresholds is exceeded.
257A value of 0 means that this parameter is ignored and send BDs will
258only be returned when the send max coalesced BDs value is reached.
259The default value is 2000.
260.It Va dev.ti.%d.tx_max_coal_bds
261This value, send max coalesced BDs, controls the number of send
262buffer descriptors that will be coalesced before the NIC updates
263the send consumer index.
264If this value is set to 0 it will disable send buffer descriptor
265coalescing.
266The default value is 32.
267.It Va dev.ti.%d.tx_buf_ratio
268This value controls the ratio of the remaining memory in the NIC
269that should be devoted to transmit buffer vs. receive buffer.
270The lower 7 bits are used to indicate the ratio in 1/64th increments.
271For example, setting this value to 16 will set the transmit buffer
272to 1/4 of the remaining buffer space.
273In no cases will the transmit or receive buffer be reduced below
27468 KB.
275For a 1 MB NIC the approximate total space for data buffers is
276800 KB.
277For a 512 KB NIC that number is 300 KB.
278The default value is 21.
279.It Va dev.ti.%d.stat_ticks
280The value, stat ticks, controls the number of clock ticks
281(of 1 microseconds each) that must elapse before the NIC DMAs
282the statistics block to the Host and generates a STATS_UPDATED
283event.
284If set to zero then statistics are never DMAed to the Host.
285It is recommended that this value be set to a high enough
286frequency to not mislead someone reading statistics refreshes.
287Several times a second is enough.
288The default value is 2000000 (2 seconds).
289.El
290.Sh IOCTLS
291In addition to the standard
292.Xr socket 2
293.Xr ioctl 2
294calls implemented by most network drivers, the
295.Nm
296driver also includes a character device interface that can be used for
297additional diagnostics, configuration and debugging.
298With this character
299device interface, and a specially patched version of
300.Xr gdb 1 Pq Pa ports/devel/gdb ,
301the user can
302debug firmware running on the Tigon board.
303.Pp
304These ioctls and their arguments are defined in the
305.In sys/tiio.h
306header file.
307.Bl -tag -width ".Dv ALT_WRITE_TG_MEM"
308.It Dv TIIOCGETSTATS
309Return card statistics DMAed from the card into kernel memory approximately
310every 2 seconds.
311(That time interval can be changed via the
312.Dv TIIOCSETPARAMS
313ioctl.)
314The argument is
315.Vt "struct ti_stats" .
316.It Dv TIIOCGETPARAMS
317Get various performance-related firmware parameters that largely affect how
318interrupts are coalesced.
319The argument is
320.Vt "struct ti_params" .
321.It Dv TIIOCSETPARAMS
322Set various performance-related firmware parameters that largely affect how
323interrupts are coalesced.
324The argument is
325.Vt "struct ti_params" .
326.It Dv TIIOCSETTRACE
327Tell the NIC to trace the requested types of information.
328The argument is
329.Vt ti_trace_type .
330.It Dv TIIOCGETTRACE
331Dump the trace buffer from the card.
332The argument is
333.Vt "struct ti_trace_buf" .
334.It Dv ALT_ATTACH
335This ioctl is used for compatibility with Alteon's Solaris driver.
336They apparently only have one character interface for debugging, so they have
337to tell it which Tigon instance they want to debug.
338This ioctl is a noop for
339.Fx .
340.It Dv ALT_READ_TG_MEM
341Read the requested memory region from the Tigon board.
342The argument is
343.Vt "struct tg_mem" .
344.It Dv ALT_WRITE_TG_MEM
345Write to the requested memory region on the Tigon board.
346The argument is
347.Vt "struct tg_mem" .
348.It Dv ALT_READ_TG_REG
349Read the requested register from the Tigon board.
350The argument is
351.Vt "struct tg_reg" .
352.It Dv ALT_WRITE_TG_REG
353Write to the requested register on the Tigon board.
354The argument is
355.Vt "struct tg_reg" .
356.El
357.Sh FILES
358.Bl -tag -width ".Pa /dev/ti[0-255]" -compact
359.It Pa /dev/ti[0-255]
360Tigon driver character interface.
361.El
362.Sh DIAGNOSTICS
363.Bl -diag
364.It "ti%d: couldn't map memory"
365A fatal initialization error has occurred.
366.It "ti%d: couldn't map interrupt"
367A fatal initialization error has occurred.
368.It "ti%d: no memory for softc struct!"
369The driver failed to allocate memory for per-device instance information
370during initialization.
371.It "ti%d: failed to enable memory mapping!"
372The driver failed to initialize PCI shared memory mapping.
373This might
374happen if the card is not in a bus-master slot.
375.It "ti%d: no memory for jumbo buffers!"
376The driver failed to allocate memory for jumbo frames during
377initialization.
378.It "ti%d: bios thinks we're in a 64 bit slot, but we aren't"
379The BIOS has programmed the NIC as though it had been installed in
380a 64-bit PCI slot, but in fact the NIC is in a 32-bit slot.
381This happens
382as a result of a bug in some BIOSes.
383This can be worked around on the
384Tigon II, but on the Tigon I initialization will fail.
385.It "ti%d: board self-diagnostics failed!"
386The ROMFAIL bit in the CPU state register was set after system
387startup, indicating that the on-board NIC diagnostics failed.
388.It "ti%d: unknown hwrev"
389The driver detected a board with an unsupported hardware revision.
390The
391.Nm
392driver supports revision 4 (Tigon 1) and revision 6 (Tigon 2) chips
393and has firmware only for those devices.
394.It "ti%d: watchdog timeout"
395The device has stopped responding to the network, or there is a problem with
396the network connection (cable).
397.El
398.Sh SEE ALSO
399.Xr sendfile 2 ,
400.Xr altq 4 ,
401.Xr arp 4 ,
402.Xr netintro 4 ,
403.Xr ng_ether 4 ,
404.Xr vlan 4 ,
405.Xr ifconfig 8 ,
406.Xr zero_copy 9
407.Sh HISTORY
408The
409.Nm
410device driver first appeared in
411.Fx 3.0 .
412.Sh AUTHORS
413.An -nosplit
414The
415.Nm
416driver was written by
417.An Bill Paul Aq Mt wpaul@bsdi.com .
418The header splitting firmware modifications, character
419.Xr ioctl 2
420interface and debugging support were written by
421.An Kenneth Merry Aq Mt ken@FreeBSD.org .
422Initial zero copy support was written by
423.An Andrew Gallatin Aq Mt gallatin@FreeBSD.org .
424