MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_hash_crc

Function rte_hash_crc

dpdk/lib/hash/rte_hash_crc.h:166–191  ·  view source on GitHub ↗

* Calculate CRC32 hash on user-supplied byte array. * * @param data * Data to perform hash on. * @param data_len * How many bytes to use to calculate hash value. * @param init_val * Value to initialise hash generator. * @return * 32bit calculated hash value. */

Source from the content-addressed store, hash-verified

164 * 32bit calculated hash value.
165 */
166static inline uint32_t
167rte_hash_crc(const void *data, uint32_t data_len, uint32_t init_val)
168{
169 unsigned i;
170 uintptr_t pd = (uintptr_t) data;
171
172 for (i = 0; i < data_len / 8; i++) {
173 init_val = rte_hash_crc_8byte(*(const uint64_t *)pd, init_val);
174 pd += 8;
175 }
176
177 if (data_len & 0x4) {
178 init_val = rte_hash_crc_4byte(*(const uint32_t *)pd, init_val);
179 pd += 4;
180 }
181
182 if (data_len & 0x2) {
183 init_val = rte_hash_crc_2byte(*(const uint16_t *)pd, init_val);
184 pd += 2;
185 }
186
187 if (data_len & 0x1)
188 init_val = rte_hash_crc_1byte(*(const uint8_t *)pd, init_val);
189
190 return init_val;
191}
192
193#ifdef __cplusplus
194}

Callers 14

add_specificFunction · 0.85
rte_ipsec_sad_addFunction · 0.85
del_specificFunction · 0.85
rte_ipsec_sad_delFunction · 0.85
__ipsec_sad_lookupFunction · 0.85
cnxk_ml_model_get_typeFunction · 0.85
hns3_fdir_filter_lookupFunction · 0.85
hns3_insert_fdir_filterFunction · 0.85
hns3_remove_fdir_filterFunction · 0.85
i40e_fdir_filter_convertFunction · 0.85

Calls 4

rte_hash_crc_8byteFunction · 0.70
rte_hash_crc_4byteFunction · 0.70
rte_hash_crc_2byteFunction · 0.70
rte_hash_crc_1byteFunction · 0.70

Tested by 3

ml_inference_validationFunction · 0.68