nvmf/rdma/tcp: Use spdk_env_get_core_count to estimate cache size

Usage of spdk_thread_get_count is wrong since there might be many
threads allocated by other modules. Transport buffers are used by
transport poll groups, their number is equal to the number of cores.

Change-Id: I4bc748e93c3b204bf3b3ec73f17257b927a7f428
Signed-off-by: Alexey Marchuk <alexeymar@mellanox.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/3882
Community-CI: Broadcom CI
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
Alexey Marchuk 2020-08-21 10:27:05 +03:00 committed by Tomasz Zawadzki
parent 903fdb752b
commit e9b9510a86
2 changed files with 2 additions and 2 deletions

View File

@ -2323,7 +2323,7 @@ nvmf_rdma_create(struct spdk_nvmf_transport_opts *opts)
return NULL;
}
min_shared_buffers = spdk_thread_get_count() * opts->buf_cache_size;
min_shared_buffers = spdk_env_get_core_count() * opts->buf_cache_size;
if (min_shared_buffers > opts->num_shared_buffers) {
SPDK_ERRLOG("There are not enough buffers to satisfy"
"per-poll group caches for each thread. (%" PRIu32 ")"

View File

@ -507,7 +507,7 @@ nvmf_tcp_create(struct spdk_nvmf_transport_opts *opts)
return NULL;
}
min_shared_buffers = spdk_thread_get_count() * opts->buf_cache_size;
min_shared_buffers = spdk_env_get_core_count() * opts->buf_cache_size;
if (min_shared_buffers > opts->num_shared_buffers) {
SPDK_ERRLOG("There are not enough buffers to satisfy"
"per-poll group caches for each thread. (%" PRIu32 ")"