test/threads: add unit test
[dpdk.git] / app / test / test_cryptodev.h
index 5c41e36..29a7d4d 100644 (file)
@@ -19,7 +19,7 @@
 #define DEFAULT_NUM_XFORMS              (2)
 #define NUM_MBUFS                       (8191)
 #define MBUF_CACHE_SIZE                 (256)
-#define MBUF_DATAPAYLOAD_SIZE          (2048 + DIGEST_BYTE_LENGTH_SHA512)
+#define MBUF_DATAPAYLOAD_SIZE          (4096 + DIGEST_BYTE_LENGTH_SHA512)
 #define MBUF_SIZE                      (sizeof(struct rte_mbuf) + \
                RTE_PKTMBUF_HEADROOM + MBUF_DATAPAYLOAD_SIZE)
 
@@ -59,6 +59,7 @@
 #define CRYPTODEV_NAME_SNOW3G_PMD      crypto_snow3g
 #define CRYPTODEV_NAME_KASUMI_PMD      crypto_kasumi
 #define CRYPTODEV_NAME_ZUC_PMD         crypto_zuc
+#define CRYPTODEV_NAME_CHACHA20_POLY1305_PMD   crypto_chacha20_poly1305
 #define CRYPTODEV_NAME_ARMV8_PMD       crypto_armv8
 #define CRYPTODEV_NAME_DPAA_SEC_PMD    crypto_dpaa_sec
 #define CRYPTODEV_NAME_DPAA2_SEC_PMD   crypto_dpaa2_sec
 #define CRYPTODEV_NAME_CCP_PMD         crypto_ccp
 #define CRYPTODEV_NAME_VIRTIO_PMD      crypto_virtio
 #define CRYPTODEV_NAME_OCTEONTX_SYM_PMD        crypto_octeontx
-#define CRYPTODEV_NAME_OCTEONTX2_PMD   crypto_octeontx2
 #define CRYPTODEV_NAME_CAAM_JR_PMD     crypto_caam_jr
 #define CRYPTODEV_NAME_NITROX_PMD      crypto_nitrox_sym
 #define CRYPTODEV_NAME_BCMFS_PMD       crypto_bcmfs
+#define CRYPTODEV_NAME_CN9K_PMD                crypto_cn9k
+#define CRYPTODEV_NAME_CN10K_PMD       crypto_cn10k
+#define CRYPTODEV_NAME_MLX5_PMD                crypto_mlx5
+
 
 enum cryptodev_api_test_type {
        CRYPTODEV_API_TEST = 0,
@@ -79,6 +83,20 @@ enum cryptodev_api_test_type {
 
 extern enum cryptodev_api_test_type global_api_test_type;
 
+extern struct crypto_testsuite_params *p_testsuite_params;
+struct crypto_testsuite_params {
+       struct rte_mempool *mbuf_pool;
+       struct rte_mempool *large_mbuf_pool;
+       struct rte_mempool *op_mpool;
+       struct rte_mempool *session_mpool;
+       struct rte_mempool *session_priv_mpool;
+       struct rte_cryptodev_config conf;
+       struct rte_cryptodev_qp_conf qp_conf;
+
+       uint8_t valid_devs[RTE_CRYPTO_MAX_DEVS];
+       uint8_t valid_dev_count;
+};
+
 /**
  * Write (spread) data from buffer to mbuf data
  *
@@ -212,8 +230,7 @@ create_segmented_mbuf(struct rte_mempool *mbuf_pool, int pkt_len,
        return mbuf;
 
 fail:
-       if (mbuf)
-               rte_pktmbuf_free(mbuf);
+       rte_pktmbuf_free(mbuf);
        return NULL;
 }
 
@@ -234,4 +251,10 @@ int
 check_aead_capabilities_supported(const enum rte_crypto_aead_algorithm *aeads,
                uint16_t num_aeads);
 
+int
+ut_setup(void);
+
+void
+ut_teardown(void);
+
 #endif /* TEST_CRYPTODEV_H_ */