Lines Matching +full:ri +full:- +full:override

1 // SPDX-License-Identifier: BSD-3-Clause
39 if (kslist->cnt > 0) { in test_val_keyset()
40 switch (admin->vtype) { in test_val_keyset()
42 for (idx = 0; idx < kslist->cnt; idx++) { in test_val_keyset()
43 if (kslist->keysets[idx] == VCAP_KFS_ETAG) in test_val_keyset()
44 return kslist->keysets[idx]; in test_val_keyset()
45 if (kslist->keysets[idx] == VCAP_KFS_PURE_5TUPLE_IP4) in test_val_keyset()
46 return kslist->keysets[idx]; in test_val_keyset()
47 if (kslist->keysets[idx] == VCAP_KFS_NORMAL_5TUPLE_IP4) in test_val_keyset()
48 return kslist->keysets[idx]; in test_val_keyset()
49 if (kslist->keysets[idx] == VCAP_KFS_NORMAL_7TUPLE) in test_val_keyset()
50 return kslist->keysets[idx]; in test_val_keyset()
54 for (idx = 0; idx < kslist->cnt; idx++) { in test_val_keyset()
55 if (kslist->keysets[idx] == VCAP_KFS_MAC_ETYPE) in test_val_keyset()
56 return kslist->keysets[idx]; in test_val_keyset()
57 if (kslist->keysets[idx] == VCAP_KFS_ARP) in test_val_keyset()
58 return kslist->keysets[idx]; in test_val_keyset()
59 if (kslist->keysets[idx] == VCAP_KFS_IP_7TUPLE) in test_val_keyset()
60 return kslist->keysets[idx]; in test_val_keyset()
65 __func__, __LINE__, admin->vtype); in test_val_keyset()
69 return -EINVAL; in test_val_keyset()
77 if (admin->vinst == 0 || admin->vinst == 2) in test_add_def_fields()
87 memset(admin->cache.keystream, 0, test_cache_erase_count); in test_cache_erase()
88 memset(admin->cache.maskstream, 0, test_cache_erase_count); in test_cache_erase()
89 memset(admin->cache.actionstream, 0, test_cache_erase_count); in test_cache_erase()
112 keystr = &admin->cache.keystream[start]; in test_cache_read()
113 mskstr = &admin->cache.maskstream[start]; in test_cache_read()
126 actstr = &admin->cache.actionstream[start]; in test_cache_read()
135 admin->cache.counter = test_hw_cache.counter; in test_cache_read()
136 admin->cache.sticky = test_hw_cache.sticky; in test_cache_read()
153 keystr = &admin->cache.keystream[start]; in test_cache_write()
154 mskstr = &admin->cache.maskstream[start]; in test_cache_write()
167 actstr = &admin->cache.actionstream[start]; in test_cache_write()
176 test_hw_cache.counter = admin->cache.counter; in test_cache_write()
177 test_hw_cache.sticky = admin->cache.sticky; in test_cache_write()
236 INIT_LIST_HEAD(&admin->list); in vcap_test_api_init()
237 INIT_LIST_HEAD(&admin->rules); in vcap_test_api_init()
238 INIT_LIST_HEAD(&admin->enabled); in vcap_test_api_init()
239 mutex_init(&admin->lock); in vcap_test_api_init()
240 list_add_tail(&admin->list, &test_vctrl.list); in vcap_test_api_init()
251 struct vcap_rule_internal *ri; in test_vcap_xn_rule_creator() local
292 ri = (struct vcap_rule_internal *)rule; in test_vcap_xn_rule_creator()
294 /* Override rule keyset */ in test_vcap_xn_rule_creator()
300 /* Override rule actionset */ in test_vcap_xn_rule_creator()
305 KUNIT_EXPECT_EQ(test, keyset, rule->keyset); in test_vcap_xn_rule_creator()
306 KUNIT_EXPECT_EQ(test, actionset, rule->actionset); in test_vcap_xn_rule_creator()
307 KUNIT_EXPECT_EQ(test, size, ri->size); in test_vcap_xn_rule_creator()
312 KUNIT_EXPECT_EQ(test, expected_addr, ri->addr); in test_vcap_xn_rule_creator()
556 KUNIT_EXPECT_EQ(test, 25 + 3 + 2 - sw_width, iter.reg_bitpos); in vcap_api_encode_short_field_test()
561 KUNIT_EXPECT_EQ(test, (u32)(0x5 << (25 + 3 + 2 - sw_width)), stream[1]); in vcap_api_encode_short_field_test()
570 KUNIT_EXPECT_EQ(test, (u32)((0x5 << (25 + 3 + 2 - sw_width)) + 3), stream[1]); in vcap_api_encode_short_field_test()
742 KUNIT_EXPECT_EQ(test, (u32)((0x32 << (35 + 2 + 1 - sw_width)) & 0x1fffff), actwords[1]); in vcap_api_encode_actionfield_test()
743 KUNIT_EXPECT_EQ(test, (u32)((0x32 >> ((2 * sw_width) - 38 - 1))), actwords[2]); in vcap_api_encode_actionfield_test()
898 KUNIT_EXPECT_EQ(test, -EINVAL, ret); in vcap_api_encode_rule_keyset_test()
1001 list_for_each_entry_safe(ckf, next_ckf, &rule->keyfields, ctrl.list) { in vcap_free_ckf()
1002 list_del(&ckf->ctrl.list); in vcap_free_ckf()
1012 struct vcap_rule_internal ri = { in vcap_api_rule_add_keyvalue_test() local
1019 struct vcap_rule *rule = (struct vcap_rule *)&ri; in vcap_api_rule_add_keyvalue_test()
1028 INIT_LIST_HEAD(&rule->keyfields); in vcap_api_rule_add_keyvalue_test()
1031 ret = list_empty(&rule->keyfields); in vcap_api_rule_add_keyvalue_test()
1033 kf = list_first_entry(&rule->keyfields, struct vcap_client_keyfield, in vcap_api_rule_add_keyvalue_test()
1035 KUNIT_EXPECT_EQ(test, VCAP_KF_LOOKUP_FIRST_IS, kf->ctrl.key); in vcap_api_rule_add_keyvalue_test()
1036 KUNIT_EXPECT_EQ(test, VCAP_FIELD_BIT, kf->ctrl.type); in vcap_api_rule_add_keyvalue_test()
1037 KUNIT_EXPECT_EQ(test, 0x0, kf->data.u1.value); in vcap_api_rule_add_keyvalue_test()
1038 KUNIT_EXPECT_EQ(test, 0x1, kf->data.u1.mask); in vcap_api_rule_add_keyvalue_test()
1041 INIT_LIST_HEAD(&rule->keyfields); in vcap_api_rule_add_keyvalue_test()
1044 ret = list_empty(&rule->keyfields); in vcap_api_rule_add_keyvalue_test()
1046 kf = list_first_entry(&rule->keyfields, struct vcap_client_keyfield, in vcap_api_rule_add_keyvalue_test()
1048 KUNIT_EXPECT_EQ(test, VCAP_KF_LOOKUP_FIRST_IS, kf->ctrl.key); in vcap_api_rule_add_keyvalue_test()
1049 KUNIT_EXPECT_EQ(test, VCAP_FIELD_BIT, kf->ctrl.type); in vcap_api_rule_add_keyvalue_test()
1050 KUNIT_EXPECT_EQ(test, 0x1, kf->data.u1.value); in vcap_api_rule_add_keyvalue_test()
1051 KUNIT_EXPECT_EQ(test, 0x1, kf->data.u1.mask); in vcap_api_rule_add_keyvalue_test()
1054 INIT_LIST_HEAD(&rule->keyfields); in vcap_api_rule_add_keyvalue_test()
1058 ret = list_empty(&rule->keyfields); in vcap_api_rule_add_keyvalue_test()
1060 kf = list_first_entry(&rule->keyfields, struct vcap_client_keyfield, in vcap_api_rule_add_keyvalue_test()
1062 KUNIT_EXPECT_EQ(test, VCAP_KF_LOOKUP_FIRST_IS, kf->ctrl.key); in vcap_api_rule_add_keyvalue_test()
1063 KUNIT_EXPECT_EQ(test, VCAP_FIELD_BIT, kf->ctrl.type); in vcap_api_rule_add_keyvalue_test()
1064 KUNIT_EXPECT_EQ(test, 0x0, kf->data.u1.value); in vcap_api_rule_add_keyvalue_test()
1065 KUNIT_EXPECT_EQ(test, 0x0, kf->data.u1.mask); in vcap_api_rule_add_keyvalue_test()
1068 INIT_LIST_HEAD(&rule->keyfields); in vcap_api_rule_add_keyvalue_test()
1071 ret = list_empty(&rule->keyfields); in vcap_api_rule_add_keyvalue_test()
1073 kf = list_first_entry(&rule->keyfields, struct vcap_client_keyfield, in vcap_api_rule_add_keyvalue_test()
1075 KUNIT_EXPECT_EQ(test, VCAP_KF_TYPE, kf->ctrl.key); in vcap_api_rule_add_keyvalue_test()
1076 KUNIT_EXPECT_EQ(test, VCAP_FIELD_U32, kf->ctrl.type); in vcap_api_rule_add_keyvalue_test()
1077 KUNIT_EXPECT_EQ(test, 0x98765432, kf->data.u32.value); in vcap_api_rule_add_keyvalue_test()
1078 KUNIT_EXPECT_EQ(test, 0xff00ffab, kf->data.u32.mask); in vcap_api_rule_add_keyvalue_test()
1081 INIT_LIST_HEAD(&rule->keyfields); in vcap_api_rule_add_keyvalue_test()
1084 ret = list_empty(&rule->keyfields); in vcap_api_rule_add_keyvalue_test()
1086 kf = list_first_entry(&rule->keyfields, struct vcap_client_keyfield, in vcap_api_rule_add_keyvalue_test()
1088 KUNIT_EXPECT_EQ(test, VCAP_KF_L3_IP6_SIP, kf->ctrl.key); in vcap_api_rule_add_keyvalue_test()
1089 KUNIT_EXPECT_EQ(test, VCAP_FIELD_U128, kf->ctrl.type); in vcap_api_rule_add_keyvalue_test()
1091 KUNIT_EXPECT_EQ(test, dip.value[idx], kf->data.u128.value[idx]); in vcap_api_rule_add_keyvalue_test()
1093 KUNIT_EXPECT_EQ(test, dip.mask[idx], kf->data.u128.mask[idx]); in vcap_api_rule_add_keyvalue_test()
1102 &rule->actionfields, ctrl.list) { in vcap_free_caf()
1103 list_del(&caf->ctrl.list); in vcap_free_caf()
1113 struct vcap_rule_internal ri = { in vcap_api_rule_add_actionvalue_test() local
1119 struct vcap_rule *rule = (struct vcap_rule *)&ri; in vcap_api_rule_add_actionvalue_test()
1123 INIT_LIST_HEAD(&rule->actionfields); in vcap_api_rule_add_actionvalue_test()
1126 ret = list_empty(&rule->actionfields); in vcap_api_rule_add_actionvalue_test()
1128 af = list_first_entry(&rule->actionfields, in vcap_api_rule_add_actionvalue_test()
1130 KUNIT_EXPECT_EQ(test, VCAP_AF_POLICE_ENA, af->ctrl.action); in vcap_api_rule_add_actionvalue_test()
1131 KUNIT_EXPECT_EQ(test, VCAP_FIELD_BIT, af->ctrl.type); in vcap_api_rule_add_actionvalue_test()
1132 KUNIT_EXPECT_EQ(test, 0x0, af->data.u1.value); in vcap_api_rule_add_actionvalue_test()
1135 INIT_LIST_HEAD(&rule->actionfields); in vcap_api_rule_add_actionvalue_test()
1138 ret = list_empty(&rule->actionfields); in vcap_api_rule_add_actionvalue_test()
1140 af = list_first_entry(&rule->actionfields, in vcap_api_rule_add_actionvalue_test()
1142 KUNIT_EXPECT_EQ(test, VCAP_AF_POLICE_ENA, af->ctrl.action); in vcap_api_rule_add_actionvalue_test()
1143 KUNIT_EXPECT_EQ(test, VCAP_FIELD_BIT, af->ctrl.type); in vcap_api_rule_add_actionvalue_test()
1144 KUNIT_EXPECT_EQ(test, 0x1, af->data.u1.value); in vcap_api_rule_add_actionvalue_test()
1147 INIT_LIST_HEAD(&rule->actionfields); in vcap_api_rule_add_actionvalue_test()
1150 ret = list_empty(&rule->actionfields); in vcap_api_rule_add_actionvalue_test()
1152 af = list_first_entry(&rule->actionfields, in vcap_api_rule_add_actionvalue_test()
1154 KUNIT_EXPECT_EQ(test, VCAP_AF_POLICE_ENA, af->ctrl.action); in vcap_api_rule_add_actionvalue_test()
1155 KUNIT_EXPECT_EQ(test, VCAP_FIELD_BIT, af->ctrl.type); in vcap_api_rule_add_actionvalue_test()
1156 KUNIT_EXPECT_EQ(test, 0x0, af->data.u1.value); in vcap_api_rule_add_actionvalue_test()
1159 INIT_LIST_HEAD(&rule->actionfields); in vcap_api_rule_add_actionvalue_test()
1162 ret = list_empty(&rule->actionfields); in vcap_api_rule_add_actionvalue_test()
1164 af = list_first_entry(&rule->actionfields, in vcap_api_rule_add_actionvalue_test()
1166 KUNIT_EXPECT_EQ(test, VCAP_AF_TYPE, af->ctrl.action); in vcap_api_rule_add_actionvalue_test()
1167 KUNIT_EXPECT_EQ(test, VCAP_FIELD_U32, af->ctrl.type); in vcap_api_rule_add_actionvalue_test()
1168 KUNIT_EXPECT_EQ(test, 0x98765432, af->data.u32.value); in vcap_api_rule_add_actionvalue_test()
1171 INIT_LIST_HEAD(&rule->actionfields); in vcap_api_rule_add_actionvalue_test()
1174 ret = list_empty(&rule->actionfields); in vcap_api_rule_add_actionvalue_test()
1176 af = list_first_entry(&rule->actionfields, in vcap_api_rule_add_actionvalue_test()
1178 KUNIT_EXPECT_EQ(test, VCAP_AF_MASK_MODE, af->ctrl.action); in vcap_api_rule_add_actionvalue_test()
1179 KUNIT_EXPECT_EQ(test, VCAP_FIELD_U32, af->ctrl.type); in vcap_api_rule_add_actionvalue_test()
1180 KUNIT_EXPECT_EQ(test, 0xaabbccdd, af->data.u32.value); in vcap_api_rule_add_actionvalue_test()
1190 struct vcap_rule_internal ri = { in vcap_api_rule_find_keyset_basic_test() local
1220 INIT_LIST_HEAD(&ri.data.keyfields); in vcap_api_rule_find_keyset_basic_test()
1222 list_add_tail(&ckf[idx].ctrl.list, &ri.data.keyfields); in vcap_api_rule_find_keyset_basic_test()
1224 ret = vcap_rule_find_keysets(&ri.data, &matches); in vcap_api_rule_find_keyset_basic_test()
1237 struct vcap_rule_internal ri = { in vcap_api_rule_find_keyset_failed_test() local
1267 INIT_LIST_HEAD(&ri.data.keyfields); in vcap_api_rule_find_keyset_failed_test()
1269 list_add_tail(&ckf[idx].ctrl.list, &ri.data.keyfields); in vcap_api_rule_find_keyset_failed_test()
1271 ret = vcap_rule_find_keysets(&ri.data, &matches); in vcap_api_rule_find_keyset_failed_test()
1284 struct vcap_rule_internal ri = { in vcap_api_rule_find_keyset_many_test() local
1314 INIT_LIST_HEAD(&ri.data.keyfields); in vcap_api_rule_find_keyset_many_test()
1316 list_add_tail(&ckf[idx].ctrl.list, &ri.data.keyfields); in vcap_api_rule_find_keyset_many_test()
1318 ret = vcap_rule_find_keysets(&ri.data, &matches); in vcap_api_rule_find_keyset_many_test()
1352 struct vcap_rule_internal *ri; in vcap_api_encode_rule_test() local
1380 ri = (struct vcap_rule_internal *)rule; in vcap_api_encode_rule_test()
1391 KUNIT_EXPECT_EQ(test, -EINVAL, ret); in vcap_api_encode_rule_test()
1419 KUNIT_EXPECT_EQ(test, VCAP_KFS_MAC_ETYPE, rule->keyset); in vcap_api_encode_rule_test()
1420 KUNIT_EXPECT_EQ(test, VCAP_AFS_BASE_TYPE, rule->actionset); in vcap_api_encode_rule_test()
1421 KUNIT_EXPECT_EQ(test, 6, ri->size); in vcap_api_encode_rule_test()
1422 KUNIT_EXPECT_EQ(test, 2, ri->keyset_sw_regs); in vcap_api_encode_rule_test()
1423 KUNIT_EXPECT_EQ(test, 4, ri->actionset_sw_regs); in vcap_api_encode_rule_test()
1427 rule->vcap_chain_id, rule->cookie, true); in vcap_api_encode_rule_test()
1443 rule->cookie, false); in vcap_api_encode_rule_test()
1451 ret = list_empty(&rule->keyfields); in vcap_api_encode_rule_test()
1453 ret = list_empty(&rule->actionfields); in vcap_api_encode_rule_test()
1467 struct vcap_rule_internal ri = { in vcap_api_set_rule_counter_test() local
1490 list_add_tail(&ri.list, &is2_admin.rules); in vcap_api_set_rule_counter_test()
1494 ret = vcap_rule_set_counter(&ri.data, &ctr); in vcap_api_set_rule_counter_test()
1520 struct vcap_rule_internal ri = { in vcap_api_get_rule_counter_test() local
1546 list_add_tail(&ri.list, &is2_admin.rules); in vcap_api_get_rule_counter_test()
1549 ret = vcap_rule_get_counter(&ri.data, &ctr); in vcap_api_get_rule_counter_test()
1659 KUNIT_EXPECT_EQ(test, exp_addr[idx], elem->addr); in vcap_api_rule_insert_reverse_order_test()
1756 .last_valid_addr = 800 - 1, in vcap_api_rule_remove_in_middle_test()
1780 KUNIT_EXPECT_EQ(test, -6, test_move_offset); in vcap_api_rule_remove_in_middle_test()
1790 KUNIT_EXPECT_EQ(test, -4, test_move_offset); in vcap_api_rule_remove_in_middle_test()
1800 KUNIT_EXPECT_EQ(test, -20, test_move_offset); in vcap_api_rule_remove_in_middle_test()
1831 .last_valid_addr = 800 - 1, in vcap_api_rule_remove_in_front_test()
1863 KUNIT_EXPECT_EQ(test, -8, test_move_offset); in vcap_api_rule_remove_in_front_test()
2008 struct vcap_rule_internal ri = { in vcap_api_filter_unsupported_keys_test() local
2043 INIT_LIST_HEAD(&ri.data.keyfields); in vcap_api_filter_unsupported_keys_test()
2047 ckf->ctrl.key = keylist[idx]; in vcap_api_filter_unsupported_keys_test()
2048 list_add_tail(&ckf->ctrl.list, &ri.data.keyfields); in vcap_api_filter_unsupported_keys_test()
2055 ret = vcap_filter_rule_keys(&ri.data, NULL, 0, true); in vcap_api_filter_unsupported_keys_test()
2061 list_for_each_entry_safe(ckf, next, &ri.data.keyfields, ctrl.list) { in vcap_api_filter_unsupported_keys_test()
2062 KUNIT_EXPECT_EQ(test, expected[idx], ckf->ctrl.key); in vcap_api_filter_unsupported_keys_test()
2063 list_del(&ckf->ctrl.list); in vcap_api_filter_unsupported_keys_test()
2075 struct vcap_rule_internal ri = { in vcap_api_filter_keylist_test() local
2167 INIT_LIST_HEAD(&ri.data.keyfields); in vcap_api_filter_keylist_test()
2171 ckf->ctrl.key = keylist[idx]; in vcap_api_filter_keylist_test()
2172 list_add_tail(&ckf->ctrl.list, &ri.data.keyfields); in vcap_api_filter_keylist_test()
2179 ret = vcap_filter_rule_keys(&ri.data, droplist, ARRAY_SIZE(droplist), in vcap_api_filter_keylist_test()
2186 list_for_each_entry_safe(ckf, next, &ri.data.keyfields, ctrl.list) { in vcap_api_filter_keylist_test()
2187 KUNIT_EXPECT_EQ(test, expected[idx], ckf->ctrl.key); in vcap_api_filter_keylist_test()
2188 list_del(&ckf->ctrl.list); in vcap_api_filter_keylist_test()