* Sort list of rules based on the rules wildness. * Use recursive mergesort algorithm. */
| 1271 | * Use recursive mergesort algorithm. |
| 1272 | */ |
| 1273 | static struct rte_acl_build_rule * |
| 1274 | sort_rules(struct rte_acl_build_rule *head) |
| 1275 | { |
| 1276 | struct rte_acl_build_rule *a; |
| 1277 | struct rte_acl_build_rule *b; |
| 1278 | |
| 1279 | /* Base case -- length 0 or 1 */ |
| 1280 | if (head == NULL || head->next == NULL) |
| 1281 | return head; |
| 1282 | |
| 1283 | /* Split head into 'a' and 'b' sublists */ |
| 1284 | rule_list_split(head, &a, &b); |
| 1285 | |
| 1286 | /* Recursively sort the sublists */ |
| 1287 | a = sort_rules(a); |
| 1288 | b = sort_rules(b); |
| 1289 | |
| 1290 | /* answer = merge the two sorted lists together */ |
| 1291 | return rule_list_sorted_merge(a, b); |
| 1292 | } |
| 1293 | |
| 1294 | static uint32_t |
| 1295 | acl_build_index(const struct rte_acl_config *config, uint32_t *data_index) |
no test coverage detected