Lines Matching refs:task
160 uint32_t cryop_total; /* Total number of crypto operations in this task */
200 struct accel_dpdk_cryptodev_task *task);
241 struct accel_dpdk_cryptodev_task *task;
256 * particular task so need to look at each and determine if it's
257 * the last one for it's task or not.
259 task = (struct accel_dpdk_cryptodev_task *)*RTE_MBUF_DYNFIELD(dequeued_ops[i]->sym->m_src,
261 assert(task != NULL);
265 /* Update the task status to error, we'll still process the
266 * rest of the crypto ops for this task though so they
269 task->is_failed = true;
281 task->cryop_completed++;
282 if (task->cryop_completed == task->cryop_total) {
284 spdk_accel_task_complete(&task->base, task->is_failed ? -EINVAL : 0);
285 } else if (task->cryop_completed == task->cryop_submitted) {
287 int rc = accel_dpdk_cryptodev_process_task(crypto_ch, task);
291 TAILQ_INSERT_TAIL(&crypto_ch->queued_tasks, task, link);
294 /* -EALREADY means that a task is completed, but it might be unsafe to complete
296 * complete th task immediately */
299 spdk_accel_task_complete(&task->base, rc);
320 * runs) totals up to one or more complete task */
326 struct accel_dpdk_cryptodev_task *task, *task_tmp;
342 TAILQ_FOREACH_SAFE(task, &crypto_ch->queued_tasks, link, task_tmp) {
343 TAILQ_REMOVE(&crypto_ch->queued_tasks, task, link);
344 rc = accel_dpdk_cryptodev_process_task(crypto_ch, task);
347 TAILQ_INSERT_TAIL(&queued_tasks_tmp, task, link);
352 /* -EALREADY means that a task is completed, but it might be unsafe to complete
354 * complete th task immediately */
357 spdk_accel_task_complete(&task->base, rc);
367 TAILQ_FOREACH_SAFE(task, &crypto_ch->completed_tasks, link, task_tmp) {
368 TAILQ_REMOVE(&crypto_ch->completed_tasks, task, link);
369 spdk_accel_task_complete(&task->base, 0);
379 accel_dpdk_cryptodev_mbuf_chain_remainder(struct accel_dpdk_cryptodev_task *task,
398 *RTE_MBUF_DYNFIELD(chain_mbuf, g_mbuf_offset, uint64_t *) = (uint64_t)task;
412 accel_dpdk_cryptodev_mbuf_attach_buf(struct accel_dpdk_cryptodev_task *task, struct rte_mbuf *mbuf,
418 *RTE_MBUF_DYNFIELD(mbuf, g_mbuf_offset, uint64_t *) = (uint64_t)task;
515 struct accel_dpdk_cryptodev_task *task)
524 buf_len = spdk_min(task->base.block_size, sgl->iov->iov_len - sgl->iov_offset);
526 phys_len = accel_dpdk_cryptodev_mbuf_attach_buf(task, mbuf, buf_addr, buf_len);
534 assert(task->base.block_size >= buf_len);
535 remainder = task->base.block_size - buf_len;
539 rc = accel_dpdk_cryptodev_mbuf_chain_remainder(task, mbuf, buf_addr, &buf_len);
574 struct accel_dpdk_cryptodev_task *task)
578 uint32_t crypto_len = task->base.block_size;
594 bool inplace = task->inplace;
596 if (spdk_unlikely(!task->base.crypto_key ||
597 task->base.crypto_key->module_if != &g_accel_dpdk_cryptodev_module)) {
601 priv = task->base.crypto_key->priv;
604 if (task->cryop_completed) {
606 assert(task->cryop_submitted == task->cryop_completed);
607 assert(task->cryop_total > task->cryop_completed);
608 cryop_cnt = task->cryop_total - task->cryop_completed;
609 sgl_offset = task->cryop_completed * crypto_len;
610 iv_start = task->base.iv + task->cryop_completed;
612 /* That is a new task */
614 for (i = 0; i < task->base.s.iovcnt; i++) {
615 total_length += task->base.s.iovs[i].iov_len;
618 for (i = 0; i < task->base.d.iovcnt; i++) {
619 dst_length += task->base.d.iovs[i].iov_len;
625 if (spdk_unlikely(total_length % task->base.block_size != 0)) {
629 cryop_cnt = total_length / task->base.block_size;
630 task->cryop_total = cryop_cnt;
632 iv_start = task->base.iv;
660 if (task->base.op_code == SPDK_ACCEL_OPC_ENCRYPT) {
662 } else if (task->base.op_code == SPDK_ACCEL_OPC_DECRYPT) {
676 * dst_mbuf in our local arrays by looping through the length of the accel task and
681 spdk_iov_sgl_init(&src, task->base.s.iovs, task->base.s.iovcnt, 0);
684 spdk_iov_sgl_init(&dst, task->base.d.iovs, task->base.d.iovcnt, 0);
689 rc = accel_dpdk_cryptodev_mbuf_add_single_block(&src, src_mbufs[crypto_index], task);
709 rc = accel_dpdk_cryptodev_mbuf_add_single_block(&dst, dst_mbufs[crypto_index], task);
722 /* This value is used in the completion callback to determine when the accel task is complete. */
723 task->cryop_submitted += num_enqueued_ops;
738 assert(task->cryop_total > task->cryop_completed);
739 task->cryop_completed++;
740 task->cryop_submitted++;
741 if (task->cryop_completed == task->cryop_total) {
743 /* All crypto ops are completed. We can't complete the task immediately since this function might be
767 /* For all other statuses, mark task as failed so that the poller will pick
768 * the failure up for the overall task status.
770 task->is_failed = true;
946 struct accel_dpdk_cryptodev_task *task = SPDK_CONTAINEROF(_task, struct accel_dpdk_cryptodev_task,
951 task->cryop_completed = 0;
952 task->cryop_submitted = 0;
953 task->cryop_total = 0;
954 task->inplace = true;
955 task->is_failed = false;
958 if (task->base.s.iovcnt == task->base.d.iovcnt) {
959 if (memcmp(task->base.s.iovs, task->base.d.iovs, sizeof(struct iovec) * task->base.s.iovcnt) != 0) {
960 task->inplace = false;
962 } else if (task->base.d.iovcnt != 0) {
963 task->inplace = false;
966 rc = accel_dpdk_cryptodev_process_task(ch, task);
969 TAILQ_INSERT_TAIL(&ch->queued_tasks, task, link);
972 /* -EALREADY means that a task is completed, but it might be unsafe to complete
975 TAILQ_INSERT_TAIL(&ch->completed_tasks, task, link);