0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-28 16:34:13 +01:00

ircd::db: Log warning when crc32c acceleration is not available.

This commit is contained in:
Jason Volk 2019-04-22 15:13:22 -07:00
parent ae4ae66f08
commit c6d056421d

View file

@ -86,6 +86,7 @@ ircd::db::write_mutex;
namespace ircd::db
{
static std::string direct_io_test_file_path();
static void init_test_hw_crc32();
static void init_test_direct_io();
static void init_compressions();
static void init_directory();
@ -141,6 +142,7 @@ ircd::db::init::init()
init_compressions();
init_directory();
init_test_direct_io();
init_test_hw_crc32();
request.add(request_pool_size);
}
@ -254,6 +256,33 @@ ircd::db::direct_io_test_file_path()
return fs::path_string(fs::DB, test_file_name);
}
namespace rocksdb::crc32c
{
extern std::string IsFastCrc32Supported();
}
void
ircd::db::init_test_hw_crc32()
{
const auto supported_str
{
rocksdb::crc32c::IsFastCrc32Supported()
};
const bool supported
{
startswith(supported_str, "Supported")
};
assert(supported || startswith(supported_str, "Not supported"));
if(!supported)
log::warning
{
log, "crc32c hardware acceleration is not available on this platform."
};
}
decltype(ircd::db::compressions)
ircd::db::compressions;