src/dpdk/lib/librte_efd/rte_efd.c
static inline void
revert_groups(struct efd_offline_group_rules *previous_group,
		struct efd_offline_group_rules *current_group, uint8_t bin_size)
{
	unsigned int i;

	if (current_group == previous_group)
		return;

	/* Move keys back to previous group */
	for (i = current_group->num_rules - bin_size;
			i < current_group->num_rules; i++) {
		previous_group->key_idx[previous_group->num_rules] =
				current_group->key_idx[i];
		previous_group->value[previous_group->num_rules] =
				current_group->value[i];
		previous_group->bin_id[previous_group->num_rules] =
				current_group->bin_id[i];
		previous_group->num_rules++;
	}

	/*
	 * Decrease number of rules after the move
	 * in the new group
	 */
	current_group->num_rules -= bin_size;
}
/*
 * Revert group/s to their previous state before
 * trying to insert/add a new key
 */
Revert group/s to their previous state before
trying to insert/add a new key
Revert group / s to their previous state before trying to insert / add a new key
static inline void
revert_groups(struct efd_offline_group_rules *previous_group,
		struct efd_offline_group_rules *current_group, uint8_t bin_size)
{
	unsigned int i;
	if (current_group == previous_group)
		return;
	for (i = current_group->num_rules - bin_size;
			i < current_group->num_rules; i++) {
		previous_group->key_idx[previous_group->num_rules] =
				current_group->key_idx[i];
		previous_group->value[previous_group->num_rules] =
				current_group->value[i];
		previous_group->bin_id[previous_group->num_rules] =
				current_group->bin_id[i];
		previous_group->num_rules++;
	}
	current_group->num_rules -= bin_size;
}
static inline void revert_groups ( struct efd_offline_group_rules * previous_group , struct efd_offline_group_rules * current_group , uint8_t bin_size ) { unsigned int i ; if ( current_group == previous_group ) return ; for ( i = current_group -> num_rules - bin_size ; i < current_group -> num_rules ; i ++ ) { previous_group -> key_idx [ previous_group -> num_rules ] = current_group -> key_idx [ i ] ; previous_group -> value [ previous_group -> num_rules ] = current_group -> value [ i ] ; previous_group -> bin_id [ previous_group -> num_rules ] = current_group -> bin_id [ i ] ; previous_group -> num_rules ++ ; } current_group -> num_rules -= bin_size ; }
Revert group/s to their previous state before
 trying to insert/add a new key
Revert group / s to their previous state before trying to insert / add a new key
/* Move keys back to previous group */ /*
	 * Decrease number of rules after the move
	 * in the new group
	 */