| 1296 | } |
| 1297 | |
| 1298 | efd_value_t |
| 1299 | rte_efd_lookup(const struct rte_efd_table * const table, |
| 1300 | const unsigned int socket_id, const void *key) |
| 1301 | { |
| 1302 | uint32_t chunk_id, group_id, bin_id; |
| 1303 | uint8_t bin_choice; |
| 1304 | const struct efd_online_group_entry *group; |
| 1305 | const struct efd_online_chunk * const chunks = table->chunks[socket_id]; |
| 1306 | |
| 1307 | /* Determine the chunk and group location for the given key */ |
| 1308 | efd_compute_ids(table, key, &chunk_id, &bin_id); |
| 1309 | bin_choice = efd_get_choice(table, socket_id, chunk_id, bin_id); |
| 1310 | group_id = efd_bin_to_group[bin_choice][bin_id]; |
| 1311 | group = &chunks[chunk_id].groups[group_id]; |
| 1312 | |
| 1313 | return efd_lookup_internal(group, |
| 1314 | EFD_HASHFUNCA(key, table), |
| 1315 | EFD_HASHFUNCB(key, table), |
| 1316 | table->lookup_fn); |
| 1317 | } |
| 1318 | |
| 1319 | void rte_efd_lookup_bulk(const struct rte_efd_table * const table, |
| 1320 | const unsigned int socket_id, const int num_keys, |