#include #include #include #include #include #define MAX_SESSIONS 1024 #define NUM_MBUFS 1024 #define POOL_CACHE_SIZE 128 #define BURST_SIZE 32 #define BUFFER_SIZE 1024 int main(int argc, char *argv[]) { struct rte_mempool *mbuf_pool, *crypto_op_pool; struct rte_mempool *session_pool, *session_priv_pool; unsigned int session_size; int ret; /* Initialize EAL. */ ret = rte_eal_init(argc, argv); if (ret < 0) rte_exit(EXIT_FAILURE, "Invalid EAL arguments\n"); uint8_t socket_id = rte_socket_id(); /* Create the mbuf pool. */ mbuf_pool = rte_pktmbuf_pool_create("mbuf_pool", NUM_MBUFS, POOL_CACHE_SIZE, 0, RTE_MBUF_DEFAULT_BUF_SIZE, socket_id); if (mbuf_pool == NULL) { printf("rte_pktmbuf_pool_create failed %s\n", rte_strerror(rte_errno)); rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n"); } /* Create the virtual crypto device. */ char args[128]; const char *crypto_name = "crypto_dpaa_sec"; snprintf(args, sizeof(args), "socket_id=%d", socket_id); ret = rte_vdev_init(crypto_name, args); if (ret != 0) { printf("rte_vdev_init failed %s\n", rte_strerror(rte_errno)); rte_exit(EXIT_FAILURE, "Cannot create virtual device\n"); } return 0; }