Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixl/if_ixl.c
Show First 20 Lines • Show All 1,985 Lines • ▼ Show 20 Lines | taskqueue_start_threads(&pf->tq, 1, PI_NET, "%s adminq", | ||||
device_get_nameunit(dev)); | device_get_nameunit(dev)); | ||||
return (0); | return (0); | ||||
} | } | ||||
static void | static void | ||||
ixl_init_taskqueues(struct ixl_pf *pf) | ixl_init_taskqueues(struct ixl_pf *pf) | ||||
{ | { | ||||
struct ixl_vsi *vsi = &pf->vsi; | struct ixl_vsi *vsi = &pf->vsi; | ||||
struct ixl_queue *que = vsi->queues; | struct ixl_queue *que = vsi->queues; | ||||
device_t dev = pf->dev; | device_t dev = pf->dev; | ||||
#ifdef RSS | |||||
int cpu_id; | |||||
cpuset_t cpu_mask; | |||||
#endif | |||||
/* Tasklet for Admin Queue */ | /* Tasklet for Admin Queue */ | ||||
TASK_INIT(&pf->adminq, 0, ixl_do_adminq, pf); | TASK_INIT(&pf->adminq, 0, ixl_do_adminq, pf); | ||||
#ifdef PCI_IOV | #ifdef PCI_IOV | ||||
/* VFLR Tasklet */ | /* VFLR Tasklet */ | ||||
TASK_INIT(&pf->vflr_task, 0, ixl_handle_vflr, pf); | TASK_INIT(&pf->vflr_task, 0, ixl_handle_vflr, pf); | ||||
#endif | #endif | ||||
/* Create and start PF taskqueue */ | /* Create and start PF taskqueue */ | ||||
pf->tq = taskqueue_create_fast("ixl_adm", M_NOWAIT, | pf->tq = taskqueue_create_fast("ixl_adm", M_NOWAIT, | ||||
taskqueue_thread_enqueue, &pf->tq); | taskqueue_thread_enqueue, &pf->tq); | ||||
taskqueue_start_threads(&pf->tq, 1, PI_NET, "%s adminq", | taskqueue_start_threads(&pf->tq, 1, PI_NET, "%s adminq", | ||||
device_get_nameunit(dev)); | device_get_nameunit(dev)); | ||||
/* Create queue tasks and start queue taskqueues */ | /* Create queue tasks and start queue taskqueues */ | ||||
for (int i = 0; i < vsi->num_queues; i++, que++) { | for (int i = 0; i < vsi->num_queues; i++, que++) { | ||||
TASK_INIT(&que->tx_task, 0, ixl_deferred_mq_start, que); | TASK_INIT(&que->tx_task, 0, ixl_deferred_mq_start, que); | ||||
TASK_INIT(&que->task, 0, ixl_handle_que, que); | TASK_INIT(&que->task, 0, ixl_handle_que, que); | ||||
que->tq = taskqueue_create_fast("ixl_que", M_NOWAIT, | que->tq = taskqueue_create_fast("ixl_que", M_NOWAIT, | ||||
taskqueue_thread_enqueue, &que->tq); | taskqueue_thread_enqueue, &que->tq); | ||||
#ifdef RSS | #ifdef RSS | ||||
cpu_id = rss_getcpu(i % rss_getnumbuckets()); | |||||
CPU_SETOF(cpu_id, &cpu_mask); | CPU_SETOF(cpu_id, &cpu_mask); | ||||
taskqueue_start_threads_cpuset(&que->tq, 1, PI_NET, | taskqueue_start_threads_cpuset(&que->tq, 1, PI_NET, | ||||
&cpu_mask, "%s (bucket %d)", | &cpu_mask, "%s (bucket %d)", | ||||
device_get_nameunit(dev), cpu_id); | device_get_nameunit(dev), cpu_id); | ||||
#else | #else | ||||
taskqueue_start_threads(&que->tq, 1, PI_NET, | taskqueue_start_threads(&que->tq, 1, PI_NET, | ||||
"%s (que %d)", device_get_nameunit(dev), que->me); | "%s (que %d)", device_get_nameunit(dev), que->me); | ||||
#endif | #endif | ||||
} | } | ||||
} | } | ||||
static void | static void | ||||
ixl_free_taskqueues(struct ixl_pf *pf) | ixl_free_taskqueues(struct ixl_pf *pf) | ||||
{ | { | ||||
struct ixl_vsi *vsi = &pf->vsi; | struct ixl_vsi *vsi = &pf->vsi; | ||||
struct ixl_queue *que = vsi->queues; | struct ixl_queue *que = vsi->queues; | ||||
if (pf->tq) | if (pf->tq) | ||||
taskqueue_free(pf->tq); | taskqueue_free(pf->tq); | ||||
for (int i = 0; i < vsi->num_queues; i++, que++) { | for (int i = 0; i < vsi->num_queues; i++, que++) { | ||||
if (que->tq) | if (que->tq) | ||||
taskqueue_free(que->tq); | taskqueue_free(que->tq); | ||||
} | } | ||||
} | } | ||||
/********************************************************************* | /********************************************************************* | ||||
* | * | ||||
* Setup MSIX Interrupt resources and handlers for the VSI | * Setup MSIX Interrupt resources and handlers for the VSI | ||||
* | * | ||||
**********************************************************************/ | **********************************************************************/ | ||||
static int | static int | ||||
ixl_assign_vsi_msix(struct ixl_pf *pf) | ixl_assign_vsi_msix(struct ixl_pf *pf) | ||||
{ | { | ||||
device_t dev = pf->dev; | device_t dev = pf->dev; | ||||
struct ixl_vsi *vsi = &pf->vsi; | struct ixl_vsi *vsi = &pf->vsi; | ||||
struct ixl_queue *que = vsi->queues; | struct ixl_queue *que = vsi->queues; | ||||
struct tx_ring *txr; | struct tx_ring *txr; | ||||
int error, rid, vector = 0; | int error, rid, vector = 0; | ||||
#ifdef RSS | |||||
cpuset_t cpu_mask; | |||||
#endif | |||||
/* Admin Que is vector 0*/ | /* Admin Que is vector 0*/ | ||||
rid = vector + 1; | rid = vector + 1; | ||||
pf->res = bus_alloc_resource_any(dev, | pf->res = bus_alloc_resource_any(dev, | ||||
SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); | SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); | ||||
if (!pf->res) { | if (!pf->res) { | ||||
device_printf(dev,"Unable to allocate" | device_printf(dev,"Unable to allocate" | ||||
" bus resource: Adminq interrupt [%d]\n", rid); | " bus resource: Adminq interrupt [%d]\n", rid); | ||||
▲ Show 20 Lines • Show All 4,653 Lines • Show Last 20 Lines |