1# SPDX-License-Identifier: BSD-3-Clause 2# Copyright (C) 2022 Intel Corporation. 3# All rights reserved. 4 5 6def iobuf_set_options(client, small_pool_count, large_pool_count, small_bufsize, large_bufsize, enable_numa=None): 7 """Set iobuf pool options. 8 9 Args: 10 small_pool_count: number of small buffers in the global pool 11 large_pool_count: number of large buffers in the global pool 12 small_bufsize: size of a small buffer 13 large_bufsize: size of a large buffer 14 enable_numa: enable per-NUMA buffer pools 15 """ 16 params = {} 17 18 if small_pool_count is not None: 19 params['small_pool_count'] = small_pool_count 20 if large_pool_count is not None: 21 params['large_pool_count'] = large_pool_count 22 if small_bufsize is not None: 23 params['small_bufsize'] = small_bufsize 24 if large_bufsize is not None: 25 params['large_bufsize'] = large_bufsize 26 if enable_numa is not None: 27 params['enable_numa'] = enable_numa 28 29 return client.call('iobuf_set_options', params) 30 31 32def iobuf_get_stats(client): 33 """Get iobuf statistics""" 34 35 return client.call('iobuf_get_stats') 36