Lines Matching defs:rule
383 /* Locate the first rule available */
398 flow_rule_match_ipv4_addrs(flow->rule, &ipv4);
399 flow_rule_match_ports(flow->rule, &ports);
400 flow_rule_match_ip(flow->rule, &ip);
465 /* Turn on CFP for this rule now */
470 /* Flag the rule as being used and return it */
570 struct cfp_rule *rule;
572 list_for_each_entry(rule, &priv->cfp.rules_list, next) {
573 if (rule->port == port && rule->fs.location == location)
574 return rule;
583 struct cfp_rule *rule = NULL;
590 list_for_each_entry(rule, &priv->cfp.rules_list, next) {
592 if (rule->port != port)
595 if (rule->fs.flow_type != fs->flow_type ||
596 rule->fs.ring_cookie != fs->ring_cookie ||
597 rule->fs.h_ext.data[0] != fs->h_ext.data[0])
613 ret = memcmp(&rule->fs.h_u, &fs->h_u, fs_size);
614 ret |= memcmp(&rule->fs.m_u, &fs->m_u, fs_size);
616 if (rule->fs.flow_type & FLOW_EXT) {
617 ret |= rule->fs.h_ext.vlan_tci != fs->h_ext.vlan_tci;
618 ret |= rule->fs.m_ext.vlan_tci != fs->m_ext.vlan_tci;
675 * that helps with the rule lookup later on since the second half is
708 flow_rule_match_ipv6_addrs(flow->rule, &ipv6);
709 flow_rule_match_ports(flow->rule, &ports);
752 /* Insert into TCAM now because we need to insert a second rule */
767 /* Now deal with the second slice to chain this rule */
779 /* Chained rule, source port match is coming from the rule we are
825 /* Turn on CFP for this rule now */
830 /* Flag the second half rule as being used now, return it as the
857 /* This rule is a Wake-on-LAN filter and we must specifically
875 /* If the rule is matching a particular VLAN, make sure that we honor
930 struct cfp_rule *rule = NULL;
953 rule = kzalloc(sizeof(*rule), GFP_KERNEL);
954 if (!rule)
959 kfree(rule);
963 rule->port = port;
964 memcpy(&rule->fs, fs, sizeof(*fs));
965 list_add_tail(&rule->next, &priv->cfp.rules_list);
976 /* Indicate which rule we want to read */
983 /* Check if this is possibly an IPv6 rule that would
984 * indicate we need to delete its companion rule
1017 /* If this was an IPv6 rule, delete is companion rule too */
1026 struct cfp_rule *rule;
1033 * that could leave IPv6 rules with one of the chained rule in the
1039 rule = bcm_sf2_cfp_rule_find(priv, port, loc);
1040 if (!rule)
1045 list_del(&rule->next);
1046 kfree(rule);
1067 struct cfp_rule *rule;
1069 rule = bcm_sf2_cfp_rule_find(priv, port, nfc->fs.location);
1070 if (!rule)
1073 memcpy(&nfc->fs, &rule->fs, sizeof(rule->fs));
1113 /* Subtract the default, unusable rule */
1116 /* We support specifying rule locations */
1215 struct cfp_rule *rule, *n;
1220 list_for_each_entry_safe_reverse(rule, n, &priv->cfp.rules_list, next)
1221 bcm_sf2_cfp_rule_del(priv, rule->port, rule->fs.location);
1227 struct cfp_rule *rule;
1242 list_for_each_entry(rule, &priv->cfp.rules_list, next) {
1243 ret = bcm_sf2_cfp_rule_remove(priv, rule->port,
1244 rule->fs.location);
1246 dev_err(ds->dev, "failed to remove rule\n");
1250 ret = bcm_sf2_cfp_rule_insert(ds, rule->port, &rule->fs);
1252 dev_err(ds->dev, "failed to restore rule\n");
1312 struct cfp_rule *rule;
1317 rule = bcm_sf2_cfp_rule_find(priv, port, i);
1318 if (!rule)