| 950 | } |
| 951 | |
| 952 | static int |
| 953 | test_convert(void) |
| 954 | { |
| 955 | static const struct { |
| 956 | const char *desc; |
| 957 | void (*config)(struct rte_acl_config *); |
| 958 | void (*convert)(const struct rte_acl_ipv4vlan_rule *, |
| 959 | struct acl_ipv4vlan_rule *); |
| 960 | } convert_param[] = { |
| 961 | { |
| 962 | "acl_ipv4vlan_tuple", |
| 963 | convert_config, |
| 964 | convert_rule, |
| 965 | }, |
| 966 | { |
| 967 | "acl_ipv4vlan_tuple, RTE_ACL_FIELD_TYPE_BITMASK type " |
| 968 | "for IPv4", |
| 969 | convert_config_1, |
| 970 | convert_rule_1, |
| 971 | }, |
| 972 | { |
| 973 | "acl_ipv4vlan_tuple, RTE_ACL_FIELD_TYPE_RANGE type " |
| 974 | "for IPv4", |
| 975 | convert_config_2, |
| 976 | convert_rule_2, |
| 977 | }, |
| 978 | { |
| 979 | "acl_ipv4vlan_tuple: swap VLAN and PORTs order", |
| 980 | convert_config_3, |
| 981 | convert_rule_3, |
| 982 | }, |
| 983 | { |
| 984 | "acl_ipv4vlan_tuple: swap SRC and DST IPv4 order", |
| 985 | convert_config_4, |
| 986 | convert_rule_4, |
| 987 | }, |
| 988 | }; |
| 989 | |
| 990 | uint32_t i; |
| 991 | int32_t rc; |
| 992 | |
| 993 | for (i = 0; i != RTE_DIM(convert_param); i++) { |
| 994 | rc = test_convert_rules(convert_param[i].desc, |
| 995 | convert_param[i].config, |
| 996 | convert_param[i].convert); |
| 997 | if (rc != 0) { |
| 998 | printf("%s for test-case: %s failed, error code: %d;\n", |
| 999 | __func__, convert_param[i].desc, rc); |
| 1000 | return rc; |
| 1001 | } |
| 1002 | } |
| 1003 | |
| 1004 | return 0; |
| 1005 | } |
| 1006 | |
| 1007 | /* |
| 1008 | * Test wrong layout behavior |
no test coverage detected