ring: update ring size doxygen comments
[dpdk.git] / drivers / common / cpt / cpt_ucode.h
index bb3a862..e1f2f60 100644 (file)
@@ -246,7 +246,7 @@ cpt_fc_ciph_set_key(struct cpt_ctx *cpt_ctx, cipher_type_t type,
        if (cpt_ctx->fc_type == FC_GEN) {
                /*
                 * We need to always say IV is from DPTR as user can
-                * sometimes iverride IV per operation.
+                * sometimes override IV per operation.
                 */
                fctx->enc.iv_source = CPT_FROM_DPTR;
 
@@ -561,8 +561,7 @@ cpt_digest_gen_prep(uint32_t flags,
        i = 0;
 
        if (ctx->hmac) {
-               uint64_t k_dma = params->ctx_buf.dma_addr +
-                       offsetof(struct cpt_ctx, auth_key);
+               uint64_t k_dma = ctx->auth_key_iova;
                /* Key */
                i = fill_sg_comp(gather_comp, i, k_dma,
                                 RTE_ALIGN_CEIL(key_len, 8));
@@ -2312,7 +2311,7 @@ cpt_kasumi_dec_prep(uint64_t d_offs,
        /* consider iv len */
        encr_offset += iv_len;
 
-       inputlen = iv_len + (RTE_ALIGN(encr_data_len, 8) / 8);
+       inputlen = encr_offset + (RTE_ALIGN(encr_data_len, 8) / 8);
        outputlen = inputlen;
 
        /* save space for offset ctrl & iv */
@@ -2551,7 +2550,12 @@ cpt_fc_auth_set_key(struct cpt_ctx *cpt_ctx, auth_type_t type,
 
        if (key_len) {
                cpt_ctx->hmac = 1;
-               memset(cpt_ctx->auth_key, 0, sizeof(cpt_ctx->auth_key));
+
+               cpt_ctx->auth_key = rte_zmalloc(NULL, key_len, 8);
+               if (cpt_ctx->auth_key == NULL)
+                       return -1;
+
+               cpt_ctx->auth_key_iova = rte_mem_virt2iova(cpt_ctx->auth_key);
                memcpy(cpt_ctx->auth_key, key, key_len);
                cpt_ctx->auth_key_len = key_len;
                memset(fctx->hmac.ipad, 0, sizeof(fctx->hmac.ipad));
@@ -3031,7 +3035,7 @@ prepare_iov_from_pkt_inplace(struct rte_mbuf *pkt,
                tailroom = rte_pktmbuf_tailroom(pkt);
                if (likely((headroom >= 24) &&
                    (tailroom >= 8))) {
-                       /* In 83XX this is prerequivisit for Direct mode */
+                       /* In 83XX this is prerequisite for Direct mode */
                        *flags |= SINGLE_BUF_HEADTAILROOM;
                }
                param->bufs[0].vaddr = seg_data;