ec: Determine exact conditions where gf_gen_rs_matrix works

Add a program calculating some of the exact conditions where gf_gen_rs_matrix
works, add comments stating these bounds to gf_gen_rs_matrix, and fix erasure
code test that violates the bounds.

Change-Id: I1d0010b09fea97731bfd24f4f76e24609538b24f
Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
This commit is contained in:
Roy Oursler
2017-06-06 11:04:28 -07:00
committed by Xiaodong Liu
parent 1a7c640ef9
commit 82a6ac65dc
4 changed files with 129 additions and 5 deletions

View File

@@ -884,10 +884,17 @@ unsigned char gf_inv(unsigned char a);
* Vandermonde matrix example of encoding coefficients where high portion of
* matrix is identity matrix I and lower portion is constructed as 2^{i*(j-k+1)}
* i:{0,k-1} j:{k,m-1}. Commonly used method for choosing coefficients in
* erasure encoding but does not guarantee invertable for every sub matrix. For
* large k it is possible to find cases where the decode matrix chosen from
* sources and parity not in erasure are not invertable. Users may want to
* adjust for k > 5.
* erasure encoding but does not guarantee invertable for every sub matrix. For
* large pairs of m and k it is possible to find cases where the decode matrix
* chosen from sources and parity is not invertable. Users may want to adjust
* for certain pairs m and k. If m and k satisfy one of the following
* inequalities, no adjustment is required:
*
* k <= 3
* k = 4, m <= 25
* k = 5, m <= 10
* k <= 21, m-k = 4
* m - k <= 3.
*
* @param a [mxk] array to hold coefficients
* @param m number of rows in matrix corresponding to srcs + parity.