Open CAS Framework
Open source framework of Cache Acceleration Software
Macros | Enumerations
ocf_def.h File Reference

OCF definitions. More...

#include "ocf_cfg.h"

Go to the source code of this file.

Macros

#define OCF_SEQ_CUTOFF_MAX_STREAMS   256
 
#define MAX_TRIM_RQ_SIZE   (512 * KiB)
 
OCF cache definitions
#define OCF_CACHE_ID_MIN   1
 
#define OCF_CACHE_ID_MAX   16384
 
#define OCF_CACHE_ID_INVALID   0
 
#define OCF_CACHE_SIZE_MIN   (20 * MiB)
 
#define OCF_CACHE_NAME_SIZE   32
 
#define OCF_CACHE_FALLBACK_PT_INACTIVE   0
 
#define OCF_CACHE_FALLBACK_PT_MIN_ERROR_THRESHOLD   OCF_CACHE_FALLBACK_PT_INACTIVE
 
#define OCF_CACHE_FALLBACK_PT_MAX_ERROR_THRESHOLD   1000000
 
OCF cores definitions
#define OCF_CORE_MAX   OCF_CONFIG_MAX_CORES
 
#define OCF_CORE_ID_MIN   0
 
#define OCF_CORE_ID_MAX   (OCF_CORE_MAX - 1)
 
#define OCF_CORE_ID_INVALID   OCF_CORE_MAX
 
#define OCF_CORE_NAME_SIZE   32
 
#define OCF_SEQ_NO_MIN   1
 
#define OCF_SEQ_NO_MAX   (65535UL)
 
#define OCF_SEQ_NO_INVALID   0
 
Miscellaneous defines
#define KiB   (1ULL << 10)
 
#define MiB   (1ULL << 20)
 
#define GiB   (1ULL << 30)
 
OCF IO class definitions
#define OCF_IO_CLASS_MAX   OCF_CONFIG_MAX_IO_CLASSES
 
#define OCF_IO_CLASS_ID_MIN   0
 
#define OCF_IO_CLASS_ID_MAX   (OCF_IO_CLASS_MAX - 1)
 
#define OCF_IO_CLASS_INVALID   OCF_IO_CLASS_MAX
 
#define OCF_IO_CLASS_NAME_MAX   1024
 
#define OCF_IO_CLASS_PRIO_PINNED   -1
 
#define OCF_IO_CLASS_PRIO_HIGHEST   0
 
#define OCF_IO_CLASS_PRIO_LOWEST   255
 
#define OCF_IO_CLASS_PRIO_DEFAULT   OCF_IO_CLASS_PRIO_LOWEST
 
I/O operations
#define OCF_READ   0
 
#define OCF_WRITE   1
 
OCF cleaner definitions
#define OCF_CLEANER_DISABLE   ~0U
 

Enumerations

enum  ocf_cache_state_t {
  ocf_cache_state_running = 0, ocf_cache_state_stopping = 1, ocf_cache_state_initializing = 2, ocf_cache_state_incomplete = 3,
  ocf_cache_state_max
}
 
enum  ocf_core_state_t { ocf_core_state_active = 0, ocf_core_state_inactive, ocf_core_state_max }
 
enum  ocf_cache_mode_t {
  ocf_cache_mode_wt = 0, ocf_cache_mode_wb, ocf_cache_mode_wa, ocf_cache_mode_pt,
  ocf_cache_mode_wi, ocf_cache_mode_wo, ocf_cache_mode_max, ocf_cache_mode_default = ocf_cache_mode_wt,
  ocf_cache_mode_none = -1
}
 
enum  ocf_seq_cutoff_policy {
  ocf_seq_cutoff_policy_always = 0, ocf_seq_cutoff_policy_full, ocf_seq_cutoff_policy_never, ocf_seq_cutoff_policy_max,
  ocf_seq_cutoff_policy_default = ocf_seq_cutoff_policy_full
}
 
enum  ocf_eviction_t { ocf_eviction_lru = 0, ocf_eviction_max, ocf_eviction_default = ocf_eviction_lru }
 
enum  ocf_promotion_t { ocf_promotion_always = 0, ocf_promotion_nhit, ocf_promotion_max, ocf_promotion_default = ocf_promotion_always }
 
enum  ocf_cleaning_t {
  ocf_cleaning_nop = 0, ocf_cleaning_alru, ocf_cleaning_acp, ocf_cleaning_max,
  ocf_cleaning_default = ocf_cleaning_alru
}
 
enum  ocf_cache_line_size_t {
  ocf_cache_line_size_none = 0, ocf_cache_line_size_4 = 4 * KiB, ocf_cache_line_size_8 = 8 * KiB, ocf_cache_line_size_16 = 16 * KiB,
  ocf_cache_line_size_32 = 32 * KiB, ocf_cache_line_size_64 = 64 * KiB, ocf_cache_line_size_default = ocf_cache_line_size_4, ocf_cache_line_size_min = ocf_cache_line_size_4,
  ocf_cache_line_size_max = ocf_cache_line_size_64, ocf_cache_line_size_inf = ~0ULL
}
 
enum  ocf_metadata_layout_t { ocf_metadata_layout_striping = 0, ocf_metadata_layout_seq = 1, ocf_metadata_layout_max, ocf_metadata_layout_default = ocf_metadata_layout_striping }
 

Detailed Description

OCF definitions.

Macro Definition Documentation

◆ OCF_CACHE_FALLBACK_PT_INACTIVE

#define OCF_CACHE_FALLBACK_PT_INACTIVE   0

Value to turn off fallback pass through

◆ OCF_CACHE_FALLBACK_PT_MAX_ERROR_THRESHOLD

#define OCF_CACHE_FALLBACK_PT_MAX_ERROR_THRESHOLD   1000000

Maximum value of io error threshold

◆ OCF_CACHE_FALLBACK_PT_MIN_ERROR_THRESHOLD

#define OCF_CACHE_FALLBACK_PT_MIN_ERROR_THRESHOLD   OCF_CACHE_FALLBACK_PT_INACTIVE

Minimum value of io error threshold

◆ OCF_CACHE_ID_INVALID

#define OCF_CACHE_ID_INVALID   0

Invalid value of cache id

◆ OCF_CACHE_ID_MAX

#define OCF_CACHE_ID_MAX   16384

Maximum value of a valid cache ID

◆ OCF_CACHE_ID_MIN

#define OCF_CACHE_ID_MIN   1

Minimum value of a valid cache ID

◆ OCF_CACHE_NAME_SIZE

#define OCF_CACHE_NAME_SIZE   32

Size of cache name

◆ OCF_CACHE_SIZE_MIN

#define OCF_CACHE_SIZE_MIN   (20 * MiB)

Minimum cache size in bytes

◆ OCF_CORE_ID_INVALID

#define OCF_CORE_ID_INVALID   OCF_CORE_MAX

Invalid value of core id

◆ OCF_CORE_ID_MAX

#define OCF_CORE_ID_MAX   (OCF_CORE_MAX - 1)

Maximum value of a valid core ID

◆ OCF_CORE_ID_MIN

#define OCF_CORE_ID_MIN   0

Minimum value of a valid core ID

◆ OCF_CORE_MAX

#define OCF_CORE_MAX   OCF_CONFIG_MAX_CORES

Maximum numbers of cores per cache instance

◆ OCF_CORE_NAME_SIZE

#define OCF_CORE_NAME_SIZE   32

Size of core name

◆ OCF_IO_CLASS_ID_MAX

#define OCF_IO_CLASS_ID_MAX   (OCF_IO_CLASS_MAX - 1)

Maximum value of a valid IO class ID

◆ OCF_IO_CLASS_ID_MIN

#define OCF_IO_CLASS_ID_MIN   0

Minimum value of a valid IO class ID

◆ OCF_IO_CLASS_INVALID

#define OCF_IO_CLASS_INVALID   OCF_IO_CLASS_MAX

Invalid value of IO class id

◆ OCF_IO_CLASS_MAX

#define OCF_IO_CLASS_MAX   OCF_CONFIG_MAX_IO_CLASSES

Maximum numbers of IO classes per cache instance

◆ OCF_IO_CLASS_NAME_MAX

#define OCF_IO_CLASS_NAME_MAX   1024

Maximum size of the IO class name

◆ OCF_IO_CLASS_PRIO_DEFAULT

#define OCF_IO_CLASS_PRIO_DEFAULT   OCF_IO_CLASS_PRIO_LOWEST

Default IO class priority

◆ OCF_IO_CLASS_PRIO_HIGHEST

#define OCF_IO_CLASS_PRIO_HIGHEST   0

The highest IO class priority

◆ OCF_IO_CLASS_PRIO_LOWEST

#define OCF_IO_CLASS_PRIO_LOWEST   255

The lowest IO class priority

◆ OCF_IO_CLASS_PRIO_PINNED

#define OCF_IO_CLASS_PRIO_PINNED   -1

IO class priority which indicates pinning

◆ OCF_SEQ_NO_MAX

#define OCF_SEQ_NO_MAX   (65535UL)

Maximum value of a valid core sequence number

◆ OCF_SEQ_NO_MIN

#define OCF_SEQ_NO_MIN   1

Minimum value of valid core sequence number

Enumeration Type Documentation

◆ ocf_cache_line_size_t

OCF supported cache line sizes in bytes

Enumerator
ocf_cache_line_size_none 

None

ocf_cache_line_size_4 

4 kiB

ocf_cache_line_size_8 

8 kiB

ocf_cache_line_size_16 

16 kiB

ocf_cache_line_size_32 

32 kiB

ocf_cache_line_size_64 

64 kiB

ocf_cache_line_size_default 

Default cache line size

ocf_cache_line_size_min 

Minimum cache line size

ocf_cache_line_size_max 

Maximal cache line size

ocf_cache_line_size_inf 

Force enum to be 64-bit

◆ ocf_cache_mode_t

OCF supported cache modes

Enumerator
ocf_cache_mode_wt 

Write-through cache mode

ocf_cache_mode_wb 

Write-back cache mode

ocf_cache_mode_wa 

Write-around cache mode

ocf_cache_mode_pt 

Pass-through cache mode

ocf_cache_mode_wi 

Write invalidate cache mode

ocf_cache_mode_wo 

Write-only cache mode

ocf_cache_mode_max 

Stopper of cache mode enumerator

ocf_cache_mode_default 

Default cache mode

ocf_cache_mode_none 

Current cache mode of given cache instance

◆ ocf_cache_state_t

This Enumerator describes OCF cache instance state

Enumerator
ocf_cache_state_running 

ocf_cache_state_running

OCF is currently running

ocf_cache_state_stopping 

ocf_cache_state_stopping

OCF cache instance is stopping

ocf_cache_state_initializing 

ocf_cache_state_initializing

OCF cache instance during initialization

ocf_cache_state_incomplete 

ocf_cache_state_incomplete

OCF cache has at least one inactive core

ocf_cache_state_max 

ocf_cache_state_max

Stopper of cache state enumerator

◆ ocf_cleaning_t

OCF supported Write-Back cleaning policies type

Enumerator
ocf_cleaning_nop 

Cleaning won't happen in background. Only on eviction or during cache stop

ocf_cleaning_alru 

Approximately recently used. Cleaning thread in the background enabled which cleans dirty data during IO inactivity.

ocf_cleaning_acp 

Cleaning algorithm attempts to reduce core device seek distance. Cleaning thread runs concurrently with I/O.

ocf_cleaning_max 

Stopper of enumerator

ocf_cleaning_default 

Default cleaning policy type

◆ ocf_core_state_t

This Enumerator describes OCF core instance state

Enumerator
ocf_core_state_active 

Core is active

ocf_core_state_inactive 

Core is inactive (not attached)

ocf_core_state_max 

Stopper of core state enumerator

◆ ocf_eviction_t

OCF supported eviction policy types

Enumerator
ocf_eviction_lru 

Last recently used eviction policy

ocf_eviction_max 

Stopper of enumerator

ocf_eviction_default 

Default eviction policy

◆ ocf_metadata_layout_t

Metadata layout

◆ ocf_promotion_t

OCF supported promotion policy types

Enumerator
ocf_promotion_always 

No promotion policy. Cache inserts are not filtered

ocf_promotion_nhit 

Line can be inserted after N requests for it

ocf_promotion_max 

Stopper of enumerator

ocf_promotion_default 

Default promotion policy

◆ ocf_seq_cutoff_policy

Enumerator
ocf_seq_cutoff_policy_always 

Sequential cutoff always on

ocf_seq_cutoff_policy_full 

Sequential cutoff when occupancy is 100%

ocf_seq_cutoff_policy_never 

Sequential cutoff disabled

ocf_seq_cutoff_policy_max 

Stopper of sequential cutoff policy enumerator

ocf_seq_cutoff_policy_default 

Default sequential cutoff policy