Commit faf9ad6a authored by paul luse's avatar paul luse Committed by Darek Stojaczyk
Browse files

bdev/compress: fail get channel calback if we are out of qpairs



qpairs can be limited by the compression polled mode driver or
system resources and we need one per thread so if we run out we
have to fail the callback.

Change-Id: Ibd07d9c65880e7de321c439119aed479ef00746c
Signed-off-by: default avatarpaul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463339


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
parent c2d44122
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -1224,12 +1224,17 @@ comp_bdev_ch_create_cb(void *io_device, void *ctx_buf)
			}
		}
		pthread_mutex_unlock(&g_comp_device_qp_lock);
		assert(comp_bdev->device_qp);
	}
	comp_bdev->ch_count++;
	pthread_mutex_unlock(&comp_bdev->reduce_lock);

	if (comp_bdev->device_qp != NULL) {
		return 0;
	} else {
		SPDK_ERRLOG("out of qpairs, cannot assign one to comp_bdev %p\n", comp_bdev);
		assert(false);
		return -ENOMEM;
	}
}

static void