]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
erasure-code: Fix to set FLAG_EC_PLUGIN_CRC_ENCODE_DECODE_SUPPORT for ISA-L cauchy wip-jamiepryde-isal-auto-switch-to-cauchy
authorJamie Pryde <jamiepry@uk.ibm.com>
Wed, 13 Aug 2025 20:42:17 +0000 (21:42 +0100)
committerJamie Pryde <jamiepry@uk.ibm.com>
Thu, 14 Aug 2025 10:45:50 +0000 (11:45 +0100)
Signed-off-by: Jamie Pryde <jamiepry@uk.ibm.com>
src/erasure-code/isa/ErasureCodeIsa.h
src/erasure-code/isa/ErasureCodePluginIsa.cc
src/test/erasure-code/TestErasureCodePluginIsa.cc

index 19e654f2ea84ea21d58ee8d1a5c64cb898b3c1b5..ae14b1d6aace9737f8233faf5b7ff31ad9700047 100644 (file)
@@ -57,7 +57,8 @@ public:
   uint64_t flags;
 
   ErasureCodeIsa(const std::string &_technique,
-                 ErasureCodeIsaTableCache &_tcache) :
+                 ErasureCodeIsaTableCache &_tcache,
+                 const std::string &_m = "0") :
   k(0),
   m(0),
   w(0),
@@ -71,9 +72,9 @@ public:
             FLAG_EC_PLUGIN_PARITY_DELTA_OPTIMIZATION;
 
     if (technique == "reed_sol_van"sv) {
-      flags |= FLAG_EC_PLUGIN_CRC_ENCODE_DECODE_SUPPORT;
-    } else if (technique == "cauchy"sv && m == 1) {
-      flags |= FLAG_EC_PLUGIN_CRC_ENCODE_DECODE_SUPPORT;
+       flags |= FLAG_EC_PLUGIN_CRC_ENCODE_DECODE_SUPPORT;
+    } else if (technique == "cauchy"sv && _m == "1"sv) {
+       flags |= FLAG_EC_PLUGIN_CRC_ENCODE_DECODE_SUPPORT;
     }
   }
 
@@ -154,8 +155,9 @@ public:
 
   ErasureCodeIsaDefault(ErasureCodeIsaTableCache &_tcache,
                         const std::string& technique,
-                        int matrix = kVandermonde) :
-  ErasureCodeIsa(technique, _tcache),
+                        int matrix = kVandermonde,
+                        const std::string &_m = "0") :
+  ErasureCodeIsa(technique, _tcache, _m),
   encode_coeff(0), encode_tbls(0)
   {
     matrixtype = matrix;
index 80a4b803de15815c283239ffd876df6261492432..7904f407d7cfa3a4b83981ca86592544657ca9a1 100644 (file)
@@ -38,14 +38,17 @@ int ErasureCodePluginIsa::factory(const std::string &directory,
   ErasureCodeIsa *interface;
     std::string technique;
     technique = profile.find("technique")->second;
+    std::string _m = profile.find("m")->second;
     if ((technique == "reed_sol_van")) {
       interface = new ErasureCodeIsaDefault(tcache,
                                             technique,
-                                            ErasureCodeIsaDefault::kVandermonde);
+                                            ErasureCodeIsaDefault::kVandermonde,
+                                            _m);
     } else if ((technique == "cauchy")) {
       interface = new ErasureCodeIsaDefault(tcache,
                                             technique,
-                                            ErasureCodeIsaDefault::kCauchy);
+                                            ErasureCodeIsaDefault::kCauchy,
+                                            _m);
     } else {
       *ss << "technique=" << technique << " is not a valid coding technique. "
         << " Choose one of the following: "
index 86bac636dcc664542d3e24bfef7bf3f987c53484..26032169e46eb9212babe16e4bc7aaea3edc1899 100644 (file)
@@ -43,6 +43,7 @@ TEST(ErasureCodePlugin, factory)
   for(const char **technique = techniques; *technique; technique++) {
     ErasureCodeInterfaceRef erasure_code;
     profile["technique"] = *technique;
+    profile["m"] = "2";
     EXPECT_FALSE(erasure_code);
     EXPECT_EQ(0, instance.factory("isa",
                                  g_conf().get_val<std::string>("erasure_code_dir"),