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: paul luse <paul.e.luse@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/463339
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>
This commit is contained in:
paul luse 2019-07-26 12:26:18 -04:00 committed by Darek Stojaczyk
parent c2d441226a
commit faf9ad6a6d

View File

@ -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);
return 0;
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