Commit Graph

1509 Commits

Author SHA1 Message Date
Adam Rutkowski
28f99ad7a5 pyocf: flush engine logic test
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-06-01 22:35:21 +02:00
Adam Rutkowski
f0b8815429 pyocf: reintroduce trace device
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-06-01 22:35:17 +02:00
Adam Rutkowski
ad2a583f43 pyocf: test for large I/O
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-06-01 22:33:35 +02:00
Adam Rutkowski
df7ed6920c Fix ops(flush) engine
Flush I/O should be forwarded to core and cache device. In case of core
this is simple - just mirror the I/O from the top volume. Since
cache data is owned by OCF it makes sense to send a simple flush I/O
with 0 address and size.

Current implementation attempts to use cache data I/O interface
(ocf_submit_cache_reqs function) instead of submitting empty flush to
the underlying cache device. This function is designed to read/write
from mapped cachelines while there is no traversation/mapping
performed on flush I/O.

If request map allocation succeeds, this results in sending I/O to
addres 0 with size and flags inherited from the top adapter I/O.
This doesn't make any sense, and can even result in invalid I/O if the
size is greater than cache device size.

Even worse, if flush request map allocation fails (which happens
always in case of large flush requests) then the erroneous call to
ocf_submit_cache_reqs results in NULL pointer dereference.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-06-01 22:33:35 +02:00
Adam Rutkowski
8e16a26b6a pyocf: add volume submit_flush() and submit_discard()
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-06-01 22:33:35 +02:00
Adam Rutkowski
07c7db81f4 pyocf: add FLUSH flag
Flush I/O must be recognized by the bottom adapter by inspecting
adapter specific flags

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-06-01 22:33:35 +02:00
Adam Rutkowski
9646df431f
Merge pull request #712 from arutk/black
pyocf: format all .py files with black -l 100
2022-05-19 16:42:24 +02:00
Jan Musiał
0357e49896
Merge pull request #716 from jfckm/alock-count-locks
Extend alock API with entries_count method
2022-05-18 15:33:32 +02:00
Jan Musial
6016a6f4c7 Mark unlikely branches in pio_concurrency
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-05-18 11:56:06 +02:00
Adam Rutkowski
83bb7317bf pyocf: format all .py files with black -l 100
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 16:44:19 +02:00
Adam Rutkowski
3a1b6fd718
Merge pull request #695 from arutk/failover_test_5
pyocf: failover functional and power failure recovery tests
2022-05-16 16:37:45 +02:00
Jan Musial
60a6da7ee6 Extend alock API with entries_count method
Right now alock assumes that number of locks taken will equal number of
core lines. This is not the case in pio, where only parts of metadata
are under locks. If pio request overlaps locked and not-locked metadata
section it will have different core lines number and awaited locks
number. To remedy this discrepancy additional method which gets count of
locks that will be taken/waited on is added to alock API.

Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-05-16 16:21:08 +02:00
Adam Rutkowski
2721378942 failover tests
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:42:17 +02:00
Adam Rutkowski
fcfbd860c4 pyocf: fix error volume stats reset
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
a504821302 pyocf: separate get_conf() from stats in Cache
Configuration parameters are available in standby mode, while
stats are not. Need to separate the two.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
3d83e1f004 pyocf: more generic erorr device volume
Make ErrorDevice a wraper over any type of volume rather than
inheriting from RamVolume. This way error injection layer can be added
over any type of volume.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
d8e519855b pyocf: more options to standby load
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
b78c36ccdd pyocf: add missing import Volume in cache
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
6a03145acf pyocf: cache/core object volume fixes
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
ebb107f1a1 posix env: print call stack in case of BUG()
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
2dde108cd9 pyocf: collision addr helper
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
978620f9e3 pyocf: move C wrappers to newly added "c" diretory
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
f66eefb3bd pyocf: remember queue name
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
7c186f5d0e pyocf: make queues a required rio param
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
c37ffea4c2 pyocf: add from_page() method to Size class
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:16 +02:00
Robert Baldyga
3aa12793a1
Merge pull request #713 from robertbaldyga/use-ocf-div-round-up
Use internal implementation of DIV_ROUND_UP
2022-05-13 21:21:26 +02:00
Robert Baldyga
703f5b7e23
Merge pull request #704 from robertbaldyga/disable-cleaner
Add disable_cleaner option
2022-05-10 14:07:19 +02:00
Robert Baldyga
ad7a40feaf Use internal implementation of DIV_ROUND_UP
It's required, because environments other than Linux kernel may not define
their own DIV_ROUND_UP. Moving it to env would just generate boilerplate,
because its implementation is trivial and portable.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-05-10 09:52:17 +02:00
Robert Baldyga
50bff0285d
Merge pull request #708 from KamilLepek/fix_perm
Fix permissions for verify_header.sh
2022-05-05 16:06:50 +02:00
Kamil Lepek
3464bb5da7 Fix permissions for verify_header.sh
Signed-off-by: Kamil Lepek <kamil.lepek@intel.com>
2022-05-05 13:49:05 +02:00
Robert Baldyga
32dbb2d355
Merge pull request #707 from Open-CAS/KamilLepek-patch-1
Added header verification script
2022-05-05 11:40:31 +02:00
Kamil Łepek
0ce8ced578 Added header verification script
Signed-off-by: Kamil Lepek <kamil.lepek@intel.com>
2022-05-04 16:52:11 +02:00
Robert Baldyga
ed012411d3 Add disable_cleaner field to CacheAttachConfig
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-04-28 13:04:27 +02:00
Robert Baldyga
94aca1e8e4 pyocf: Remove non-existing field from CacheAttachConfig
This field has been moved to CacheDeviceConfig.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-04-28 13:04:27 +02:00
Robert Baldyga
d4df912f46 Add option to disable cleaner
This allows to avoid allocating cleaner metadata section and effectively
save up to 20% of metadata memory footprint.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-04-28 13:04:27 +02:00
Robert Baldyga
761ff2f053 pyocf: Add test designs for disable_cleaner option
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-04-28 13:04:27 +02:00
Robert Baldyga
c088faf711 doc: Add disable_cleaner requirements documentation
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-04-27 16:09:14 +02:00
Adam Rutkowski
650511df4e pyocf: remove Queue objects from Cache::start() params
... since a started cache is required to construct a queue object.
Instead add params to control whether to construct and register
management and default I/O queue in start().

Additionally introducing Cache method to register additional I/O
queues.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-04-13 10:38:57 +02:00
Adam Rutkowski
1f9c3dd24f pyocf: add test fixture with 2 ctxts
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-04-13 10:38:56 +02:00
Robert Baldyga
fa6c0f3573
Merge pull request #699 from mmichal10/alleviation-for-static-analysers
Alleviation for static analyzers
2022-04-11 17:31:32 +02:00
Michal Mielewczyk
e8e4e00bb7 alru: explicit upcasting
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-04-11 15:21:37 +02:00
Michal Mielewczyk
cd4d894348 acp: skip the first bucket on recovering acp
Since the threshold for the first bucket is always zero and the condition to
exit from the loop is never met in the first iteration it is save to start
iterating from `1`

This change is meant to avoid confusing static code analyzers

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-04-11 13:14:25 +02:00
Robert Baldyga
99608c9a30
Merge pull request #698 from mmichal10/secure-fixes
fixes for Coverity static analysis findings
2022-04-08 16:39:31 +02:00
Michal Mielewczyk
edd42fed98 Avoid zero-size memcpy
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-04-08 16:10:28 +02:00
Michal Mielewczyk
92fa8f7e59 Remove redundant standby check
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-04-08 15:34:14 +02:00
Michal Mielewczyk
bc30d2665b Prevent sending io to volume if it not opened
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-04-08 15:34:14 +02:00
Michal Mielewczyk
9734980be2 Free memory when failed to open core volume
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-04-08 15:34:14 +02:00
Robert Baldyga
a0bf8587a0
Merge pull request #697 from arutk/deinit_pio_in_stop
Add missing pio deinitialization in standby stop pipeline
2022-04-07 13:02:06 +02:00
Adam Rutkowski
8f24556cec Add missing pio deinitialization in standby stop pipeline
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-04-07 12:23:03 +02:00
Adam Rutkowski
550a479cde fix typo in cache mngmt
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-04-07 12:23:03 +02:00