• Home
  • Raw
  • Download

Lines Matching full:rule

383 	/* Locate the first rule available */  in bcm_sf2_cfp_ipv4_rule_set()
398 flow_rule_match_ipv4_addrs(flow->rule, &ipv4); in bcm_sf2_cfp_ipv4_rule_set()
399 flow_rule_match_ports(flow->rule, &ports); in bcm_sf2_cfp_ipv4_rule_set()
400 flow_rule_match_ip(flow->rule, &ip); in bcm_sf2_cfp_ipv4_rule_set()
465 /* Turn on CFP for this rule now */ in bcm_sf2_cfp_ipv4_rule_set()
470 /* Flag the rule as being used and return it */ in bcm_sf2_cfp_ipv4_rule_set()
570 struct cfp_rule *rule; in bcm_sf2_cfp_rule_find() local
572 list_for_each_entry(rule, &priv->cfp.rules_list, next) { in bcm_sf2_cfp_rule_find()
573 if (rule->port == port && rule->fs.location == location) in bcm_sf2_cfp_rule_find()
574 return rule; in bcm_sf2_cfp_rule_find()
583 struct cfp_rule *rule = NULL; in bcm_sf2_cfp_rule_cmp() local
590 list_for_each_entry(rule, &priv->cfp.rules_list, next) { in bcm_sf2_cfp_rule_cmp()
592 if (rule->port != port) in bcm_sf2_cfp_rule_cmp()
595 if (rule->fs.flow_type != fs->flow_type || in bcm_sf2_cfp_rule_cmp()
596 rule->fs.ring_cookie != fs->ring_cookie || in bcm_sf2_cfp_rule_cmp()
597 rule->fs.h_ext.data[0] != fs->h_ext.data[0]) in bcm_sf2_cfp_rule_cmp()
613 ret = memcmp(&rule->fs.h_u, &fs->h_u, fs_size); in bcm_sf2_cfp_rule_cmp()
614 ret |= memcmp(&rule->fs.m_u, &fs->m_u, fs_size); in bcm_sf2_cfp_rule_cmp()
616 if (rule->fs.flow_type & FLOW_EXT) { in bcm_sf2_cfp_rule_cmp()
617 ret |= rule->fs.h_ext.vlan_tci != fs->h_ext.vlan_tci; in bcm_sf2_cfp_rule_cmp()
618 ret |= rule->fs.m_ext.vlan_tci != fs->m_ext.vlan_tci; in bcm_sf2_cfp_rule_cmp()
675 * that helps with the rule lookup later on since the second half is in bcm_sf2_cfp_ipv6_rule_set()
708 flow_rule_match_ipv6_addrs(flow->rule, &ipv6); in bcm_sf2_cfp_ipv6_rule_set()
709 flow_rule_match_ports(flow->rule, &ports); in bcm_sf2_cfp_ipv6_rule_set()
752 /* Insert into TCAM now because we need to insert a second rule */ in bcm_sf2_cfp_ipv6_rule_set()
767 /* Now deal with the second slice to chain this rule */ in bcm_sf2_cfp_ipv6_rule_set()
779 /* Chained rule, source port match is coming from the rule we are in bcm_sf2_cfp_ipv6_rule_set()
825 /* Turn on CFP for this rule now */ in bcm_sf2_cfp_ipv6_rule_set()
830 /* Flag the second half rule as being used now, return it as the in bcm_sf2_cfp_ipv6_rule_set()
857 /* This rule is a Wake-on-LAN filter and we must specifically in bcm_sf2_cfp_rule_insert()
875 /* If the rule is matching a particular VLAN, make sure that we honor in bcm_sf2_cfp_rule_insert()
933 struct cfp_rule *rule = NULL; in bcm_sf2_cfp_rule_set() local
957 rule = kzalloc(sizeof(*rule), GFP_KERNEL); in bcm_sf2_cfp_rule_set()
958 if (!rule) in bcm_sf2_cfp_rule_set()
963 kfree(rule); in bcm_sf2_cfp_rule_set()
967 rule->port = port; in bcm_sf2_cfp_rule_set()
968 memcpy(&rule->fs, fs, sizeof(*fs)); in bcm_sf2_cfp_rule_set()
969 list_add_tail(&rule->next, &priv->cfp.rules_list); in bcm_sf2_cfp_rule_set()
980 /* Indicate which rule we want to read */ in bcm_sf2_cfp_rule_del_one()
987 /* Check if this is possibly an IPv6 rule that would in bcm_sf2_cfp_rule_del_one()
988 * indicate we need to delete its companion rule in bcm_sf2_cfp_rule_del_one()
1021 /* If this was an IPv6 rule, delete is companion rule too */ in bcm_sf2_cfp_rule_remove()
1030 struct cfp_rule *rule; in bcm_sf2_cfp_rule_del() local
1037 * that could leave IPv6 rules with one of the chained rule in the in bcm_sf2_cfp_rule_del()
1043 rule = bcm_sf2_cfp_rule_find(priv, port, loc); in bcm_sf2_cfp_rule_del()
1044 if (!rule) in bcm_sf2_cfp_rule_del()
1049 list_del(&rule->next); in bcm_sf2_cfp_rule_del()
1050 kfree(rule); in bcm_sf2_cfp_rule_del()
1071 struct cfp_rule *rule; in bcm_sf2_cfp_rule_get() local
1073 rule = bcm_sf2_cfp_rule_find(priv, port, nfc->fs.location); in bcm_sf2_cfp_rule_get()
1074 if (!rule) in bcm_sf2_cfp_rule_get()
1077 memcpy(&nfc->fs, &rule->fs, sizeof(rule->fs)); in bcm_sf2_cfp_rule_get()
1117 /* Subtract the default, unusable rule */ in bcm_sf2_get_rxnfc()
1120 /* We support specifying rule locations */ in bcm_sf2_get_rxnfc()
1219 struct cfp_rule *rule, *n; in bcm_sf2_cfp_exit() local
1224 list_for_each_entry_safe_reverse(rule, n, &priv->cfp.rules_list, next) in bcm_sf2_cfp_exit()
1225 bcm_sf2_cfp_rule_del(priv, rule->port, rule->fs.location); in bcm_sf2_cfp_exit()
1231 struct cfp_rule *rule; in bcm_sf2_cfp_resume() local
1246 list_for_each_entry(rule, &priv->cfp.rules_list, next) { in bcm_sf2_cfp_resume()
1247 ret = bcm_sf2_cfp_rule_remove(priv, rule->port, in bcm_sf2_cfp_resume()
1248 rule->fs.location); in bcm_sf2_cfp_resume()
1250 dev_err(ds->dev, "failed to remove rule\n"); in bcm_sf2_cfp_resume()
1254 ret = bcm_sf2_cfp_rule_insert(ds, rule->port, &rule->fs); in bcm_sf2_cfp_resume()
1256 dev_err(ds->dev, "failed to restore rule\n"); in bcm_sf2_cfp_resume()
1316 struct cfp_rule *rule; in bcm_sf2_cfp_get_ethtool_stats() local
1321 rule = bcm_sf2_cfp_rule_find(priv, port, i); in bcm_sf2_cfp_get_ethtool_stats()
1322 if (!rule) in bcm_sf2_cfp_get_ethtool_stats()