Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/cxgbe/tom/t4_cpl_io.c
Show First 20 Lines • Show All 2,205 Lines • ▼ Show 20 Lines | while (!TAILQ_EMPTY(&toep->aiotx_jobq) && sowriteable(so)) { | ||||
TAILQ_REMOVE(&toep->aiotx_jobq, job, list); | TAILQ_REMOVE(&toep->aiotx_jobq, job, list); | ||||
if (!aio_clear_cancel_function(job)) | if (!aio_clear_cancel_function(job)) | ||||
continue; | continue; | ||||
t4_aiotx_process_job(toep, so, job); | t4_aiotx_process_job(toep, so, job); | ||||
} | } | ||||
toep->aiotx_task_active = false; | toep->aiotx_task_active = false; | ||||
SOCKBUF_UNLOCK(&so->so_snd); | SOCKBUF_UNLOCK(&so->so_snd); | ||||
wakeup(&toep->aiotx_task_active); | |||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
free_toepcb(toep); | free_toepcb(toep); | ||||
} | } | ||||
static void | static void | ||||
t4_aiotx_queue_toep(struct toepcb *toep) | t4_aiotx_queue_toep(struct toepcb *toep) | ||||
{ | { | ||||
Show All 21 Lines | t4_aiotx_cancel(struct kaiocb *job) | ||||
so = job->fd_file->f_data; | so = job->fd_file->f_data; | ||||
tp = so_sototcpcb(so); | tp = so_sototcpcb(so); | ||||
toep = tp->t_toe; | toep = tp->t_toe; | ||||
MPASS(job->uaiocb.aio_lio_opcode == LIO_WRITE); | MPASS(job->uaiocb.aio_lio_opcode == LIO_WRITE); | ||||
sb = &so->so_snd; | sb = &so->so_snd; | ||||
SOCKBUF_LOCK(sb); | SOCKBUF_LOCK(sb); | ||||
if (!aio_cancel_cleared(job)) | if (!aio_cancel_cleared(job)) { | ||||
TAILQ_REMOVE(&toep->aiotx_jobq, job, list); | TAILQ_REMOVE(&toep->aiotx_jobq, job, list); | ||||
/* | |||||
* Wait for any pending task to run if the jobq is now | |||||
* empty as this job is holding the reference to the | |||||
* socket that the task is depending on. | |||||
*/ | |||||
if (TAILQ_EMPTY(&toep->aiotx_jobq)) { | |||||
while (toep->aiotx_task_active) | |||||
mtx_sleep(&toep->aiotx_task_active, | |||||
SOCKBUF_MTX(sb), 0, "aiotxcan", 0); | |||||
} | |||||
} | |||||
SOCKBUF_UNLOCK(sb); | SOCKBUF_UNLOCK(sb); | ||||
ab = job->backend1; | ab = job->backend1; | ||||
if (ab != NULL) | if (ab != NULL) | ||||
free_aiotx_buffer(ab); | free_aiotx_buffer(ab); | ||||
else | else | ||||
aio_cancel(job); | aio_cancel(job); | ||||
} | } | ||||
Show All 39 Lines |