From 26a02f72e87857d7e6042f2f6570734f71101b84 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Wed, 18 Dec 2019 11:39:51 -0700 Subject: [PATCH] bdev/crypto: remove asserts around vtophys calls The IOVA is only needed by the QAT PMD. In order to allow the other PMDs to support the alignment requirements of the underlying bdev, we need to remove the asserts that assume a specific alignment for buffers. Change-Id: Id659cd833cf827d42c400e577afe140a0af26233 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478375 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Paul Luse Community-CI: Broadcom SPDK FC-NVMe CI --- module/bdev/crypto/vbdev_crypto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/bdev/crypto/vbdev_crypto.c b/module/bdev/crypto/vbdev_crypto.c index 4c115b596..53fec1c67 100644 --- a/module/bdev/crypto/vbdev_crypto.c +++ b/module/bdev/crypto/vbdev_crypto.c @@ -733,8 +733,8 @@ _crypto_operation(struct spdk_bdev_io *bdev_io, enum rte_crypto_cipher_operation /* Set the mbuf elements address and length. Null out the next pointer. */ src_mbufs[crypto_index]->buf_addr = current_iov; src_mbufs[crypto_index]->data_len = updated_length = crypto_len; + /* TODO: Make this assignment conditional on QAT usage and add an assert. */ src_mbufs[crypto_index]->buf_iova = spdk_vtophys((void *)current_iov, &updated_length); - assert(updated_length == crypto_len); src_mbufs[crypto_index]->next = NULL; /* Store context in every mbuf as we don't know anything about completion order */ src_mbufs[crypto_index]->userdata = bdev_io; @@ -767,9 +767,9 @@ _crypto_operation(struct spdk_bdev_io *bdev_io, enum rte_crypto_cipher_operation /* Set the relevant destination en_mbuf elements. */ dst_mbufs[crypto_index]->buf_addr = io_ctx->cry_iov.iov_base + en_offset; dst_mbufs[crypto_index]->data_len = updated_length = crypto_len; + /* TODO: Make this assignment conditional on QAT usage and add an assert. */ dst_mbufs[crypto_index]->buf_iova = spdk_vtophys(dst_mbufs[crypto_index]->buf_addr, &updated_length); - assert(updated_length == crypto_len); crypto_ops[crypto_index]->sym->m_dst = dst_mbufs[crypto_index]; en_offset += crypto_len; dst_mbufs[crypto_index]->next = NULL;