diff --git a/lib/bdev/crypto/vbdev_crypto.c b/lib/bdev/crypto/vbdev_crypto.c index b8ae8cbcc..309aeec2a 100644 --- a/lib/bdev/crypto/vbdev_crypto.c +++ b/lib/bdev/crypto/vbdev_crypto.c @@ -598,7 +598,8 @@ _crypto_operation(struct spdk_bdev_io *bdev_io, enum rte_crypto_cipher_operation * has a buffer, which ours always will. So, until we modify that API * or better yet the current ZCOPY work lands, this is the best we can do. */ - io_ctx->cry_iov.iov_base = spdk_dma_malloc(total_length, 0x10, NULL); + io_ctx->cry_iov.iov_base = spdk_dma_malloc(total_length, + spdk_bdev_get_buf_align(bdev_io->bdev), NULL); if (!io_ctx->cry_iov.iov_base) { SPDK_ERRLOG("ERROR trying to allocate write buffer for encryption!\n"); rc = -ENOMEM; diff --git a/test/unit/lib/bdev/crypto.c/crypto_ut.c b/test/unit/lib/bdev/crypto.c/crypto_ut.c index fc52cb530..6908765c6 100644 --- a/test/unit/lib/bdev/crypto.c/crypto_ut.c +++ b/test/unit/lib/bdev/crypto.c/crypto_ut.c @@ -58,6 +58,7 @@ DEFINE_STUB(spdk_bdev_io_type_supported, bool, (struct spdk_bdev *bdev, DEFINE_STUB_V(spdk_bdev_module_release_bdev, (struct spdk_bdev *bdev)); DEFINE_STUB_V(spdk_bdev_close, (struct spdk_bdev_desc *desc)); DEFINE_STUB(spdk_bdev_get_name, const char *, (const struct spdk_bdev *bdev), 0); +DEFINE_STUB(spdk_bdev_get_buf_align, size_t, (const struct spdk_bdev *bdev), 0); DEFINE_STUB(spdk_bdev_get_io_channel, struct spdk_io_channel *, (struct spdk_bdev_desc *desc), 0); DEFINE_STUB_V(spdk_bdev_unregister, (struct spdk_bdev *bdev, spdk_bdev_unregister_cb cb_fn, void *cb_arg));