• Home
  • Raw
  • Download

Lines Matching refs:rule

10 	struct sja1105_rule *rule;  in sja1105_rule_find()  local
12 list_for_each_entry(rule, &priv->flow_block.rules, list) in sja1105_rule_find()
13 if (rule->cookie == cookie) in sja1105_rule_find()
14 return rule; in sja1105_rule_find()
36 struct sja1105_rule *rule = sja1105_rule_find(priv, cookie); in sja1105_setup_bcast_policer() local
42 if (!rule) { in sja1105_setup_bcast_policer()
43 rule = kzalloc(sizeof(*rule), GFP_KERNEL); in sja1105_setup_bcast_policer()
44 if (!rule) in sja1105_setup_bcast_policer()
47 rule->cookie = cookie; in sja1105_setup_bcast_policer()
48 rule->type = SJA1105_RULE_BCAST_POLICER; in sja1105_setup_bcast_policer()
49 rule->bcast_pol.sharindx = sja1105_find_free_l2_policer(priv); in sja1105_setup_bcast_policer()
50 rule->key.type = SJA1105_KEY_BCAST; in sja1105_setup_bcast_policer()
54 if (rule->bcast_pol.sharindx == -1) { in sja1105_setup_bcast_policer()
69 rule->port_mask |= BIT(port); in sja1105_setup_bcast_policer()
74 for_each_set_bit(p, &rule->port_mask, SJA1105_NUM_PORTS) { in sja1105_setup_bcast_policer()
77 policing[bcast].sharindx = rule->bcast_pol.sharindx; in sja1105_setup_bcast_policer()
80 policing[rule->bcast_pol.sharindx].rate = div_u64(rate_bytes_per_sec * in sja1105_setup_bcast_policer()
82 policing[rule->bcast_pol.sharindx].smax = burst; in sja1105_setup_bcast_policer()
85 policing[rule->bcast_pol.sharindx].maxlen = VLAN_ETH_FRAME_LEN + in sja1105_setup_bcast_policer()
92 priv->flow_block.l2_policer_used[rule->bcast_pol.sharindx] = true; in sja1105_setup_bcast_policer()
93 list_add(&rule->list, &priv->flow_block.rules); in sja1105_setup_bcast_policer()
95 kfree(rule); in sja1105_setup_bcast_policer()
107 struct sja1105_rule *rule = sja1105_rule_find(priv, cookie); in sja1105_setup_tc_policer() local
113 if (!rule) { in sja1105_setup_tc_policer()
114 rule = kzalloc(sizeof(*rule), GFP_KERNEL); in sja1105_setup_tc_policer()
115 if (!rule) in sja1105_setup_tc_policer()
118 rule->cookie = cookie; in sja1105_setup_tc_policer()
119 rule->type = SJA1105_RULE_TC_POLICER; in sja1105_setup_tc_policer()
120 rule->tc_pol.sharindx = sja1105_find_free_l2_policer(priv); in sja1105_setup_tc_policer()
121 rule->key.type = SJA1105_KEY_TC; in sja1105_setup_tc_policer()
122 rule->key.tc.pcp = tc; in sja1105_setup_tc_policer()
126 if (rule->tc_pol.sharindx == -1) { in sja1105_setup_tc_policer()
141 rule->port_mask |= BIT(port); in sja1105_setup_tc_policer()
146 for_each_set_bit(p, &rule->port_mask, SJA1105_NUM_PORTS) { in sja1105_setup_tc_policer()
149 policing[index].sharindx = rule->tc_pol.sharindx; in sja1105_setup_tc_policer()
152 policing[rule->tc_pol.sharindx].rate = div_u64(rate_bytes_per_sec * in sja1105_setup_tc_policer()
154 policing[rule->tc_pol.sharindx].smax = burst; in sja1105_setup_tc_policer()
157 policing[rule->tc_pol.sharindx].maxlen = VLAN_ETH_FRAME_LEN + in sja1105_setup_tc_policer()
164 priv->flow_block.l2_policer_used[rule->tc_pol.sharindx] = true; in sja1105_setup_tc_policer()
165 list_add(&rule->list, &priv->flow_block.rules); in sja1105_setup_tc_policer()
167 kfree(rule); in sja1105_setup_tc_policer()
199 struct flow_rule *rule = flow_cls_offload_flow_rule(cls); in sja1105_flower_parse_key() local
200 struct flow_dissector *dissector = rule->match.dissector; in sja1105_flower_parse_key()
216 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_BASIC)) { in sja1105_flower_parse_key()
219 flow_rule_match_basic(rule, &match); in sja1105_flower_parse_key()
227 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) { in sja1105_flower_parse_key()
232 flow_rule_match_eth_addrs(rule, &match); in sja1105_flower_parse_key()
251 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_VLAN)) { in sja1105_flower_parse_key()
254 flow_rule_match_vlan(rule, &match); in sja1105_flower_parse_key()
305 struct flow_rule *rule = flow_cls_offload_flow_rule(cls); in sja1105_cls_flower_add() local
322 flow_action_for_each(i, act, &rule->action) { in sja1105_cls_flower_add()
420 struct sja1105_rule *rule = sja1105_rule_find(priv, cls->cookie); in sja1105_cls_flower_del() local
424 if (!rule) in sja1105_cls_flower_del()
427 if (rule->type == SJA1105_RULE_VL) in sja1105_cls_flower_del()
428 return sja1105_vl_delete(priv, port, rule, cls->common.extack); in sja1105_cls_flower_del()
432 if (rule->type == SJA1105_RULE_BCAST_POLICER) { in sja1105_cls_flower_del()
437 } else if (rule->type == SJA1105_RULE_TC_POLICER) { in sja1105_cls_flower_del()
438 int index = (port * SJA1105_NUM_TC) + rule->key.tc.pcp; in sja1105_cls_flower_del()
446 rule->port_mask &= ~BIT(port); in sja1105_cls_flower_del()
447 if (!rule->port_mask) { in sja1105_cls_flower_del()
449 list_del(&rule->list); in sja1105_cls_flower_del()
450 kfree(rule); in sja1105_cls_flower_del()
460 struct sja1105_rule *rule = sja1105_rule_find(priv, cls->cookie); in sja1105_cls_flower_stats() local
463 if (!rule) in sja1105_cls_flower_stats()
466 if (rule->type != SJA1105_RULE_VL) in sja1105_cls_flower_stats()
469 rc = sja1105_vl_stats(priv, port, rule, &cls->stats, in sja1105_cls_flower_stats()
491 struct sja1105_rule *rule; in sja1105_flower_teardown() local
495 rule = list_entry(pos, struct sja1105_rule, list); in sja1105_flower_teardown()
496 list_del(&rule->list); in sja1105_flower_teardown()
497 kfree(rule); in sja1105_flower_teardown()