Index: share/man/man4/em.4 =================================================================== --- share/man/man4/em.4 +++ share/man/man4/em.4 @@ -45,6 +45,16 @@ .Cd "device em" .Ed .Pp +Optional multiqueue support is available via the following kernel +compile options: +.Bd -ragged -offset indent +.Cd "options EM_MULTIQUEUE" +.Ed +.Pp +Note: Activating EM_MULTIQUEUE support with disable MSI-X features +by default. Until these issues are resolved, activing MSI-X will crash +your system with EM_MULTIQUEUE enabled. +.Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : @@ -197,6 +207,16 @@ prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent +.It Va hw.em.eee_setting +Disable or Enabled Energy Efficient Ethernet. Default 1 (disabled). +.It Va hw.em.msix +Enable or Disable MSI-X style interrupts. Default 1 (on) unless +.Cd "options EM_MULTIQUEUE" +is defined in which case Default 0 (off). +.It Va hw.em.smart_pwr_down +Enable or Disable smart power down features on newer adapters. Default 0 (off). +.It Va hw.em.sbp +Show bad packets when in promiscuous mode. Default 0 (off). .It Va hw.em.rxd Number of receive descriptors allocated by the driver. The default value is 1024 for adapters newer than 82547, @@ -228,6 +248,12 @@ .Va hw.em.tx_int_delay is non-zero, this tunable limits the maximum delay in which a transmit interrupt is generated. +.It Va hw.em.num_queues +Number of h/w queues that we will run on this adapter. Max 2. Defaults to 1. +Only valid with kernel configuration +.Cd "options EM_MULTIQUEUE". +Not compatible with +.Va hw.em.msix = 1 .El .Sh FILES .Bl -tag -width /dev/led/em* @@ -271,6 +297,9 @@ .Xr polling 4 , .Xr vlan 4 , .Xr ifconfig 8 +.Sh NOTES +Enabling EM_MULTIQUEUE in your kernel configuration will disable MSI-X by +default. At this time MSI-X support does not work with this option. .Sh HISTORY The .Nm Index: sys/conf/NOTES =================================================================== --- sys/conf/NOTES +++ sys/conf/NOTES @@ -2983,3 +2983,6 @@ # Module to enable execution of application via emulators like QEMU options IMAGACT_BINMISC + +# Intel em(4) driver +options EM_MULTIQUEUE # Activate multiqueue features/disable MSI Index: sys/conf/options =================================================================== --- sys/conf/options +++ sys/conf/options @@ -935,3 +935,6 @@ RANDOM_YARROW opt_random.h RANDOM_FORTUNA opt_random.h RANDOM_DEBUG opt_random.h + +# Intel em(4) driver +EM_MULTIQUEUE opt_em.h Index: sys/dev/e1000/if_em.c =================================================================== --- sys/dev/e1000/if_em.c +++ sys/dev/e1000/if_em.c @@ -32,6 +32,7 @@ ******************************************************************************/ /*$FreeBSD$*/ +#include "opt_em.h" #include "opt_inet.h" #include "opt_inet6.h" @@ -384,10 +385,25 @@ SYSCTL_INT(_hw_em, OID_AUTO, sbp, CTLFLAG_RDTUN, &em_debug_sbp, 0, "Show bad packets in promiscuous mode"); +#ifdef EM_MULTIQUEUE +static int em_enable_msix = FALSE; +#else static int em_enable_msix = TRUE; +#endif SYSCTL_INT(_hw_em, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &em_enable_msix, 0, "Enable MSI-X interrupts"); +#ifdef EM_MULTIQUEUE +/* +** This will autoconfigure based on the +** number of CPUs and max supported +** MSIX messages if left at 0. +*/ +static int em_num_queues = 0; +SYSCTL_INT(_hw_em, OID_AUTO, num_queues, CTLFLAG_RDTUN, &em_num_queues, 0, + "Number of queues to configure, 0 indicates autoconfigure"); +#endif + /* How many packets rxeof tries to clean at a time */ static int em_rx_process_limit = 100; SYSCTL_INT(_hw_em, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, @@ -2437,8 +2453,15 @@ rman_get_bushandle(adapter->memory); adapter->hw.hw_addr = (u8 *)&adapter->osdep.mem_bus_space_handle; +#ifdef EM_MULTIQUEUE + if (em_num_queues >= 2) + adapter->num_queues = 2; + else + adapter->num_queues = 1; +#else /* Default to a single queue */ adapter->num_queues = 1; +#endif /* * Setup MSI/X or MSI if PCI Express