Home
last modified time | relevance | path

Searched refs:rule (Results 1 – 25 of 334) sorted by relevance

12345678910>>...14

/Linux-v5.4/net/core/
Dfib_rules.c23 bool fib_rule_matchall(const struct fib_rule *rule) in fib_rule_matchall() argument
25 if (rule->iifindex || rule->oifindex || rule->mark || rule->tun_id || in fib_rule_matchall()
26 rule->flags) in fib_rule_matchall()
28 if (rule->suppress_ifgroup != -1 || rule->suppress_prefixlen != -1) in fib_rule_matchall()
30 if (!uid_eq(rule->uid_range.start, fib_kuid_range_unset.start) || in fib_rule_matchall()
31 !uid_eq(rule->uid_range.end, fib_kuid_range_unset.end)) in fib_rule_matchall()
33 if (fib_rule_port_range_set(&rule->sport_range)) in fib_rule_matchall()
35 if (fib_rule_port_range_set(&rule->dport_range)) in fib_rule_matchall()
72 struct fib_rule *rule; in fib_default_rule_pref() local
77 rule = list_entry(pos->next, struct fib_rule, list); in fib_default_rule_pref()
[all …]
Dflow_offload.c10 struct flow_rule *rule; in flow_rule_alloc() local
12 rule = kzalloc(struct_size(rule, action.entries, num_actions), in flow_rule_alloc()
14 if (!rule) in flow_rule_alloc()
17 rule->action.num_entries = num_actions; in flow_rule_alloc()
19 return rule; in flow_rule_alloc()
30 void flow_rule_match_meta(const struct flow_rule *rule, in flow_rule_match_meta() argument
33 FLOW_DISSECTOR_MATCH(rule, FLOW_DISSECTOR_KEY_META, out); in flow_rule_match_meta()
37 void flow_rule_match_basic(const struct flow_rule *rule, in flow_rule_match_basic() argument
40 FLOW_DISSECTOR_MATCH(rule, FLOW_DISSECTOR_KEY_BASIC, out); in flow_rule_match_basic()
44 void flow_rule_match_control(const struct flow_rule *rule, in flow_rule_match_control() argument
[all …]
/Linux-v5.4/net/ipv4/
Dfib_rules.c47 static bool fib4_rule_matchall(const struct fib_rule *rule) in fib4_rule_matchall() argument
49 struct fib4_rule *r = container_of(rule, struct fib4_rule, common); in fib4_rule_matchall()
53 return fib_rule_matchall(rule); in fib4_rule_matchall()
56 bool fib4_rule_default(const struct fib_rule *rule) in fib4_rule_default() argument
58 if (!fib4_rule_matchall(rule) || rule->action != FR_ACT_TO_TBL || in fib4_rule_default()
59 rule->l3mdev) in fib4_rule_default()
61 if (rule->table != RT_TABLE_LOCAL && rule->table != RT_TABLE_MAIN && in fib4_rule_default()
62 rule->table != RT_TABLE_DEFAULT) in fib4_rule_default()
92 if (arg.rule) in __fib_lookup()
93 res->tclassid = ((struct fib4_rule *)arg.rule)->tclassid; in __fib_lookup()
[all …]
/Linux-v5.4/drivers/net/ethernet/mscc/
Docelot_flower.c17 struct ocelot_ace_rule *rule) in ocelot_flower_parse_action() argument
22 if (f->rule->action.num_entries != 1) in ocelot_flower_parse_action()
25 flow_action_for_each(i, a, &f->rule->action) { in ocelot_flower_parse_action()
28 rule->action = OCELOT_ACL_ACTION_DROP; in ocelot_flower_parse_action()
31 rule->action = OCELOT_ACL_ACTION_TRAP; in ocelot_flower_parse_action()
44 struct flow_rule *rule = flow_cls_offload_flow_rule(f); in ocelot_flower_parse() local
45 struct flow_dissector *dissector = rule->match.dissector; in ocelot_flower_parse()
58 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_CONTROL)) { in ocelot_flower_parse()
61 flow_rule_match_control(rule, &match); in ocelot_flower_parse()
64 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) { in ocelot_flower_parse()
[all …]
/Linux-v5.4/drivers/pnp/
Dmanager.c23 unsigned char rule, in pnp_find_resource() argument
32 res->flags |= rule & IORESOURCE_BITS; in pnp_find_resource()
38 static int pnp_assign_port(struct pnp_dev *dev, struct pnp_port *rule, int idx) in pnp_assign_port() argument
42 res = pnp_find_resource(dev, rule->flags, IORESOURCE_IO, idx); in pnp_assign_port()
51 res->flags = rule->flags | IORESOURCE_AUTO; in pnp_assign_port()
55 if (!rule->size) { in pnp_assign_port()
61 res->start = rule->min; in pnp_assign_port()
62 res->end = res->start + rule->size - 1; in pnp_assign_port()
65 res->start += rule->align; in pnp_assign_port()
66 res->end = res->start + rule->size - 1; in pnp_assign_port()
[all …]
/Linux-v5.4/net/ipv6/
Dfib6_rules.c30 static bool fib6_rule_matchall(const struct fib_rule *rule) in fib6_rule_matchall() argument
32 struct fib6_rule *r = container_of(rule, struct fib6_rule, common); in fib6_rule_matchall()
36 return fib_rule_matchall(rule); in fib6_rule_matchall()
39 bool fib6_rule_default(const struct fib_rule *rule) in fib6_rule_default() argument
41 if (!fib6_rule_matchall(rule) || rule->action != FR_ACT_TO_TBL || in fib6_rule_default()
42 rule->l3mdev) in fib6_rule_default()
44 if (rule->table != RT6_TABLE_LOCAL && rule->table != RT6_TABLE_MAIN) in fib6_rule_default()
128 static int fib6_rule_saddr(struct net *net, struct fib_rule *rule, int flags, in fib6_rule_saddr() argument
131 struct fib6_rule *r = (struct fib6_rule *)rule; in fib6_rule_saddr()
136 if ((rule->flags & FIB_RULE_FIND_SADDR) && in fib6_rule_saddr()
[all …]
/Linux-v5.4/security/safesetid/
Dsecurityfs.c31 struct setuid_rule *rule) in parse_policy_line() argument
52 rule->src_uid = make_kuid(file->f_cred->user_ns, parsed_parent); in parse_policy_line()
53 rule->dst_uid = make_kuid(file->f_cred->user_ns, parsed_child); in parse_policy_line()
54 if (!uid_valid(rule->src_uid) || !uid_valid(rule->dst_uid)) in parse_policy_line()
65 struct setuid_rule *rule; in __release_ruleset() local
68 hash_for_each_safe(pol->rules, bucket, tmp, rule, next) in __release_ruleset()
69 kfree(rule); in __release_ruleset()
79 static void insert_rule(struct setuid_ruleset *pol, struct setuid_rule *rule) in insert_rule() argument
81 hash_add(pol->rules, &rule->next, __kuid_val(rule->src_uid)); in insert_rule()
87 struct setuid_rule *rule, *nrule; in verify_ruleset() local
[all …]
/Linux-v5.4/kernel/
Dauditfilter.c84 struct audit_krule *erule = &e->rule; in audit_free_rule()
118 entry->rule.fields = fields; in audit_init_entry()
210 struct audit_field *arch = entry->rule.arch_f; in audit_match_signal()
216 entry->rule.mask) && in audit_match_signal()
218 entry->rule.mask)); in audit_match_signal()
224 entry->rule.mask)); in audit_match_signal()
227 entry->rule.mask)); in audit_match_signal()
235 static inline struct audit_entry *audit_to_entry_common(struct audit_rule_data *rule) in audit_to_entry_common() argument
242 listnr = rule->flags & ~AUDIT_FILTER_PREPEND; in audit_to_entry_common()
258 if (unlikely(rule->action == AUDIT_POSSIBLE)) { in audit_to_entry_common()
[all …]
/Linux-v5.4/Documentation/networking/
Dtls-offload-reorder-bad.svg1rule="nonzero"/></clipPath><g clip-path="url(#p.0)"><path fill="#000000" fill-opacity="0.0" d="m0 …
Dtls-offload-reorder-good.svg1rule="nonzero"/></clipPath><g clip-path="url(#p.0)"><path fill="#000000" fill-opacity="0.0" d="m0 …
/Linux-v5.4/security/apparmor/
Daudit.c169 struct aa_audit_rule *rule = vrule; in aa_audit_rule_free() local
171 if (rule) { in aa_audit_rule_free()
172 if (!IS_ERR(rule->label)) in aa_audit_rule_free()
173 aa_put_label(rule->label); in aa_audit_rule_free()
174 kfree(rule); in aa_audit_rule_free()
180 struct aa_audit_rule *rule; in aa_audit_rule_init() local
191 rule = kzalloc(sizeof(struct aa_audit_rule), GFP_KERNEL); in aa_audit_rule_init()
193 if (!rule) in aa_audit_rule_init()
197 rule->label = aa_label_parse(&root_ns->unconfined->label, rulestr, in aa_audit_rule_init()
199 if (IS_ERR(rule->label)) { in aa_audit_rule_init()
[all …]
/Linux-v5.4/drivers/net/ethernet/netronome/nfp/flower/
Dmatch.c15 struct flow_rule *rule = flow_cls_offload_flow_rule(flow); in nfp_flower_compile_meta_tci() local
28 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_VLAN)) { in nfp_flower_compile_meta_tci()
31 flow_rule_match_vlan(rule, &match); in nfp_flower_compile_meta_tci()
83 struct flow_rule *rule = flow_cls_offload_flow_rule(flow); in nfp_flower_compile_mac() local
88 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) { in nfp_flower_compile_mac()
91 flow_rule_match_eth_addrs(rule, &match); in nfp_flower_compile_mac()
99 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_MPLS)) { in nfp_flower_compile_mac()
103 flow_rule_match_mpls(rule, &match); in nfp_flower_compile_mac()
114 } else if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_BASIC)) { in nfp_flower_compile_mac()
121 flow_rule_match_basic(rule, &match); in nfp_flower_compile_mac()
[all …]
/Linux-v5.4/include/net/
Dfib_rules.h52 struct fib_rule *rule; member
102 struct fib_rule *rule; member
124 static inline void fib_rule_get(struct fib_rule *rule) in fib_rule_get() argument
126 refcount_inc(&rule->refcnt); in fib_rule_get()
129 static inline void fib_rule_put(struct fib_rule *rule) in fib_rule_put() argument
131 if (refcount_dec_and_test(&rule->refcnt)) in fib_rule_put()
132 kfree_rcu(rule, rcu); in fib_rule_put()
136 static inline u32 fib_rule_get_table(struct fib_rule *rule, in fib_rule_get_table() argument
139 return rule->l3mdev ? arg->table : rule->table; in fib_rule_get_table()
142 static inline u32 fib_rule_get_table(struct fib_rule *rule, in fib_rule_get_table() argument
[all …]
Dflow_offload.h73 void flow_rule_match_meta(const struct flow_rule *rule,
75 void flow_rule_match_basic(const struct flow_rule *rule,
77 void flow_rule_match_control(const struct flow_rule *rule,
79 void flow_rule_match_eth_addrs(const struct flow_rule *rule,
81 void flow_rule_match_vlan(const struct flow_rule *rule,
83 void flow_rule_match_cvlan(const struct flow_rule *rule,
85 void flow_rule_match_ipv4_addrs(const struct flow_rule *rule,
87 void flow_rule_match_ipv6_addrs(const struct flow_rule *rule,
89 void flow_rule_match_ip(const struct flow_rule *rule,
91 void flow_rule_match_ports(const struct flow_rule *rule,
[all …]
/Linux-v5.4/drivers/net/ethernet/mellanox/mlxsw/
Dspectrum_flower.c143 struct flow_rule *rule = flow_cls_offload_flow_rule(f); in mlxsw_sp_flower_parse_meta() local
148 if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_META)) in mlxsw_sp_flower_parse_meta()
151 flow_rule_match_meta(rule, &match); in mlxsw_sp_flower_parse_meta()
187 flow_rule_match_ipv4_addrs(f->rule, &match); in mlxsw_sp_flower_parse_ipv4()
202 flow_rule_match_ipv6_addrs(f->rule, &match); in mlxsw_sp_flower_parse_ipv6()
235 const struct flow_rule *rule = flow_cls_offload_flow_rule(f); in mlxsw_sp_flower_parse_ports() local
238 if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_PORTS)) in mlxsw_sp_flower_parse_ports()
247 flow_rule_match_ports(rule, &match); in mlxsw_sp_flower_parse_ports()
262 const struct flow_rule *rule = flow_cls_offload_flow_rule(f); in mlxsw_sp_flower_parse_tcp() local
265 if (!flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_TCP)) in mlxsw_sp_flower_parse_tcp()
[all …]
Dspectrum_acl.c638 struct mlxsw_sp_acl_rule *rule; in mlxsw_sp_acl_rule_create() local
642 rule = kzalloc(sizeof(*rule) + ops->rule_priv_size, in mlxsw_sp_acl_rule_create()
644 if (!rule) { in mlxsw_sp_acl_rule_create()
648 rule->cookie = cookie; in mlxsw_sp_acl_rule_create()
649 rule->ruleset = ruleset; in mlxsw_sp_acl_rule_create()
651 rule->rulei = mlxsw_sp_acl_rulei_create(mlxsw_sp->acl, afa_block); in mlxsw_sp_acl_rule_create()
652 if (IS_ERR(rule->rulei)) { in mlxsw_sp_acl_rule_create()
653 err = PTR_ERR(rule->rulei); in mlxsw_sp_acl_rule_create()
657 return rule; in mlxsw_sp_acl_rule_create()
660 kfree(rule); in mlxsw_sp_acl_rule_create()
[all …]
Dspectrum2_mr_tcam.c184 mlxsw_sp2_mr_tcam_rule_parse(struct mlxsw_sp_acl_rule *rule, in mlxsw_sp2_mr_tcam_rule_parse() argument
190 rulei = mlxsw_sp_acl_rule_rulei(rule); in mlxsw_sp2_mr_tcam_rule_parse()
215 struct mlxsw_sp_acl_rule *rule; in mlxsw_sp2_mr_tcam_route_create() local
223 rule = mlxsw_sp_acl_rule_create(mlxsw_sp, ruleset, in mlxsw_sp2_mr_tcam_route_create()
226 if (IS_ERR(rule)) in mlxsw_sp2_mr_tcam_route_create()
227 return PTR_ERR(rule); in mlxsw_sp2_mr_tcam_route_create()
229 mlxsw_sp2_mr_tcam_rule_parse(rule, key, prio); in mlxsw_sp2_mr_tcam_route_create()
230 err = mlxsw_sp_acl_rule_add(mlxsw_sp, rule); in mlxsw_sp2_mr_tcam_route_create()
237 mlxsw_sp_acl_rule_destroy(mlxsw_sp, rule); in mlxsw_sp2_mr_tcam_route_create()
248 struct mlxsw_sp_acl_rule *rule; in mlxsw_sp2_mr_tcam_route_destroy() local
[all …]
/Linux-v5.4/drivers/net/ethernet/mellanox/mlx5/core/steering/
Ddr_rule.c355 dr_rule_rehash_htbl(struct mlx5dr_rule *rule, in dr_rule_rehash_htbl() argument
363 struct mlx5dr_matcher *matcher = rule->matcher; in dr_rule_rehash_htbl()
472 static struct mlx5dr_ste_htbl *dr_rule_rehash(struct mlx5dr_rule *rule, in dr_rule_rehash() argument
478 struct mlx5dr_domain *dmn = rule->matcher->tbl->dmn; in dr_rule_rehash()
487 return dr_rule_rehash_htbl(rule, nic_rule, cur_htbl, ste_location, in dr_rule_rehash()
530 static void dr_rule_remove_action_members(struct mlx5dr_rule *rule) in dr_rule_remove_action_members() argument
535 list_for_each_entry_safe(action_mem, tmp, &rule->rule_actions_list, list) { in dr_rule_remove_action_members()
542 static int dr_rule_add_action_members(struct mlx5dr_rule *rule, in dr_rule_add_action_members() argument
556 list_add_tail(&action_mem->list, &rule->rule_actions_list); in dr_rule_add_action_members()
563 dr_rule_remove_action_members(rule); in dr_rule_add_action_members()
[all …]
/Linux-v5.4/drivers/net/ethernet/aquantia/atlantic/
Daq_filters.c70 struct aq_rx_filter *rule; in aq_rule_already_exists() local
74 hlist_for_each_entry_safe(rule, aq_node2, in aq_rule_already_exists()
76 if (rule->aq_fsp.location == fsp->location) in aq_rule_already_exists()
78 if (aq_match_filter(&rule->aq_fsp, fsp)) { in aq_rule_already_exists()
426 struct aq_rx_filter *rule = NULL; in aq_del_fvlan_by_vlan() local
429 hlist_for_each_entry_safe(rule, aq_node2, in aq_del_fvlan_by_vlan()
431 if (be16_to_cpu(rule->aq_fsp.h_ext.vlan_tci) == vlan_id) in aq_del_fvlan_by_vlan()
434 if (rule && rule->type == aq_rx_filter_vlan && in aq_del_fvlan_by_vlan()
435 be16_to_cpu(rule->aq_fsp.h_ext.vlan_tci) == vlan_id) { in aq_del_fvlan_by_vlan()
438 cmd.fs.location = rule->aq_fsp.location; in aq_del_fvlan_by_vlan()
[all …]
/Linux-v5.4/drivers/net/ethernet/mellanox/mlx5/core/
Den_arfs.c57 struct mlx5_flow_handle *rule; member
394 if (arfs_rule->rule) in arfs_may_expire_flow()
395 mlx5_del_flow_rules(arfs_rule->rule); in arfs_may_expire_flow()
404 struct arfs_rule *rule; in arfs_del_rules() local
410 mlx5e_for_each_arfs_rule(rule, htmp, priv->fs.arfs.arfs_tables, i, j) { in arfs_del_rules()
411 hlist_del_init(&rule->hlist); in arfs_del_rules()
412 hlist_add_head(&rule->hlist, &del_list); in arfs_del_rules()
416 hlist_for_each_entry_safe(rule, htmp, &del_list, hlist) { in arfs_del_rules()
417 cancel_work_sync(&rule->arfs_work); in arfs_del_rules()
418 if (rule->rule) in arfs_del_rules()
[all …]
/Linux-v5.4/net/decnet/
Ddn_rules.c63 res->r = arg.rule; in dn_fib_lookup()
68 static int dn_fib_rule_action(struct fib_rule *rule, struct flowi *flp, in dn_fib_rule_action() argument
75 switch(rule->action) { in dn_fib_rule_action()
93 tbl = dn_fib_get_table(rule->table, 0); in dn_fib_rule_action()
108 static int dn_fib_rule_match(struct fib_rule *rule, struct flowi *fl, int flags) in dn_fib_rule_match() argument
110 struct dn_fib_rule *r = (struct dn_fib_rule *)rule; in dn_fib_rule_match()
122 static int dn_fib_rule_configure(struct fib_rule *rule, struct sk_buff *skb, in dn_fib_rule_configure() argument
128 struct dn_fib_rule *r = (struct dn_fib_rule *)rule; in dn_fib_rule_configure()
135 if (rule->table == RT_TABLE_UNSPEC) { in dn_fib_rule_configure()
136 if (rule->action == FR_ACT_TO_TBL) { in dn_fib_rule_configure()
[all …]
/Linux-v5.4/drivers/net/dsa/
Dbcm_sf2_cfp.c378 flow_rule_match_ipv4_addrs(flow->rule, &ipv4); in bcm_sf2_cfp_ipv4_rule_set()
379 flow_rule_match_ports(flow->rule, &ports); in bcm_sf2_cfp_ipv4_rule_set()
380 flow_rule_match_ip(flow->rule, &ip); in bcm_sf2_cfp_ipv4_rule_set()
545 struct cfp_rule *rule = NULL; in bcm_sf2_cfp_rule_find() local
547 list_for_each_entry(rule, &priv->cfp.rules_list, next) { in bcm_sf2_cfp_rule_find()
548 if (rule->port == port && rule->fs.location == location) in bcm_sf2_cfp_rule_find()
552 return rule; in bcm_sf2_cfp_rule_find()
558 struct cfp_rule *rule = NULL; in bcm_sf2_cfp_rule_cmp() local
565 list_for_each_entry(rule, &priv->cfp.rules_list, next) { in bcm_sf2_cfp_rule_cmp()
567 if (rule->port != port) in bcm_sf2_cfp_rule_cmp()
[all …]
/Linux-v5.4/security/integrity/ima/
Dima_policy.c77 void *rule; /* LSM file metadata specific */ member
257 kfree(entry->lsm[i].rule); in ima_lsm_free_rule()
280 if (!entry->lsm[i].rule) in ima_lsm_copy_rule()
292 &nentry->lsm[i].rule); in ima_lsm_copy_rule()
332 if (entry->lsm[i].rule) { in ima_lsm_update_rules()
370 static bool ima_match_rules(struct ima_rule_entry *rule, struct inode *inode, in ima_match_rules() argument
377 if ((rule->flags & IMA_FUNC) && (rule->func == func)) in ima_match_rules()
381 if ((rule->flags & IMA_FUNC) && in ima_match_rules()
382 (rule->func != func && func != POST_SETATTR)) in ima_match_rules()
384 if ((rule->flags & IMA_MASK) && in ima_match_rules()
[all …]
/Linux-v5.4/drivers/net/ethernet/marvell/mvpp2/
Dmvpp2_cls.c1078 struct mvpp2_rfs_rule *rule) in mvpp2_port_c2_tcam_rule_add() argument
1087 index = mvpp2_cls_c2_port_flow_index(port, rule->loc); in mvpp2_port_c2_tcam_rule_add()
1092 act = &rule->flow->action.entries[0]; in mvpp2_port_c2_tcam_rule_add()
1094 rule->c2_index = c2.index; in mvpp2_port_c2_tcam_rule_add()
1096 c2.tcam[3] = (rule->c2_tcam & 0xffff) | in mvpp2_port_c2_tcam_rule_add()
1097 ((rule->c2_tcam_mask & 0xffff) << 16); in mvpp2_port_c2_tcam_rule_add()
1098 c2.tcam[2] = ((rule->c2_tcam >> 16) & 0xffff) | in mvpp2_port_c2_tcam_rule_add()
1099 (((rule->c2_tcam_mask >> 16) & 0xffff) << 16); in mvpp2_port_c2_tcam_rule_add()
1100 c2.tcam[1] = ((rule->c2_tcam >> 32) & 0xffff) | in mvpp2_port_c2_tcam_rule_add()
1101 (((rule->c2_tcam_mask >> 32) & 0xffff) << 16); in mvpp2_port_c2_tcam_rule_add()
[all …]
/Linux-v5.4/drivers/net/ethernet/mellanox/mlx5/core/diag/
Dfs_tracepoint.h274 TP_PROTO(const struct mlx5_flow_rule *rule),
275 TP_ARGS(rule),
277 __field(const struct mlx5_flow_rule *, rule)
285 __entry->rule = rule;
286 fs_get_obj(__entry->fte, rule->node.parent);
288 __entry->sw_action = rule->sw_action;
290 &rule->dest_attr,
292 if (rule->dest_attr.type &
295 rule->dest_attr.counter_id;
298 __entry->rule, __entry->fte, __entry->index,
[all …]

12345678910>>...14