* 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 */
| 310 | * Currently active permutation choice in the online table |
| 311 | */ |
| 312 | static inline uint8_t |
| 313 | efd_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 |
no outgoing calls
no test coverage detected