fix typos using codespell utility
[dpdk.git] / drivers / crypto / qat / qat_crypto.c
index b9baf36..37d8a58 100644 (file)
@@ -757,7 +757,7 @@ qat_pmd_enqueue_op_burst(void *qp, struct rte_crypto_op **ops,
                        tmp_qp->stats.enqueue_err_count++;
                        /*
                         * This message cannot be enqueued,
-                        * decrease number of ops that wasnt sent
+                        * decrease number of ops that wasn't sent
                         */
                        rte_atomic16_sub(&tmp_qp->inflights16,
                                        nb_ops_possible - nb_ops_sent);
@@ -971,17 +971,24 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg,
                }
 
                /* copy IV into request if it fits */
-               if (op->sym->cipher.iv.length && (op->sym->cipher.iv.length <=
-                               sizeof(cipher_param->u.cipher_IV_array))) {
-                       rte_memcpy(cipher_param->u.cipher_IV_array,
-                                       op->sym->cipher.iv.data,
-                                       op->sym->cipher.iv.length);
-               } else {
-                       ICP_QAT_FW_LA_CIPH_IV_FLD_FLAG_SET(
-                                       qat_req->comn_hdr.serv_specif_flags,
-                                       ICP_QAT_FW_CIPH_IV_64BIT_PTR);
-                       cipher_param->u.s.cipher_IV_ptr =
-                                       op->sym->cipher.iv.phys_addr;
+               /*
+                * If IV length is zero do not copy anything but still
+                * use request descriptor embedded IV
+                *
+                */
+               if (op->sym->cipher.iv.length) {
+                       if (op->sym->cipher.iv.length <=
+                                       sizeof(cipher_param->u.cipher_IV_array)) {
+                               rte_memcpy(cipher_param->u.cipher_IV_array,
+                                               op->sym->cipher.iv.data,
+                                               op->sym->cipher.iv.length);
+                       } else {
+                               ICP_QAT_FW_LA_CIPH_IV_FLD_FLAG_SET(
+                                               qat_req->comn_hdr.serv_specif_flags,
+                                               ICP_QAT_FW_CIPH_IV_64BIT_PTR);
+                               cipher_param->u.s.cipher_IV_ptr =
+                                               op->sym->cipher.iv.phys_addr;
+                       }
                }
                min_ofs = cipher_ofs;
        }
@@ -1014,6 +1021,12 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg,
                                }
                        }
 
+               } else if (ctx->qat_hash_alg ==
+                                       ICP_QAT_HW_AUTH_ALGO_GALOIS_128 ||
+                               ctx->qat_hash_alg ==
+                                       ICP_QAT_HW_AUTH_ALGO_GALOIS_64) {
+                       auth_ofs = op->sym->cipher.data.offset;
+                       auth_len = op->sym->cipher.data.length;
                } else {
                        auth_ofs = op->sym->auth.data.offset;
                        auth_len = op->sym->auth.data.length;
@@ -1262,9 +1275,9 @@ void qat_crypto_sym_stats_get(struct rte_cryptodev *dev,
                }
 
                stats->enqueued_count += qp[i]->stats.enqueued_count;
-               stats->dequeued_count += qp[i]->stats.enqueued_count;
+               stats->dequeued_count += qp[i]->stats.dequeued_count;
                stats->enqueue_err_count += qp[i]->stats.enqueue_err_count;
-               stats->dequeue_err_count += qp[i]->stats.enqueue_err_count;
+               stats->dequeue_err_count += qp[i]->stats.dequeue_err_count;
        }
 }