Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/e1000/if_igb.c
Show First 20 Lines • Show All 2,454 Lines • ▼ Show 20 Lines | |||||
**********************************************************************/ | **********************************************************************/ | ||||
static int | static int | ||||
igb_allocate_msix(struct adapter *adapter) | igb_allocate_msix(struct adapter *adapter) | ||||
{ | { | ||||
device_t dev = adapter->dev; | device_t dev = adapter->dev; | ||||
struct igb_queue *que = adapter->queues; | struct igb_queue *que = adapter->queues; | ||||
int error, rid, vector = 0; | int error, rid, vector = 0; | ||||
int cpu_id = 0; | int cpu_id = 0; | ||||
#ifdef RSS | |||||
cpuset_t cpu_mask; | |||||
#endif | |||||
/* Be sure to start with all interrupts disabled */ | /* Be sure to start with all interrupts disabled */ | ||||
E1000_WRITE_REG(&adapter->hw, E1000_IMC, ~0); | E1000_WRITE_REG(&adapter->hw, E1000_IMC, ~0); | ||||
E1000_WRITE_FLUSH(&adapter->hw); | E1000_WRITE_FLUSH(&adapter->hw); | ||||
#ifdef RSS | #ifdef RSS | ||||
/* | /* | ||||
* If we're doing RSS, the number of queues needs to | * If we're doing RSS, the number of queues needs to | ||||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | if (adapter->num_queues > 1) { | ||||
/* | /* | ||||
* Only pin the taskqueue thread to a CPU if | * Only pin the taskqueue thread to a CPU if | ||||
* RSS is in use. | * RSS is in use. | ||||
* | * | ||||
* This again just happens to match the default RSS | * This again just happens to match the default RSS | ||||
* round-robin bucket -> queue -> CPU allocation. | * round-robin bucket -> queue -> CPU allocation. | ||||
*/ | */ | ||||
#ifdef RSS | #ifdef RSS | ||||
taskqueue_start_threads_pinned(&que->tq, 1, PI_NET, | CPU_ZERO(&cpu_mask); | ||||
cpu_id, | CPU_SET(cpu_id, &cpu_mask); | ||||
taskqueue_start_threads_cpuset(&que->tq, 1, PI_NET, | |||||
&cpu_mask, | |||||
"%s que (bucket %d)", | "%s que (bucket %d)", | ||||
device_get_nameunit(adapter->dev), | device_get_nameunit(adapter->dev), | ||||
cpu_id); | cpu_id); | ||||
#else | #else | ||||
taskqueue_start_threads(&que->tq, 1, PI_NET, | taskqueue_start_threads(&que->tq, 1, PI_NET, | ||||
"%s que (qid %d)", | "%s que (qid %d)", | ||||
device_get_nameunit(adapter->dev), | device_get_nameunit(adapter->dev), | ||||
cpu_id); | cpu_id); | ||||
▲ Show 20 Lines • Show All 3,804 Lines • Show Last 20 Lines |