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

Function test_convert_rules

dpdk/app/test/test_acl.c:908–950  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

906}
907
908static int
909test_convert_rules(const char *desc,
910 void (*config)(struct rte_acl_config *),
911 void (*convert)(const struct rte_acl_ipv4vlan_rule *,
912 struct acl_ipv4vlan_rule *))
913{
914 struct rte_acl_ctx *acx;
915 int32_t rc;
916 uint32_t i;
917 static const size_t mem_sizes[] = {0, -1};
918
919 printf("running %s(%s)\n", __func__, desc);
920
921 acx = rte_acl_create(&acl_param);
922 if (acx == NULL) {
923 printf("Line %i: Error creating ACL context!\n", __LINE__);
924 return -1;
925 }
926
927 rc = convert_rules(acx, convert, acl_test_rules,
928 RTE_DIM(acl_test_rules));
929 if (rc != 0)
930 printf("Line %i: Error converting ACL rules!\n", __LINE__);
931
932 for (i = 0; rc == 0 && i != RTE_DIM(mem_sizes); i++) {
933
934 rc = build_convert_rules(acx, config, mem_sizes[i]);
935 if (rc != 0) {
936 printf("Line %i: Error @ build_convert_rules(%zu)!\n",
937 __LINE__, mem_sizes[i]);
938 break;
939 }
940
941 rc = test_classify_run(acx, acl_test_data,
942 RTE_DIM(acl_test_data));
943 if (rc != 0)
944 printf("%s failed at line %i, max_size=%zu\n",
945 __func__, __LINE__, mem_sizes[i]);
946 }
947
948 rte_acl_free(acx);
949 return rc;
950}
951
952static int
953test_convert(void)

Callers 1

test_convertFunction · 0.85

Calls 6

rte_acl_createFunction · 0.85
convert_rulesFunction · 0.85
build_convert_rulesFunction · 0.85
test_classify_runFunction · 0.85
rte_acl_freeFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected