Commit Graph

75 Commits

Author SHA1 Message Date
Jerry Yu
183385f02f multibinary: Add run-time cpu feature detect for aarch64
Some CPUs  report "illegal instruction" error for the crc test because
they do not support the relevant optional feature . This can be fixed by
introducing CPU feature detection for AArch64 .

The difference with the x86 implementation is the dispatcher . It is based
on the glibc function `getauxval(AT_HWCAP)` and `getauxval(AT_HWCAP2)` , not
registers or instructions .

On a  heterogeneous system (big.LITTLE) , it is dangerous to detect CPU
features using identification registers . And while it is possible to use
architectural feature registers from userspace on recent kernels, this
won't necessarily work with older platforms . Thus we use the HW_CAPs
exported from the kernel (and visible in getauxval) as the solution.

- According to kernel suggestion , getauxval should be used for this purpose .
  - [CPU Feature detection](https://github.com/torvalds/linux/blob/master/Documentation/arm64/cpu-feature-registers.rst)
- According to  AAPCS result/paramter registers should be saved/restore for function call
  - [AAPCS](http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055b/IHI0055B_aapcs64.pdf)
  - [GLibc](https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=blob;f=sysdeps/aarch64/dl-trampoline.S)

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
Change-Id: Ic9abe0d2268ac95537e1abf10acc642fc58a5054
2019-08-26 17:58:42 +08:00
Zhiyuan Zhu
c80610a2bb crc: push the aarch64 crc optimization back to base functions
Some arm64 machines don't support pmull instructions, so set these
crc interface to base functions. For long-term solution, will
provide better multi-binary support with cpu features detection.

Change-Id: I02791a2a50283dc8df2f9ba124eb309912b5b4b7
Signed-off-by: Zhiyuan Zhu <zhiyuan.zhu@arm.com>
2019-07-16 07:18:54 +00:00
Zhiyuan Zhu
a46da529d9 crc: optimize crc with arm64 assembly
Change-Id: I49166ee06b3ad24babb90aeb0b834d8aacfc2d03
Signed-off-by: Zhiyuan Zhu <zhiyuan.zhu@arm.com>
2019-06-21 17:02:16 +08:00
Zhiyuan Zhu
899c647628 crc: implement table-driven crc algorithm
Change-Id: Iebfb8ae1db09bf2dc882fd87e61627d74fab4a5c
Signed-off-by: Zhiyuan Zhu <zhiyuan.zhu@arm.com>
2019-05-08 17:50:03 -07:00
Roy Oursler
699bb5bd3f all: Revamp performance testing to be time based
Change-Id: I6260d28e4adc974d8db0a1c770e3eb922d87f8e4
Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
2019-03-07 09:28:04 -07:00
Roy Oursler
5c62f1e1ec crc: Use type cast in crc32_ieee_base to avoid undefined behavior
Change-Id: I8362831125927372c62ecb5eec2f5afe6f75ef24
Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
2019-03-07 09:27:50 -07:00
Yibo Cai
7a44098a98 build: Add aarch64 support
Change-Id: If9594936a28355d89edd1a331b3b429dffa44184
Signed-off-by: Yibo Cai <yibo.cai@arm.com>
2019-02-10 13:08:56 -07:00
Ziye Yang
bed578b4d6 crc: Make crc32_table_iscsi_base static
Reason: Ceph directly copied some code from isal,
which will have conflict on the condition that
SPDK applications use isal-lib(configured with '--with-isal')
and also use Ceph (configured with --with-rbd)

Change-Id: I9f58412a68af76f8e29219a9c72cd44b9183033d
Signed-off-by: Jesse Hui <Chunyang.hui@intel.com>
Signed-off-by: Ziye Yang <ziye.yang@intel.com>
2019-02-01 17:37:33 +08:00
Greg Tucker
2e212f28fa build: Fix for mac nasm lack of symbol types
Change-Id: I9ee86a3e32876d3860477c8365fc459d94a8920e
Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
2018-11-29 13:54:36 -07:00
Greg Tucker
105eeb967c crc: Fix for small buffer readover in iscsi crc
Change-Id: Ib4d7e2c6838d490a539a0174b8eb128e4fb49bba
Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
2018-08-17 15:37:43 -07:00
Roy Oursler
3371542dce crc: Create a combined crc32 check test
Change-Id: Idae7634007363cfb59cca15270bd82c37fae26ea
Signed-off-by: Roy Oursler <roy.j.oursler@intel.com>
2018-02-02 13:51:17 -07:00
Greg Tucker
491035d956 crc: Add t10dif+copy function
Change-Id: Ic6c424a0aa746aa06643575f7fcc8d6944cbfc0e
Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
2017-12-18 15:59:17 -07:00
Chunyang Hui
e7df3fdedc crc: crc32 iscsi performance improvement
Change-Id: Ic8c946546345cf92a19dea1bbc5ebaf66c0f98da
Signed-off-by: Chunyang Hui <Chunyang.hui@intel.com>
2017-12-18 15:51:10 -07:00
Xiaodong Liu
3ab8239097 multibinary: move WRT_OPT macro to common header
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
2017-08-18 14:24:57 -07:00
Xiaodong Liu
7137c4a5be crc: release crc32_gzip_refl code outside
Merge crc32_gzip_refl function definitions, base code, multi-binary
code into crc32.h, crc32_base,c and crc_multibinary.asm in order to
keep consistency. Add crc32_gzip_refl files into crc/Makefile.am
Original crc32_gzip_refl removed NOT operation, re-add it.

Change-Id: Ib0cbbeb1ab3c9fcafec324b392596d2514202424
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
2017-06-26 04:14:27 -04:00
Greg Tucker
a8966b6709 igzip: Add unit tests for adler and crc32_gzip
Also renamed test helper function, fixed clang warnings and adler usage.

Change-Id: I4ad22d046809483456608be1f4fdc4adbf0e09e4
Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
2017-06-26 04:03:35 -04:00
Greg Tucker
14f07a9134 crc: Add base function aliases
Change-Id: I45e14808418b203e1761ae3ee4e4e510ae1e07e9
Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
2017-03-30 17:37:48 -07:00
Greg Tucker
8c975e9cbc crc: Group source by arch
Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
2017-03-06 15:46:02 -07:00
Xiaodong Liu
f42fc40db3 crc64: cache prefetch optimization
Change-Id: I4d4df3881e6fb8365cba605f7f5d010503ce73e9
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
2016-12-06 15:58:38 -07:00
Xiaodong Liu
b933fe8341 crc32: cache prefetch optimization
Change-Id: Id5783f8e76d63f42bde6d4797dff0bd5c4bfca19
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
2016-12-06 15:51:43 -07:00
Xiaodong Liu
67fa1a7baf crc32: add memset to performance cases
Change-Id: Ifc99a26d842fbf6963c259b6c82a1e0a312e081f
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
2016-12-06 15:32:16 -07:00
Xiaodong Liu
3d66317189 crc64: add jones and iso format, crc64 code clean
1. Add normal and reflected bits order functions for ISO format and
   Jones coefficients format.
2. Add a multi-binary macro for crc64 functions.
3. In order to decrease number of repeated test.c and perf.c files,
   using crc64_funcs_test.c and cr crc64_funcs_perf.c.
4. Add crc64_example.c to take the demonstration role.

Change-Id: Icb8c14f1a84cd98f58eb12206ca605dea8a2cefb
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
2016-12-06 13:48:13 -07:00
Xiaodong Liu
90f0ea90de crc64: add crc64 ecma polynomial
crc64_ecma_norm is used for the normal format.
crc64_ecma_refl is used for the refleced format.

Change-Id: I8fa8aad48ed995ea7edcdb8e123e1a5f1a1f01ad
Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
2016-12-06 13:27:39 -07:00
Xiaodong Liu
b34cb054fd build: Fix an include path to be srcdir relative
Allows configure to again build in an external directory.  When building ISAL in
an external path, assembler or compiler needs relative include paths.

Signed-off-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Greg Tucker <greg.b.tucker@intel.com>
2016-12-02 16:54:40 -07:00
Greg Tucker
61164e105b Add crc unit
New crc unit adds three different polynomials: T10dif, ieee and iscsi.

Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
2016-05-03 15:02:29 -07:00