OCF update (removed configurable eviction policy)
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
This commit is contained in:
committed by
Kozlowski Mateusz
parent
647124895f
commit
7aa883dbd3
@@ -256,11 +256,6 @@ struct name_to_val_mapping {
|
||||
int value;
|
||||
};
|
||||
|
||||
static struct name_to_val_mapping eviction_policy_names[] = {
|
||||
{ .short_name = "lru", .value = ocf_eviction_lru },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static struct name_to_val_mapping cache_mode_names[] = {
|
||||
{ .short_name = "wt", .long_name = "Write-Through", .value = ocf_cache_mode_wt },
|
||||
{ .short_name = "wb", .long_name = "Write-Back", .value = ocf_cache_mode_wb },
|
||||
@@ -417,19 +412,6 @@ static const char* val_to_short_name(int value, const struct name_to_val_mapping
|
||||
return other_name;
|
||||
}
|
||||
|
||||
/* Returns non-negative policy index or
|
||||
* negative number in case of error.
|
||||
*/
|
||||
inline int validate_str_ev_policy(const char *s)
|
||||
{
|
||||
return validate_str_val_mapping(s, eviction_policy_names, -1);
|
||||
}
|
||||
|
||||
inline const char *eviction_policy_to_name(uint8_t policy)
|
||||
{
|
||||
return val_to_short_name(policy, eviction_policy_names, "Unknown");
|
||||
}
|
||||
|
||||
inline const char *cache_mode_to_name(uint8_t cache_mode)
|
||||
{
|
||||
return val_to_short_name(cache_mode, cache_mode_names, "Unknown");
|
||||
@@ -850,7 +832,6 @@ struct cache_device *get_cache_device(const struct kcas_cache_info *info, bool b
|
||||
cache->mode = info->info.cache_mode;
|
||||
cache->dirty = info->info.dirty;
|
||||
cache->flushed = info->info.flushed;
|
||||
cache->eviction_policy = info->info.eviction_policy;
|
||||
cache->cleaning_policy = info->info.cleaning_policy;
|
||||
cache->promotion_policy = info->info.promotion_policy;
|
||||
cache->size = info->info.cache_line_size;
|
||||
@@ -1017,7 +998,6 @@ static void check_cache_scheduler(const char *cache_device, const char *elv_name
|
||||
|
||||
int start_cache(uint16_t cache_id, unsigned int cache_init,
|
||||
const char *cache_device, ocf_cache_mode_t cache_mode,
|
||||
ocf_eviction_t eviction_policy_type,
|
||||
ocf_cache_line_size_t line_size, int force)
|
||||
{
|
||||
int fd = 0;
|
||||
@@ -1069,7 +1049,6 @@ int start_cache(uint16_t cache_id, unsigned int cache_init,
|
||||
return FAILURE;
|
||||
}
|
||||
cmd.caching_mode = cache_mode;
|
||||
cmd.eviction_policy = eviction_policy_type;
|
||||
cmd.line_size = line_size;
|
||||
cmd.force = (uint8_t)force;
|
||||
|
||||
@@ -2175,7 +2154,7 @@ int partition_list(unsigned int cache_id, unsigned int output_format)
|
||||
}
|
||||
fputc('\n', intermediate_file[1]);
|
||||
|
||||
for (i = 0; i < OCF_IO_CLASS_MAX; i++, io_class.ext_err_code = 0) {
|
||||
for (i = 0; i < OCF_USER_IO_CLASS_MAX; i++, io_class.ext_err_code = 0) {
|
||||
io_class.cache_id = cache_id;
|
||||
io_class.class_id = i;
|
||||
|
||||
|
||||
@@ -91,7 +91,6 @@ enum metadata_mode_t {
|
||||
|
||||
#define STATS_FILTER_COUNTERS (STATS_FILTER_REQ | STATS_FILTER_BLK | STATS_FILTER_ERR)
|
||||
|
||||
const char *eviction_policy_to_name(uint8_t policy);
|
||||
const char *cleaning_policy_to_name(uint8_t policy);
|
||||
const char *promotion_policy_to_name(uint8_t policy);
|
||||
const char *cache_mode_to_name(uint8_t cache_mode);
|
||||
@@ -122,7 +121,6 @@ void metadata_memory_footprint(uint64_t size, float *footprint, const char **uni
|
||||
|
||||
int start_cache(uint16_t cache_id, unsigned int cache_init,
|
||||
const char *cache_device, ocf_cache_mode_t cache_mode,
|
||||
ocf_eviction_t eviction_policy_type,
|
||||
ocf_cache_line_size_t line_size, int force);
|
||||
int stop_cache(uint16_t cache_id, int flush);
|
||||
|
||||
@@ -264,7 +262,6 @@ int validate_str_unum(const char *source_str, const char *msg, unsigned int min,
|
||||
int validate_path(const char *path, int exist);
|
||||
|
||||
int validate_str_cache_mode(const char *s);
|
||||
int validate_str_ev_policy(const char *s);
|
||||
int validate_str_cln_policy(const char *s);
|
||||
int validate_str_promotion_policy(const char *s);
|
||||
int validate_str_meta_variant(const char *s);
|
||||
|
||||
@@ -44,7 +44,6 @@ struct command_args{
|
||||
int stats_filters;
|
||||
int output_format;
|
||||
int io_class_id;
|
||||
int eviction_policy_type;
|
||||
int line_size;
|
||||
int cache_state_flush;
|
||||
int flush_data;
|
||||
@@ -139,11 +138,6 @@ int command_handle_option(char *opt, const char **arg)
|
||||
|
||||
if (command_args_values.cleaning_policy_type < 0)
|
||||
return FAILURE;
|
||||
} else if (!strcmp(opt, "eviction-policy")) {
|
||||
command_args_values.eviction_policy_type = validate_str_ev_policy((const char*)arg[0]);
|
||||
|
||||
if (command_args_values.eviction_policy_type < 0)
|
||||
return FAILURE;
|
||||
} else if (!strcmp(opt, "try-add")) {
|
||||
command_args_values.try_add = true;
|
||||
} else if (!strcmp(opt, "update-path")) {
|
||||
@@ -336,7 +330,6 @@ int handle_start()
|
||||
command_args_values.state,
|
||||
command_args_values.cache_device,
|
||||
command_args_values.cache_mode,
|
||||
command_args_values.eviction_policy_type,
|
||||
command_args_values.line_size,
|
||||
command_args_values.force);
|
||||
|
||||
|
||||
@@ -498,7 +498,7 @@ int cache_stats_ioclasses(int ctrl_fd, const struct kcas_cache_info *cache_info,
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
for (part_iter_id = 0; part_iter_id < OCF_IO_CLASS_MAX; part_iter_id++) {
|
||||
for (part_iter_id = 0; part_iter_id < OCF_USER_IO_CLASS_MAX; part_iter_id++) {
|
||||
info.cache_id = cache_id;
|
||||
info.class_id = part_iter_id;
|
||||
stats.cache_id = cache_id;
|
||||
@@ -567,8 +567,6 @@ int cache_stats_conf(int ctrl_fd, const struct kcas_cache_info *cache_info,
|
||||
|
||||
print_kv_pair(outfile, "Write Policy", "%s",
|
||||
cache_mode_to_name(cache_info->info.cache_mode));
|
||||
print_kv_pair(outfile, "Eviction Policy", "%s",
|
||||
eviction_policy_to_name(cache_info->info.eviction_policy));
|
||||
print_kv_pair(outfile, "Cleaning Policy", "%s",
|
||||
cleaning_policy_to_name(cache_info->info.cleaning_policy));
|
||||
print_kv_pair(outfile, "Promotion Policy", "%s",
|
||||
|
||||
Reference in New Issue
Block a user