From c9d3f76b4719ecf602f01f58a0e1a7a577a80949 Mon Sep 17 00:00:00 2001 From: Jamie Pryde Date: Wed, 13 Aug 2025 11:57:40 +0100 Subject: [PATCH] erasure-code: use cauchy if K and M values are not supported by ISA-L reed_sol_van ISA-L supports a limited set of K and M values when using a vandermonde matrix. There are no such limitations when using a cauchy matrix. If the user specifies reed_sol_van (or does not specify a technique and relies on the default reed_sol_van setting) and an unsupported K/M combination, then we will automatically switch the technique for the new EC profile to cauchy. Benchmarking has not shown any noticeable performance differences between ISA-L in reed_sol_van vs cauchy modes. Signed-off-by: Jamie Pryde --- src/erasure-code/isa/ErasureCodeIsa.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/erasure-code/isa/ErasureCodeIsa.cc b/src/erasure-code/isa/ErasureCodeIsa.cc index 78f955a3c5f..e1482111a0e 100644 --- a/src/erasure-code/isa/ErasureCodeIsa.cc +++ b/src/erasure-code/isa/ErasureCodeIsa.cc @@ -577,7 +577,7 @@ int ErasureCodeIsaDefault::parse(ErasureCodeProfile &profile, // benchmarktool and 10*(combinatoric for maximum loss) random // full erasures if (k > MAX_K) { - *ss << "Vandermonde: m=" << m + *ss << "Vandermonde: k=" << k << " should be less/equal than " << MAX_K << " : revert to k=" << MAX_K << std::endl; k = MAX_K; @@ -587,18 +587,19 @@ int ErasureCodeIsaDefault::parse(ErasureCodeProfile &profile, if (m > 4) { *ss << "Vandermonde: m=" << m << " should be less than 5 to guarantee an MDS codec:" - << " revert to m=4" << std::endl; - m = 4; - err = -EINVAL; + << " switching to Cauchy technique" << std::endl; + matrixtype = kCauchy; + profile["technique"] = "cauchy"sv; } switch (m) { case 4: if (k > 21) { *ss << "Vandermonde: k=" << k << " should be less than 22 to guarantee an MDS" - << " codec with m=4: revert to k=21" << std::endl; - k = 21; - err = -EINVAL; + << " codec with m=4: switching" + << " to Cauchy technique" << std::endl; + matrixtype = kCauchy; + profile["technique"] = "cauchy"sv; } break; default: -- 2.39.5