From 766c5361842f42836c1105ed3faf9b55f729172a Mon Sep 17 00:00:00 2001 From: paul luse Date: Fri, 12 Apr 2019 13:25:46 -0400 Subject: [PATCH] bdev/compress: add missing mocks and re-enable UT build for comp Disabled temporarily earlier to get to basic functionality, circling back now to begin work on UT again. Change-Id: Ie7606f91072257f392727bdecc5f1eac26380453 Signed-off-by: paul luse Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/451063 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- test/unit/lib/bdev/Makefile | 2 +- test/unit/lib/bdev/compress.c/compress_ut.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/test/unit/lib/bdev/Makefile b/test/unit/lib/bdev/Makefile index 264e930c4..c9a655625 100644 --- a/test/unit/lib/bdev/Makefile +++ b/test/unit/lib/bdev/Makefile @@ -42,7 +42,7 @@ endif ifeq ($(CONFIG_REDUCE),y) # enable once new mocks are added for compressdev -#DIRS-y += compress.c +DIRS-y += compress.c endif DIRS-$(CONFIG_PMDK) += pmem diff --git a/test/unit/lib/bdev/compress.c/compress_ut.c b/test/unit/lib/bdev/compress.c/compress_ut.c index 970c4828d..7d50dbb2f 100644 --- a/test/unit/lib/bdev/compress.c/compress_ut.c +++ b/test/unit/lib/bdev/compress.c/compress_ut.c @@ -152,6 +152,12 @@ DEFINE_STUB(rte_socket_id, unsigned, (void), 0); DEFINE_STUB(rte_eal_get_configuration, struct rte_config *, (void), NULL); DEFINE_STUB(rte_vdev_init, int, (const char *name, const char *args), 0); DEFINE_STUB_V(rte_mempool_free, (struct rte_mempool *mp)); +DEFINE_STUB(rte_compressdev_dequeue_burst, uint16_t, + (uint8_t dev_id, uint16_t qp_id, struct rte_comp_op **ops, uint16_t nb_ops), 0); +DEFINE_STUB(rte_compressdev_enqueue_burst, uint16_t, + (uint8_t dev_id, uint16_t qp_id, struct rte_comp_op **ops, uint16_t nb_ops), 0); +DEFINE_STUB_V(rte_comp_op_free, (struct rte_comp_op *op)); +DEFINE_STUB(rte_comp_op_alloc, struct rte_comp_op *, (struct rte_mempool *mempool), NULL); struct spdk_bdev_io *g_bdev_io; struct spdk_io_channel *g_io_ch;