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