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

Function efd_get_choice

dpdk/lib/efd/rte_efd.c:312–334  ·  view source on GitHub ↗

* Looks up the current permutation choice for a particular bin in the online table * * @param table * EFD table to reference * @param socket_id * Socket ID to use to look up existing values (ideally caller's socket id) * @param chunk_id * Chunk ID of bin to look up * @param bin_id * Bin ID to look up * * @return * Currently active permutation choice in the online table */

Source from the content-addressed store, hash-verified

310 * Currently active permutation choice in the online table
311 */
312static inline uint8_t
313efd_get_choice(const struct rte_efd_table * const table,
314 const unsigned int socket_id, const uint32_t chunk_id,
315 const uint32_t bin_id)
316{
317 struct efd_online_chunk *chunk = &table->chunks[socket_id][chunk_id];
318
319 /*
320 * Grab the chunk (byte) that contains the choices
321 * for four neighboring bins.
322 */
323 uint8_t choice_chunk =
324 chunk->bin_choice_list[bin_id / EFD_CHUNK_NUM_BIN_TO_GROUP_SETS];
325
326 /*
327 * Compute the offset into the chunk that contains
328 * the group_id lookup position
329 */
330 int offset = (bin_id & 0x3) * 2;
331
332 /* Extract from the byte just the desired lookup position */
333 return (uint8_t) ((choice_chunk >> offset) & 0x3);
334}
335
336/**
337 * Compute the chunk_id and bin_id for a given key

Callers 4

efd_compute_updateFunction · 0.85
rte_efd_deleteFunction · 0.85
rte_efd_lookupFunction · 0.85
rte_efd_lookup_bulkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected