bdev/crypto: Set QAT alignment requirement

For QAT, a single operation can be described at most by one IOV.
To assure that we don't get memory buffers that are sub-block sized,
set the alignment requirement to the block size of the underlying device.

Change-Id: I4071bb89e696fc40e010798bd76520e5fb765217
Signed-off-by: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/440988
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
paul luse 2019-01-17 10:37:48 -05:00 committed by Darek Stojaczyk
parent b62a1f9ef1
commit fbec702944

View File

@ -1430,7 +1430,14 @@ vbdev_crypto_claim(struct spdk_bdev *bdev)
vbdev->crypto_bdev.product_name = "crypto";
vbdev->crypto_bdev.write_cache = bdev->write_cache;
vbdev->crypto_bdev.required_alignment = bdev->required_alignment;
if (strcmp(vbdev->drv_name, QAT) == 0) {
vbdev->crypto_bdev.required_alignment =
spdk_max(spdk_u32log2(bdev->blocklen), bdev->required_alignment);
SPDK_NOTICELOG("QAT in use: Required alignment set to %u\n",
vbdev->crypto_bdev.required_alignment);
} else {
vbdev->crypto_bdev.required_alignment = bdev->required_alignment;
}
/* Note: CRYPTO_MAX_IO is in units of bytes, optimal_io_boundary is
* in units of blocks.
*/