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

Function find_previous_rule

dpdk/lib/lpm/rte_lpm.c:877–897  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

875}
876
877static int32_t
878find_previous_rule(struct __rte_lpm *i_lpm, uint32_t ip, uint8_t depth,
879 uint8_t *sub_rule_depth)
880{
881 int32_t rule_index;
882 uint32_t ip_masked;
883 uint8_t prev_depth;
884
885 for (prev_depth = (uint8_t)(depth - 1); prev_depth > 0; prev_depth--) {
886 ip_masked = ip & depth_to_mask(prev_depth);
887
888 rule_index = rule_find(i_lpm, ip_masked, prev_depth);
889
890 if (rule_index >= 0) {
891 *sub_rule_depth = prev_depth;
892 return rule_index;
893 }
894 }
895
896 return -1;
897}
898
899static int32_t
900delete_depth_small(struct __rte_lpm *i_lpm, uint32_t ip_masked,

Callers 1

rte_lpm_deleteFunction · 0.70

Calls 2

depth_to_maskFunction · 0.70
rule_findFunction · 0.70

Tested by

no test coverage detected