+static inline struct rte_crypto_op *
+test_perf_set_crypto_op_snow3g_cipher(struct rte_crypto_op *op,
+ struct rte_mbuf *m,
+ struct rte_cryptodev_sym_session *sess,
+ unsigned data_len)
+{
+ if (rte_crypto_op_attach_sym_session(op, sess) != 0) {
+ rte_crypto_op_free(op);
+ return NULL;
+ }
+
+ /* Cipher Parameters */
+ op->sym->cipher.iv.data = rte_pktmbuf_mtod(m, uint8_t *);
+ op->sym->cipher.iv.length = SNOW3G_CIPHER_IV_LENGTH;
+ rte_memcpy(op->sym->cipher.iv.data, snow3g_iv, SNOW3G_CIPHER_IV_LENGTH);
+ op->sym->cipher.iv.phys_addr = rte_pktmbuf_mtophys(m);
+
+ op->sym->cipher.data.offset = SNOW3G_CIPHER_IV_LENGTH;
+ op->sym->cipher.data.length = data_len << 3;
+
+ op->sym->m_src = m;
+
+ return op;
+}
+
+
+static inline struct rte_crypto_op *
+test_perf_set_crypto_op_snow3g_hash(struct rte_crypto_op *op,
+ struct rte_mbuf *m,
+ struct rte_cryptodev_sym_session *sess,
+ unsigned data_len,
+ unsigned digest_len)
+{
+ if (rte_crypto_op_attach_sym_session(op, sess) != 0) {
+ rte_crypto_op_free(op);
+ return NULL;
+ }
+
+ /* Authentication Parameters */
+
+ op->sym->auth.digest.data =
+ (uint8_t *)rte_pktmbuf_mtod_offset(m, uint8_t *,
+ data_len);
+ op->sym->auth.digest.phys_addr =
+ rte_pktmbuf_mtophys_offset(m, data_len +
+ SNOW3G_CIPHER_IV_LENGTH);
+ op->sym->auth.digest.length = digest_len;
+ op->sym->auth.aad.data = rte_pktmbuf_mtod(m, uint8_t *);
+ op->sym->auth.aad.length = SNOW3G_CIPHER_IV_LENGTH;
+ rte_memcpy(op->sym->auth.aad.data, snow3g_iv,
+ SNOW3G_CIPHER_IV_LENGTH);
+ op->sym->auth.aad.phys_addr = rte_pktmbuf_mtophys(m);
+
+ /* Data lengths/offsets Parameters */
+ op->sym->auth.data.offset = SNOW3G_CIPHER_IV_LENGTH;
+ op->sym->auth.data.length = data_len << 3;
+
+ op->sym->m_src = m;
+
+ return op;
+}
+
+