Make iflib a loadable module.

iflib is already a module, but it is unconditionally compiled into the
kernel.  There are drivers which do not need iflib(4), and there are
situations where somebody might not want iflib in kernel because of
using the corresponding driver as module.

Reviewed by:	marius
Discussed with:	erj
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D19041
This commit is contained in:
Konstantin Belousov 2019-01-31 19:05:56 +00:00
parent 37125720b9
commit c75f49f7d8
23 changed files with 75 additions and 31 deletions

View File

@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
20190131:
Iflib is no longer unconditionally compiled into the kernel. Drivers
using iflib and statically compiled into the kernel, now require
the 'device iflib' config option. For the same drivers loaded as
modules on kernels not having 'device iflib', the iflib.ko module
is loaded automatically.
20181230:
r342635 changes the way efibootmgr(8) works by requiring users to add
the -b (bootnum) parameter for commands where the bootnum was previously

View File

@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd September 20, 2018
.Dd January 30, 2019
.Dt BNXT 4
.Os
.Sh NAME
@ -36,6 +36,7 @@ To compile this driver into the kernel,
place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device iflib"
.Cd "device bnxt"
.Ed
.Pp

View File

@ -31,7 +31,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd September 20, 2018
.Dd January 30, 2019
.Dt EM 4
.Os
.Sh NAME
@ -39,9 +39,10 @@
.Nd "Intel(R) PRO/1000 Gigabit Ethernet adapter driver"
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following line in your
place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device iflib"
.Cd "device em"
.Ed
.Pp

View File

@ -31,7 +31,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd October 5, 2018
.Dd January 30, 2019
.Dt IAVF 4
.Os
.Sh NAME
@ -41,6 +41,7 @@
To compile this driver into the kernel, place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device iflib"
.Cd "device iavf"
.Ed
.Pp

View File

@ -31,7 +31,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd December 19, 2010
.Dd January 30, 2019
.Dt IXGBE 4
.Os
.Sh NAME
@ -39,9 +39,10 @@
.Nd "Intel(R) 10Gb Ethernet driver for the FreeBSD operating system"
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following line in your
place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device iflib"
.Cd "device ixgbe"
.Ed
.Pp

View File

@ -31,7 +31,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd October 5, 2018
.Dd January 30, 2019
.Dt IXL 4
.Os
.Sh NAME
@ -41,6 +41,7 @@
To compile this driver into the kernel, place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device iflib"
.Cd "device ixl"
.Ed
.Pp

View File

@ -17,7 +17,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd March 17, 2014
.Dd January 30, 2019
.Dt VMX 4
.Os
.Sh NAME
@ -25,9 +25,10 @@
.Nd VMware VMXNET3 Virtual Interface Controller device
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following line in your
place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device iflib"
.Cd "device vmx"
.Ed
.Pp

View File

@ -234,14 +234,18 @@ device ppi # Parallel port interface device
device puc # Multi I/O cards and multi-channel UARTs
# PCI Ethernet NICs.
device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE
device de # DEC/Intel DC21x4x (``Tulip'')
# PCI/PCI-X/PCIe Ethernet NICs that use iflib infrastructure
device iflib
device em # Intel PRO/1000 Gigabit Ethernet Family
device ix # Intel PRO/10GbE PCIE PF Ethernet
device ixv # Intel PRO/10GbE PCIE VF Ethernet
device ixl # Intel 700 Series Physical Function
device iavf # Intel Adaptive Virtual Function
device vmx # VMware VMXNET3 Ethernet
# PCI Ethernet NICs.
device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE
device de # DEC/Intel DC21x4x (``Tulip'')
device le # AMD Am7900 LANCE and Am79C9xx PCnet
device ti # Alteon Networks Tigon I/II gigabit Ethernet
device txp # 3Com 3cR990 (``Typhoon'')
@ -369,9 +373,6 @@ device hyperv # HyperV drivers
options XENHVM # Xen HVM kernel infrastructure
device xenpci # Xen HVM Hypervisor services driver
# VMware support
device vmx # VMware VMXNET3 Ethernet
# Netmap provides direct access to TX/RX rings on supported NICs
device netmap # netmap(4) support

View File

@ -145,14 +145,17 @@ device al_pci # Annapurna Alpine PCI-E
options PCI_HP # PCI-Express native HotPlug
options PCI_IOV # PCI SR-IOV support
# PCI/PCI-X/PCIe Ethernet NICs that use iflib infrastructure
device iflib
device em # Intel PRO/1000 Gigabit Ethernet Family
device ix # Intel 10Gb Ethernet Family
# Ethernet NICs
device mdio
device mii
device miibus # MII bus support
device awg # Allwinner EMAC Gigabit Ethernet
device axgbe # AMD Opteron A1100 integrated NIC
device em # Intel PRO/1000 Gigabit Ethernet Family
device ix # Intel 10Gb Ethernet Family
device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet
device neta # Marvell Armada 370/38x/XP/3700 NIC
device smc # SMSC LAN91C111

View File

@ -2092,15 +2092,18 @@ device vte # DM&P Vortex86 RDC R6040 Fast Ethernet
device wb # Winbond W89C840F
device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'')
# PCI/PCI-X/PCIe Ethernet NICs that use iflib infrastructure
device iflib
device em # Intel Pro/1000 Gigabit Ethernet
device ix # Intel Pro/10Gbe PCIE Ethernet
device ixv # Intel Pro/10Gbe PCIE Ethernet VF
# PCI Ethernet NICs.
device cxgb # Chelsio T3 10 Gigabit Ethernet
device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware
device cxgbe # Chelsio T4-T6 1/10/25/40/100 Gigabit Ethernet
device cxgbev # Chelsio T4-T6 Virtual Functions
device de # DEC/Intel DC21x4x (``Tulip'')
device em # Intel Pro/1000 Gigabit Ethernet
device ix # Intel Pro/10Gbe PCIE Ethernet
device ixv # Intel Pro/10Gbe PCIE Ethernet VF
device le # AMD Am7900 LANCE and Am79C9xx PCnet
device mxge # Myricom Myri-10G 10GbE NIC
device oce # Emulex 10 GbE (OneConnect Ethernet)

View File

@ -4132,10 +4132,10 @@ net/if_tun.c optional tun
net/if_tap.c optional tap
net/if_vlan.c optional vlan
net/if_vxlan.c optional vxlan inet | vxlan inet6
net/ifdi_if.m optional ether pci
net/iflib.c optional ether pci
net/iflib_clone.c optional ether pci
net/mp_ring.c optional ether
net/ifdi_if.m optional ether pci iflib
net/iflib.c optional ether pci iflib
net/iflib_clone.c optional ether pci iflib
net/mp_ring.c optional ether iflib
net/mppcc.c optional netgraph_mppc_compression
net/mppcd.c optional netgraph_mppc_compression
net/netisr.c standard

View File

@ -144,11 +144,9 @@ static driver_t ixv_driver = {
devclass_t ixv_devclass;
DRIVER_MODULE(ixv, pci, ixv_driver, ixv_devclass, 0, 0);
IFLIB_PNP_INFO(pci, ixv_driver, ixv_vendor_info_array);
MODULE_DEPEND(ixv, iflib, 1, 1, 1);
MODULE_DEPEND(ixv, pci, 1, 1, 1);
MODULE_DEPEND(ixv, ether, 1, 1, 1);
#ifdef DEV_NETMAP
MODULE_DEPEND(ixv, netmap, 1, 1, 1);
#endif /* DEV_NETMAP */
static device_method_t ixv_if_methods[] = {
DEVMETHOD(ifdi_attach_pre, ixv_if_attach_pre),

View File

@ -220,10 +220,14 @@ device ppi # Parallel port interface device
device puc # Multi I/O cards and multi-channel UARTs
# PCI/PCI-X/PCIe Ethernet NICs that use iflib infrastructure
device iflib
device em # Intel PRO/1000 Gigabit Ethernet Family
device vmx # VMware VMXNET3 Ethernet
# PCI Ethernet NICs.
device bxe # Broadcom NetXtreme II BCM5771X/BCM578XX 10GbE
device de # DEC/Intel DC21x4x (``Tulip'')
device em # Intel PRO/1000 Gigabit Ethernet Family
device le # AMD Am7900 LANCE and Am79C9xx PCnet
device ti # Alteon Networks Tigon I/II gigabit Ethernet
device txp # 3Com 3cR990 (``Typhoon'')
@ -362,9 +366,6 @@ device hyperv # HyperV drivers
options XENHVM # Xen HVM kernel infrastructure
device xenpci # Xen HVM Hypervisor services driver
# VMware support
device vmx # VMware VMXNET3 Ethernet
# evdev interface
options EVDEV_SUPPORT # evdev support in legacy drivers
device evdev # input event device support

View File

@ -155,6 +155,8 @@ device octm
# physical port, but may eventually provide support for DSA or similar instead.
#device mv88e61xxphy # Marvell 88E61XX
device iflib
# PCI Ethernet NICs.
device em # Intel PRO/1000 Gigabit Ethernet Family
device ix # Intel PRO/10GbE PF PCIE Ethernet Family

View File

@ -75,6 +75,7 @@ device ether
device xlpge
#device re
device msk
device iflib
device em
# Disks

View File

@ -169,6 +169,7 @@ SUBDIR= \
if_tun \
if_vlan \
if_vxlan \
iflib \
${_iir} \
imgact_binmisc \
${_intelspi} \

View File

@ -0,0 +1,13 @@
# $FreeBSD$
.PATH: ${SRCTOP}/sys/net
KMOD= iflib
SRCS= \
iflib.c \
iflib_clone.c \
mp_ring.c
SRCS+= ifdi_if.c
SRCS+= device_if.h bus_if.h pci_if.h ifdi_if.h
.include <bsd.kmod.mk>

View File

@ -159,6 +159,8 @@ device scc
device uart
device uart_z8530
device iflib
# Ethernet hardware
device em # Intel PRO/1000 Gigabit Ethernet Family
device ix # Intel PRO/10GbE PCIE PF Ethernet Family

View File

@ -74,6 +74,7 @@ device cryptodev
device da
device ds1307
device ds1553
device iflib
device em
device alc
device ether

View File

@ -74,6 +74,7 @@ device cryptodev
device da
device ds1307
device ds1553
device iflib
device em
device alc
device ether

View File

@ -81,6 +81,7 @@ device cryptodev
device da
device ds1307
device ds1553
device iflib
device em
device alc
device dpaa

View File

@ -74,6 +74,7 @@ device sdhci
# Network devices
device miibus # MII bus support
device iflib
device em

View File

@ -181,6 +181,8 @@ device uart # Multi-uart driver
#device ppi # Parallel port interface device
#device vpo # Requires scbus and da
device iflib
# PCI Ethernet NICs.
#device de # DEC/Intel DC21x4x (``Tulip'')
device em # Intel PRO/1000 adapter Gigabit Ethernet Card