diff --git a/inc/ocf_mngt.h b/inc/ocf_mngt.h index 6d8f159..46becb2 100644 --- a/inc/ocf_mngt.h +++ b/inc/ocf_mngt.h @@ -1021,7 +1021,7 @@ int ocf_mngt_core_get_seq_cutoff_policy(ocf_core_t core, * use function ocf_mngt_cache_save(). * * @param[in] core Core handle - * @param[in] thresh promotion request count + * @param[in] count promotion request count * * @retval 0 Sequential cutoff promotion requets count has been set successfully * @retval Non-zero Error occured and request count hasn't been updated diff --git a/tests/functional/pyocf/types/core.py b/tests/functional/pyocf/types/core.py index 3981bf1..6a2e4a7 100644 --- a/tests/functional/pyocf/types/core.py +++ b/tests/functional/pyocf/types/core.py @@ -45,6 +45,7 @@ class CoreConfig(Structure): ("_volume_type", c_uint8), ("_try_add", c_bool), ("_seq_cutoff_threshold", c_uint32), + ("_seq_cutoff_promotion_count", c_uint32), ("_user_metadata", UserMetadata), ] @@ -52,6 +53,7 @@ class CoreConfig(Structure): class Core: DEFAULT_ID = 4096 DEFAULT_SEQ_CUTOFF_THRESHOLD = 1024 * 1024 + DEFAULT_SEQ_CUTOFF_PROMOTION_COUNT = 8 def __init__( self, @@ -59,6 +61,7 @@ class Core: try_add: bool, name: str = "core", seq_cutoff_threshold: int = DEFAULT_SEQ_CUTOFF_THRESHOLD, + seq_cutoff_promotion_count: int = DEFAULT_SEQ_CUTOFF_PROMOTION_COUNT, ): self.cache = None self.device = device @@ -76,6 +79,7 @@ class Core: _volume_type=self.device.type_id, _try_add=try_add, _seq_cutoff_threshold=seq_cutoff_threshold, + _seq_cutoff_promotion_count=seq_cutoff_promotion_count, _user_metadata=UserMetadata(_data=None, _size=0), ) diff --git a/tests/functional/tests/engine/test_seq_cutoff.py b/tests/functional/tests/engine/test_seq_cutoff.py index ac1d6d4..9d11dd7 100644 --- a/tests/functional/tests/engine/test_seq_cutoff.py +++ b/tests/functional/tests/engine/test_seq_cutoff.py @@ -71,7 +71,7 @@ def test_seq_cutoff_max_streams(pyocf_ctx): handled by cache. It should no longer be tracked by OCF, because of request in step 3. which overflowed the OCF handling structure) """ - MAX_STREAMS = 256 + MAX_STREAMS = 128 TEST_STREAMS = MAX_STREAMS + 1 # Number of streams used by test - one more than OCF can track core_size = Size.from_MiB(200) threshold = Size.from_KiB(4) @@ -91,7 +91,7 @@ def test_seq_cutoff_max_streams(pyocf_ctx): streams.remove(non_active_stream) cache = Cache.start_on_device(Volume(Size.from_MiB(200)), cache_mode=CacheMode.WT) - core = Core.using_device(Volume(core_size)) + core = Core.using_device(Volume(core_size), seq_cutoff_promotion_count=1) cache.add_core(core)