diff --git a/include/spdk/reduce.h b/include/spdk/reduce.h index f67c484fb..03c996294 100644 --- a/include/spdk/reduce.h +++ b/include/spdk/reduce.h @@ -3,6 +3,7 @@ * * Copyright (c) Intel Corporation. * All rights reserved. + * Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -131,6 +132,8 @@ struct spdk_reduce_backing_dev { uint64_t blockcnt; uint32_t blocklen; + bool sgl_in; + bool sgl_out; }; /** diff --git a/module/bdev/compress/vbdev_compress.c b/module/bdev/compress/vbdev_compress.c index 2cf73445e..607fbd3d4 100644 --- a/module/bdev/compress/vbdev_compress.c +++ b/module/bdev/compress/vbdev_compress.c @@ -3,7 +3,7 @@ * * Copyright (c) Intel Corporation. * All rights reserved. - * Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * Copyright (c) 2021, 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -1467,6 +1467,15 @@ comp_bdev_ch_create_cb(void *io_device, void *ctx_buf) pthread_mutex_unlock(&comp_bdev->reduce_lock); if (comp_bdev->device_qp != NULL) { + uint64_t comp_feature_flags = + comp_bdev->device_qp->device->cdev_info.capabilities[RTE_COMP_ALGO_DEFLATE].comp_feature_flags; + + if (comp_feature_flags & (RTE_COMP_FF_OOP_SGL_IN_SGL_OUT | RTE_COMP_FF_OOP_SGL_IN_LB_OUT)) { + comp_bdev->backing_dev.sgl_in = true; + } + if (comp_feature_flags & (RTE_COMP_FF_OOP_SGL_IN_SGL_OUT | RTE_COMP_FF_OOP_LB_IN_SGL_OUT)) { + comp_bdev->backing_dev.sgl_out = true; + } return 0; } else { SPDK_ERRLOG("out of qpairs, cannot assign one to comp_bdev %p\n", comp_bdev);