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