Commit Graph

58 Commits

Author SHA1 Message Date
Jim Cheung 06e50ea86b Add Phazr.IO libphazr backend to liberasurecode
Currently, there are several implementations of erasure codes that are
available within OpenStack Swift.  Most, if not all, of which are based
on the Reed Solomon coding algorithm.

Phazr.IO’s Erasure Coding technology uses a patented algorithm which are
significantly more efficient and improves the speed of coding, decoding
and reconstruction.  In addition, Phazr.IO Erasure Code use a non-systematic
algorithm which provides data protection at rest and in transport without
the need to use encryption.

Please contact support@phazr.io for more info on our technology.

Change-Id: I4e40d02a8951e38409ad3c604c5dd6f050fa7ea0
2017-02-28 11:14:11 -08:00
Jenkins dc77b681aa Merge "Add get_version functionality to liberasurecode lib" 2016-12-08 19:54:37 +00:00
Kota Tsuyuzaki 8d067ab2f6 ISA-L Cauchy support
This is for supporting ISA-L cauchy based matrix. The difference
from isa_l_rs_vand is only the matrix to use the encode/decode calculation.

As a known issue, isa_l_rs_vand backend has constraint for the
combinations of the available fragment to be able to decode/reconstuct.
(See related change in detail)

To avoid the constraint, this patch adds another isa-l backend to use
cauchy matrix and keep the backward compatibility, this is in
another isa_l_rs_cauchy namespace.

For implementation consieration, the code is almost same except the matrix
generation fucntion so that this patch makes isa_l_common.c file for
gathering common fucntions like init/encode/decode/reconstruct. And then the
common init funciton takes an extra args "gen_matrix_func_name" for entry
point to load the fucntion by dlsym from isa-l .so file.

Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com>

Related-Change: Icee788a0931fe692fe0de31fabc4ba450e338a87
Change-Id: I6eb150d9d0c3febf233570fa7729f9f72df2e9be
2016-12-06 17:08:55 -08:00
Kota Tsuyuzaki 09d8bbf361 Add get_version functionality to liberasurecode lib
Currently, we have liberasurecode version info in the header and pyeclib
is using the info to detect the version. However it's a bit painful
because it requires to rebuild pyeclib c code for you to see the actual
installed version.

This addition for liberasurecode_get_version enables caller to get the
version integer from compiled shared library file (.so) and it will
rescure to re-compiled operation from pyeclib.

Change-Id: I8161ea7da3b069e83c93e11cb41ce12fa60c6f32
2016-12-04 20:56:24 -08:00
Kota Tsuyuzaki cb0daba975 Add get_by_desc ret val handling to get_fragment_size
As well as any other callers, libersurecode_get_fragment_size should
handle the return value of liberasurecode_get_backend_instance_by_desc.

Otherwise, get_by_desc can return NULL and it causes an invalid memory
access in librerasurecode_get_fragment_size.

Change-Id: I489f8b5d049610863b5e0b477b6ff70ead245b55
2016-09-07 20:22:47 -07:00
Tushar Gohad a6a8d2018d Fragment metadata checksumming support 2016-03-10 07:33:16 +00:00
Timur Alperovich c7a94df072 Add a method to check if a backend is present.
Uses dlopen to check if a backend is present. This may be used by
consumers who need to check which backends are present on a system.

Issue #23
2016-03-08 22:06:19 -08:00
Tushar Gohad 5ac6ae9c12 Move fragment_header defn to main erasurecode header 2015-09-17 23:23:01 +00:00
Kota Tsuyuzaki c9ce822825 Enforce the (k + m < 32) limit, add unit tests 2015-08-18 08:30:34 +00:00
Tushar Gohad fdb36f1e7a Rename remaining INTERNAL_RS_VAND instances
... to LIBERASURECODE_RS_VAND
2015-07-20 04:19:09 +00:00
Kevin Greenan e9ca485c7c Plugging new internal RS backend into liberasurecode. 2015-06-18 12:31:17 -07:00
Kota Tsuyuzaki dd67555f84 Rename frag_adder_size
This patch renames following variables and functions:

- frag_adder_size -> frag_backend_metadata_size
- set_fragment_adder_size() -> set_fragment_backend_metadata_size()
- get_fragment_adder_size() -> get_fragment_backend_metadata_size()
2015-03-05 14:01:10 +09:00
Kota Tsuyuzaki 9722168b58 Update documentation about metadata_adder 2015-02-27 07:56:28 -08:00
Kota Tsuyuzaki 54da656c65 Add liberasurecode_get_fragment_size function
For get_segment_info function of PyECLib, liberasurecode should
support get_fragment_size function because if pyeclib and liberasurecode
have the calculation of fragment size each other, it might cause
the size mismatch (i.e. it'll be a bug) in the future development work.

This patch introduces liberasurecode_get_fragment_size function to return
the fragment_size calculated at liberasurecode accoring to specified
backend descriptor.

It really usefull to help caller knows how large size it have to expect
and all pyeclib has to do for retrieving fragment_size will be just calling
the liberasurecode_get_fragment_size function on get_segment_info.
2015-02-27 04:54:50 -08:00
Kota Tsuyuzaki 0addebdbf6 Enable to get fragment_len includes metadata_adder
This patch allows to get correct fragment size includes metadata_adder.

Current implementaion automatically allocates extra bytes for the metadata_adder
in alloc_buffer, and then, no information about the extra bytes will be returned
to the api caller side. It's too confusable because callers couldn't know how size they
assumes as the fragment size.

To be easy to find out the size infomation, this patch adds "frag_adder_size"
variable into fragment metadata and also some functions to get fragment size.

The definitions of these size infomation are here,

fragment_meta:
- size-> raw data size used to encode/fragment_to_string
- frag_adder_size-> metadata_adder of backend specification

And the definitions of functions are here,

- get_fragment_size:
  -> return sizeof(fragument_header) + size + frag_adder_size

- get_fragment_buffer_size:
  -> return size + frag_adder_size

- get_fragment_payload_size:
  -> return size

By using these function above, users could get the size information
directly from fragments. It results in enabling to return fragment_len
to the caller side easily.
2015-02-27 04:54:50 -08:00
Kota Tsuyuzaki b30a15d87f Add NTT backend called "shss"
This introduces a new plug-able backend called "shss" made by
Nippon Telegraph and Telephone corporation (NTT).

Note that this produces a just plug-in to shss erasure coding binary
so that users have to install a shss binary (i.e. libshss.so) aside from
liberasurecode when using shss.

Please contact us if you are insterested in the NTT backend (welcome!):
Kota Tsuyuzaki <tsuyuzaki.kota@lab.ntt.co.jp>

Co-Author: Ryuta Kon <kon.ryuta@po.ntts.co.jp>
2015-02-10 18:28:05 -08:00
Tushar Gohad 6d9c09faeb Adjust checksum enum defintions to match pyeclib
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2015-02-01 15:03:39 -07:00
Tushar Gohad ff5dd39017 Add optional fragment metadata check for decode
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2015-01-30 18:42:04 -07:00
Kevin Greenan 09efa2dd84 Decreasing the verbosity of the tests and renaming one of the stripe verify
tests to a 'fragment verify' test, since it is using is_valid_fragment and
and validating fragment headers, not stripe-level.
2015-01-19 10:47:41 -08:00
Kevin Greenan 2e153037af Changing stripe verification to properly work with clients. 2015-01-11 09:41:27 -08:00
Eric Lambert 1b1d18733f add fragment validation 2014-11-09 08:52:11 -08:00
Eric Lambert 581afe3199 libec version is now stored in fragment header 2014-10-02 22:31:34 -04:00
Kevin Greenan 543d7e9923 Plugging-in the ISA-L backend... Still needs more documentation and a little clean-up, but the tests are passing... 2014-09-29 14:01:56 -07:00
Eric Lambert be8dcbcc27 Char * backend names are no longer supported. They have been replaced with elements of the ec_backend_id_t enum. 2014-09-29 13:24:50 -07:00
Eric Lambert 512353f8be Compile in pedantic mode and fail compilation on warnings. Also cleanup all existing warnings. 2014-09-10 17:13:45 -07:00
Eric Lambert 6bbcfde657 added argument validation logic and tests for
liberasure_get_fragment_metadata and
liberasurecode_verify_stripe_metadata. In the process removed the
liberasure descriptor from the liberasure_get_fragment_metadata
function's signature as it was not being used in the function's
implementation.
2014-09-02 15:07:07 -07:00
Tushar Gohad d03557c151 Add doxygen config. Update README, copyrights.
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-09-01 22:40:09 -07:00
Kevin Greenan d251ed8f98 API change for liberasurecode_fragments_needed
Still needed:

1.) RS and XOR backends need to honor the 'exclude' argument.
2.) Need to add tests.
2014-08-20 09:15:36 -07:00
Mark Storer 8af4f83e86 - Cleaned up the documentation in erasurecode.h to ensure that it
follows a common format and that it accurately reflects the code.
- Cleaned up liberasurecode_instance_destroy to ensure that the return
  code is correct and that it is not trying to free data that has
  not been removed from the open instances.
- Updated the tests to assert that the liberasurecode_instance_destroy
  method is return correctly.
2014-08-18 10:44:19 -07:00
Mark Storer 4cfd3f535b Updated liberasurecode_supported_checksum_types to accept a pointer
argument that holds the length of the list returned (i.e. the number of
supported checksum types).
2014-08-15 16:50:14 -07:00
Kevin Greenan c22312f2d0 Added cleanup API 2014-08-13 21:41:38 -07:00
Tushar Gohad 5e2108722c Split metadata handling into own routine, add crc32 support
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-08-07 14:19:43 -07:00
Kevin Greenan dbbc02d3db Add HD parameter to generic params. 2014-08-05 14:33:39 -07:00
Kevin Greenan 1bb14c6a3a Stubbing the metadata functions and updating their interfaces. 2014-07-30 23:06:30 -07:00
Tushar Gohad 6671c45b03 Add liberasurecode_supported_backends API implementation
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-25 22:18:37 -07:00
Tushar Gohad 7cc67fee9c Minor API doc fixup (backend names)
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-22 22:20:07 -07:00
Tushar Gohad 779ff74024 null_code: First cut
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-22 22:07:17 -07:00
Tushar Gohad 9069a7a33a Fix data_size type, int -> uint64_t
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-22 20:45:24 -07:00
Kevin Greenan 59bec942cb Ripping out galois.[ch] and dynamically pulling the multiplication functon from jerasure 2014-07-22 13:37:39 -07:00
Tushar Gohad af4279dfb2 Update encode API so liberasurecode allocates all memory
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-21 01:14:56 -07:00
Kevin Greenan bf219bde4f Added functionality needed to support the get_segment_info() API in PyECLib. 2014-07-21 09:10:33 -07:00
Tushar Gohad 19cd7d3b49 Make int types consistent across API
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-18 09:37:40 -07:00
Tushar Gohad 5383c54099 flat_xor_hd: Handle backend init errors
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-18 01:15:29 -07:00
Kevin Greenan 3eeb4c82b8 Wiring in the reconstruct preprocessing! 2014-07-19 16:39:25 -07:00
Kevin Greenan 0422ac5233 Wire-in the decoding preprocessing...
This compiles, but has not been tested!
2014-07-19 11:01:00 -07:00
Tushar Gohad e30f788f9a Make 'w' part of common user args, set 'w' in backend init
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-17 15:21:07 -07:00
Tushar Gohad 05e65c3f96 Fix liberasurecode main routines for new API (take 2)
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-16 12:58:41 -07:00
Tushar Gohad 2de939a9a5 Fix liberasurecode main routines for new API
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-16 11:26:57 -07:00
Tushar Gohad 6822a7a98e More API documentation
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-16 09:27:27 -07:00
Tushar Gohad c41559c125 Pass only 'available_fragments' to decode/reconstruct
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
2014-07-15 22:21:28 -07:00