Lines Matching full:ocelot

2 /* Microsemi Ocelot Switch driver
39 * offload support in Ocelot in ocelot_chain_to_block()
65 * offload support in Ocelot in ocelot_chain_to_lookup()
81 * offload support in Ocelot in ocelot_chain_to_pag()
145 ocelot_find_vcap_filter_that_points_at(struct ocelot *ocelot, int chain) in ocelot_find_vcap_filter_that_points_at() argument
156 block = &ocelot->block[VCAP_IS1]; in ocelot_find_vcap_filter_that_points_at()
164 list_for_each_entry(filter, &ocelot->dummy_rules, list) in ocelot_find_vcap_filter_that_points_at()
172 ocelot_flower_parse_ingress_vlan_modify(struct ocelot *ocelot, int port, in ocelot_flower_parse_ingress_vlan_modify() argument
177 struct ocelot_port *ocelot_port = ocelot->ports[port]; in ocelot_flower_parse_ingress_vlan_modify()
231 static int ocelot_flower_parse_action(struct ocelot *ocelot, int port, in ocelot_flower_parse_action() argument
340 pol_ix = a->hw_index + ocelot->vcap_pol.base; in ocelot_flower_parse_action()
341 pol_max = ocelot->vcap_pol.max; in ocelot_flower_parse_action()
343 if (ocelot->vcap_pol.max2 && pol_ix > pol_max) { in ocelot_flower_parse_action()
344 pol_ix += ocelot->vcap_pol.base2 - pol_max - 1; in ocelot_flower_parse_action()
345 pol_max = ocelot->vcap_pol.max2; in ocelot_flower_parse_action()
369 egress_port = ocelot->ops->netdev_to_port(a->dev); in ocelot_flower_parse_action()
372 "Destination not an ocelot port"); in ocelot_flower_parse_action()
390 egress_port = ocelot->ops->netdev_to_port(a->dev); in ocelot_flower_parse_action()
393 "Destination not an ocelot port"); in ocelot_flower_parse_action()
422 err = ocelot_flower_parse_ingress_vlan_modify(ocelot, port, in ocelot_flower_parse_action()
520 static int ocelot_flower_parse_indev(struct ocelot *ocelot, int port, in ocelot_flower_parse_indev() argument
525 const struct vcap_props *vcap = &ocelot->vcap[VCAP_ES0]; in ocelot_flower_parse_indev()
542 dev = ocelot->ops->port_to_netdev(ocelot, port); in ocelot_flower_parse_indev()
553 ingress_port = ocelot->ops->netdev_to_port(indev); in ocelot_flower_parse_indev()
556 "Can only offload an ocelot ingress port"); in ocelot_flower_parse_indev()
572 ocelot_flower_parse_key(struct ocelot *ocelot, int port, bool ingress, in ocelot_flower_parse_key() argument
607 ret = ocelot_flower_parse_indev(ocelot, port, f, filter); in ocelot_flower_parse_key()
779 static int ocelot_flower_parse(struct ocelot *ocelot, int port, bool ingress, in ocelot_flower_parse() argument
789 ret = ocelot_flower_parse_action(ocelot, port, ingress, f, filter); in ocelot_flower_parse()
797 return ocelot_flower_parse_key(ocelot, port, ingress, f, filter); in ocelot_flower_parse()
801 *ocelot_vcap_filter_create(struct ocelot *ocelot, int port, bool ingress, in ocelot_vcap_filter_create() argument
813 const struct vcap_props *vcap = &ocelot->vcap[VCAP_ES0]; in ocelot_vcap_filter_create()
823 static int ocelot_vcap_dummy_filter_add(struct ocelot *ocelot, in ocelot_vcap_dummy_filter_add() argument
826 list_add(&filter->list, &ocelot->dummy_rules); in ocelot_vcap_dummy_filter_add()
831 static int ocelot_vcap_dummy_filter_del(struct ocelot *ocelot, in ocelot_vcap_dummy_filter_del() argument
865 int ocelot_cls_flower_replace(struct ocelot *ocelot, int port, in ocelot_cls_flower_replace() argument
873 if (chain && !ocelot_find_vcap_filter_that_points_at(ocelot, chain)) { in ocelot_cls_flower_replace()
884 filter = ocelot_vcap_block_find_filter_by_id(&ocelot->block[block_id], in ocelot_cls_flower_replace()
895 return ocelot_vcap_filter_replace(ocelot, filter); in ocelot_cls_flower_replace()
899 filter = ocelot_vcap_filter_create(ocelot, port, ingress, f); in ocelot_cls_flower_replace()
903 ret = ocelot_flower_parse(ocelot, port, ingress, f, filter); in ocelot_cls_flower_replace()
919 return ocelot_vcap_dummy_filter_add(ocelot, filter); in ocelot_cls_flower_replace()
923 if (ocelot->ops->psfp_filter_add) in ocelot_cls_flower_replace()
924 return ocelot->ops->psfp_filter_add(ocelot, port, f); in ocelot_cls_flower_replace()
930 return ocelot_vcap_filter_add(ocelot, filter, f->common.extack); in ocelot_cls_flower_replace()
934 int ocelot_cls_flower_destroy(struct ocelot *ocelot, int port, in ocelot_cls_flower_destroy() argument
946 if (ocelot->ops->psfp_filter_del) in ocelot_cls_flower_destroy()
947 return ocelot->ops->psfp_filter_del(ocelot, f); in ocelot_cls_flower_destroy()
952 block = &ocelot->block[block_id]; in ocelot_cls_flower_destroy()
959 return ocelot_vcap_dummy_filter_del(ocelot, filter); in ocelot_cls_flower_destroy()
964 return ocelot_vcap_filter_replace(ocelot, filter); in ocelot_cls_flower_destroy()
967 return ocelot_vcap_filter_del(ocelot, filter); in ocelot_cls_flower_destroy()
971 int ocelot_cls_flower_stats(struct ocelot *ocelot, int port, in ocelot_cls_flower_stats() argument
984 if (ocelot->ops->psfp_stats_get) { in ocelot_cls_flower_stats()
985 ret = ocelot->ops->psfp_stats_get(ocelot, f, &stats); in ocelot_cls_flower_stats()
995 block = &ocelot->block[block_id]; in ocelot_cls_flower_stats()
1001 ret = ocelot_vcap_filter_stats_update(ocelot, filter); in ocelot_cls_flower_stats()