TI(4)

πŸ’– TI(4) β€” Kernel Interfaces Manual πŸ’–

okay bestie, sit down, hydrate, because we're about to talk about the ti driver β€” that's the Alteon Networks Tigon I and Tigon II Gigabit Ethernet driver β€” and she is lowkey a legend. this is page 4 of the kernel interfaces manual, and yes she's long, but she's worth it. periodt. ✨


🌸 NAME 🌸

ti β€” the Alteon Networks Tigon I and Tigon II Gigabit Ethernet driver. that's her. that's the whole name. iconic. πŸ’…


✨ SYNOPSIS ✨

so if you wanna bake this driver into the kernel (main character move, no modules, just vibes), you drop these lines into your kernel configuration file:

device ti
options TI_SF_BUF_JUMBO
options TI_JUMBO_HDRSPLIT

or β€” and this is the low-effort slay β€” you can just load her as a module at boot time instead. for that, put this line in loader.conf(5):

if_ti_load="YES"

literally that's it. two paths, both valid, pick your fighter. πŸ¦‹


πŸŽ€ DESCRIPTION πŸŽ€

okay so the ti driver provides support for PCI Gigabit Ethernet adapters based on the Alteon Networks Tigon Gigabit Ethernet controller chip. and let me tell you what's inside that chip because she is PACKED: the Tigon contains an embedded R4000 CPU, a gigabit MAC, dual DMA channels and a PCI interface unit. it's giving tiny computer living inside your network card. 🧚

the Tigon II contains two R4000 CPUs plus other refinements β€” she upgraded, she leveled up, she ate. and here's the cute part: either chip can be used in either a 32-bit or 64-bit PCI slot. no gatekeeping. 🌈

communication with the chip happens via PCI shared memory and bus master DMA.

the Tigon I and II support:

  • hardware multicast address filtering
  • VLAN tag extraction and insertion
  • jumbo Ethernet frames sizes up to 9000 bytes
ngl, heads up: the Tigon I chipset is no longer in active production. all new adapters should come equipped with Tigon II chipsets. so like… if you're out here buying new hardware, get the II. the I is retired, she's resting. 😭

now β€” the Tigon chipset supports 10, 100 and 1000Mbps speeds, but support for the 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. so like, no promises, but she's trying her best fr fr. 🫢

πŸ¦‹ Jumbo Frames πŸ¦‹

support for jumbo frames is provided via the interface MTU setting. if you select an MTU larger than 1500 bytes with the ifconfig(8) utility, that configures the adapter to receive and transmit jumbo frames. and using jumbo frames can greatly improve performance for certain tasks, such as file transfers and data streaming. it's giving efficiency. it's giving throughput. πŸ’–

πŸ’œ Header Splitting πŸ’œ

header splitting support for Tigon 2 boards (and bestie, note this: this option has no effect for the Tigon 1) can be turned on with the TI_JUMBO_HDRSPLIT option. see zero_copy(9) for more discussion on zero copy receive and header splitting. iykyk. ✨

πŸ“ Buffer Allocator Tea πŸ“

the ti driver uses UMA backed jumbo receive buffers, but can be configured to use the sendfile(2) buffer allocator. to turn on the sendfile(2) buffer allocator, use the TI_SF_BUF_JUMBO option. 🌸

🌈 VLANs 🌈

support for vlans is also available using the vlan(4) mechanism. see the vlan(4) man page for more details β€” she has her own whole page, go read her. πŸ’…


πŸ‘‘ Media Types πŸ‘‘

the ti driver supports the following media types:

  • autoselect β€” enable autoselection of the media type and options. the user can manually override the autoselected mode by adding media options to the /etc/rc.conf file. she picks for you, but you can overrule her, you're the main character. ✨
  • 10baseT/UTP β€” set 10Mbps operation. the mediaopt option can also be used to select either full-duplex or half-duplex modes.
  • 100baseTX β€” set 100Mbps (Fast Ethernet) operation. the mediaopt option can also be used to select either full-duplex or half-duplex modes.
  • 1000baseSX β€” set 1000Mbps (Gigabit Ethernet) operation. only full-duplex mode is supported at this speed. no half-duplex at gigabit, that's just the rules bestie. πŸ’€

πŸŽ€ Media Options πŸŽ€

the ti driver supports the following media options:

  • full-duplex β€” force full-duplex operation. πŸ’ͺ
  • half-duplex β€” force half duplex operation. 🀝

for more information on configuring this device, see ifconfig(8).


πŸ¦‹ HARDWARE πŸ¦‹

the ti driver supports Gigabit Ethernet adapters based on the Alteon Tigon I and II chips. the ti driver has been tested with the following adapters:

  • 3Com 3c985-SX Gigabit Ethernet adapter (Tigon 1)
  • 3Com 3c985B-SX Gigabit Ethernet adapter (Tigon 2)
  • Alteon AceNIC V Gigabit Ethernet adapter (1000baseSX)
  • Alteon AceNIC V Gigabit Ethernet adapter (1000baseT)
  • Digital EtherWORKS 1000SX PCI Gigabit adapter
  • Netgear GA620 Gigabit Ethernet adapter (1000baseSX)
  • Netgear GA620T Gigabit Ethernet adapter (1000baseT)

the following adapters should also be supported but have not yet been tested β€” so like, they're invited to the party, we just haven't met them yet:

  • Asante GigaNIX1000T Gigabit Ethernet adapter
  • Asante PCI 1000BASE-SX Gigabit Ethernet adapter
  • Farallon PN9000SX Gigabit Ethernet adapter
  • NEC Gigabit Ethernet
  • Silicon Graphics PCI Gigabit Ethernet adapter

⭐ LOADER TUNABLES ⭐

tunables can be set at the loader(8) prompt before booting the kernel, or stored in loader.conf(5). your choice, both slay. πŸ’…

  • hw.ti.%d.dac β€” if this tunable is set to 0 it will disable DAC (Dual Address Cycle). the default value is 1, which means the driver will use full 64bit DMA addressing. so 1 = full send, 0 = dial it back. 🌈

πŸ’– SYSCTL VARIABLES πŸ’–

the following variables are available as both sysctl(8) variables and loader(8) tunables. 🌸

okay important bestie: the interface has to be brought down and up again before a change takes effect when any of the following tunables are changed. don't forget the lil reset dance. πŸ”„

also, the one microsecond clock tick referenced below is a nominal time and the actual hardware may not provide granularity to this level. for example, on Tigon 2 (revision 6) cards with release 12.0 the clock granularity is 5 microseconds. so like, "one microsecond" is aspirational. 😭

  • dev.ti.%d.rx_coal_ticks β€” this value, receive coalesced ticks, controls the number of clock ticks (of 1 microsecond each) that must elapse before the NIC DMAs the receive return producer pointer to the Host and generates an interrupt. this parameter works in conjunction with the rx_max_coal_bds, receive max coalesced BDs, tunable parameter. the NIC will return the receive return producer pointer to the Host when either of the thresholds is exceeded. a value of 0 means that this parameter is ignored and receive BDs will only be returned when the receive max coalesced BDs value is reached. the default value is 170. ✨
  • dev.ti.%d.rx_max_coal_bds β€” this value, receive max coalesced BDs, controls the number of receive buffer descriptors that will be coalesced before the NIC updates the receive return ring producer index. if this value is set to 0 it will disable receive buffer descriptor coalescing. the default value is 64. πŸ¦‹
  • dev.ti.%d.ti_tx_coal_ticks β€” this value, send coalesced ticks, controls the number of clock ticks (of 1 microsecond each) that must elapse before the NIC DMAs the send consumer pointer to the Host and generates an interrupt. this parameter works in conjunction with the tx_max_coal_bds, send max coalesced BDs, tunable parameter. the NIC will return the send consumer pointer to the Host when either of the thresholds is exceeded. a value of 0 means that this parameter is ignored and send BDs will only be returned when the send max coalesced BDs value is reached. the default value is 2000. πŸ’œ
  • dev.ti.%d.tx_max_coal_bds β€” this value, send max coalesced BDs, controls the number of send buffer descriptors that will be coalesced before the NIC updates the send consumer index. if this value is set to 0 it will disable send buffer descriptor coalescing. the default value is 32. πŸ“
  • dev.ti.%d.tx_buf_ratio β€” this value controls the ratio of the remaining memory in the NIC that should be devoted to transmit buffer vs. receive buffer. the lower 7 bits are used to indicate the ratio in 1/64th increments. for example, setting this value to 16 will set the transmit buffer to 1/4 of the remaining buffer space. in no cases will the transmit or receive buffer be reduced below 68 KB. for a 1 MB NIC the approximate total space for data buffers is 800 KB. for a 512 KB NIC that number is 300 KB. the default value is 21. math bestie, it's giving math. 🧚
  • dev.ti.%d.stat_ticks β€” the value, stat ticks, controls the number of clock ticks (of 1 microsecond each) that must elapse before the NIC DMAs the statistics block to the Host and generates a STATS_UPDATED event. if set to zero then statistics are never DMAed to the Host. it is recommended that this value be set to a high enough frequency to not mislead someone reading statistics refreshes. several times a second is enough. the default value is 2000000 (2 seconds). πŸ‘‘

🌈 IOCTLS 🌈

in addition to the standard socket(2) ioctl(2) calls implemented by most network drivers, the ti driver also includes a character device interface that can be used for additional diagnostics, configuration and debugging. and bestie, here's the iconic part: with this character device interface, and a specially patched version of gdb(1), the user can debug firmware running on the Tigon board. like, you can literally debug the little computer inside your network card. that's so main character. πŸ’…βœ¨

these ioctls and their arguments are defined in the <sys/tiio.h> header file.

  • TIIOCGETSTATS β€” return card statistics DMAed from the card into kernel memory approximately every 2 seconds. (that time interval can be changed via the TIIOCSETPARAMS ioctl.) the argument is struct ti_stats. πŸ“Š
  • TIIOCGETPARAMS β€” get various performance-related firmware parameters that largely affect how interrupts are coalesced. the argument is struct ti_params.
  • TIIOCSETPARAMS β€” set various performance-related firmware parameters that largely affect how interrupts are coalesced. the argument is struct ti_params.
  • TIIOCSETTRACE β€” tell the NIC to trace the requested types of information. the argument is ti_trace_type. πŸ”
  • TIIOCGETTRACE β€” dump the trace buffer from the card. the argument is struct ti_trace_buf.
  • ALT_ATTACH β€” this ioctl is used for compatibility with Alteon's Solaris driver. they apparently 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. πŸ’€ (she's just here for the vibes)
  • ALT_READ_TG_MEM β€” read the requested memory region from the Tigon board. the argument is struct tg_mem.
  • ALT_WRITE_TG_MEM β€” write to the requested memory region on the Tigon board. the argument is struct tg_mem.
  • ALT_READ_TG_REG β€” read the requested register from the Tigon board. the argument is struct tg_reg.
  • ALT_WRITE_TG_REG β€” write to the requested register on the Tigon board. the argument is struct tg_reg.

πŸŽ€ FILES πŸŽ€

  • /dev/ti[0-255] β€” Tigon driver character interface. that's the lil doorway to the card. πŸšͺ✨

πŸ’€ DIAGNOSTICS πŸ’€

okay bestie, this is the part where the driver is basically yelling at you in the group chat. every single one of these messages means something and you're gonna know what. no cap.

  • ti%d: couldn't map memory β€” fatal initialization error, bestie. like, the driver literally could not do the memory mapping thing. it's over. 😭
  • ti%d: couldn't map interrupt β€” also a fatal initialization error. the interrupt mapping said "not today." πŸ’€
  • ti%d: no memory for softc struct! β€” the driver tried to grab memory for per-device instance info during initialization and… got nothing. allocation said no. πŸ™ˆ
  • ti%d: failed to enable memory mapping! β€” the driver failed to initialize the PCI shared memory mapping. this might happen if the card is not in a bus-master slot β€” so like, check your slot situation, bestie, that's giving physical-layer problem. πŸ’…
  • ti%d: no memory for jumbo buffers! β€” tried to allocate memory for jumbo frames during initialization. no memory. no jumbo. tragic. πŸ“
  • ti%d: bios thinks we're in a 64 bit slot, but we aren't β€” okay this one is so messy of the BIOS. the BIOS programmed the NIC as though it had been installed in a 64-bit PCI slot, but the NIC is actually in a 32-bit slot. it happens because of a bug in some BIOSes. on the Tigon II this can be worked around, but on the Tigon I initialization will fail. iconic BIOS behavior. πŸ™„
  • ti%d: board self-diagnostics failed! β€” the ROMFAIL bit in the CPU state register was set after system startup, which means the on-board NIC diagnostics failed. it's not giving healthy. πŸ’€
  • ti%d: unknown hwrev β€” the driver found a board with an unsupported hardware revision. for the record, the ti driver supports revision 4 (Tigon 1) and revision 6 (Tigon 2) chips, and has firmware only for those devices. anything else? not invited to the party. 🚫
  • ti%d: watchdog timeout β€” the device stopped responding to the network, or there's a problem with the network connection (cable). check the cable first, bestie, it's always the cable. πŸ”Œ

πŸ‘€ SEE ALSO πŸ‘€

go read these, they're all part of the lore:


πŸ“œ HISTORY πŸ“œ

the ti device driver first appeared in FreeBSD 3.0. ancient. legendary. a true OG. πŸ‘‘


🫢 AUTHORS 🫢

  • the ti driver was written by Bill Paul <wpaul@bsdi.com>
  • the header splitting firmware modifications, the character ioctl(2) interface, and the debugging support were written by Kenneth Merry <ken@FreeBSD.org>
  • the initial zero copy support was written by Andrew Gallatin <gallatin@FreeBSD.org>

and that's the whole page, bestie!! πŸ’–βœ¨ you made it to the end, which is honestly main character energy. this one shipped with Debian, dated November 14, 2011, and it lives in the TI(4) manual page. go forth and slay your network config. πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from