Skip to content

Commit 8ab51c7

Browse files
rnicolaubluca
authored andcommitted
"crypto/qat: fix backported patch
Backported patch below was applied to the wrong QAT function. Fixes: 96a4318 ("crypto/qat: fix out-of-place chain/cipher/auth headers") Signed-off-by: Radu Nicolau <[email protected]>
1 parent 12b1ff8 commit 8ab51c7

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

drivers/crypto/qat/dev/qat_crypto_pmd_gen3.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -546,24 +546,27 @@ qat_sym_dp_enqueue_aead_jobs_gen3(void *qp_data, uint8_t *drv_ctx,
546546
for (i = 0; i < n; i++) {
547547
struct qat_sym_op_cookie *cookie =
548548
qp->op_cookies[tail >> tx_queue->trailz];
549+
int error = 0;
549550

550551
req = (struct icp_qat_fw_la_bulk_req *)(
551552
(uint8_t *)tx_queue->base_addr + tail);
552553
rte_mov128((uint8_t *)req, (const uint8_t *)&(ctx->fw_req));
553554

554555
if (vec->dest_sgl) {
555-
data_len = qat_sym_build_req_set_data(req,
556-
user_data[i], cookie,
557-
vec->src_sgl[i].vec, vec->src_sgl[i].num,
558-
vec->dest_sgl[i].vec, vec->dest_sgl[i].num, NULL, NULL);
556+
data_len = qat_reqs_mid_set(&error, req, cookie, user_data[i],
557+
&vec->src_sgl[i], &vec->dest_sgl[i], ofs);
558+
/* In oop there is no offset, src/dst addresses are moved
559+
* to avoid overwriting the dst header
560+
*/
561+
ofs.ofs.cipher.head = 0;
559562
} else {
560563
data_len = qat_sym_build_req_set_data(req,
561564
user_data[i], cookie,
562565
vec->src_sgl[i].vec,
563566
vec->src_sgl[i].num, NULL, 0, NULL, NULL);
564567
}
565568

566-
if (unlikely(data_len < 0))
569+
if (unlikely(data_len < 0) || error)
567570
break;
568571

569572
enqueue_one_aead_job_gen3(ctx, req, &vec->iv[i],
@@ -662,27 +665,24 @@ qat_sym_dp_enqueue_auth_jobs_gen3(void *qp_data, uint8_t *drv_ctx,
662665
for (i = 0; i < n; i++) {
663666
struct qat_sym_op_cookie *cookie =
664667
qp->op_cookies[tail >> tx_queue->trailz];
665-
int error = 0;
666668

667669
req = (struct icp_qat_fw_la_bulk_req *)(
668670
(uint8_t *)tx_queue->base_addr + tail);
669671
rte_mov128((uint8_t *)req, (const uint8_t *)&(ctx->fw_req));
670672

671673
if (vec->dest_sgl) {
672-
data_len = qat_reqs_mid_set(&error, req, cookie, user_data[i],
673-
&vec->src_sgl[i], &vec->dest_sgl[i], ofs);
674-
/* In oop there is no offset, src/dst addresses are moved
675-
* to avoid overwriting the dst header
676-
*/
677-
ofs.ofs.cipher.head = 0;
674+
data_len = qat_sym_build_req_set_data(req,
675+
user_data[i], cookie,
676+
vec->src_sgl[i].vec, vec->src_sgl[i].num,
677+
vec->dest_sgl[i].vec, vec->dest_sgl[i].num, NULL, NULL);
678678
} else {
679679
data_len = qat_sym_build_req_set_data(req,
680680
user_data[i], cookie,
681681
vec->src_sgl[i].vec,
682682
vec->src_sgl[i].num, NULL, 0, NULL, NULL);
683683
}
684684

685-
if (unlikely(data_len < 0) || error)
685+
if (unlikely(data_len < 0))
686686
break;
687687
if (ctx->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_NULL) {
688688
null_digest.iova = cookie->digest_null_phys_addr;

0 commit comments

Comments
 (0)