2626#define CEPH_ERASURE_CODE_ISA_L_H
2727
2828// -----------------------------------------------------------------------------
29+ #include < string_view>
2930#include " erasure-code/ErasureCode.h"
3031#include " ErasureCodeIsaTableCache.h"
3132// -----------------------------------------------------------------------------
3233
34+ using namespace std ::literals;
35+
3336#define EC_ISA_ADDRESS_ALIGNMENT 32u
3437
3538#define is_aligned (POINTER, BYTE_COUNT ) \
@@ -51,6 +54,7 @@ class ErasureCodeIsa : public ceph::ErasureCode {
5154
5255 ErasureCodeIsaTableCache &tcache;
5356 const char *technique;
57+ uint64_t flags;
5458
5559 ErasureCodeIsa (const char *_technique,
5660 ErasureCodeIsaTableCache &_tcache) :
@@ -60,6 +64,15 @@ class ErasureCodeIsa : public ceph::ErasureCode {
6064 tcache (_tcache),
6165 technique (_technique)
6266 {
67+ flags = FLAG_EC_PLUGIN_PARTIAL_READ_OPTIMIZATION |
68+ FLAG_EC_PLUGIN_PARTIAL_WRITE_OPTIMIZATION |
69+ FLAG_EC_PLUGIN_ZERO_INPUT_ZERO_OUTPUT_OPTIMIZATION |
70+ FLAG_EC_PLUGIN_PARITY_DELTA_OPTIMIZATION;
71+
72+ if (technique == " reed_sol_van" sv ||
73+ technique == " default" sv) {
74+ flags |= FLAG_EC_PLUGIN_OPTIMIZED_SUPPORTED;
75+ }
6376 }
6477
6578
@@ -68,10 +81,7 @@ class ErasureCodeIsa : public ceph::ErasureCode {
6881 }
6982
7083 uint64_t get_supported_optimizations () const override {
71- return FLAG_EC_PLUGIN_PARTIAL_READ_OPTIMIZATION |
72- FLAG_EC_PLUGIN_PARTIAL_WRITE_OPTIMIZATION |
73- FLAG_EC_PLUGIN_ZERO_INPUT_ZERO_OUTPUT_OPTIMIZATION |
74- FLAG_EC_PLUGIN_PARITY_DELTA_OPTIMIZATION;
84+ return flags;
7585 }
7686
7787 unsigned int
0 commit comments