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

Function revert_groups

dpdk/lib/efd/rte_efd.c:884–910  ·  view source on GitHub ↗

* Revert group/s to their previous state before * trying to insert/add a new key */

Source from the content-addressed store, hash-verified

882 * trying to insert/add a new key
883 */
884static inline void
885revert_groups(struct efd_offline_group_rules *previous_group,
886 struct efd_offline_group_rules *current_group, uint8_t bin_size)
887{
888 unsigned int i;
889
890 if (current_group == previous_group)
891 return;
892
893 /* Move keys back to previous group */
894 for (i = current_group->num_rules - bin_size;
895 i < current_group->num_rules; i++) {
896 previous_group->key_idx[previous_group->num_rules] =
897 current_group->key_idx[i];
898 previous_group->value[previous_group->num_rules] =
899 current_group->value[i];
900 previous_group->bin_id[previous_group->num_rules] =
901 current_group->bin_id[i];
902 previous_group->num_rules++;
903 }
904
905 /*
906 * Decrease number of rules after the move
907 * in the new group
908 */
909 current_group->num_rules -= bin_size;
910}
911
912/**
913 * Computes an updated table entry where the supplied key points to a new host.

Callers 1

efd_compute_updateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected