This gives us a place to initialize iobuf pools, specify subsystem dependencies, and execute RPCs to configure the sizes of the pools. We allow users to configure the size of the pools either through the options in spdk_bdev_opts or through the new RPC, iobuf_set_options. The second option has higher priority, so it will override the options set by the bdev layer. Signed-off-by: Konrad Sztyber <konrad.sztyber@intel.com> Change-Id: I7c45ace04bc71c8343658f98248fc7babcf24e5d Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15765 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
26 lines
900 B
Python
26 lines
900 B
Python
# SPDX-License-Identifier: BSD-3-Clause
|
|
# Copyright (C) 2022 Intel Corporation.
|
|
# All rights reserved.
|
|
|
|
def iobuf_set_options(client, small_pool_count, large_pool_count, small_bufsize, large_bufsize):
|
|
"""Set iobuf pool options.
|
|
|
|
Args:
|
|
small_pool_count: number of small buffers in the global pool
|
|
large_pool_count: number of large buffers in the global pool
|
|
small_bufsize: size of a small buffer
|
|
large_bufsize: size of a large buffer
|
|
"""
|
|
params = {}
|
|
|
|
if small_pool_count is not None:
|
|
params['small_pool_count'] = small_pool_count
|
|
if large_pool_count is not None:
|
|
params['large_pool_count'] = large_pool_count
|
|
if small_bufsize is not None:
|
|
params['small_bufsize'] = small_bufsize
|
|
if large_bufsize is not None:
|
|
params['large_bufsize'] = large_bufsize
|
|
|
|
return client.call('iobuf_set_options', params)
|