GENET(4)

πŸ“¦
version 15.1 Β· 3 versions
, in freebsd 14.5, freebsd 15.1

Okay so bestie, let's talk about GENET(4)β€”that's the manpage from the Kernel Interfaces Manual all about this iconic driver. It's giving Raspberry Pi 4 Ethernet realness, and I'm obsessed. πŸ’…βœ¨


πŸ’– NAME πŸ’–

genet β€” the Raspberry Pi 4 / BCM2711 Gigabit Ethernet controller driver, aka your fave networking bestie for that sweet, sweet wired connection. 🫢


✨ SYNOPSIS ✨

Okay so first, to compile this driver into the kernel, you gotta drop these lines into your kernel configuration file:

To compile this driver into the kernel, place the following lines in the
kernel configuration file:

      device miibus
      device genet

No cap, that's literally it. πŸ’β€β™€οΈ


🌸 DESCRIPTION 🌸

So like, the genet driver is the main character for the BCM2711 Ethernet controllerβ€”you know, the one that lives on the Raspberry Pi 4. It's literally made for it. πŸ‘‘

Here's what's supported in the genet driver in FreeBSD, bestie:

  • IP/TCP/UDP checksum offload for IPv4 and IPv6 πŸ”₯
  • 10/100/1000Mbps operation in full-duplex mode πŸ’¨
  • 10/100Mbps operation in half-duplex mode 🐒
Okay but listen: the operation of transmit checksum offload is coupled for IPv4 and IPv6. So if you wanna disable it, you gotta disable bothβ€”even if you're not using both address families. It's giving package deal, iykyk. πŸ’€

The genet driver supports these media types, and they're all valid:

  • autoselect β€” Enables autoselection of the media type and options. The user can manually override the autoselected mode by adding media options to rc.conf(5). So convenient, honestly. ✨
  • 10baseT/UTP β€” Sets 10Mbps operation. The ifconfig(8) mediaopt option can also be used to select either full-duplex or half-duplex modes. Old school but still slaying. πŸ’–
  • 100baseTX β€” Sets 100Mbps (Fast Ethernet) operation. The ifconfig(8) mediaopt option can also be used to select either full-duplex or half-duplex modes. Fast-ish and cute. πŸ¦‹
  • 1000baseT β€” Sets 1000baseT operation over twisted pair. Only full-duplex mode is supported. Like, don't even try half-duplex here, it's not the vibe. πŸ‘‘

The genet driver also supports these media options, which you set with the mediaopt option to the ifconfig(8) command:

  • full-duplex β€” Forces full duplex operation. All the speed, all the time. πŸ’¨
  • half-duplex β€” Forces half duplex operation. Sharing is caring, I guess. 🫢

For more info on configuring this device, just peek at ifconfig(8). It's got you. πŸ’…


πŸŽ€ HARDWARE πŸŽ€

The genet driver supports the Ethernet controller portion of the Broadcom BCM2711 on the Raspberry Pi 4 Model B and related systems. It utilizes the BCM54213PE PHY. So like, that's the specific chip combo it's vibing with, and it works perfectly. No cap. 🌈


🌟 LOADER TUNABLES 🌟

Bestie, you can set these tunables at the loader(8) prompt before booting the kernel, or you can stash them in loader.conf(5). The following loader tunable variable is available, and it's also available as a read-only sysctl(8) variable:

  • hw.genet.rx_batch β€” The maximum number of packets to pass to the link-layer input routine at one time. The default is 16. So like, it batches up to 16 packets at once, which is a whole vibe. πŸ“¦βœ¨

πŸ¦‹ SYSCTL VARIABLES πŸ¦‹

The following variable is available as a sysctl(8) variable:

  • hw.genet.tx_hdr_min β€” When the driver is given an output packet in a buffer chain in which the first buffer contains only the Ethernet header, this is the number of bytes of the packet to add to the Ethernet header in the first buffer.
Warning, bestie: certain packets may be lost if this value is too small. The default value is 56, and is sufficient for the observed cases to date. So like, don't go messing with it unless you know what you're doing. πŸ’€πŸ™ˆ

πŸ’€ DIAGNOSTICS πŸ’€

Okay so normally, the genet driver has no diagnostics that are likely in normal operationβ€”it's lowkey chill. But when the debug option is set with ifconfig(8), most failures that cause packet loss in the transmit and receive paths cause a cryptic diagnostic message naming the failure. These messages generally make sense only when looking at the driver source. So like, they're giving "you had to be there" energy. 😭


πŸ”₯ SEE ALSO πŸ”₯

All the essentials, bestie. Go read them if you're curious. πŸ“šβœ¨


🌈 HISTORY 🌈

The genet device driver first appeared in FreeBSD 13.0. So it's a relatively new icon, and it's been slaying ever since. πŸ‘‘


πŸ’œ AUTHORS πŸ’œ

The genet driver was written by Mike Karels <karels@freebsd.org>. Portions are derived from the bcmgenet driver in NetBSD by Jared McNeill, and parts of the structure and common code are from the awg driver for the Allwinner EMAC by Jared McNeill. We stan these legends. 🫢🌸


This page is from Debian, December 8, 2021, and it's all about GENET(4). Catch you on the flip side, bestie. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from