if_rge: initial import of if_rge driver from OpenBSD.

This is an initial import of the if_rge driver from OpenBSD
and adapted to FreeBSD.

Differential Revision:	https://reviews.freebsd.org/D54101
This commit is contained in:
Adrian Chadd
2025-12-05 21:26:30 -08:00
parent edd982b953
commit 4bf8ce037d
17 changed files with 19407 additions and 0 deletions
+1
View File
@@ -501,6 +501,7 @@ MAN= aac.4 \
random.4 \
rctl.4 \
re.4 \
rge.4 \
rgephy.4 \
rights.4 \
rl.4 \
+165
View File
@@ -0,0 +1,165 @@
.\"
.\" Copyright (c) 2025 Adrian Chadd <adrian@FreeBSD.org>
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.Dd December 12, 2025
.Dt RGE 4
.Os
.Sh NAME
.Nm rge
.Nd RealTek RTL8125/RTL8126/RTL8127/Killer E3000 PCIe Ethernet adapter driver
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device rge"
.Ed
.Pp
Alternatively, to load the driver as a
module at boot time, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
if_rge_load="YES"
.Ed
.Sh DESCRIPTION
The
.Nm
driver provides support for various NICs based on the RealTek RTL8125,
RTL8126 and RTL8127 PCIe Ethernet controllers.
.Pp
All of the NICs supported by this driver support 10, 100 and 1000Mbit
over CAT5 cable.
NICs based on the RTL8125 additionally support 2.5Gbit over CAT6 cable.
NICs based on the RTL8126 additionally support 2.5Gbit and 5Gbit over CAT6
cable.
NICs based on the RTL8127 additionally support 2.5Gbit, 5Gbit and 10Gbit
over CAT6 cable.
.Pp
All NICs supported by the
.Nm
driver have TCP/IP checksum offload and hardware VLAN tagging/insertion
features, and use a descriptor-based DMA mechanism.
They are also
capable of TCP large send (TCP segmentation offload).
.Pp
The RTL8125, RTL8126 and RTL8127 devices are single-chip solutions combining
both a MAC and PHY.
Standalone cards are available in 1x PCIe models.
.Pp
The RTL8125, RTL8126 and RTL8127 also support jumbo frames, which can be
configured via the interface MTU setting.
The MTU is limited to 9126.
Selecting an MTU larger than 1500 bytes with the
.Xr ifconfig 8
utility configures the adapter to receive and transmit jumbo frames.
.Pp
The
.Nm
driver supports the following media types:
.Bl -tag -width "10baseT/UTP"
.It Cm autoselect
Enable autoselection of the media type and options.
The user can manually override
the autoselected mode by adding media options to
.Xr rc.conf 5 .
.It Cm 10baseT/UTP
Set 10Mbps operation.
The
.Xr ifconfig 8
.Cm mediaopt
option can also be used to select either
.Cm full-duplex
or
.Cm half-duplex
modes.
.It Cm 100baseTX
Set 100Mbps (Fast Ethernet) operation.
The
.Xr ifconfig 8
.Cm mediaopt
option can also be used to select either
.Cm full-duplex
or
.Cm half-duplex
modes.
.It Cm 1000baseTX
Set 1000baseTX operation over twisted pair.
The RealTek gigE chips support 1000Mbps in
.Cm full-duplex
mode only.
.It Cm 2500baseTX
Set 2500baseTX operation over twisted pair.
The RealTek devices support 2.5Gbit in
.Cm full-duplex
mode only.
.It Cm 5000baseTX
Set 5000baseTX operation over twisted pair.
The RealTek devices support 5Gbit in
.Cm full-duplex
mode only.
.It Cm 10000baseTX
Set 10000baseTX operation over twisted pair.
The RealTek devices support 10Gbit in
.Cm full-duplex
mode only.
.El
.Pp
The
.Nm
driver supports the following media options:
.Bl -tag -width "full-duplex"
.It Cm full-duplex
Force full duplex operation.
.It Cm half-duplex
Force half duplex operation.
.El
.Pp
For more information on configuring this device, see
.Xr ifconfig 8 .
.Sh HARDWARE
The
.Nm
driver supports RealTek RTL8125, RTL8126, RTL8125 and Killer E3000 based
PCIe 1GB to 1GB Ethernet devices.
.Sh SYSCTL VARIABLES
The following variables are available as both
.Xr sysctl 8
variables and
.Xr loader 8
tunables:
.Bl -tag -width "xxxxxx"
.It Va dev.rge.%d.debug
Configure runtime debug output. This is a 32 bit bitmask.
.El
.Sh DIAGNOSTICS
.Bl -diag
.It "rge%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 altq 4 ,
.Xr arp 4 ,
.Xr miibus 4 ,
.Xr netintro 4 ,
.Xr ng_ether 4 ,
.Xr polling 4 ,
.Xr vlan 4 ,
.Xr ifconfig 8
.Rs
.%U https://www.realtek.com/
.Re
.Sh HISTORY
The
.Nm
device driver first appeared in
.Fx 16.0 .
.Sh AUTHORS
The
.Nm
driver was written by
.An Kevin Lo Aq Mt kevlo@openbsd.org
and ported to FreeBSD by
.An Adrian Chadd Aq Mt adrian@freebsd.org .