Lines Matching refs:rule
26 static struct flow_action_entry *get_flow_act(struct flow_rule *rule,
58 struct flow_rule *rule = flow_cls_offload_flow_rule(flow); in is_pre_ct_flow() local
59 struct flow_dissector *dissector = rule->match.dissector; in is_pre_ct_flow()
65 flow_rule_match_ct(rule, &ct); in is_pre_ct_flow()
73 flow_action_for_each(i, act, &flow->rule->action) { in is_pre_ct_flow()
90 struct flow_rule *rule = flow_cls_offload_flow_rule(flow); in is_post_ct_flow() local
91 struct flow_dissector *dissector = rule->match.dissector; in is_post_ct_flow()
98 flow_rule_match_ct(rule, &ct); in is_post_ct_flow()
103 flow_action_for_each(i, act, &flow->rule->action) { in is_post_ct_flow()
135 static void *get_mangled_key(struct flow_rule *rule, void *buf, in get_mangled_key() argument
144 flow_action_for_each(i, act, &rule->action) { in get_mangled_key()
172 static void *get_mangled_tos_ttl(struct flow_rule *rule, void *buf, in get_mangled_tos_ttl() argument
180 flow_rule_match_ip(rule, &match); in get_mangled_tos_ttl()
196 get_mangled_key(rule, ip_hdr, 0, hdr_len, in get_mangled_tos_ttl()
242 ovlp_keys = entry1->rule->match.dissector->used_keys & in nfp_ct_merge_check()
243 entry2->rule->match.dissector->used_keys; in nfp_ct_merge_check()
264 flow_rule_match_control(entry1->rule, &match1); in nfp_ct_merge_check()
265 flow_rule_match_control(entry2->rule, &match2); in nfp_ct_merge_check()
274 flow_rule_match_basic(entry1->rule, &match1); in nfp_ct_merge_check()
275 flow_rule_match_basic(entry2->rule, &match2); in nfp_ct_merge_check()
297 flow_rule_match_ipv4_addrs(entry1->rule, &match1); in nfp_ct_merge_check()
298 flow_rule_match_ipv4_addrs(entry2->rule, &match2); in nfp_ct_merge_check()
301 match1.key = get_mangled_key(entry1->rule, buf, in nfp_ct_merge_check()
319 flow_rule_match_ipv6_addrs(entry1->rule, &match1); in nfp_ct_merge_check()
320 flow_rule_match_ipv6_addrs(entry2->rule, &match2); in nfp_ct_merge_check()
323 match1.key = get_mangled_key(entry1->rule, buf, in nfp_ct_merge_check()
342 flow_rule_match_ports(entry1->rule, &match1); in nfp_ct_merge_check()
343 flow_rule_match_ports(entry2->rule, &match2); in nfp_ct_merge_check()
351 match1.key = get_mangled_key(entry1->rule, buf, 0, in nfp_ct_merge_check()
362 flow_rule_match_eth_addrs(entry1->rule, &match1); in nfp_ct_merge_check()
363 flow_rule_match_eth_addrs(entry2->rule, &match2); in nfp_ct_merge_check()
366 match1.key = get_mangled_key(entry1->rule, buf, 0, in nfp_ct_merge_check()
378 flow_rule_match_vlan(entry1->rule, &match1); in nfp_ct_merge_check()
379 flow_rule_match_vlan(entry2->rule, &match2); in nfp_ct_merge_check()
388 flow_rule_match_mpls(entry1->rule, &match1); in nfp_ct_merge_check()
389 flow_rule_match_mpls(entry2->rule, &match2); in nfp_ct_merge_check()
398 flow_rule_match_tcp(entry1->rule, &match1); in nfp_ct_merge_check()
399 flow_rule_match_tcp(entry2->rule, &match2); in nfp_ct_merge_check()
408 flow_rule_match_ip(entry1->rule, &match1); in nfp_ct_merge_check()
409 flow_rule_match_ip(entry2->rule, &match2); in nfp_ct_merge_check()
411 match1.key = get_mangled_tos_ttl(entry1->rule, buf, is_v6); in nfp_ct_merge_check()
420 flow_rule_match_enc_keyid(entry1->rule, &match1); in nfp_ct_merge_check()
421 flow_rule_match_enc_keyid(entry2->rule, &match2); in nfp_ct_merge_check()
430 flow_rule_match_enc_ipv4_addrs(entry1->rule, &match1); in nfp_ct_merge_check()
431 flow_rule_match_enc_ipv4_addrs(entry2->rule, &match2); in nfp_ct_merge_check()
440 flow_rule_match_enc_ipv6_addrs(entry1->rule, &match1); in nfp_ct_merge_check()
441 flow_rule_match_enc_ipv6_addrs(entry2->rule, &match2); in nfp_ct_merge_check()
450 flow_rule_match_enc_control(entry1->rule, &match1); in nfp_ct_merge_check()
451 flow_rule_match_enc_control(entry2->rule, &match2); in nfp_ct_merge_check()
460 flow_rule_match_enc_ip(entry1->rule, &match1); in nfp_ct_merge_check()
461 flow_rule_match_enc_ip(entry2->rule, &match2); in nfp_ct_merge_check()
470 flow_rule_match_enc_opts(entry1->rule, &match1); in nfp_ct_merge_check()
471 flow_rule_match_enc_opts(entry2->rule, &match2); in nfp_ct_merge_check()
484 struct flow_rule *rule) in nfp_ct_check_vlan_merge() argument
488 if (unlikely(flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CVLAN))) in nfp_ct_check_vlan_merge()
492 if (likely(!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_VLAN))) in nfp_ct_check_vlan_merge()
502 flow_rule_match_vlan(rule, &match); in nfp_ct_check_vlan_merge()
549 flow_action_for_each(i, act, &pre_ct_entry->rule->action) { in nfp_ct_merge_act_check()
554 err = nfp_ct_check_vlan_merge(act, post_ct_entry->rule); in nfp_ct_merge_act_check()
568 flow_action_for_each(i, act, &nft_entry->rule->action) { in nfp_ct_merge_act_check()
587 struct flow_dissector *dissector = post_ct_entry->rule->match.dissector; in nfp_ct_check_meta()
592 ct_met = get_flow_act(nft_entry->rule, FLOW_ACTION_CT_METADATA); in nfp_ct_check_meta()
597 flow_rule_match_ct(post_ct_entry->rule, &ct); in nfp_ct_check_meta()
836 rules[j++] = pre_ct_entry->prev_m_entries[i]->tc_m_parent->pre_ct_parent->rule; in nfp_fl_ct_add_offload()
837 rules[j++] = pre_ct_entry->prev_m_entries[i]->nft_parent->rule; in nfp_fl_ct_add_offload()
840 rules[j++] = m_entry->tc_m_parent->pre_ct_parent->rule; in nfp_fl_ct_add_offload()
841 rules[j++] = m_entry->nft_parent->rule; in nfp_fl_ct_add_offload()
842 rules[j++] = m_entry->tc_m_parent->post_ct_parent->rule; in nfp_fl_ct_add_offload()
1401 static struct net_device *get_netdev_from_rule(struct flow_rule *rule) in get_netdev_from_rule() argument
1403 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_META)) { in get_netdev_from_rule()
1406 flow_rule_match_meta(rule, &match); in get_netdev_from_rule()
1494 entry->rule = flow_rule_alloc(flow->rule->action.num_entries); in nfp_fl_ct_add_flow()
1495 if (!entry->rule) { in nfp_fl_ct_add_flow()
1509 memcpy(&nft_match->dissector, flow->rule->match.dissector, in nfp_fl_ct_add_flow()
1511 memcpy(&nft_match->mask, flow->rule->match.mask, in nfp_fl_ct_add_flow()
1513 memcpy(&nft_match->key, flow->rule->match.key, in nfp_fl_ct_add_flow()
1515 entry->rule->match.dissector = &nft_match->dissector; in nfp_fl_ct_add_flow()
1516 entry->rule->match.mask = &nft_match->mask; in nfp_fl_ct_add_flow()
1517 entry->rule->match.key = &nft_match->key; in nfp_fl_ct_add_flow()
1520 netdev = get_netdev_from_rule(entry->rule); in nfp_fl_ct_add_flow()
1522 entry->rule->match.dissector = flow->rule->match.dissector; in nfp_fl_ct_add_flow()
1523 entry->rule->match.mask = flow->rule->match.mask; in nfp_fl_ct_add_flow()
1524 entry->rule->match.key = flow->rule->match.key; in nfp_fl_ct_add_flow()
1538 entry->rule->action.num_entries = flow->rule->action.num_entries; in nfp_fl_ct_add_flow()
1539 flow_action_for_each(i, act, &flow->rule->action) { in nfp_fl_ct_add_flow()
1542 new_act = &entry->rule->action.entries[i]; in nfp_fl_ct_add_flow()
1598 kfree(entry->rule->action.entries[entry->tun_offset].tunnel); in nfp_fl_ct_add_flow()
1602 kfree(entry->rule); in nfp_fl_ct_add_flow()
1721 kfree(entry->rule->action.entries[entry->tun_offset].tunnel); in nfp_fl_ct_clean_flow_entry()
1726 nft_match = container_of(entry->rule->match.dissector, in nfp_fl_ct_clean_flow_entry()
1731 kfree(entry->rule); in nfp_fl_ct_clean_flow_entry()
1735 static struct flow_action_entry *get_flow_act_ct(struct flow_rule *rule) in get_flow_act_ct() argument
1743 flow_action_for_each(i, act, &rule->action) { in get_flow_act_ct()
1751 static struct flow_action_entry *get_flow_act(struct flow_rule *rule, in get_flow_act() argument
1757 flow_action_for_each(i, act, &rule->action) { in get_flow_act()
1816 ct_act = get_flow_act_ct(flow->rule); in nfp_fl_ct_handle_pre_ct()
1823 ct_goto = get_flow_act(flow->rule, FLOW_ACTION_GOTO); in nfp_fl_ct_handle_pre_ct()
1885 struct flow_rule *rule = flow_cls_offload_flow_rule(flow); in nfp_fl_ct_handle_post_ct() local
1894 flow_action_for_each(i, act, &rule->action) { in nfp_fl_ct_handle_post_ct()
1912 flow_rule_match_ct(rule, &ct); in nfp_fl_ct_handle_post_ct()
1935 ct_goto = get_flow_act(flow->rule, FLOW_ACTION_GOTO); in nfp_fl_ct_handle_post_ct()
1977 new_pre_ct_flow.rule = post_ct_entry->rule; in nfp_fl_create_new_pre_ct()
2149 struct flow_rule *flow_rule = flow->rule; in nfp_fl_ct_offload_nft_supported()