Lines Matching refs:rule

26 static struct flow_action_entry *get_flow_act(struct flow_rule *rule,
61 flow_action_for_each(i, act, &flow->rule->action) { in is_pre_ct_flow()
78 struct flow_rule *rule = flow_cls_offload_flow_rule(flow); in is_post_ct_flow() local
79 struct flow_dissector *dissector = rule->match.dissector; in is_post_ct_flow()
86 flow_action_for_each(i, act, &flow->rule->action) { in is_post_ct_flow()
99 flow_rule_match_ct(rule, &ct); in is_post_ct_flow()
124 static void *get_mangled_key(struct flow_rule *rule, void *buf, in get_mangled_key() argument
133 flow_action_for_each(i, act, &rule->action) { in get_mangled_key()
161 static void *get_mangled_tos_ttl(struct flow_rule *rule, void *buf, in get_mangled_tos_ttl() argument
169 flow_rule_match_ip(rule, &match); in get_mangled_tos_ttl()
185 get_mangled_key(rule, ip_hdr, 0, hdr_len, in get_mangled_tos_ttl()
228 unsigned int ovlp_keys = entry1->rule->match.dissector->used_keys & in nfp_ct_merge_check()
229 entry2->rule->match.dissector->used_keys; in nfp_ct_merge_check()
252 flow_rule_match_control(entry1->rule, &match1); in nfp_ct_merge_check()
253 flow_rule_match_control(entry2->rule, &match2); in nfp_ct_merge_check()
262 flow_rule_match_basic(entry1->rule, &match1); in nfp_ct_merge_check()
263 flow_rule_match_basic(entry2->rule, &match2); in nfp_ct_merge_check()
285 flow_rule_match_ipv4_addrs(entry1->rule, &match1); in nfp_ct_merge_check()
286 flow_rule_match_ipv4_addrs(entry2->rule, &match2); in nfp_ct_merge_check()
289 match1.key = get_mangled_key(entry1->rule, buf, in nfp_ct_merge_check()
307 flow_rule_match_ipv6_addrs(entry1->rule, &match1); in nfp_ct_merge_check()
308 flow_rule_match_ipv6_addrs(entry2->rule, &match2); in nfp_ct_merge_check()
311 match1.key = get_mangled_key(entry1->rule, buf, in nfp_ct_merge_check()
330 flow_rule_match_ports(entry1->rule, &match1); in nfp_ct_merge_check()
331 flow_rule_match_ports(entry2->rule, &match2); in nfp_ct_merge_check()
339 match1.key = get_mangled_key(entry1->rule, buf, 0, in nfp_ct_merge_check()
350 flow_rule_match_eth_addrs(entry1->rule, &match1); in nfp_ct_merge_check()
351 flow_rule_match_eth_addrs(entry2->rule, &match2); in nfp_ct_merge_check()
354 match1.key = get_mangled_key(entry1->rule, buf, 0, in nfp_ct_merge_check()
366 flow_rule_match_vlan(entry1->rule, &match1); in nfp_ct_merge_check()
367 flow_rule_match_vlan(entry2->rule, &match2); in nfp_ct_merge_check()
376 flow_rule_match_mpls(entry1->rule, &match1); in nfp_ct_merge_check()
377 flow_rule_match_mpls(entry2->rule, &match2); in nfp_ct_merge_check()
386 flow_rule_match_tcp(entry1->rule, &match1); in nfp_ct_merge_check()
387 flow_rule_match_tcp(entry2->rule, &match2); in nfp_ct_merge_check()
396 flow_rule_match_ip(entry1->rule, &match1); in nfp_ct_merge_check()
397 flow_rule_match_ip(entry2->rule, &match2); in nfp_ct_merge_check()
399 match1.key = get_mangled_tos_ttl(entry1->rule, buf, is_v6); in nfp_ct_merge_check()
408 flow_rule_match_enc_keyid(entry1->rule, &match1); in nfp_ct_merge_check()
409 flow_rule_match_enc_keyid(entry2->rule, &match2); in nfp_ct_merge_check()
418 flow_rule_match_enc_ipv4_addrs(entry1->rule, &match1); in nfp_ct_merge_check()
419 flow_rule_match_enc_ipv4_addrs(entry2->rule, &match2); in nfp_ct_merge_check()
428 flow_rule_match_enc_ipv6_addrs(entry1->rule, &match1); in nfp_ct_merge_check()
429 flow_rule_match_enc_ipv6_addrs(entry2->rule, &match2); in nfp_ct_merge_check()
438 flow_rule_match_enc_control(entry1->rule, &match1); in nfp_ct_merge_check()
439 flow_rule_match_enc_control(entry2->rule, &match2); in nfp_ct_merge_check()
448 flow_rule_match_enc_ip(entry1->rule, &match1); in nfp_ct_merge_check()
449 flow_rule_match_enc_ip(entry2->rule, &match2); in nfp_ct_merge_check()
458 flow_rule_match_enc_opts(entry1->rule, &match1); in nfp_ct_merge_check()
459 flow_rule_match_enc_opts(entry2->rule, &match2); in nfp_ct_merge_check()
472 struct flow_rule *rule) in nfp_ct_check_vlan_merge() argument
476 if (unlikely(flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CVLAN))) in nfp_ct_check_vlan_merge()
480 if (likely(!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_VLAN))) in nfp_ct_check_vlan_merge()
490 flow_rule_match_vlan(rule, &match); in nfp_ct_check_vlan_merge()
522 flow_action_for_each(i, act, &pre_ct_entry->rule->action) { in nfp_ct_merge_act_check()
527 err = nfp_ct_check_vlan_merge(act, post_ct_entry->rule); in nfp_ct_merge_act_check()
541 flow_action_for_each(i, act, &nft_entry->rule->action) { in nfp_ct_merge_act_check()
560 struct flow_dissector *dissector = post_ct_entry->rule->match.dissector; in nfp_ct_check_meta()
565 ct_met = get_flow_act(nft_entry->rule, FLOW_ACTION_CT_METADATA); in nfp_ct_check_meta()
570 flow_rule_match_ct(post_ct_entry->rule, &ct); in nfp_ct_check_meta()
804 rules[CT_TYPE_PRE_CT] = m_entry->tc_m_parent->pre_ct_parent->rule; in nfp_fl_ct_add_offload()
805 rules[CT_TYPE_NFT] = m_entry->nft_parent->rule; in nfp_fl_ct_add_offload()
806 rules[CT_TYPE_POST_CT] = m_entry->tc_m_parent->post_ct_parent->rule; in nfp_fl_ct_add_offload()
1356 static struct net_device *get_netdev_from_rule(struct flow_rule *rule) in get_netdev_from_rule() argument
1358 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_META)) { in get_netdev_from_rule()
1361 flow_rule_match_meta(rule, &match); in get_netdev_from_rule()
1429 entry->rule = flow_rule_alloc(flow->rule->action.num_entries); in nfp_fl_ct_add_flow()
1430 if (!entry->rule) { in nfp_fl_ct_add_flow()
1444 memcpy(&nft_match->dissector, flow->rule->match.dissector, in nfp_fl_ct_add_flow()
1446 memcpy(&nft_match->mask, flow->rule->match.mask, in nfp_fl_ct_add_flow()
1448 memcpy(&nft_match->key, flow->rule->match.key, in nfp_fl_ct_add_flow()
1450 entry->rule->match.dissector = &nft_match->dissector; in nfp_fl_ct_add_flow()
1451 entry->rule->match.mask = &nft_match->mask; in nfp_fl_ct_add_flow()
1452 entry->rule->match.key = &nft_match->key; in nfp_fl_ct_add_flow()
1455 netdev = get_netdev_from_rule(entry->rule); in nfp_fl_ct_add_flow()
1457 entry->rule->match.dissector = flow->rule->match.dissector; in nfp_fl_ct_add_flow()
1458 entry->rule->match.mask = flow->rule->match.mask; in nfp_fl_ct_add_flow()
1459 entry->rule->match.key = flow->rule->match.key; in nfp_fl_ct_add_flow()
1473 entry->rule->action.num_entries = flow->rule->action.num_entries; in nfp_fl_ct_add_flow()
1474 flow_action_for_each(i, act, &flow->rule->action) { in nfp_fl_ct_add_flow()
1477 new_act = &entry->rule->action.entries[i]; in nfp_fl_ct_add_flow()
1530 kfree(entry->rule->action.entries[entry->tun_offset].tunnel); in nfp_fl_ct_add_flow()
1534 kfree(entry->rule); in nfp_fl_ct_add_flow()
1645 kfree(entry->rule->action.entries[entry->tun_offset].tunnel); in nfp_fl_ct_clean_flow_entry()
1650 nft_match = container_of(entry->rule->match.dissector, in nfp_fl_ct_clean_flow_entry()
1655 kfree(entry->rule); in nfp_fl_ct_clean_flow_entry()
1659 static struct flow_action_entry *get_flow_act(struct flow_rule *rule, in get_flow_act() argument
1665 flow_action_for_each(i, act, &rule->action) { in get_flow_act()
1723 ct_act = get_flow_act(flow->rule, FLOW_ACTION_CT); in nfp_fl_ct_handle_pre_ct()
1730 ct_goto = get_flow_act(flow->rule, FLOW_ACTION_GOTO); in nfp_fl_ct_handle_pre_ct()
1777 struct flow_rule *rule = flow_cls_offload_flow_rule(flow); in nfp_fl_ct_handle_post_ct() local
1783 flow_rule_match_ct(rule, &ct); in nfp_fl_ct_handle_post_ct()