By switching to a new gf-complete with SIMD runtime detection, we can now remove all the different flavors of jerasure and shec. This simplifies deployment and configuration of erasure coding, enables hetergenous OSDs, and enables us to take advantage of new performance improvements in jerasure without config/build changes.
This commit removes flavors from cmake, removes ErasureCodePluginSelect___, and fixes unit tests. There is now a single plugin for jerasure and a single plugin for shec.
SIMDExt.cmake was changed so that its a little more generic, and is not polluted with gf-complete specific CFLAG defines. The #define for SIMD instruction were based on gf-complete.
I also added a small init helper for jerasure that has code that was common between jerasure and shec.
Signed-off-by: Bassam Tabbara <bassam.tabbara@quantum.com>
# detect SIMD extentions
#
-# ARM_NEON_FLAGS
-#
# HAVE_ARMV8_CRC
-# HAVE_NEON
-# HAVE_SSE
-# HAVE_SSE2
+# HAVE_ARMV8_SIMD
+# HAVE_ARM_NEON
+# HAVE_INTEL_SSE
+# HAVE_INTEL_SSE2
+# HAVE_INTEL_SSE3
+# HAVE_INTEL_SSSE3
+# HAVE_INTEL_PCLMUL
+# HAVE_INTEL_SSE4_1
+# HAVE_INTEL_SSE4_2
#
# INTEL_SSE4_1
-# INTEL_SSE4_2
-#
-# SSE3_FLAGS
-# SSE4_FLAGS
+#
+# SIMD_COMPILE_FLAGS
#
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64")
CHECK_C_COMPILER_FLAG(-march=armv8-a+crc HAVE_ARMV8_CRC)
if(HAVE_ARMV8_CRC)
- set(ARM_CRC_FLAGS "-march=armv8-a+crc -DARCH_AARCH64")
+ set(ARM_CRC_FLAGS "-march=armv8-a+crc")
endif()
- CHECK_C_COMPILER_FLAG(-march=armv8-a+simd HAVE_NEON)
- if(HAVE_NEON)
- set(ARM_NEON_FLAGS "-march=armv8-a+simd -DARCH_AARCH64 -DARM_NEON")
+ CHECK_C_COMPILER_FLAG(-march=armv8-a+simd HAVE_ARMV8_SIMD)
+ if(HAVE_ARMV8_SIMD)
+ set(SIMD_COMPILE_FLAGS "${SIMD_COMPILE_FLAGS} -march=armv8-a+simd")
endif()
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm|ARM")
- CHECK_C_COMPILER_FLAG(-mfpu=neon HAVE_NEON)
- if(HAVE_NEON)
- set(ARM_NEON_FLAGS "-mfpu=neon -DARM_NEON")
+ CHECK_C_COMPILER_FLAG(-mfpu=neon HAVE_ARM_NEON)
+ if(HAVE_ARM_NEON)
+ set(SIMD_COMPILE_FLAGS "${SIMD_COMPILE_FLAGS} -mfpu=neon")
endif()
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "i386|i686|amd64|x86_64|AMD64")
- set(SSE3_FLAGS)
- CHECK_C_COMPILER_FLAG(-msse HAVE_SSE)
- if(HAVE_SSE)
- set(SSE3_FLAGS "${SSE3_FLAGS} -msse -DINTEL_SSE")
+ CHECK_C_COMPILER_FLAG(-msse HAVE_INTEL_SSE)
+ if(HAVE_INTEL_SSE)
+ set(SIMD_COMPILE_FLAGS "${SIMD_COMPILE_FLAGS} -msse")
endif()
-
- CHECK_C_COMPILER_FLAG(-msse2 HAVE_SSE2)
- if(HAVE_SSE2)
- set(SSE3_FLAGS "${SSE3_FLAGS} -msse2 -DINTEL_SSE2")
+ CHECK_C_COMPILER_FLAG(-msse2 HAVE_INTEL_SSE2)
+ if(HAVE_INTEL_SSE2)
+ set(SIMD_COMPILE_FLAGS "${SIMD_COMPILE_FLAGS} -msse2")
endif()
-
- CHECK_C_COMPILER_FLAG(-msse3 HAVE_SSE3)
- if(HAVE_SSE3)
- set(SSE3_FLAGS "${SSE3_FLAGS} -msse3 -DINTEL_SSE3")
+ CHECK_C_COMPILER_FLAG(-msse3 HAVE_INTEL_SSE3)
+ if(HAVE_INTEL_SSE3)
+ set(SIMD_COMPILE_FLAGS "${SIMD_COMPILE_FLAGS} -msse3")
endif()
-
- CHECK_C_COMPILER_FLAG(-mssse3 SUPPORTS_SSSE3)
- if(SUPPORTS_SSSE3)
- set(SSE3_FLAGS "${SSE3_FLAGS} -mssse3 -DINTEL_SSSE3")
+ CHECK_C_COMPILER_FLAG(-mssse3 HAVE_INTEL_SSSE3)
+ if(HAVE_INTEL_SSSE3)
+ set(SIMD_COMPILE_FLAGS "${SIMD_COMPILE_FLAGS} -mssse3")
+ endif()
+ CHECK_C_COMPILER_FLAG(-mpclmul HAVE_INTEL_PCLMUL)
+ if(HAVE_INTEL_PCLMUL)
+ set(SIMD_COMPILE_FLAGS "${SIMD_COMPILE_FLAGS} -mpclmul")
endif()
-
- # pclmul is not enabled in SSE3, otherwise we need another
- # flavor or an cmake option for enabling it
-
- set(SSE4_FLAGS ${SSE3_FLAGS})
CHECK_C_COMPILER_FLAG(-msse4.1 INTEL_SSE4_1)
- if(SUPPORTS_SSE41)
- set(SSE4_FLAGS "${SSE4_FLAGS} -msse41 -DINTEL_SSE4")
+ CHECK_C_COMPILER_FLAG(-msse4.1 HAVE_INTEL_SSE4_1)
+ if(HAVE_INTEL_SSE4_1)
+ set(SIMD_COMPILE_FLAGS "${SIMD_COMPILE_FLAGS} -msse4.1")
endif()
-
- CHECK_C_COMPILER_FLAG(-msse4.2 INTEL_SSE4_2)
- if(SUPPORTS_SSE42)
- set(SSE4_FLAGS "${SSE4_FLAGS} -msse42 -DINTEL_SSE4")
+ CHECK_C_COMPILER_FLAG(-msse4.2 HAVE_INTEL_SSE4_2)
+ if(HAVE_INTEL_SSE4_2)
+ set(SIMD_COMPILE_FLAGS "${SIMD_COMPILE_FLAGS} -msse4.2")
endif()
endif()
: ${VERBOSE:=false}
: ${CEPH_ERASURE_CODE_BENCHMARK:=ceph_erasure_code_benchmark}
: ${PLUGIN_DIRECTORY:=/usr/lib/ceph/erasure-code}
-: ${PLUGINS:=isa jerasure_generic jerasure_sse4}
+: ${PLUGINS:=isa jerasure}
: ${TECHNIQUES:=vandermonde cauchy}
: ${TOTAL_SIZE:=$((1024 * 1024))}
: ${SIZE:=4096}
k2ms[4]="2 3"
k2ms[6]="2 3 4"
k2ms[10]="3 4"
- local isa2technique_vandermonde='reed_sol_van'
- local isa2technique_cauchy='cauchy'
- local jerasure_generic2technique_vandermonde='reed_sol_van'
- local jerasure_generic2technique_cauchy='cauchy_good'
- local jerasure_sse42technique_vandermonde='reed_sol_van'
- local jerasure_sse42technique_cauchy='cauchy_good'
for technique in ${TECHNIQUES} ; do
for plugin in ${PLUGINS} ; do
eval technique_parameter=\$${plugin}2technique_${technique}
lines: { show: true },
});
}
- if (typeof encode_vandermonde_jerasure_generic != 'undefined') {
+ if (typeof encode_vandermonde_jerasure != 'undefined') {
encode.push({
- data: encode_vandermonde_jerasure_generic,
+ data: encode_vandermonde_jerasure,
label: "Jerasure Generic, Vandermonde",
points: { show: true },
lines: { show: true },
});
}
- if (typeof encode_vandermonde_jerasure_sse4 != 'undefined') {
- encode.push({
- data: encode_vandermonde_jerasure_sse4,
- label: "Jerasure SIMD, Vandermonde",
- points: { show: true },
- lines: { show: true },
- });
- }
if (typeof encode_cauchy_isa != 'undefined') {
encode.push({
data: encode_cauchy_isa,
lines: { show: true },
});
}
- if (typeof encode_cauchy_jerasure_generic != 'undefined') {
+ if (typeof encode_cauchy_jerasure != 'undefined') {
encode.push({
- data: encode_cauchy_jerasure_generic,
+ data: encode_cauchy_jerasure,
label: "Jerasure, Cauchy",
points: { show: true },
lines: { show: true },
lines: { show: true },
});
}
- if (typeof decode_vandermonde_jerasure_generic != 'undefined') {
+ if (typeof decode_vandermonde_jerasure != 'undefined') {
decode.push({
- data: decode_vandermonde_jerasure_generic,
+ data: decode_vandermonde_jerasure,
label: "Jerasure Generic, Vandermonde",
points: { show: true },
lines: { show: true },
});
}
- if (typeof decode_vandermonde_jerasure_sse4 != 'undefined') {
- decode.push({
- data: decode_vandermonde_jerasure_sse4,
- label: "Jerasure SIMD, Vandermonde",
- points: { show: true },
- lines: { show: true },
- });
- }
if (typeof decode_cauchy_isa != 'undefined') {
decode.push({
data: decode_cauchy_isa,
lines: { show: true },
});
}
- if (typeof decode_cauchy_jerasure_generic != 'undefined') {
+ if (typeof decode_cauchy_jerasure != 'undefined') {
decode.push({
- data: decode_cauchy_jerasure_generic,
+ data: decode_cauchy_jerasure,
label: "Jerasure, Cauchy",
points: { show: true },
lines: { show: true },
include_directories(jerasure/gf-complete/include)
include_directories(jerasure)
-if(TRUE)
- list(APPEND jerasure_flavors generic)
-endif()
-
-if(HAVE_NEON)
- list(APPEND jerasure_flavors neon)
-endif()
-
-if(HAVE_SSE)
- list(APPEND jerasure_flavors sse3)
-endif()
-
-if(INTEL_SSE4_1)
- list(APPEND jerasure_flavors sse4)
-endif()
-
add_subdirectory(jerasure)
add_subdirectory(lrc)
add_subdirectory(shec)
${EC_ISA_LIB}
ec_lrc
ec_jerasure)
-if(TARGET ec_jerasure_sse3)
- add_dependencies(erasure_code_plugins ec_jerasure_sse3)
-endif()
-if(TARGET ec_jerasure_sse4)
- add_dependencies(erasure_code_plugins ec_jerasure_sse4)
-endif()
ErasureCodeJerasure.cc)
add_dependencies(jerasure_utils ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
-add_library(ec_jerasure SHARED ErasureCodePluginSelectJerasure.cc)
-add_dependencies(ec_jerasure ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
-target_link_libraries(ec_jerasure ${EXTRALIBS})
-install(TARGETS ec_jerasure DESTINATION ${erasure_plugin_dir})
+# Set the CFLAGS correctly for gf-complete based on SIMD compiler support
+set(GF_COMPILE_FLAGS)
+if(HAVE_ARMV8_SIMD)
+ list(APPEND GF_COMPILE_FLAGS ARM_NEON ARCH_AARCH64)
+endif()
+if(HAVE_ARM_NEON)
+ list(APPEND GF_COMPILE_FLAGS ARM_NEON)
+endif()
+if(HAVE_INTEL_SSE)
+ list(APPEND GF_COMPILE_FLAGS INTEL_SSE)
+endif()
+if(HAVE_INTEL_SSE2)
+ list(APPEND GF_COMPILE_FLAGS INTEL_SSE2)
+endif()
+if(HAVE_INTEL_SSE3)
+ list(APPEND GF_COMPILE_FLAGS INTEL_SSE3)
+endif()
+if(HAVE_INTEL_SSSE3)
+ list(APPEND GF_COMPILE_FLAGS INTEL_SSSE3)
+endif()
+if(HAVE_INTEL_PCLMUL)
+ list(APPEND GF_COMPILE_FLAGS INTEL_SSE4_PCLMUL)
+endif()
+if(HAVE_INTEL_SSE4_1)
+ list(APPEND GF_COMPILE_FLAGS INTEL_SSE4)
+endif()
+if(HAVE_INTEL_SSE4_2)
+ list(APPEND GF_COMPILE_FLAGS INTEL_SSE4)
+endif()
-set(jerasure_srcs
- jerasure/src/cauchy.c
- jerasure/src/galois.c
- jerasure/src/jerasure.c
- jerasure/src/liberation.c
- jerasure/src/reed_sol.c
+set(gf-complete_srcs
gf-complete/src/gf_cpu.c
gf-complete/src/gf_wgen.c
- gf-complete/src/gf_method.c
gf-complete/src/gf_w16.c
gf-complete/src/gf.c
gf-complete/src/gf_w32.c
gf-complete/src/gf_rand.c
gf-complete/src/gf_w8.c)
-list(FIND jerasure_flavors generic found)
-if(found GREATER -1)
- add_library(jerasure_generic OBJECT ${jerasure_srcs})
-endif()
-
-list(FIND jerasure_flavors neon found)
-if(found GREATER -1)
- add_library(jerasure_neon OBJECT
- ${jerasure_srcs}
+if(HAVE_ARM_NEON OR HAVE_ARMV8_SIMD)
+ list(APPEND gf-complete_srcs
gf-complete/src/neon/gf_w4_neon.c
gf-complete/src/neon/gf_w8_neon.c
gf-complete/src/neon/gf_w16_neon.c
gf-complete/src/neon/gf_w32_neon.c
gf-complete/src/neon/gf_w64_neon.c)
- set_target_properties(jerasure_neon PROPERTIES
- COMPILE_FLAGS ${ARM_NEON_FLAGS})
endif()
-list(FIND jerasure_flavors sse3 found)
-if(found GREATER -1)
- add_library(jerasure_sse3 OBJECT ${jerasure_srcs})
- set_target_properties(jerasure_sse3 PROPERTIES
- COMPILE_FLAGS ${SSE3_FLAGS})
-endif()
+add_library(gf-complete_objs OBJECT ${gf-complete_srcs})
+set_target_properties(gf-complete_objs PROPERTIES
+ COMPILE_FLAGS ${SIMD_COMPILE_FLAGS})
+set_target_properties(gf-complete_objs PROPERTIES
+ COMPILE_DEFINITIONS "${GF_COMPILE_FLAGS}")
-list(FIND jerasure_flavors sse4 found)
-if(found GREATER -1)
- add_library(jerasure_sse4 OBJECT ${jerasure_srcs})
- set_target_properties(jerasure_sse4 PROPERTIES
- COMPILE_FLAGS ${SSE4_FLAGS})
-endif()
+set(jerasure_srcs
+ jerasure/src/cauchy.c
+ jerasure/src/galois.c
+ jerasure/src/jerasure.c
+ jerasure/src/liberation.c
+ jerasure/src/reed_sol.c
+ jerasure_init.cc)
+add_library(jerasure_objs OBJECT ${jerasure_srcs})
-foreach(flavor ${jerasure_flavors})
- set(plugin_name "ec_jerasure_${flavor}")
- add_library(${plugin_name} SHARED
- $<TARGET_OBJECTS:jerasure_${flavor}>
- $<TARGET_OBJECTS:jerasure_utils>
- $<TARGET_OBJECTS:erasure_code_objs>)
- target_link_libraries(${plugin_name} ${EXTRALIBS})
- install(TARGETS ${plugin_name} DESTINATION ${erasure_plugin_dir})
-endforeach()
+add_library(ec_jerasure SHARED
+ $<TARGET_OBJECTS:gf-complete_objs>
+ $<TARGET_OBJECTS:jerasure_objs>
+ $<TARGET_OBJECTS:jerasure_utils>
+ $<TARGET_OBJECTS:erasure_code_objs>)
+target_link_libraries(ec_jerasure ${EXTRALIBS})
+install(TARGETS ec_jerasure DESTINATION ${erasure_plugin_dir})
#include "common/debug.h"
#include "erasure-code/ErasureCodePlugin.h"
#include "ErasureCodeJerasure.h"
+#include "jerasure_init.h"
#define dout_subsys ceph_subsys_osd
#undef dout_prefix
}
};
-extern "C" {
-#include "galois.h"
-
-extern gf_t *gfp_array[];
-extern int gfp_is_composite[];
-}
-
const char *__erasure_code_version() { return CEPH_GIT_NICE_VER; }
int __erasure_code_init(char *plugin_name, char *directory)
{
ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
int w[] = { 4, 8, 16, 32 };
- for(int i = 0; i < 4; i++) {
- int r = galois_init_default_field(w[i]);
- if (r) {
- derr << "failed to gf_init_easy(" << w[i] << ")" << dendl;
- return -r;
- }
+ int r = jerasure_init(4, w);
+ if (r) {
+ return -r;
}
return instance.add(plugin_name, new ErasureCodePluginJerasure());
}
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph distributed storage system
- *
- * Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
- * Copyright (C) 2014 Red Hat <contact@redhat.com>
- *
- * Author: Loic Dachary <loic@dachary.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- */
-
-#include "ceph_ver.h"
-#include "common/debug.h"
-#include "arch/probe.h"
-#include "arch/intel.h"
-#include "arch/arm.h"
-#include "erasure-code/ErasureCodePlugin.h"
-
-#define dout_subsys ceph_subsys_osd
-#undef dout_prefix
-#define dout_prefix _prefix(_dout)
-
-static ostream& _prefix(std::ostream* _dout)
-{
- return *_dout << "ErasureCodePluginSelectJerasure: ";
-}
-
-static string get_variant() {
- ceph_arch_probe();
-
- if (ceph_arch_intel_pclmul &&
- ceph_arch_intel_sse42 &&
- ceph_arch_intel_sse41 &&
- ceph_arch_intel_ssse3 &&
- ceph_arch_intel_sse3 &&
- ceph_arch_intel_sse2) {
- return "sse4";
- } else if (ceph_arch_intel_ssse3 &&
- ceph_arch_intel_sse3 &&
- ceph_arch_intel_sse2) {
- return "sse3";
- } else if (ceph_arch_neon) {
- return "neon";
- } else {
- return "generic";
- }
-}
-
-class ErasureCodePluginSelectJerasure : public ErasureCodePlugin {
-public:
- virtual int factory(const std::string &directory,
- ErasureCodeProfile &profile,
- ErasureCodeInterfaceRef *erasure_code,
- ostream *ss) {
- ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
- int ret;
- string name = "jerasure";
- if (profile.count("jerasure-name"))
- name = profile.find("jerasure-name")->second;
- if (profile.count("jerasure-variant")) {
- dout(10) << "jerasure-variant "
- << profile.find("jerasure-variant")->second << dendl;
- ret = instance.factory(name + "_" + profile.find("jerasure-variant")->second,
- directory,
- profile, erasure_code, ss);
- } else {
- string variant = get_variant();
- dout(10) << variant << " plugin" << dendl;
- ret = instance.factory(name + "_" + variant, directory,
- profile, erasure_code, ss);
- }
- return ret;
- }
-};
-
-const char *__erasure_code_version() { return CEPH_GIT_NICE_VER; }
-
-int __erasure_code_init(char *plugin_name, char *directory)
-{
- ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
- string variant = get_variant();
- ErasureCodePlugin *plugin;
- stringstream ss;
- int r = instance.load(plugin_name + string("_") + variant,
- directory, &plugin, &ss);
- if (r) {
- derr << ss.str() << dendl;
- return r;
- }
- dout(10) << ss.str() << dendl;
- return instance.add(plugin_name, new ErasureCodePluginSelectJerasure());
-}
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+/*
+ * Ceph distributed storage system
+ *
+ * Copyright (C) 2013,2014 Cloudwatt <libre.licensing@cloudwatt.com>
+ * Copyright (C) 2014 Red Hat <contact@redhat.com>
+ *
+ * Author: Loic Dachary <loic@dachary.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ */
+
+#include "common/debug.h"
+#include "jerasure_init.h"
+
+extern "C" {
+#include "galois.h"
+}
+
+extern "C" int jerasure_init(int count, int *words)
+{
+ for(int i = 0; i < count; i++) {
+ int r = galois_init_default_field(words[i]);
+ if (r) {
+ derr << "failed to galois_init_default_field(" << words[i] << ")" << dendl;
+ return -r;
+ }
+ }
+ return 0;
+}
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+/*
+ * Ceph distributed storage system
+ *
+ * Copyright (C) 2013, 2014 Cloudwatt <libre.licensing@cloudwatt.com>
+ * Copyright (C) 2014 Red Hat <contact@redhat.com>
+ *
+ * Author: Loic Dachary <loic@dachary.org>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ */
+
+#ifndef CEPH_JERASURE_INIT_H
+#define CEPH_JERASURE_INIT_H
+
+extern "C" int jerasure_init(int count, int *words);
+
+#endif
+
determinant.c)
add_dependencies(shec_utils ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
-add_library(ec_shec SHARED ErasureCodePluginSelectShec.cc)
+add_library(ec_shec SHARED
+ $<TARGET_OBJECTS:gf-complete_objs>
+ $<TARGET_OBJECTS:jerasure_objs>
+ $<TARGET_OBJECTS:shec_utils>)
add_dependencies(ec_shec ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
target_link_libraries(ec_shec ${EXTRALIBS})
install(TARGETS ec_shec DESTINATION ${erasure_plugin_dir})
-
-foreach(flavor ${jerasure_flavors})
- set(plugin_name "ec_shec_${flavor}")
- add_library(${plugin_name} SHARED
- $<TARGET_OBJECTS:jerasure_${flavor}>
- $<TARGET_OBJECTS:shec_utils>)
- target_link_libraries(${plugin_name} ${EXTRALIBS})
- install(TARGETS ${plugin_name} DESTINATION ${erasure_plugin_dir})
-endforeach()
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph - scalable distributed file system
- *
- * Copyright (C) 2013,2014 Cloudwatt <libre.licensing@cloudwatt.com>
- * Copyright (C) 2014 Red Hat <contact@redhat.com>
- * Copyright (C) 2014,2015 FUJITSU LIMITED
- *
- * Author: Loic Dachary <loic@dachary.org>
- * Author: Shotaro Kawaguchi <kawaguchi.s@jp.fujitsu.com>
- * Author: Takanori Nakao <nakao.takanori@jp.fujitsu.com>
- * Author: Takeshi Miyamae <miyamae.takeshi@jp.fujitsu.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- */
-
-#include "ceph_ver.h"
-#include "common/debug.h"
-#include "arch/probe.h"
-#include "arch/intel.h"
-#include "arch/arm.h"
-#include "erasure-code/ErasureCodePlugin.h"
-
-#define dout_subsys ceph_subsys_osd
-#undef dout_prefix
-#define dout_prefix _prefix(_dout)
-
-static ostream& _prefix(std::ostream* _dout)
-{
- return *_dout << "ErasureCodePluginSelectShec: ";
-}
-
-static string get_variant() {
- ceph_arch_probe();
-
- if (ceph_arch_intel_pclmul &&
- ceph_arch_intel_sse42 &&
- ceph_arch_intel_sse41 &&
- ceph_arch_intel_ssse3 &&
- ceph_arch_intel_sse3 &&
- ceph_arch_intel_sse2) {
- return "sse4";
- } else if (ceph_arch_intel_ssse3 &&
- ceph_arch_intel_sse3 &&
- ceph_arch_intel_sse2) {
- return "sse3";
- } else if (ceph_arch_neon) {
- return "neon";
- } else {
- return "generic";
- }
-}
-
-class ErasureCodePluginSelectShec : public ErasureCodePlugin {
-public:
- virtual int factory(const std::string &directory,
- ErasureCodeProfile &profile,
- ErasureCodeInterfaceRef *erasure_code,
- ostream *ss) {
- ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
- int ret;
- string name = "shec";
- if (profile.count("shec-name"))
- name = profile.find("shec-name")->second;
- if (profile.count("shec-variant")) {
- dout(10) << "shec-variant "
- << profile.find("shec-variant")->second << dendl;
- ret = instance.factory(name + "_" + profile.find("shec-variant")->second,
- directory,
- profile, erasure_code, ss);
- } else {
- string variant = get_variant();
- dout(10) << variant << " plugin" << dendl;
- ret = instance.factory(name + "_" + variant, directory,
- profile, erasure_code, ss);
- }
- return ret;
- }
-};
-
-const char *__erasure_code_version() { return CEPH_GIT_NICE_VER; }
-
-int __erasure_code_init(char *plugin_name, char *directory)
-{
- ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
- string variant = get_variant();
- ErasureCodePlugin *plugin;
- stringstream ss;
- int r = instance.load(plugin_name + string("_") + variant,
- directory, &plugin, &ss);
- if (r) {
- derr << ss.str() << dendl;
- return r;
- }
- dout(10) << ss.str() << dendl;
- return instance.add(plugin_name, new ErasureCodePluginSelectShec());
-}
#include "erasure-code/ErasureCodePlugin.h"
#include "ErasureCodeShecTableCache.h"
#include "ErasureCodeShec.h"
+#include "jerasure_init.h"
#define dout_subsys ceph_subsys_osd
#undef dout_prefix
}
};
-extern "C" {
-#include "jerasure/include/galois.h"
-
-extern gf_t *gfp_array[];
-extern int gfp_is_composite[];
-}
-
const char *__erasure_code_version() { return CEPH_GIT_NICE_VER; }
int __erasure_code_init(char *plugin_name, char *directory = (char *)"")
{
ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
int w[] = { 8, 16, 32 };
- for(int i = 0; i < 3; i++) {
- int r = galois_init_default_field(w[i]);
- if (r) {
- derr << "failed to gf_init_easy(" << w[i] << ")" << dendl;
- return -r;
- }
+ int r = jerasure_init(3, w);
+ if (r) {
+ return -r;
}
return instance.add(plugin_name, new ErasureCodePluginShec());
}
common
)
-add_library(ec_test_jerasure_neon SHARED TestJerasurePluginNEON.cc)
-add_dependencies(ec_test_jerasure_neon ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
-target_link_libraries(ec_test_jerasure_neon pthread ${EXTRALIBS})
-
-add_library(ec_test_jerasure_sse4 SHARED TestJerasurePluginSSE4.cc)
-add_dependencies(ec_test_jerasure_sse4 ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
-target_link_libraries(ec_test_jerasure_sse4 pthread ${EXTRALIBS})
-
-add_library(ec_test_jerasure_sse3 SHARED TestJerasurePluginSSE3.cc)
-add_dependencies(ec_test_jerasure_sse3 ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
-target_link_libraries(ec_test_jerasure_sse3 pthread ${EXTRALIBS})
-
-add_library(ec_test_jerasure_generic SHARED TestJerasurePluginGeneric.cc)
-add_dependencies(ec_test_jerasure_generic ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
-target_link_libraries(ec_test_jerasure_generic pthread ${EXTRALIBS})
-
# unittest_erasure_code_plugin_jerasure
add_executable(unittest_erasure_code_plugin_jerasure
TestErasureCodePluginJerasure.cc
target_link_libraries(unittest_erasure_code_plugin_jerasure
global
osd
- ec_jerasure_generic
+ ec_jerasure
common)
add_dependencies(unittest_erasure_code_plugin_jerasure
- ec_jerasure
- ec_jerasure_sse3
- ec_jerasure_sse4
- ec_test_jerasure_neon
- ec_test_jerasure_sse4
- ec_test_jerasure_sse3
- ec_test_jerasure_generic)
+ ec_jerasure)
if(HAVE_BETTER_YASM_ELF64)
add_ceph_unittest(unittest_erasure_code_plugin_lrc ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest_erasure_code_plugin_lrc)
add_dependencies(unittest_erasure_code_plugin_lrc
ec_lrc
- ec_jerasure
- ec_jerasure_sse3
- ec_jerasure_sse4
- ec_jerasure_generic)
+ ec_jerasure)
target_link_libraries(unittest_erasure_code_plugin_lrc
global
osd
${CMAKE_DL_LIBS}
ec_lrc
- ec_jerasure_generic
+ ec_jerasure
common)
-add_library(ec_test_shec_neon SHARED TestShecPluginNEON.cc)
-add_dependencies(ec_test_shec_neon ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
-target_link_libraries(ec_test_shec_neon pthread ${EXTRALIBS})
-
-add_library(ec_test_shec_sse4 SHARED TestShecPluginSSE4.cc)
-add_dependencies(ec_test_shec_sse4 ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
-target_link_libraries(ec_test_shec_sse4 pthread ${EXTRALIBS})
-
-add_library(ec_test_shec_sse3 SHARED TestShecPluginSSE3.cc)
-add_dependencies(ec_test_shec_sse3 ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
-target_link_libraries(ec_test_shec_sse3 pthread ${EXTRALIBS})
-
-add_library(ec_test_shec_generic SHARED TestShecPluginGeneric.cc)
-add_dependencies(ec_test_shec_generic ${CMAKE_SOURCE_DIR}/src/ceph_ver.h)
-target_link_libraries(ec_test_shec_generic pthread ${EXTRALIBS})
-
# unittest_erasure_code_plugin_shec
add_executable(unittest_erasure_code_plugin_shec
TestErasureCodePluginShec.cc
osd
${CMAKE_DL_LIBS}
common
- ec_shec_generic)
+ ec_shec)
add_dependencies(unittest_erasure_code_plugin_shec
- ec_shec
- ec_shec_sse3
- ec_shec_sse4
- #ec_shec_neon
- ec_test_shec_neon
- ec_test_shec_sse3
- ec_test_shec_sse4
- ec_test_shec_generic)
+ ec_shec)
# unittest_erasure_code_example
add_executable(unittest_erasure_code_example
global
osd
common
- ec_jerasure_generic
+ ec_jerasure
)
include_directories(${CMAKE_SOURCE_DIR}/src/erasure-code/jerasure)
osd
${CMAKE_DL_LIBS}
common
- ec_shec_generic
+ ec_shec
)
# unittest_erasure_code_shec_all
osd
${CMAKE_DL_LIBS}
common
- ec_shec_generic
+ ec_shec
)
# unittest_erasure_code_shec_thread
osd
${CMAKE_DL_LIBS}
common
- ec_shec_generic
+ ec_shec
)
osd
${CMAKE_DL_LIBS}
common
- ec_shec_generic
+ ec_shec
)
#include <errno.h>
#include <stdlib.h>
-#include "arch/probe.h"
-#include "arch/intel.h"
-#include "arch/arm.h"
#include "global/global_init.h"
#include "erasure-code/ErasureCodePlugin.h"
#include "common/ceph_argparse.h"
}
}
-TEST(ErasureCodePlugin, select)
-{
- ceph_arch_probe();
- // save probe results
- int arch_intel_pclmul = ceph_arch_intel_pclmul;
- int arch_intel_sse42 = ceph_arch_intel_sse42;
- int arch_intel_sse41 = ceph_arch_intel_sse41;
- int arch_intel_ssse3 = ceph_arch_intel_ssse3;
- int arch_intel_sse3 = ceph_arch_intel_sse3;
- int arch_intel_sse2 = ceph_arch_intel_sse2;
- int arch_neon = ceph_arch_neon;
-
- ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
- ErasureCodeProfile profile;
- // load test plugins instead of actual plugins to assert the desired side effect
- // happens
- profile["jerasure-name"] = "test_jerasure";
- profile["technique"] = "reed_sol_van";
-
- // all features are available, load the SSE4 plugin
- {
- ceph_arch_intel_pclmul = 1;
- ceph_arch_intel_sse42 = 1;
- ceph_arch_intel_sse41 = 1;
- ceph_arch_intel_ssse3 = 1;
- ceph_arch_intel_sse3 = 1;
- ceph_arch_intel_sse2 = 1;
- ceph_arch_neon = 0;
-
- ErasureCodeInterfaceRef erasure_code;
- int sse4_side_effect = -444;
- EXPECT_EQ(sse4_side_effect, instance.factory("jerasure",
- g_conf->erasure_code_dir,
- profile,
- &erasure_code, &cerr));
- }
- // pclmul is missing, load the SSE3 plugin
- {
- ceph_arch_intel_pclmul = 0;
- ceph_arch_intel_sse42 = 1;
- ceph_arch_intel_sse41 = 1;
- ceph_arch_intel_ssse3 = 1;
- ceph_arch_intel_sse3 = 1;
- ceph_arch_intel_sse2 = 1;
- ceph_arch_neon = 0;
-
- ErasureCodeInterfaceRef erasure_code;
- int sse3_side_effect = -333;
- EXPECT_EQ(sse3_side_effect, instance.factory("jerasure",
- g_conf->erasure_code_dir,
- profile,
- &erasure_code, &cerr));
- }
- // pclmul and sse3 are missing, load the generic plugin
- {
- ceph_arch_intel_pclmul = 0;
- ceph_arch_intel_sse42 = 1;
- ceph_arch_intel_sse41 = 1;
- ceph_arch_intel_ssse3 = 1;
- ceph_arch_intel_sse3 = 0;
- ceph_arch_intel_sse2 = 1;
- ceph_arch_neon = 0;
-
- ErasureCodeInterfaceRef erasure_code;
- int generic_side_effect = -111;
- EXPECT_EQ(generic_side_effect, instance.factory("jerasure",
- g_conf->erasure_code_dir,
- profile,
- &erasure_code, &cerr));
- }
- // neon is set, load the neon plugin
- {
- ceph_arch_intel_pclmul = 0;
- ceph_arch_intel_sse42 = 0;
- ceph_arch_intel_sse41 = 0;
- ceph_arch_intel_ssse3 = 0;
- ceph_arch_intel_sse3 = 0;
- ceph_arch_intel_sse2 = 0;
- ceph_arch_neon = 1;
-
- ErasureCodeInterfaceRef erasure_code;
- int generic_side_effect = -555;
- EXPECT_EQ(generic_side_effect, instance.factory("jerasure",
- g_conf->erasure_code_dir,
- profile,
- &erasure_code, &cerr));
- }
-
-
- // restore probe results
- ceph_arch_intel_pclmul = arch_intel_pclmul;
- ceph_arch_intel_sse42 = arch_intel_sse42;
- ceph_arch_intel_sse41 = arch_intel_sse41;
- ceph_arch_intel_ssse3 = arch_intel_ssse3;
- ceph_arch_intel_sse3 = arch_intel_sse3;
- ceph_arch_intel_sse2 = arch_intel_sse2;
- ceph_arch_neon = arch_neon;
-}
-
-TEST(ErasureCodePlugin, sse)
-{
- ceph_arch_probe();
- bool sse4 = ceph_arch_intel_pclmul &&
- ceph_arch_intel_sse42 && ceph_arch_intel_sse41 &&
- ceph_arch_intel_ssse3 && ceph_arch_intel_sse3 &&
- ceph_arch_intel_sse2;
- bool sse3 = ceph_arch_intel_ssse3 && ceph_arch_intel_sse3 &&
- ceph_arch_intel_sse2;
- vector<string> sse_variants;
- sse_variants.push_back("generic");
- if (!sse3)
- cerr << "SKIP sse3 plugin testing because CPU does not support it\n";
- else
- sse_variants.push_back("sse3");
- if (!sse4)
- cerr << "SKIP sse4 plugin testing because CPU does not support it\n";
- else
- sse_variants.push_back("sse4");
-
-#define LARGE_ENOUGH 2048
- bufferptr in_ptr(buffer::create_page_aligned(LARGE_ENOUGH));
- in_ptr.zero();
- in_ptr.set_length(0);
- const char *payload =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
- in_ptr.append(payload, strlen(payload));
- bufferlist in;
- in.push_front(in_ptr);
-
- ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
- ErasureCodeProfile profile;
- profile["technique"] = "reed_sol_van";
- profile["k"] = "2";
- profile["m"] = "1";
- for (vector<string>::iterator sse_variant = sse_variants.begin();
- sse_variant != sse_variants.end();
- ++sse_variant) {
- //
- // load the plugin variant
- //
- ErasureCodeInterfaceRef erasure_code;
- EXPECT_FALSE(erasure_code);
- EXPECT_EQ(0, instance.factory("jerasure_" + *sse_variant,
- g_conf->erasure_code_dir,
- profile,
- &erasure_code, &cerr));
- EXPECT_TRUE(erasure_code.get());
-
- //
- // encode
- //
- int want_to_encode[] = { 0, 1, 2 };
- map<int, bufferlist> encoded;
- EXPECT_EQ(0, erasure_code->encode(set<int>(want_to_encode, want_to_encode+3),
- in,
- &encoded));
- EXPECT_EQ(3u, encoded.size());
- unsigned length = encoded[0].length();
- EXPECT_EQ(0, strncmp(encoded[0].c_str(), in.c_str(), length));
- EXPECT_EQ(0, strncmp(encoded[1].c_str(), in.c_str() + length,
- in.length() - length));
-
- //
- // decode with reconstruction
- //
- map<int, bufferlist> degraded = encoded;
- degraded.erase(1);
- EXPECT_EQ(2u, degraded.size());
- int want_to_decode[] = { 0, 1 };
- map<int, bufferlist> decoded;
- EXPECT_EQ(0, erasure_code->decode(set<int>(want_to_decode, want_to_decode+2),
- degraded,
- &decoded));
- EXPECT_EQ(3u, decoded.size());
- EXPECT_EQ(length, decoded[0].length());
- EXPECT_EQ(0, strncmp(decoded[0].c_str(), in.c_str(), length));
- EXPECT_EQ(0, strncmp(decoded[1].c_str(), in.c_str() + length,
- in.length() - length));
-
- }
-}
-
int main(int argc, char **argv)
{
vector<const char*> args;
#include <errno.h>
#include <stdlib.h>
-#include "arch/probe.h"
-#include "arch/intel.h"
-#include "arch/arm.h"
#include "global/global_init.h"
#include "erasure-code/ErasureCodePlugin.h"
#include "common/ceph_argparse.h"
}
}
-TEST(ErasureCodePlugin, select)
-{
- ceph_arch_probe();
- // save probe results
- int arch_intel_pclmul = ceph_arch_intel_pclmul;
- int arch_intel_sse42 = ceph_arch_intel_sse42;
- int arch_intel_sse41 = ceph_arch_intel_sse41;
- int arch_intel_ssse3 = ceph_arch_intel_ssse3;
- int arch_intel_sse3 = ceph_arch_intel_sse3;
- int arch_intel_sse2 = ceph_arch_intel_sse2;
- int arch_neon = ceph_arch_neon;
-
- ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
- map<std::string,std::string> profile;
- // load test plugins instead of actual plugins to assert the desired side effect
- // happens
- profile["shec-name"] = "test_shec";
- profile["technique"] = "multiple";
-
- // all features are available, load the SSE4 plugin
- {
- ceph_arch_intel_pclmul = 1;
- ceph_arch_intel_sse42 = 1;
- ceph_arch_intel_sse41 = 1;
- ceph_arch_intel_ssse3 = 1;
- ceph_arch_intel_sse3 = 1;
- ceph_arch_intel_sse2 = 1;
- ceph_arch_neon = 0;
-
- ErasureCodeInterfaceRef erasure_code;
- int sse4_side_effect = -444;
- EXPECT_EQ(sse4_side_effect, instance.factory("shec",
- g_conf->erasure_code_dir,
- profile,
- &erasure_code, &cerr));
- }
- // pclmul is missing, load the SSE3 plugin
- {
- ceph_arch_intel_pclmul = 0;
- ceph_arch_intel_sse42 = 1;
- ceph_arch_intel_sse41 = 1;
- ceph_arch_intel_ssse3 = 1;
- ceph_arch_intel_sse3 = 1;
- ceph_arch_intel_sse2 = 1;
- ceph_arch_neon = 0;
-
- ErasureCodeInterfaceRef erasure_code;
- int sse3_side_effect = -333;
- EXPECT_EQ(sse3_side_effect, instance.factory("shec",
- g_conf->erasure_code_dir,
- profile,
- &erasure_code, &cerr));
- }
- // pclmul and sse3 are missing, load the generic plugin
- {
- ceph_arch_intel_pclmul = 0;
- ceph_arch_intel_sse42 = 1;
- ceph_arch_intel_sse41 = 1;
- ceph_arch_intel_ssse3 = 1;
- ceph_arch_intel_sse3 = 0;
- ceph_arch_intel_sse2 = 1;
- ceph_arch_neon = 0;
-
- ErasureCodeInterfaceRef erasure_code;
- int generic_side_effect = -111;
- EXPECT_EQ(generic_side_effect, instance.factory("shec",
- g_conf->erasure_code_dir,
- profile,
- &erasure_code, &cerr));
- }
- // neon is set, load the neon plugin
- {
- ceph_arch_intel_pclmul = 0;
- ceph_arch_intel_sse42 = 0;
- ceph_arch_intel_sse41 = 0;
- ceph_arch_intel_ssse3 = 0;
- ceph_arch_intel_sse3 = 0;
- ceph_arch_intel_sse2 = 0;
- ceph_arch_neon = 1;
-
- ErasureCodeInterfaceRef erasure_code;
- int generic_side_effect = -555;
- EXPECT_EQ(generic_side_effect, instance.factory("shec",
- g_conf->erasure_code_dir,
- profile,
- &erasure_code, &cerr));
- }
-
-
- // restore probe results
- ceph_arch_intel_pclmul = arch_intel_pclmul;
- ceph_arch_intel_sse42 = arch_intel_sse42;
- ceph_arch_intel_sse41 = arch_intel_sse41;
- ceph_arch_intel_ssse3 = arch_intel_ssse3;
- ceph_arch_intel_sse3 = arch_intel_sse3;
- ceph_arch_intel_sse2 = arch_intel_sse2;
- ceph_arch_neon = arch_neon;
-}
-
-TEST(ErasureCodePlugin, sse)
-{
- ceph_arch_probe();
- bool sse4 = ceph_arch_intel_pclmul &&
- ceph_arch_intel_sse42 && ceph_arch_intel_sse41 &&
- ceph_arch_intel_ssse3 && ceph_arch_intel_sse3 &&
- ceph_arch_intel_sse2;
- bool sse3 = ceph_arch_intel_ssse3 && ceph_arch_intel_sse3 &&
- ceph_arch_intel_sse2;
- vector<string> sse_variants;
- sse_variants.push_back("generic");
- if (!sse3)
- cerr << "SKIP sse3 plugin testing because CPU does not support it\n";
- else
- sse_variants.push_back("sse3");
- if (!sse4)
- cerr << "SKIP sse4 plugin testing because CPU does not support it\n";
- else
- sse_variants.push_back("sse4");
-
-#define LARGE_ENOUGH 2048
- bufferptr in_ptr(buffer::create_page_aligned(LARGE_ENOUGH));
- in_ptr.zero();
- in_ptr.set_length(0);
- const char *payload =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
- in_ptr.append(payload, strlen(payload));
- bufferlist in;
- in.push_front(in_ptr);
-
- ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance();
- map<std::string,std::string> profile;
- profile["technique"] = "multiple";
- profile["k"] = "2";
- profile["m"] = "1";
- profile["c"] = "1";
- for (vector<string>::iterator sse_variant = sse_variants.begin();
- sse_variant != sse_variants.end();
- ++sse_variant) {
- //
- // load the plugin variant
- //
- ErasureCodeInterfaceRef erasure_code;
- EXPECT_FALSE(erasure_code);
- EXPECT_EQ(0, instance.factory("shec_" + *sse_variant,
- g_conf->erasure_code_dir,
- profile,
- &erasure_code, &cerr));
- EXPECT_TRUE(erasure_code.get());
-
- //
- // encode
- //
- int want_to_encode[] = { 0, 1, 2 };
- map<int, bufferlist> encoded;
- EXPECT_EQ(0, erasure_code->encode(set<int>(want_to_encode, want_to_encode+3),
- in,
- &encoded));
- EXPECT_EQ(3u, encoded.size());
- unsigned length = encoded[0].length();
- EXPECT_EQ(0, strncmp(encoded[0].c_str(), in.c_str(), length));
- EXPECT_EQ(0, strncmp(encoded[1].c_str(), in.c_str() + length,
- in.length() - length));
-
- //
- // decode with reconstruction
- //
- map<int, bufferlist> degraded = encoded;
- degraded.erase(1);
- EXPECT_EQ(2u, degraded.size());
- int want_to_decode[] = { 0, 1 };
- map<int, bufferlist> decoded;
- EXPECT_EQ(0, erasure_code->decode(set<int>(want_to_decode, want_to_decode+2),
- degraded,
- &decoded));
- EXPECT_EQ(3u, decoded.size());
- EXPECT_EQ(length, decoded[0].length());
- EXPECT_EQ(0, strncmp(decoded[0].c_str(), in.c_str(), length));
- EXPECT_EQ(0, strncmp(decoded[1].c_str(), in.c_str() + length,
- in.length() - length));
-
- }
-}
-
int main(int argc, char **argv)
{
vector<const char*> args;
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph distributed storage system
- *
- * Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
- * Copyright (C) 2014 Red Hat <contact@redhat.com>
- *
- * Author: Loic Dachary <loic@dachary.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- */
-
-#include "ceph_ver.h"
-
-extern "C" const char *__erasure_code_version() { return CEPH_GIT_NICE_VER; }
-
-extern "C" int __erasure_code_init(char *plugin_name, char *directory)
-{
- return -111;
-}
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph distributed storage system
- *
- * Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
- * Copyright (C) 2014 Red Hat <contact@redhat.com>
- *
- * Author: Loic Dachary <loic@dachary.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- */
-
-#include "ceph_ver.h"
-
-extern "C" const char *__erasure_code_version() { return CEPH_GIT_NICE_VER; }
-
-extern "C" int __erasure_code_init(char *plugin_name, char *directory)
-{
- return -555;
-}
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph distributed storage system
- *
- * Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
- * Copyright (C) 2014 Red Hat <contact@redhat.com>
- *
- * Author: Loic Dachary <loic@dachary.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- */
-
-#include "ceph_ver.h"
-
-extern "C" const char *__erasure_code_version() { return CEPH_GIT_NICE_VER; }
-
-extern "C" int __erasure_code_init(char *plugin_name, char *directory)
-{
- return -333;
-}
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph distributed storage system
- *
- * Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
- * Copyright (C) 2014 Red Hat <contact@redhat.com>
- *
- * Author: Loic Dachary <loic@dachary.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- */
-
-#include "ceph_ver.h"
-
-extern "C" const char *__erasure_code_version() { return CEPH_GIT_NICE_VER; }
-
-extern "C" int __erasure_code_init(char *plugin_name, char *directory)
-{
- return -444;
-}
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph distributed storage system
- *
- * Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
- * Copyright (C) 2014 Red Hat <contact@redhat.com>
- * Copyright (C) 2015 FUJITSU LIMITED
- *
- * Author: Loic Dachary <loic@dachary.org>
- * Author: Shotaro Kawaguchi <kawaguchi.s@jp.fujitsu.com>
- * Author: Takanori Nakao <nakao.takanori@jp.fujitsu.com>
- * Author: Takeshi Miyamae <miyamae.takeshi@jp.fujitsu.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- */
-
-#include "ceph_ver.h"
-
-extern "C" const char *__erasure_code_version() { return CEPH_GIT_NICE_VER; }
-
-extern "C" int __erasure_code_init(char *plugin_name, char *directory)
-{
- return -111;
-}
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph distributed storage system
- *
- * Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
- * Copyright (C) 2014 Red Hat <contact@redhat.com>
- * Copyright (C) 2015 FUJITSU LIMITED
- *
- * Author: Loic Dachary <loic@dachary.org>
- * Author: Shotaro Kawaguchi <kawaguchi.s@jp.fujitsu.com>
- * Author: Takanori Nakao <nakao.takanori@jp.fujitsu.com>
- * Author: Takeshi Miyamae <miyamae.takeshi@jp.fujitsu.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- */
-
-#include "ceph_ver.h"
-
-extern "C" const char *__erasure_code_version() { return CEPH_GIT_NICE_VER; }
-
-extern "C" int __erasure_code_init(char *plugin_name, char *directory)
-{
- return -555;
-}
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph distributed storage system
- *
- * Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
- * Copyright (C) 2014 Red Hat <contact@redhat.com>
- * Copyright (C) 2015 FUJITSU LIMITED
- *
- * Author: Loic Dachary <loic@dachary.org>
- * Author: Shotaro Kawaguchi <kawaguchi.s@jp.fujitsu.com>
- * Author: Takanori Nakao <nakao.takanori@jp.fujitsu.com>
- * Author: Takeshi Miyamae <miyamae.takeshi@jp.fujitsu.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- */
-
-#include "ceph_ver.h"
-
-extern "C" const char *__erasure_code_version() { return CEPH_GIT_NICE_VER; }
-
-extern "C" int __erasure_code_init(char *plugin_name, char *directory)
-{
- return -333;
-}
+++ /dev/null
-// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
-/*
- * Ceph distributed storage system
- *
- * Copyright (C) 2014 Cloudwatt <libre.licensing@cloudwatt.com>
- * Copyright (C) 2014 Red Hat <contact@redhat.com>
- * Copyright (C) 2015 FUJITSU LIMITED
- *
- * Author: Loic Dachary <loic@dachary.org>
- * Author: Shotaro Kawaguchi <kawaguchi.s@jp.fujitsu.com>
- * Author: Takanori Nakao <nakao.takanori@jp.fujitsu.com>
- * Author: Takeshi Miyamae <miyamae.takeshi@jp.fujitsu.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- */
-
-#include "ceph_ver.h"
-
-extern "C" const char *__erasure_code_version() { return CEPH_GIT_NICE_VER; }
-
-extern "C" int __erasure_code_init(char *plugin_name, char *directory)
-{
- return -444;
-}