vhost: add packed ring single enqueue
[dpdk.git] / drivers / common / cpt / cpt_ucode.h
index 0992576..0dac12e 100644 (file)
@@ -55,7 +55,7 @@ cpt_is_algo_supported(struct rte_crypto_sym_xform *xform)
 }
 
 static __rte_always_inline void
-gen_key_snow3g(uint8_t *ck, uint32_t *keyx)
+gen_key_snow3g(const uint8_t *ck, uint32_t *keyx)
 {
        int i, base;
 
@@ -175,7 +175,7 @@ cpt_fc_ciph_set_key_set_aes_key_type(mc_fc_context_t *fctx, uint16_t key_len)
 }
 
 static __rte_always_inline void
-cpt_fc_ciph_set_key_snow3g_uea2(struct cpt_ctx *cpt_ctx, uint8_t *key,
+cpt_fc_ciph_set_key_snow3g_uea2(struct cpt_ctx *cpt_ctx, const uint8_t *key,
                uint16_t key_len)
 {
        uint32_t keyx[4];
@@ -186,7 +186,7 @@ cpt_fc_ciph_set_key_snow3g_uea2(struct cpt_ctx *cpt_ctx, uint8_t *key,
 }
 
 static __rte_always_inline void
-cpt_fc_ciph_set_key_zuc_eea3(struct cpt_ctx *cpt_ctx, uint8_t *key,
+cpt_fc_ciph_set_key_zuc_eea3(struct cpt_ctx *cpt_ctx, const uint8_t *key,
                uint16_t key_len)
 {
        cpt_ctx->snow3g = 0;
@@ -196,7 +196,7 @@ cpt_fc_ciph_set_key_zuc_eea3(struct cpt_ctx *cpt_ctx, uint8_t *key,
 }
 
 static __rte_always_inline void
-cpt_fc_ciph_set_key_kasumi_f8_ecb(struct cpt_ctx *cpt_ctx, uint8_t *key,
+cpt_fc_ciph_set_key_kasumi_f8_ecb(struct cpt_ctx *cpt_ctx, const uint8_t *key,
                uint16_t key_len)
 {
        cpt_ctx->k_ecb = 1;
@@ -205,7 +205,7 @@ cpt_fc_ciph_set_key_kasumi_f8_ecb(struct cpt_ctx *cpt_ctx, uint8_t *key,
 }
 
 static __rte_always_inline void
-cpt_fc_ciph_set_key_kasumi_f8_cbc(struct cpt_ctx *cpt_ctx, uint8_t *key,
+cpt_fc_ciph_set_key_kasumi_f8_cbc(struct cpt_ctx *cpt_ctx, const uint8_t *key,
                uint16_t key_len)
 {
        memcpy(cpt_ctx->k_ctx.ci_key, key, key_len);
@@ -213,7 +213,7 @@ cpt_fc_ciph_set_key_kasumi_f8_cbc(struct cpt_ctx *cpt_ctx, uint8_t *key,
 }
 
 static __rte_always_inline int
-cpt_fc_ciph_set_key(void *ctx, cipher_type_t type, uint8_t *key,
+cpt_fc_ciph_set_key(void *ctx, cipher_type_t type, const uint8_t *key,
                    uint16_t key_len, uint8_t *salt)
 {
        struct cpt_ctx *cpt_ctx = ctx;
@@ -1467,7 +1467,8 @@ cpt_zuc_snow3g_enc_prep(uint32_t req_flags,
        opcode.s.major = CPT_MAJOR_OP_ZUC_SNOW3G;
 
        /* indicates CPTR ctx, operation type, KEY & IV mode from DPTR */
-       opcode.s.minor = ((1 << 6) | (snow3g << 5) | (0 << 4) |
+
+       opcode.s.minor = ((1 << 7) | (snow3g << 5) | (0 << 4) |
                          (0 << 3) | (flags & 0x7));
 
        if (flags == 0x1) {
@@ -1791,7 +1792,8 @@ cpt_zuc_snow3g_dec_prep(uint32_t req_flags,
        opcode.s.major = CPT_MAJOR_OP_ZUC_SNOW3G;
 
        /* indicates CPTR ctx, operation type, KEY & IV mode from DPTR */
-       opcode.s.minor = ((1 << 6) | (snow3g << 5) | (0 << 4) |
+
+       opcode.s.minor = ((1 << 7) | (snow3g << 5) | (0 << 4) |
                          (0 << 3) | (flags & 0x7));
 
        /* consider iv len */
@@ -2486,7 +2488,7 @@ cpt_fc_enc_hmac_prep(uint32_t flags, uint64_t d_offs, uint64_t d_lens,
 }
 
 static __rte_always_inline int
-cpt_fc_auth_set_key(void *ctx, auth_type_t type, uint8_t *key,
+cpt_fc_auth_set_key(void *ctx, auth_type_t type, const uint8_t *key,
                    uint16_t key_len, uint16_t mac_len)
 {
        struct cpt_ctx *cpt_ctx = ctx;