|
|
@@ -36,26 +36,13 @@ static int crct10dif_update(struct shash_desc *desc, const u8 *data,
|
|
|
unsigned int length)
|
|
|
{
|
|
|
u16 *crc = shash_desc_ctx(desc);
|
|
|
- unsigned int l;
|
|
|
|
|
|
- if (unlikely((u64)data % CRC_T10DIF_PMULL_CHUNK_SIZE)) {
|
|
|
- l = min_t(u32, length, CRC_T10DIF_PMULL_CHUNK_SIZE -
|
|
|
- ((u64)data % CRC_T10DIF_PMULL_CHUNK_SIZE));
|
|
|
-
|
|
|
- *crc = crc_t10dif_generic(*crc, data, l);
|
|
|
-
|
|
|
- length -= l;
|
|
|
- data += l;
|
|
|
- }
|
|
|
-
|
|
|
- if (length > 0) {
|
|
|
- if (may_use_simd()) {
|
|
|
- kernel_neon_begin();
|
|
|
- *crc = crc_t10dif_pmull(*crc, data, length);
|
|
|
- kernel_neon_end();
|
|
|
- } else {
|
|
|
- *crc = crc_t10dif_generic(*crc, data, length);
|
|
|
- }
|
|
|
+ if (length >= CRC_T10DIF_PMULL_CHUNK_SIZE && may_use_simd()) {
|
|
|
+ kernel_neon_begin();
|
|
|
+ *crc = crc_t10dif_pmull(*crc, data, length);
|
|
|
+ kernel_neon_end();
|
|
|
+ } else {
|
|
|
+ *crc = crc_t10dif_generic(*crc, data, length);
|
|
|
}
|
|
|
|
|
|
return 0;
|