Commit Graph

43 Commits

Author SHA1 Message Date
Robert Baldyga
6c7df8abf6 Initialize and deinitialize core pool with ctx
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-05-09 11:22:06 +02:00
Katarzyna Łapińska
c80ca4a9a8
Merge pull request #122 from KamilLepek/security_tests
Add security fuzzy tests and improve pyocf api
2019-04-18 07:33:11 +02:00
Michal Mielewczyk
5e52ac4ef2 Rename 'printf' field name in logger ops to 'print'.
Due the aggresive security checks in compiler 'printf' might be substituded with
'__printf_chk'. However it does not differentiate whether substituted string is
library function call whether field in structure.

By renaming field we prevent it to be unintentionally subustituted by the
preprocessor.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-04-17 11:37:47 -04:00
Jan Musiał
121b3233e4
Merge pull request #120 from arutk/core-query-api
Add API to query for core devices associated with cache
2019-04-17 13:33:04 +02:00
Adam Rutkowski
dfd89dd43a Probe core UUIDs from metadata
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-04-17 14:07:42 -04:00
Kamil Lepek
d55195ecf5 Add security fuzzy tests and improve pyocf api
Fuzzy tests added for:
changing cache mode
attaching cache device with fuzzed cache line size
setting cleaning policy
setting alru params
setting acp params
setting seq cut off policy per cache
setting seq cut off policy per core
2019-04-17 12:46:25 +02:00
Jan Musial
003d6505aa Fix leaky tests
Fix some instance tracking to prevent Python-side objects from leaking
buffers.
Also, reduce min size of Cache instance (real minimum should be around ~~19MiB,
but we need to make it more deterministic and 20 MiB seems to be reasonable).

Still some stuff left to do, but it needs more investigation and, for
now, this should suffice just to enable some form of CI.

Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-04-16 09:55:02 +02:00
Adam Rutkowski
2aba5a2843 Add volume_params argument to bottom volume open
This pointer is used to provide optional volume specific data
from the user down to bottom volume open callback. volume_params
is provided to OCF in ocf_mngt_cache_device_config.volume_params.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-04-01 19:28:14 -04:00
Michal Wysoczanski
901bbc5ebf Make ioclass name bigger
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-03-27 17:09:01 -04:00
Robert Baldyga
5699422586 Introduce ocf_cache_has_pending_cleaning() function
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-03-26 15:09:52 +01:00
Vitaliy Mysak
b2b0a56fbd Remove undefined declaration: ocf_cleaner_set_io_queue
Function ocf_cleaner_set_io_queue is not used and not defined
But is declared

This patch removes declaration

Signed-off-by: Vitaliy Mysak <vitaliy.mysak@intel.com>
2019-03-21 09:17:44 +01:00
Robert Baldyga
91e0345b78 Implement asynchronous attach, load, detach and stop
NOTE: This is still not the real asynchronism. Metadata interfaces
are still not fully asynchronous.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-03-18 15:06:57 +01:00
Robert Baldyga
c5df82f2cb Make management API asynchronous
NOTE: This patch only changes API that pretends to be asynchronous.
Most of management operations are still performed synchronously.
The real asynchronism will be introduced in the next patches.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-03-12 10:33:26 +01:00
Michal Rakowski
e5227cef89 Implement pyocf adapter with sample OCF test
PyOCF is a tool written with testing OCF functionality in mind.
It is a Python3 (3.6 version required) package which wraps OCF
by providing Python objects in place of OCF objects (volumes, queues,
etc). Thin layer of translation between OCF objects and PyOCF objects
enables using customized behaviors for OCF primitives by subclassing
PyOCF classes.

This initial version implements only WT and WI modes and single,
synchronously operating Queue.

TO DO:

  - Queues/Cleaner/MetadataUpdater implemented as Python threads
  - Loading of caches from PyOCF Volumes (fix bugs in OCF)
  - Make sure it works multi-threaded for more sophisticated tests

Co-authored-by: Jan Musial <jan.musial@intel.com>
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
Signed-off-by: Jan Musial <jan.musial@intel.com>
2019-03-07 12:48:40 +01:00
Michal Rakowski
794b008127
Merge pull request #66 from robertbaldyga/metadata-probe-asynchronous
Make metadata probe asynchronous
2019-03-04 12:26:34 +01:00
Robert Baldyga
9b9b965b55 Add cache locking functions in trylock variant
- Add cache trylock and read trylock functions.
- Introduce new error code -OCF_ERR_NO_LOCK.
- Change trylock functions in env to return this code in case of
  lock contention.

[ENV CHANGES REQUIRED]
Following functions should return 0 on success or -OCF_ERR_NO_LOCK
in case of lock contention:
- env_mutex_trylock()
- env_rwsem_up_read_trylock()
- env_rwsem_up_write_trylock()

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-03-01 17:31:32 +01:00
Robert Baldyga
9c0390a6ce Make metadata probe asynchronous
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-03-01 15:46:16 +01:00
Robert Baldyga
c1028b2b89 Add ocf_cache_set_flush_queue() function
This is needed to enable flushing with dynamic queues.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-02-28 10:51:51 +01:00
Jan Musiał
d5ac3035d7
Merge pull request #64 from robertbaldyga/add-has-pending-reqs-func
Add ocf_cache_has_pending_requests() function
2019-02-27 12:22:16 +01:00
Michal Mielewczyk
e53944d472 Dynamic I/O queue management
- Queue allocation is now separated from starting cache.
- Queue can be created and destroyed in runtime.
- All queue ops accept queue handle instead of queue id.
- Cache stores queues as list instead of array.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-02-26 17:36:19 +01:00
Robert Baldyga
03bd6d6c49 Add ocf_cache_has_pending_requests() function
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-02-26 17:23:07 +01:00
Robert Baldyga
44ed250d41 Add API function ocf_cache_wait_for_io_finish()
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-02-20 11:16:06 +01:00
Robert Baldyga
404b976109 Make cleaner asynchronous
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-02-19 16:10:24 +01:00
Michal Mielewczyk
f8037cb349 Added function to hanlde single request from queue. 2019-02-13 12:02:59 -05:00
Robert Baldyga
97300b1137 Rename "data object" to "volume"
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-02-08 14:13:05 +01:00
Michal Mielewczyk
2dfd6248c9 Configure all io classes at once.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-01-28 08:51:26 -05:00
Robert Baldyga
3b4a666942 Enable passing priv to logger during context initialization
This may be used in logger implementations that need file
name or descriptor to initialize properly.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-01-24 10:54:50 +01:00
Robert Baldyga
6860cdbd2c Reorganize context ops
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-01-22 13:14:35 +01:00
Robert Baldyga
03c2f142b3 Cache lock cleanup and API improvements
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-01-21 13:46:28 +01:00
Robert Baldyga
7352f3092d Fix leak in core pool
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-01-16 11:53:54 +01:00
Robert Baldyga
d9cfab67b8 Fix compilation errors after tracing introduction
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-01-14 17:28:51 +01:00
Robert Bałdyga
dd6b074258
Merge pull request #3 from tomaszrybicki/add-tracing-support
Added tracing functionality
2019-01-14 16:37:34 +01:00
Michał Mielewczyk
f11db9c31a
Merge pull request #38 from robertbaldyga/remove-name_size
Remove name_size field from cache and core config
2019-01-14 16:04:16 +01:00
Robert Baldyga
322f1aeffd Remove name_size field from cache and core config
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-01-14 15:09:09 +01:00
Robert Baldyga
afb63790f2 Add ocf_uuid_to_str() function
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-01-14 15:07:31 +01:00
Robert Baldyga
749f6906bb Fix function initializing UUID from string
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-01-14 15:07:15 +01:00
Tomasz Rybicki
1156531590 Added tracing functionality
Signed-off-by: Tomasz Rybicki <tomasz.rybicki@intel.com>
2019-01-14 14:17:48 +01:00
Robert Baldyga
4cf4d6d7c7 Simplify data object API
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-01-04 17:34:39 +01:00
Robert Baldyga
4be6761a18 Core data object
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-01-04 08:33:34 +01:00
Robert Baldyga
848cd9112b Add str_to_uuid function
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2018-12-19 13:30:17 +01:00
Robert Baldyga
db92083432 Unify req naming convention (rq -> req)
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2018-12-12 13:36:34 +01:00
Robert Baldyga
d862778e2b Remove legacy io completion API
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2018-12-12 11:20:41 +01:00
Robert Baldyga
a8e1ce8cc5 Initial commit
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2018-11-29 15:14:21 +01:00