• Home
  • Raw
  • Download

Lines Matching full:mask

96 	struct fl_flow_key mask;  member
111 struct fl_flow_mask *mask; member
139 static unsigned short int fl_mask_range(const struct fl_flow_mask *mask) in fl_mask_range() argument
141 return mask->range.end - mask->range.start; in fl_mask_range()
144 static void fl_mask_update_range(struct fl_flow_mask *mask) in fl_mask_update_range() argument
146 const u8 *bytes = (const u8 *) &mask->key; in fl_mask_update_range()
147 size_t size = sizeof(mask->key); in fl_mask_update_range()
163 mask->range.start = rounddown(first, sizeof(long)); in fl_mask_update_range()
164 mask->range.end = roundup(last + 1, sizeof(long)); in fl_mask_update_range()
168 const struct fl_flow_mask *mask) in fl_key_get_start() argument
170 return (u8 *) key + mask->range.start; in fl_key_get_start()
174 struct fl_flow_mask *mask) in fl_set_masked_key() argument
176 const long *lkey = fl_key_get_start(key, mask); in fl_set_masked_key()
177 const long *lmask = fl_key_get_start(&mask->key, mask); in fl_set_masked_key()
178 long *lmkey = fl_key_get_start(mkey, mask); in fl_set_masked_key()
181 for (i = 0; i < fl_mask_range(mask); i += sizeof(long)) in fl_set_masked_key()
186 struct fl_flow_mask *mask) in fl_mask_fits_tmplt() argument
188 const long *lmask = fl_key_get_start(&mask->key, mask); in fl_mask_fits_tmplt()
194 ltmplt = fl_key_get_start(&tmplt->mask, mask); in fl_mask_fits_tmplt()
195 for (i = 0; i < fl_mask_range(mask); i += sizeof(long)) { in fl_mask_fits_tmplt()
203 struct fl_flow_mask *mask) in fl_clear_masked_range() argument
205 memset(fl_key_get_start(key, mask), 0, fl_mask_range(mask)); in fl_clear_masked_range()
214 min_mask = ntohs(filter->mask->key.tp_range.tp_min.dst); in fl_range_port_dst_cmp()
215 max_mask = ntohs(filter->mask->key.tp_range.tp_max.dst); in fl_range_port_dst_cmp()
237 min_mask = ntohs(filter->mask->key.tp_range.tp_min.src); in fl_range_port_src_cmp()
238 max_mask = ntohs(filter->mask->key.tp_range.tp_max.src); in fl_range_port_src_cmp()
254 static struct cls_fl_filter *__fl_lookup(struct fl_flow_mask *mask, in __fl_lookup() argument
257 return rhashtable_lookup_fast(&mask->ht, fl_key_get_start(mkey, mask), in __fl_lookup()
258 mask->filter_ht_params); in __fl_lookup()
261 static struct cls_fl_filter *fl_lookup_range(struct fl_flow_mask *mask, in fl_lookup_range() argument
267 list_for_each_entry_rcu(filter, &mask->filters, list) { in fl_lookup_range()
274 f = __fl_lookup(mask, mkey); in fl_lookup_range()
282 struct cls_fl_filter *fl_mask_lookup(struct fl_flow_mask *mask, struct fl_flow_key *key) in fl_mask_lookup() argument
286 fl_set_masked_key(&mkey, key, mask); in fl_mask_lookup()
287 if ((mask->flags & TCA_FLOWER_MASK_FLAGS_RANGE)) in fl_mask_lookup()
288 return fl_lookup_range(mask, &mkey, key); in fl_mask_lookup()
290 return __fl_lookup(mask, &mkey); in fl_mask_lookup()
311 struct fl_flow_mask *mask; in fl_classify() local
314 list_for_each_entry_rcu(mask, &head->masks, list) { in fl_classify()
316 fl_clear_masked_range(&skb_key, mask); in fl_classify()
318 skb_flow_dissect_meta(skb, &mask->dissector, &skb_key); in fl_classify()
323 skb_flow_dissect_tunnel_info(skb, &mask->dissector, &skb_key); in fl_classify()
324 skb_flow_dissect_ct(skb, &mask->dissector, &skb_key, in fl_classify()
327 skb_flow_dissect_hash(skb, &mask->dissector, &skb_key); in fl_classify()
328 skb_flow_dissect(skb, &mask->dissector, &skb_key, 0); in fl_classify()
330 f = fl_mask_lookup(mask, &skb_key); in fl_classify()
356 static void fl_mask_free(struct fl_flow_mask *mask, bool mask_init_done) in fl_mask_free() argument
360 WARN_ON(!list_empty(&mask->filters)); in fl_mask_free()
361 rhashtable_destroy(&mask->ht); in fl_mask_free()
363 kfree(mask); in fl_mask_free()
368 struct fl_flow_mask *mask = container_of(to_rcu_work(work), in fl_mask_free_work() local
371 fl_mask_free(mask, true); in fl_mask_free_work()
376 struct fl_flow_mask *mask = container_of(to_rcu_work(work), in fl_uninit_mask_free_work() local
379 fl_mask_free(mask, false); in fl_uninit_mask_free_work()
382 static bool fl_mask_put(struct cls_fl_head *head, struct fl_flow_mask *mask) in fl_mask_put() argument
384 if (!refcount_dec_and_test(&mask->refcnt)) in fl_mask_put()
387 rhashtable_remove_fast(&head->ht, &mask->ht_node, mask_ht_params); in fl_mask_put()
390 list_del_rcu(&mask->list); in fl_mask_put()
393 tcf_queue_work(&mask->rwork, fl_mask_free_work); in fl_mask_put()
454 cls_flower.rule->match.dissector = &f->mask->dissector; in fl_hw_replace_filter()
455 cls_flower.rule->match.mask = &f->mask->key; in fl_hw_replace_filter()
546 rhashtable_remove_fast(&f->mask->ht, &f->ht_node, in __fl_delete()
547 f->mask->filter_ht_params); in __fl_delete()
552 *last = fl_mask_put(head, f->mask); in __fl_delete()
576 struct fl_flow_mask *mask, *next_mask; in fl_destroy() local
580 list_for_each_entry_safe(mask, next_mask, &head->masks, list) { in fl_destroy()
581 list_for_each_entry_safe(f, next, &mask->filters, list) { in fl_destroy()
753 void *mask, int mask_type, int len) in fl_set_key_val() argument
759 memset(mask, 0xff, len); in fl_set_key_val()
761 nla_memcpy(mask, tb[mask_type], len); in fl_set_key_val()
765 struct fl_flow_key *mask, in fl_set_key_port_range() argument
769 TCA_FLOWER_KEY_PORT_DST_MIN, &mask->tp_range.tp_min.dst, in fl_set_key_port_range()
772 TCA_FLOWER_KEY_PORT_DST_MAX, &mask->tp_range.tp_max.dst, in fl_set_key_port_range()
775 TCA_FLOWER_KEY_PORT_SRC_MIN, &mask->tp_range.tp_min.src, in fl_set_key_port_range()
778 TCA_FLOWER_KEY_PORT_SRC_MAX, &mask->tp_range.tp_max.src, in fl_set_key_port_range()
781 if (mask->tp_range.tp_min.dst && mask->tp_range.tp_max.dst && in fl_set_key_port_range()
789 if (mask->tp_range.tp_min.src && mask->tp_range.tp_max.src && in fl_set_key_port_range()
1041 u32 key, mask; in fl_set_key_flags() local
1043 /* mask is mandatory for flags */ in fl_set_key_flags()
1045 NL_SET_ERR_MSG(extack, "Missing flags mask"); in fl_set_key_flags()
1050 mask = be32_to_cpu(nla_get_u32(tb[TCA_FLOWER_KEY_FLAGS_MASK])); in fl_set_key_flags()
1055 fl_set_key_flag(key, mask, flags_key, flags_mask, in fl_set_key_flags()
1057 fl_set_key_flag(key, mask, flags_key, flags_mask, in fl_set_key_flags()
1066 struct flow_dissector_key_ip *mask) in fl_set_key_ip() argument
1073 fl_set_key_val(tb, &key->tos, tos_key, &mask->tos, tos_mask, sizeof(key->tos)); in fl_set_key_ip()
1074 fl_set_key_val(tb, &key->ttl, ttl_key, &mask->ttl, ttl_mask, sizeof(key->ttl)); in fl_set_key_ip()
1099 /* If no mask has been prodived we assume an exact match. */ in fl_set_geneve_opt()
1104 NL_SET_ERR_MSG(extack, "Non-geneve option type for mask"); in fl_set_geneve_opt()
1126 * for the mask. in fl_set_geneve_opt()
1180 NL_SET_ERR_MSG(extack, "Non-vxlan option type for mask"); in fl_set_vxlan_opt()
1218 NL_SET_ERR_MSG(extack, "Non-erspan option type for mask"); in fl_set_erspan_opt()
1268 struct fl_flow_key *mask, in fl_set_enc_opt() argument
1315 /* At the same time we need to parse through the mask in fl_set_enc_opt()
1316 * in order to verify exact and mask attribute lengths. in fl_set_enc_opt()
1318 mask->enc_opts.dst_opt_type = TUNNEL_GENEVE_OPT; in fl_set_enc_opt()
1319 option_len = fl_set_geneve_opt(nla_opt_msk, mask, in fl_set_enc_opt()
1325 mask->enc_opts.len += option_len; in fl_set_enc_opt()
1326 if (key->enc_opts.len != mask->enc_opts.len) { in fl_set_enc_opt()
1327 NL_SET_ERR_MSG(extack, "Key and mask miss aligned"); in fl_set_enc_opt()
1345 /* At the same time we need to parse through the mask in fl_set_enc_opt()
1346 * in order to verify exact and mask attribute lengths. in fl_set_enc_opt()
1348 mask->enc_opts.dst_opt_type = TUNNEL_VXLAN_OPT; in fl_set_enc_opt()
1349 option_len = fl_set_vxlan_opt(nla_opt_msk, mask, in fl_set_enc_opt()
1355 mask->enc_opts.len += option_len; in fl_set_enc_opt()
1356 if (key->enc_opts.len != mask->enc_opts.len) { in fl_set_enc_opt()
1357 NL_SET_ERR_MSG(extack, "Key and mask miss aligned"); in fl_set_enc_opt()
1375 /* At the same time we need to parse through the mask in fl_set_enc_opt()
1376 * in order to verify exact and mask attribute lengths. in fl_set_enc_opt()
1378 mask->enc_opts.dst_opt_type = TUNNEL_ERSPAN_OPT; in fl_set_enc_opt()
1379 option_len = fl_set_erspan_opt(nla_opt_msk, mask, in fl_set_enc_opt()
1385 mask->enc_opts.len += option_len; in fl_set_enc_opt()
1386 if (key->enc_opts.len != mask->enc_opts.len) { in fl_set_enc_opt()
1387 NL_SET_ERR_MSG(extack, "Key and mask miss aligned"); in fl_set_enc_opt()
1400 NL_SET_ERR_MSG(extack, "A mask attribute is invalid"); in fl_set_enc_opt()
1430 struct flow_dissector_key_ct *mask, in fl_set_key_ct() argument
1441 &mask->ct_state, TCA_FLOWER_KEY_CT_STATE_MASK, in fl_set_key_ct()
1444 err = fl_validate_ct_state(key->ct_state & mask->ct_state, in fl_set_key_ct()
1457 &mask->ct_zone, TCA_FLOWER_KEY_CT_ZONE_MASK, in fl_set_key_ct()
1466 &mask->ct_mark, TCA_FLOWER_KEY_CT_MARK_MASK, in fl_set_key_ct()
1475 mask->ct_labels, TCA_FLOWER_KEY_CT_LABELS_MASK, in fl_set_key_ct()
1483 struct fl_flow_key *key, struct fl_flow_key *mask, in fl_set_key() argument
1494 mask->meta.ingress_ifindex = 0xffffffff; in fl_set_key()
1498 mask->eth.dst, TCA_FLOWER_KEY_ETH_DST_MASK, in fl_set_key()
1501 mask->eth.src, TCA_FLOWER_KEY_ETH_SRC_MASK, in fl_set_key()
1511 &key->vlan, &mask->vlan); in fl_set_key()
1520 &key->cvlan, &mask->cvlan); in fl_set_key()
1523 &mask->basic.n_proto, in fl_set_key()
1528 mask->basic.n_proto = cpu_to_be16(~0); in fl_set_key()
1533 mask->basic.n_proto = cpu_to_be16(~0); in fl_set_key()
1540 &mask->basic.ip_proto, TCA_FLOWER_UNSPEC, in fl_set_key()
1542 fl_set_key_ip(tb, false, &key->ip, &mask->ip); in fl_set_key()
1547 mask->control.addr_type = ~0; in fl_set_key()
1549 &mask->ipv4.src, TCA_FLOWER_KEY_IPV4_SRC_MASK, in fl_set_key()
1552 &mask->ipv4.dst, TCA_FLOWER_KEY_IPV4_DST_MASK, in fl_set_key()
1556 mask->control.addr_type = ~0; in fl_set_key()
1558 &mask->ipv6.src, TCA_FLOWER_KEY_IPV6_SRC_MASK, in fl_set_key()
1561 &mask->ipv6.dst, TCA_FLOWER_KEY_IPV6_DST_MASK, in fl_set_key()
1567 &mask->tp.src, TCA_FLOWER_KEY_TCP_SRC_MASK, in fl_set_key()
1570 &mask->tp.dst, TCA_FLOWER_KEY_TCP_DST_MASK, in fl_set_key()
1573 &mask->tcp.flags, TCA_FLOWER_KEY_TCP_FLAGS_MASK, in fl_set_key()
1577 &mask->tp.src, TCA_FLOWER_KEY_UDP_SRC_MASK, in fl_set_key()
1580 &mask->tp.dst, TCA_FLOWER_KEY_UDP_DST_MASK, in fl_set_key()
1584 &mask->tp.src, TCA_FLOWER_KEY_SCTP_SRC_MASK, in fl_set_key()
1587 &mask->tp.dst, TCA_FLOWER_KEY_SCTP_DST_MASK, in fl_set_key()
1592 &mask->icmp.type, in fl_set_key()
1596 &mask->icmp.code, in fl_set_key()
1602 &mask->icmp.type, in fl_set_key()
1606 &mask->icmp.code, in fl_set_key()
1611 ret = fl_set_key_mpls(tb, &key->mpls, &mask->mpls, extack); in fl_set_key()
1617 &mask->arp.sip, TCA_FLOWER_KEY_ARP_SIP_MASK, in fl_set_key()
1620 &mask->arp.tip, TCA_FLOWER_KEY_ARP_TIP_MASK, in fl_set_key()
1623 &mask->arp.op, TCA_FLOWER_KEY_ARP_OP_MASK, in fl_set_key()
1626 mask->arp.sha, TCA_FLOWER_KEY_ARP_SHA_MASK, in fl_set_key()
1629 mask->arp.tha, TCA_FLOWER_KEY_ARP_THA_MASK, in fl_set_key()
1636 ret = fl_set_key_port_range(tb, key, mask, extack); in fl_set_key()
1644 mask->enc_control.addr_type = ~0; in fl_set_key()
1647 &mask->enc_ipv4.src, in fl_set_key()
1652 &mask->enc_ipv4.dst, in fl_set_key()
1660 mask->enc_control.addr_type = ~0; in fl_set_key()
1663 &mask->enc_ipv6.src, in fl_set_key()
1668 &mask->enc_ipv6.dst, in fl_set_key()
1674 &mask->enc_key_id.keyid, TCA_FLOWER_UNSPEC, in fl_set_key()
1678 &mask->enc_tp.src, TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK, in fl_set_key()
1682 &mask->enc_tp.dst, TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK, in fl_set_key()
1685 fl_set_key_ip(tb, true, &key->enc_ip, &mask->enc_ip); in fl_set_key()
1688 &mask->hash.hash, TCA_FLOWER_KEY_HASH_MASK, in fl_set_key()
1692 ret = fl_set_enc_opt(tb, key, mask, extack); in fl_set_key()
1697 ret = fl_set_key_ct(tb, &key->ct, &mask->ct, extack); in fl_set_key()
1703 &mask->control.flags, extack); in fl_set_key()
1724 static int fl_init_mask_hashtable(struct fl_flow_mask *mask) in fl_init_mask_hashtable() argument
1726 mask->filter_ht_params = fl_ht_params; in fl_init_mask_hashtable()
1727 mask->filter_ht_params.key_len = fl_mask_range(mask); in fl_init_mask_hashtable()
1728 mask->filter_ht_params.key_offset += mask->range.start; in fl_init_mask_hashtable()
1730 return rhashtable_init(&mask->ht, &mask->filter_ht_params); in fl_init_mask_hashtable()
1736 #define FL_KEY_IS_MASKED(mask, member) \ argument
1737 memchr_inv(((char *)mask) + FL_KEY_MEMBER_OFFSET(member), \
1747 #define FL_KEY_SET_IF_MASKED(mask, keys, cnt, id, member) \ argument
1749 if (FL_KEY_IS_MASKED(mask, member)) \
1754 struct fl_flow_key *mask) in fl_init_dissector() argument
1759 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1763 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1765 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1767 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1769 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1771 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1773 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1775 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1777 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1779 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1781 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1783 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1785 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1787 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1789 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1791 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1793 if (FL_KEY_IS_MASKED(mask, enc_ipv4) || in fl_init_dissector()
1794 FL_KEY_IS_MASKED(mask, enc_ipv6)) in fl_init_dissector()
1797 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1799 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1801 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1803 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1805 FL_KEY_SET_IF_MASKED(mask, keys, cnt, in fl_init_dissector()
1812 struct fl_flow_mask *mask) in fl_create_new_mask() argument
1821 fl_mask_copy(newmask, mask); in fl_create_new_mask()
1838 err = rhashtable_replace_fast(&head->ht, &mask->ht_node, in fl_create_new_mask()
1860 struct fl_flow_mask *mask) in fl_check_assign_mask() argument
1867 /* Insert mask as temporary node to prevent concurrent creation of mask in fl_check_assign_mask()
1869 * -EAGAIN because mask's refcnt is zero. in fl_check_assign_mask()
1871 fnew->mask = rhashtable_lookup_get_insert_fast(&head->ht, in fl_check_assign_mask()
1872 &mask->ht_node, in fl_check_assign_mask()
1874 if (!fnew->mask) { in fl_check_assign_mask()
1882 newmask = fl_create_new_mask(head, mask); in fl_check_assign_mask()
1888 fnew->mask = newmask; in fl_check_assign_mask()
1890 } else if (IS_ERR(fnew->mask)) { in fl_check_assign_mask()
1891 ret = PTR_ERR(fnew->mask); in fl_check_assign_mask()
1892 } else if (fold && fold->mask != fnew->mask) { in fl_check_assign_mask()
1894 } else if (!refcount_inc_not_zero(&fnew->mask->refcnt)) { in fl_check_assign_mask()
1895 /* Mask was deleted concurrently, try again */ in fl_check_assign_mask()
1902 rhashtable_remove_fast(&head->ht, &mask->ht_node, in fl_check_assign_mask()
1908 struct cls_fl_filter *f, struct fl_flow_mask *mask, in fl_set_parms() argument
1930 err = fl_set_key(net, tb, &f->key, &mask->key, extack); in fl_set_parms()
1934 fl_mask_update_range(mask); in fl_set_parms()
1935 fl_set_masked_key(&f->mkey, &f->key, mask); in fl_set_parms()
1937 if (!fl_mask_fits_tmplt(tmplt, mask)) { in fl_set_parms()
1938 NL_SET_ERR_MSG_MOD(extack, "Mask does not fit the template"); in fl_set_parms()
1949 struct fl_flow_mask *mask = fnew->mask; in fl_ht_insert_unique() local
1952 err = rhashtable_lookup_insert_fast(&mask->ht, in fl_ht_insert_unique()
1954 mask->filter_ht_params); in fl_ht_insert_unique()
1976 struct fl_flow_mask *mask; in fl_change() local
1986 mask = kzalloc(sizeof(struct fl_flow_mask), GFP_KERNEL); in fl_change()
1987 if (!mask) { in fl_change()
2029 err = fl_set_parms(net, tp, fnew, mask, base, tb, tca[TCA_RATE], ovr, in fl_change()
2034 err = fl_check_assign_mask(head, fnew, fold, mask); in fl_change()
2072 fnew->mask->filter_ht_params; in fl_change()
2074 err = rhashtable_insert_fast(&fnew->mask->ht, in fl_change()
2083 rhashtable_remove_fast(&fold->mask->ht, in fl_change()
2085 fold->mask->filter_ht_params); in fl_change()
2092 fl_mask_put(head, fold->mask); in fl_change()
2125 list_add_tail_rcu(&fnew->list, &fnew->mask->filters); in fl_change()
2132 tcf_queue_work(&mask->rwork, fl_uninit_mask_free_work); in fl_change()
2143 rhashtable_remove_fast(&fnew->mask->ht, &fnew->ht_node, in fl_change()
2144 fnew->mask->filter_ht_params); in fl_change()
2146 fl_mask_put(head, fnew->mask); in fl_change()
2152 tcf_queue_work(&mask->rwork, fl_uninit_mask_free_work); in fl_change()
2256 cls_flower.rule->match.dissector = &f->mask->dissector; in fl_reoffload()
2257 cls_flower.rule->match.mask = &f->mask->key; in fl_reoffload()
2329 cls_flower.rule->match.mask = &tmplt->mask; in fl_hw_create_tmplt()
2379 err = fl_set_key(net, tb, &tmplt->dummy_key, &tmplt->mask, extack); in fl_tmplt_create()
2383 fl_init_dissector(&tmplt->dissector, &tmplt->mask); in fl_tmplt_create()
2409 void *mask, int mask_type, int len) in fl_dump_key_val() argument
2413 if (!memchr_inv(mask, 0, len)) in fl_dump_key_val()
2419 err = nla_put(skb, mask_type, len, mask); in fl_dump_key_val()
2427 struct fl_flow_key *mask) in fl_dump_key_port_range() argument
2431 &mask->tp_range.tp_min.dst, TCA_FLOWER_UNSPEC, in fl_dump_key_port_range()
2435 &mask->tp_range.tp_max.dst, TCA_FLOWER_UNSPEC, in fl_dump_key_port_range()
2439 &mask->tp_range.tp_min.src, TCA_FLOWER_UNSPEC, in fl_dump_key_port_range()
2443 &mask->tp_range.tp_max.src, TCA_FLOWER_UNSPEC, in fl_dump_key_port_range()
2584 struct flow_dissector_key_ip *mask) in fl_dump_key_ip() argument
2591 if (fl_dump_key_val(skb, &key->tos, tos_key, &mask->tos, tos_mask, sizeof(key->tos)) || in fl_dump_key_ip()
2592 fl_dump_key_val(skb, &key->ttl, ttl_key, &mask->ttl, ttl_mask, sizeof(key->ttl))) in fl_dump_key_ip()
2635 u32 key, mask; in fl_dump_key_flags() local
2643 mask = 0; in fl_dump_key_flags()
2645 fl_get_key_flag(flags_key, flags_mask, &key, &mask, in fl_dump_key_flags()
2647 fl_get_key_flag(flags_key, flags_mask, &key, &mask, in fl_dump_key_flags()
2652 _mask = cpu_to_be32(mask); in fl_dump_key_flags()
2752 struct flow_dissector_key_ct *mask) in fl_dump_key_ct() argument
2756 &mask->ct_state, TCA_FLOWER_KEY_CT_STATE_MASK, in fl_dump_key_ct()
2762 &mask->ct_zone, TCA_FLOWER_KEY_CT_ZONE_MASK, in fl_dump_key_ct()
2768 &mask->ct_mark, TCA_FLOWER_KEY_CT_MARK_MASK, in fl_dump_key_ct()
2774 &mask->ct_labels, TCA_FLOWER_KEY_CT_LABELS_MASK, in fl_dump_key_ct()
2838 struct fl_flow_key *key, struct fl_flow_key *mask) in fl_dump_key() argument
2840 if (mask->meta.ingress_ifindex) { in fl_dump_key()
2849 mask->eth.dst, TCA_FLOWER_KEY_ETH_DST_MASK, in fl_dump_key()
2852 mask->eth.src, TCA_FLOWER_KEY_ETH_SRC_MASK, in fl_dump_key()
2855 &mask->basic.n_proto, TCA_FLOWER_UNSPEC, in fl_dump_key()
2859 if (fl_dump_key_mpls(skb, &key->mpls, &mask->mpls)) in fl_dump_key()
2863 TCA_FLOWER_KEY_VLAN_PRIO, &key->vlan, &mask->vlan)) in fl_dump_key()
2868 &key->cvlan, &mask->cvlan) || in fl_dump_key()
2869 (mask->cvlan.vlan_tpid && in fl_dump_key()
2874 if (mask->basic.n_proto) { in fl_dump_key()
2875 if (mask->cvlan.vlan_eth_type) { in fl_dump_key()
2879 } else if (mask->vlan.vlan_eth_type) { in fl_dump_key()
2889 &mask->basic.ip_proto, TCA_FLOWER_UNSPEC, in fl_dump_key()
2891 fl_dump_key_ip(skb, false, &key->ip, &mask->ip))) in fl_dump_key()
2896 &mask->ipv4.src, TCA_FLOWER_KEY_IPV4_SRC_MASK, in fl_dump_key()
2899 &mask->ipv4.dst, TCA_FLOWER_KEY_IPV4_DST_MASK, in fl_dump_key()
2904 &mask->ipv6.src, TCA_FLOWER_KEY_IPV6_SRC_MASK, in fl_dump_key()
2907 &mask->ipv6.dst, TCA_FLOWER_KEY_IPV6_DST_MASK, in fl_dump_key()
2913 &mask->tp.src, TCA_FLOWER_KEY_TCP_SRC_MASK, in fl_dump_key()
2916 &mask->tp.dst, TCA_FLOWER_KEY_TCP_DST_MASK, in fl_dump_key()
2919 &mask->tcp.flags, TCA_FLOWER_KEY_TCP_FLAGS_MASK, in fl_dump_key()
2924 &mask->tp.src, TCA_FLOWER_KEY_UDP_SRC_MASK, in fl_dump_key()
2927 &mask->tp.dst, TCA_FLOWER_KEY_UDP_DST_MASK, in fl_dump_key()
2932 &mask->tp.src, TCA_FLOWER_KEY_SCTP_SRC_MASK, in fl_dump_key()
2935 &mask->tp.dst, TCA_FLOWER_KEY_SCTP_DST_MASK, in fl_dump_key()
2941 TCA_FLOWER_KEY_ICMPV4_TYPE, &mask->icmp.type, in fl_dump_key()
2945 TCA_FLOWER_KEY_ICMPV4_CODE, &mask->icmp.code, in fl_dump_key()
2952 TCA_FLOWER_KEY_ICMPV6_TYPE, &mask->icmp.type, in fl_dump_key()
2956 TCA_FLOWER_KEY_ICMPV6_CODE, &mask->icmp.code, in fl_dump_key()
2963 TCA_FLOWER_KEY_ARP_SIP, &mask->arp.sip, in fl_dump_key()
2967 TCA_FLOWER_KEY_ARP_TIP, &mask->arp.tip, in fl_dump_key()
2971 TCA_FLOWER_KEY_ARP_OP, &mask->arp.op, in fl_dump_key()
2975 mask->arp.sha, TCA_FLOWER_KEY_ARP_SHA_MASK, in fl_dump_key()
2978 mask->arp.tha, TCA_FLOWER_KEY_ARP_THA_MASK, in fl_dump_key()
2985 fl_dump_key_port_range(skb, key, mask)) in fl_dump_key()
2990 TCA_FLOWER_KEY_ENC_IPV4_SRC, &mask->enc_ipv4.src, in fl_dump_key()
2994 TCA_FLOWER_KEY_ENC_IPV4_DST, &mask->enc_ipv4.dst, in fl_dump_key()
3000 TCA_FLOWER_KEY_ENC_IPV6_SRC, &mask->enc_ipv6.src, in fl_dump_key()
3005 &mask->enc_ipv6.dst, in fl_dump_key()
3011 &mask->enc_key_id, TCA_FLOWER_UNSPEC, in fl_dump_key()
3015 &mask->enc_tp.src, in fl_dump_key()
3020 &mask->enc_tp.dst, in fl_dump_key()
3023 fl_dump_key_ip(skb, true, &key->enc_ip, &mask->enc_ip) || in fl_dump_key()
3024 fl_dump_key_enc_opt(skb, &key->enc_opts, &mask->enc_opts)) in fl_dump_key()
3027 if (fl_dump_key_ct(skb, &key->ct, &mask->ct)) in fl_dump_key()
3030 if (fl_dump_key_flags(skb, key->control.flags, mask->control.flags)) in fl_dump_key()
3034 &mask->hash.hash, TCA_FLOWER_KEY_HASH_MASK, in fl_dump_key()
3049 struct fl_flow_key *key, *mask; in fl_dump() local
3068 mask = &f->mask->key; in fl_dump()
3071 if (fl_dump_key(skb, net, key, mask)) in fl_dump()
3147 struct fl_flow_key *key, *mask; in fl_tmplt_dump() local
3155 mask = &tmplt->mask; in fl_tmplt_dump()
3157 if (fl_dump_key(skb, net, key, mask)) in fl_tmplt_dump()