Lines Matching refs:rule
23 static struct flow_action_entry *get_flow_act(struct flow_rule *rule,
58 flow_action_for_each(i, act, &flow->rule->action) { in is_pre_ct_flow()
67 struct flow_rule *rule = flow_cls_offload_flow_rule(flow); in is_post_ct_flow() local
68 struct flow_dissector *dissector = rule->match.dissector; in is_post_ct_flow()
72 flow_rule_match_ct(rule, &ct); in is_post_ct_flow()
82 unsigned int ovlp_keys = entry1->rule->match.dissector->used_keys & in nfp_ct_merge_check()
83 entry2->rule->match.dissector->used_keys; in nfp_ct_merge_check()
92 flow_rule_match_control(entry1->rule, &match1); in nfp_ct_merge_check()
93 flow_rule_match_control(entry2->rule, &match2); in nfp_ct_merge_check()
102 flow_rule_match_basic(entry1->rule, &match1); in nfp_ct_merge_check()
103 flow_rule_match_basic(entry2->rule, &match2); in nfp_ct_merge_check()
112 flow_rule_match_ipv4_addrs(entry1->rule, &match1); in nfp_ct_merge_check()
113 flow_rule_match_ipv4_addrs(entry2->rule, &match2); in nfp_ct_merge_check()
122 flow_rule_match_ipv6_addrs(entry1->rule, &match1); in nfp_ct_merge_check()
123 flow_rule_match_ipv6_addrs(entry2->rule, &match2); in nfp_ct_merge_check()
132 flow_rule_match_ports(entry1->rule, &match1); in nfp_ct_merge_check()
133 flow_rule_match_ports(entry2->rule, &match2); in nfp_ct_merge_check()
142 flow_rule_match_eth_addrs(entry1->rule, &match1); in nfp_ct_merge_check()
143 flow_rule_match_eth_addrs(entry2->rule, &match2); in nfp_ct_merge_check()
152 flow_rule_match_vlan(entry1->rule, &match1); in nfp_ct_merge_check()
153 flow_rule_match_vlan(entry2->rule, &match2); in nfp_ct_merge_check()
162 flow_rule_match_mpls(entry1->rule, &match1); in nfp_ct_merge_check()
163 flow_rule_match_mpls(entry2->rule, &match2); in nfp_ct_merge_check()
172 flow_rule_match_tcp(entry1->rule, &match1); in nfp_ct_merge_check()
173 flow_rule_match_tcp(entry2->rule, &match2); in nfp_ct_merge_check()
182 flow_rule_match_ip(entry1->rule, &match1); in nfp_ct_merge_check()
183 flow_rule_match_ip(entry2->rule, &match2); in nfp_ct_merge_check()
192 flow_rule_match_enc_keyid(entry1->rule, &match1); in nfp_ct_merge_check()
193 flow_rule_match_enc_keyid(entry2->rule, &match2); in nfp_ct_merge_check()
202 flow_rule_match_enc_ipv4_addrs(entry1->rule, &match1); in nfp_ct_merge_check()
203 flow_rule_match_enc_ipv4_addrs(entry2->rule, &match2); in nfp_ct_merge_check()
212 flow_rule_match_enc_ipv6_addrs(entry1->rule, &match1); in nfp_ct_merge_check()
213 flow_rule_match_enc_ipv6_addrs(entry2->rule, &match2); in nfp_ct_merge_check()
222 flow_rule_match_enc_control(entry1->rule, &match1); in nfp_ct_merge_check()
223 flow_rule_match_enc_control(entry2->rule, &match2); in nfp_ct_merge_check()
232 flow_rule_match_enc_ip(entry1->rule, &match1); in nfp_ct_merge_check()
233 flow_rule_match_enc_ip(entry2->rule, &match2); in nfp_ct_merge_check()
242 flow_rule_match_enc_opts(entry1->rule, &match1); in nfp_ct_merge_check()
243 flow_rule_match_enc_opts(entry2->rule, &match2); in nfp_ct_merge_check()
256 struct flow_rule *rule) in nfp_ct_check_mangle_merge() argument
263 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) in nfp_ct_check_mangle_merge()
267 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_IP)) { in nfp_ct_check_mangle_merge()
270 flow_rule_match_ip(rule, &match); in nfp_ct_check_mangle_merge()
278 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_IPV4_ADDRS)) { in nfp_ct_check_mangle_merge()
281 flow_rule_match_ipv4_addrs(rule, &match); in nfp_ct_check_mangle_merge()
291 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_IP)) { in nfp_ct_check_mangle_merge()
294 flow_rule_match_ip(rule, &match); in nfp_ct_check_mangle_merge()
303 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_IPV6_ADDRS)) { in nfp_ct_check_mangle_merge()
306 flow_rule_match_ipv6_addrs(rule, &match); in nfp_ct_check_mangle_merge()
320 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_PORTS)) in nfp_ct_check_mangle_merge()
337 flow_action_for_each(i, act, &pre_ct_entry->rule->action) { in nfp_ct_merge_act_check()
340 err = nfp_ct_check_mangle_merge(act, nft_entry->rule); in nfp_ct_merge_act_check()
343 err = nfp_ct_check_mangle_merge(act, post_ct_entry->rule); in nfp_ct_merge_act_check()
360 flow_action_for_each(i, act, &nft_entry->rule->action) { in nfp_ct_merge_act_check()
363 err = nfp_ct_check_mangle_merge(act, post_ct_entry->rule); in nfp_ct_merge_act_check()
384 struct flow_dissector *dissector = post_ct_entry->rule->match.dissector; in nfp_ct_check_meta()
389 ct_met = get_flow_act(nft_entry->rule, FLOW_ACTION_CT_METADATA); in nfp_ct_check_meta()
394 flow_rule_match_ct(post_ct_entry->rule, &ct); in nfp_ct_check_meta()
563 rules[CT_TYPE_PRE_CT] = m_entry->tc_m_parent->pre_ct_parent->rule; in nfp_fl_ct_add_offload()
564 rules[CT_TYPE_NFT] = m_entry->nft_parent->rule; in nfp_fl_ct_add_offload()
565 rules[CT_TYPE_POST_CT] = m_entry->tc_m_parent->post_ct_parent->rule; in nfp_fl_ct_add_offload()
1133 entry->rule = flow_rule_alloc(flow->rule->action.num_entries); in nfp_fl_ct_add_flow()
1134 if (!entry->rule) { in nfp_fl_ct_add_flow()
1148 memcpy(&nft_match->dissector, flow->rule->match.dissector, in nfp_fl_ct_add_flow()
1150 memcpy(&nft_match->mask, flow->rule->match.mask, in nfp_fl_ct_add_flow()
1152 memcpy(&nft_match->key, flow->rule->match.key, in nfp_fl_ct_add_flow()
1154 entry->rule->match.dissector = &nft_match->dissector; in nfp_fl_ct_add_flow()
1155 entry->rule->match.mask = &nft_match->mask; in nfp_fl_ct_add_flow()
1156 entry->rule->match.key = &nft_match->key; in nfp_fl_ct_add_flow()
1158 entry->rule->match.dissector = flow->rule->match.dissector; in nfp_fl_ct_add_flow()
1159 entry->rule->match.mask = flow->rule->match.mask; in nfp_fl_ct_add_flow()
1160 entry->rule->match.key = flow->rule->match.key; in nfp_fl_ct_add_flow()
1174 entry->rule->action.num_entries = flow->rule->action.num_entries; in nfp_fl_ct_add_flow()
1175 flow_action_for_each(i, act, &flow->rule->action) { in nfp_fl_ct_add_flow()
1178 new_act = &entry->rule->action.entries[i]; in nfp_fl_ct_add_flow()
1224 kfree(entry->rule->action.entries[entry->tun_offset].tunnel); in nfp_fl_ct_add_flow()
1228 kfree(entry->rule); in nfp_fl_ct_add_flow()
1339 kfree(entry->rule->action.entries[entry->tun_offset].tunnel); in nfp_fl_ct_clean_flow_entry()
1344 nft_match = container_of(entry->rule->match.dissector, in nfp_fl_ct_clean_flow_entry()
1349 kfree(entry->rule); in nfp_fl_ct_clean_flow_entry()
1353 static struct flow_action_entry *get_flow_act(struct flow_rule *rule, in get_flow_act() argument
1359 flow_action_for_each(i, act, &rule->action) { in get_flow_act()
1417 ct_act = get_flow_act(flow->rule, FLOW_ACTION_CT); in nfp_fl_ct_handle_pre_ct()
1424 ct_goto = get_flow_act(flow->rule, FLOW_ACTION_GOTO); in nfp_fl_ct_handle_pre_ct()
1471 struct flow_rule *rule = flow_cls_offload_flow_rule(flow); in nfp_fl_ct_handle_post_ct() local
1477 flow_rule_match_ct(rule, &ct); in nfp_fl_ct_handle_post_ct()