src/dpdk/lib/librte_efd/rte_efd.c
static inline void
efd_apply_update(struct rte_efd_table * const table, const unsigned int socket_id,
		const uint32_t chunk_id, const uint32_t group_id,
		const uint32_t bin_id, const uint8_t new_bin_choice,
		const struct efd_online_group_entry * const new_group_entry)
{
	int i;
	struct efd_online_chunk *chunk = &table->chunks[socket_id][chunk_id];
	uint8_t bin_index = bin_id / EFD_CHUNK_NUM_BIN_TO_GROUP_SETS;

	/*
	 * Grab the current byte that contains the choices
	 * for four neighboring bins
	 */
	uint8_t choice_chunk =
			chunk->bin_choice_list[bin_index];


	/* Compute the offset into the chunk that needs to be updated */
	int offset = (bin_id & 0x3) * 2;

	/* Zero the two bits of interest and set them to new_bin_choice */
	choice_chunk = (choice_chunk & (~(0x03 << offset)))
			| ((new_bin_choice & 0x03) << offset);

	/* Update the online table with the new data across all sockets */
	for (i = 0; i < RTE_MAX_NUMA_NODES; i++) {
		if (table->chunks[i] != NULL) {
			memcpy(&(table->chunks[i][chunk_id].groups[group_id]),
					new_group_entry,
					sizeof(struct efd_online_group_entry));
			table->chunks[i][chunk_id].bin_choice_list[bin_index] =
					choice_chunk;
		}
	}
}
/**
 * Applies a previously computed table entry to the specified table for all
 * socket-local copies of the online table.
 * Intended to apply an update for only a single change
 * to a key/value pair at a time
 *
 * @param table
 *   EFD table to reference
 * @param socket_id
 *   Socket ID to use to lookup existing values (ideally caller's socket id)
 * @param chunk_id
 *   Chunk index to update
 * @param group_id
 *   Group index to update
 * @param bin_id
 *   Bin within the group that this update affects
 * @param new_bin_choice
 *   Newly chosen permutation which this bin should use - only lower 2 bits
 * @param new_group_entry
 *   Previously computed updated chunk/group entry
 */
Applies a previously computed table entry to the specified table for all
socket-local copies of the online table.
Intended to apply an update for only a single change
to a key/value pair at a time


Applies a previously computed table entry to the specified table for all socket - local copies of the online table . Intended to apply an update for only a single change to a key / value pair at a time
static inline void
efd_apply_update(struct rte_efd_table * const table, const unsigned int socket_id,
		const uint32_t chunk_id, const uint32_t group_id,
		const uint32_t bin_id, const uint8_t new_bin_choice,
		const struct efd_online_group_entry * const new_group_entry)
{
	int i;
	struct efd_online_chunk *chunk = &table->chunks[socket_id][chunk_id];
	uint8_t bin_index = bin_id / EFD_CHUNK_NUM_BIN_TO_GROUP_SETS;
	uint8_t choice_chunk =
			chunk->bin_choice_list[bin_index];
	int offset = (bin_id & 0x3) * 2;
	choice_chunk = (choice_chunk & (~(0x03 << offset)))
			| ((new_bin_choice & 0x03) << offset);
	for (i = 0; i < RTE_MAX_NUMA_NODES; i++) {
		if (table->chunks[i] != NULL) {
			memcpy(&(table->chunks[i][chunk_id].groups[group_id]),
					new_group_entry,
					sizeof(struct efd_online_group_entry));
			table->chunks[i][chunk_id].bin_choice_list[bin_index] =
					choice_chunk;
		}
	}
}
static inline void efd_apply_update ( struct rte_efd_table * const table , const unsigned int socket_id , const uint32_t chunk_id , const uint32_t group_id , const uint32_t bin_id , const uint8_t new_bin_choice , const struct efd_online_group_entry * const new_group_entry ) { int i ; struct efd_online_chunk * chunk = & table -> chunks [ socket_id ] [ chunk_id ] ; uint8_t bin_index = bin_id / EFD_CHUNK_NUM_BIN_TO_GROUP_SETS ; uint8_t choice_chunk = chunk -> bin_choice_list [ bin_index ] ; int offset = ( bin_id & 0x3 ) * 2 ; choice_chunk = ( choice_chunk & ( ~ ( 0x03 << offset ) ) ) | ( ( new_bin_choice & 0x03 ) << offset ) ; for ( i = 0 ; i < RTE_MAX_NUMA_NODES ; i ++ ) { if ( table -> chunks [ i ] != NULL ) { memcpy ( & ( table -> chunks [ i ] [ chunk_id ] . groups [ group_id ] ) , new_group_entry , sizeof ( struct efd_online_group_entry ) ) ; table -> chunks [ i ] [ chunk_id ] . bin_choice_list [ bin_index ] = choice_chunk ; } } }
Applies a previously computed table entry to the specified table for all
 socket-local copies of the online table.
Applies a previously computed table entry to the specified table for all socket - local copies of the online table .
/*
	 * Grab the current byte that contains the choices
	 * for four neighboring bins
	 */ /* Compute the offset into the chunk that needs to be updated */ /* Zero the two bits of interest and set them to new_bin_choice */ /* Update the online table with the new data across all sockets */