Remove "metadata_layout" parameter of the cache
This feature is replaced with LRU list shuffling. Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright(c) 2019-2021 Intel Corporation
|
||||
# Copyright(c) 2019-2022 Intel Corporation
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
@@ -52,7 +52,6 @@ class CacheConfig(Structure):
|
||||
("_cache_mode", c_uint32),
|
||||
("_promotion_policy", c_uint32),
|
||||
("_cache_line_size", c_uint64),
|
||||
("_metadata_layout", c_uint32),
|
||||
("_metadata_volatile", c_bool),
|
||||
("_locked", c_bool),
|
||||
("_pt_unaligned_io", c_bool),
|
||||
@@ -173,7 +172,6 @@ class Cache:
|
||||
cache_mode: CacheMode = CacheMode.DEFAULT,
|
||||
promotion_policy: PromotionPolicy = PromotionPolicy.DEFAULT,
|
||||
cache_line_size: CacheLineSize = CacheLineSize.DEFAULT,
|
||||
metadata_layout: MetadataLayout = MetadataLayout.DEFAULT,
|
||||
metadata_volatile: bool = False,
|
||||
max_queue_size: int = DEFAULT_BACKFILL_QUEUE_SIZE,
|
||||
queue_unblock_size: int = DEFAULT_BACKFILL_UNBLOCK,
|
||||
@@ -188,7 +186,6 @@ class Cache:
|
||||
self.cache_mode = cache_mode
|
||||
self.promotion_policy = promotion_policy
|
||||
self.cache_line_size = cache_line_size
|
||||
self.metadata_layout = metadata_layout
|
||||
self.metadata_volatile = metadata_volatile
|
||||
self.max_queue_size = max_queue_size
|
||||
self.queue_unblock_size = queue_unblock_size
|
||||
@@ -211,7 +208,6 @@ class Cache:
|
||||
_cache_mode=self.cache_mode,
|
||||
_promotion_policy=self.promotion_policy,
|
||||
_cache_line_size=self.cache_line_size,
|
||||
_metadata_layout=self.metadata_layout,
|
||||
_metadata_volatile=self.metadata_volatile,
|
||||
_backfill=Backfill(
|
||||
_max_queue_size=self.max_queue_size,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright(c) 2019-2021 Intel Corporation
|
||||
# Copyright(c) 2019-2022 Intel Corporation
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
@@ -153,7 +153,6 @@ def test_start_params(pyocf_ctx, mode: CacheMode, cls: CacheLineSize, layout: Me
|
||||
cache_mode=mode,
|
||||
cache_line_size=cls,
|
||||
name=name,
|
||||
metadata_layout=MetadataLayout.SEQUENTIAL,
|
||||
metadata_volatile=volatile_metadata,
|
||||
max_queue_size=queue_size,
|
||||
queue_unblock_size=unblock_size,
|
||||
@@ -164,7 +163,7 @@ def test_start_params(pyocf_ctx, mode: CacheMode, cls: CacheLineSize, layout: Me
|
||||
assert stats["conf"]["cache_mode"] == mode, "Cache mode"
|
||||
assert stats["conf"]["cache_line_size"] == cls, "Cache line size"
|
||||
assert cache.get_name() == name, "Cache name"
|
||||
# TODO: metadata_layout, metadata_volatile, max_queue_size,
|
||||
# TODO: metadata_volatile, max_queue_size,
|
||||
# queue_unblock_size, pt_unaligned_io, use_submit_fast
|
||||
# TODO: test in functional tests
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright(c) 2019-2021 Intel Corporation
|
||||
# Copyright(c) 2019-2022 Intel Corporation
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
@@ -82,10 +82,3 @@ def not_cache_line_size_randomize(request):
|
||||
)
|
||||
def not_promotion_policy_randomize(request):
|
||||
return request.param
|
||||
|
||||
|
||||
@pytest.fixture(
|
||||
params=RandomGenerator(DefaultRanges.UINT32).exclude_range(enum_range(MetadataLayout))
|
||||
)
|
||||
def not_metadata_layout_randomize(request):
|
||||
return request.param
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright(c) 2019-2021 Intel Corporation
|
||||
# Copyright(c) 2019-2022 Intel Corporation
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
#
|
||||
|
||||
@@ -73,25 +73,6 @@ def test_fuzzy_start_name(pyocf_ctx, string_randomize, cm, cls):
|
||||
cache.stop()
|
||||
|
||||
|
||||
@pytest.mark.security
|
||||
@pytest.mark.parametrize("cm", CacheMode)
|
||||
@pytest.mark.parametrize("cls", CacheLineSize)
|
||||
def test_fuzzy_start_metadata_layout(pyocf_ctx, not_metadata_layout_randomize, cm, cls):
|
||||
"""
|
||||
Test whether it is impossible to start cache with invalid metadata layout value.
|
||||
:param pyocf_ctx: basic pyocf context fixture
|
||||
:param c_uint32_randomize: metadata layout enum value to start cache with
|
||||
:param cm: cache mode value to start cache with
|
||||
:param cls: cache line size value to start cache with
|
||||
"""
|
||||
with pytest.raises(OcfError, match="OCF_ERR_INVAL"):
|
||||
try_start_cache(
|
||||
metadata_layout=not_metadata_layout_randomize,
|
||||
cache_mode=cm,
|
||||
cache_line_size=cls
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.security
|
||||
@pytest.mark.parametrize("cls", CacheLineSize)
|
||||
@pytest.mark.parametrize('max_wb_queue_size', RandomGenerator(DefaultRanges.UINT32, 10))
|
||||
|
Reference in New Issue
Block a user