Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/e1000/if_em.c
Show All 26 Lines | /****************************************************************************** | ||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||||
POSSIBILITY OF SUCH DAMAGE. | POSSIBILITY OF SUCH DAMAGE. | ||||
******************************************************************************/ | ******************************************************************************/ | ||||
/*$FreeBSD$*/ | /*$FreeBSD$*/ | ||||
#include "opt_em.h" | |||||
#include "opt_inet.h" | #include "opt_inet.h" | ||||
#include "opt_inet6.h" | #include "opt_inet6.h" | ||||
#ifdef HAVE_KERNEL_OPTION_HEADERS | #ifdef HAVE_KERNEL_OPTION_HEADERS | ||||
#include "opt_device_polling.h" | #include "opt_device_polling.h" | ||||
#endif | #endif | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
▲ Show 20 Lines • Show All 336 Lines • ▼ Show 20 Lines | |||||
SYSCTL_INT(_hw_em, OID_AUTO, smart_pwr_down, CTLFLAG_RDTUN, &em_smart_pwr_down, | SYSCTL_INT(_hw_em, OID_AUTO, smart_pwr_down, CTLFLAG_RDTUN, &em_smart_pwr_down, | ||||
0, "Set to true to leave smart power down enabled on newer adapters"); | 0, "Set to true to leave smart power down enabled on newer adapters"); | ||||
/* Controls whether promiscuous also shows bad packets */ | /* Controls whether promiscuous also shows bad packets */ | ||||
static int em_debug_sbp = FALSE; | static int em_debug_sbp = FALSE; | ||||
SYSCTL_INT(_hw_em, OID_AUTO, sbp, CTLFLAG_RDTUN, &em_debug_sbp, 0, | SYSCTL_INT(_hw_em, OID_AUTO, sbp, CTLFLAG_RDTUN, &em_debug_sbp, 0, | ||||
"Show bad packets in promiscuous mode"); | "Show bad packets in promiscuous mode"); | ||||
#ifdef EM_MULTIQUEUE | |||||
static int em_enable_msix = FALSE; | |||||
#else | |||||
static int em_enable_msix = TRUE; | static int em_enable_msix = TRUE; | ||||
#endif | |||||
SYSCTL_INT(_hw_em, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &em_enable_msix, 0, | SYSCTL_INT(_hw_em, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &em_enable_msix, 0, | ||||
"Enable MSI-X interrupts"); | "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 */ | /* How many packets rxeof tries to clean at a time */ | ||||
static int em_rx_process_limit = 100; | static int em_rx_process_limit = 100; | ||||
SYSCTL_INT(_hw_em, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, | SYSCTL_INT(_hw_em, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, | ||||
&em_rx_process_limit, 0, | &em_rx_process_limit, 0, | ||||
"Maximum number of received packets to process " | "Maximum number of received packets to process " | ||||
"at a time, -1 means unlimited"); | "at a time, -1 means unlimited"); | ||||
/* Energy efficient ethernet - default to OFF */ | /* Energy efficient ethernet - default to OFF */ | ||||
▲ Show 20 Lines • Show All 2,033 Lines • ▼ Show 20 Lines | if (adapter->memory == NULL) { | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
adapter->osdep.mem_bus_space_tag = | adapter->osdep.mem_bus_space_tag = | ||||
rman_get_bustag(adapter->memory); | rman_get_bustag(adapter->memory); | ||||
adapter->osdep.mem_bus_space_handle = | adapter->osdep.mem_bus_space_handle = | ||||
rman_get_bushandle(adapter->memory); | rman_get_bushandle(adapter->memory); | ||||
adapter->hw.hw_addr = (u8 *)&adapter->osdep.mem_bus_space_handle; | 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 */ | /* Default to a single queue */ | ||||
adapter->num_queues = 1; | adapter->num_queues = 1; | ||||
#endif | |||||
/* | /* | ||||
* Setup MSI/X or MSI if PCI Express | * Setup MSI/X or MSI if PCI Express | ||||
*/ | */ | ||||
adapter->msix = em_setup_msix(adapter); | adapter->msix = em_setup_msix(adapter); | ||||
adapter->hw.back = &adapter->osdep; | adapter->hw.back = &adapter->osdep; | ||||
▲ Show 20 Lines • Show All 3,322 Lines • Show Last 20 Lines |