Lines Matching refs:len
44 u64 (*func)(u64 crc, const u8 *p, size_t len);
66 u64 crc, const u8 *p, size_t len) in crc_ref() argument
70 for (i = 0; i < len; i++) { in crc_ref()
128 size_t len; in generate_random_length() local
132 len = rand32() % 128; in generate_random_length()
135 len = rand32() % 3072; in generate_random_length()
138 len = rand32(); in generate_random_length()
141 return len % (max_length + 1); in generate_random_length()
151 size_t len, offset; in crc_test() local
155 len = generate_random_length(CRC_KUNIT_MAX_LEN); in crc_test()
161 offset = min(offset, CRC_KUNIT_MAX_LEN - len); in crc_test()
164 offset = test_buflen - len; in crc_test()
169 prandom_bytes_state(&rng, &test_buffer[offset], len); in crc_test()
177 expected_crc = crc_ref(v, init_crc, &test_buffer[offset], len); in crc_test()
180 actual_crc = v->func(init_crc, &test_buffer[offset], len); in crc_test()
185 len, offset, nosimd); in crc_test()
191 u64 (*crc_func)(u64 crc, const u8 *p, size_t len)) in crc_benchmark() argument
196 size_t len, i, j, num_iters; in crc_benchmark() local
213 len = lens_to_test[i]; in crc_benchmark()
214 KUNIT_ASSERT_LE(test, len, CRC_KUNIT_MAX_LEN); in crc_benchmark()
215 num_iters = 10000000 / (len + 128); in crc_benchmark()
219 crc = crc_func(crc, test_buffer, len); in crc_benchmark()
223 len, div64_u64((u64)len * num_iters * 1000, t)); in crc_benchmark()
229 static u64 crc7_be_wrapper(u64 crc, const u8 *p, size_t len) in crc7_be_wrapper() argument
235 return crc7_be(crc << 1, p, len) >> 1; in crc7_be_wrapper()
256 static u64 crc16_wrapper(u64 crc, const u8 *p, size_t len) in crc16_wrapper() argument
258 return crc16(crc, p, len); in crc16_wrapper()
280 static u64 crc_t10dif_wrapper(u64 crc, const u8 *p, size_t len) in crc_t10dif_wrapper() argument
282 return crc_t10dif_update(crc, p, len); in crc_t10dif_wrapper()
304 static u64 crc32_le_wrapper(u64 crc, const u8 *p, size_t len) in crc32_le_wrapper() argument
306 return crc32_le(crc, p, len); in crc32_le_wrapper()
328 static u64 crc32_be_wrapper(u64 crc, const u8 *p, size_t len) in crc32_be_wrapper() argument
330 return crc32_be(crc, p, len); in crc32_be_wrapper()
352 static u64 crc32c_wrapper(u64 crc, const u8 *p, size_t len) in crc32c_wrapper() argument
354 return crc32c(crc, p, len); in crc32c_wrapper()
376 static u64 crc64_be_wrapper(u64 crc, const u8 *p, size_t len) in crc64_be_wrapper() argument
378 return crc64_be(crc, p, len); in crc64_be_wrapper()
400 static u64 crc64_nvme_wrapper(u64 crc, const u8 *p, size_t len) in crc64_nvme_wrapper() argument
403 return ~crc64_nvme(~crc, p, len); in crc64_nvme_wrapper()