Lines Matching refs:ocelot

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()
390 egress_port = ocelot->ops->netdev_to_port(a->dev); 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()
572 ocelot_flower_parse_key(struct ocelot *ocelot, int port, bool ingress, in ocelot_flower_parse_key() argument
597 ret = ocelot_flower_parse_indev(ocelot, port, f, filter); in ocelot_flower_parse_key()
772 static int ocelot_flower_parse(struct ocelot *ocelot, int port, bool ingress, in ocelot_flower_parse() argument
782 ret = ocelot_flower_parse_action(ocelot, port, ingress, f, filter); in ocelot_flower_parse()
790 return ocelot_flower_parse_key(ocelot, port, ingress, f, filter); in ocelot_flower_parse()
794 *ocelot_vcap_filter_create(struct ocelot *ocelot, int port, bool ingress, in ocelot_vcap_filter_create() argument
806 const struct vcap_props *vcap = &ocelot->vcap[VCAP_ES0]; in ocelot_vcap_filter_create()
816 static int ocelot_vcap_dummy_filter_add(struct ocelot *ocelot, in ocelot_vcap_dummy_filter_add() argument
819 list_add(&filter->list, &ocelot->dummy_rules); in ocelot_vcap_dummy_filter_add()
824 static int ocelot_vcap_dummy_filter_del(struct ocelot *ocelot, in ocelot_vcap_dummy_filter_del() argument
858 int ocelot_cls_flower_replace(struct ocelot *ocelot, int port, in ocelot_cls_flower_replace() argument
866 if (chain && !ocelot_find_vcap_filter_that_points_at(ocelot, chain)) { in ocelot_cls_flower_replace()
877 filter = ocelot_vcap_block_find_filter_by_id(&ocelot->block[block_id], in ocelot_cls_flower_replace()
888 return ocelot_vcap_filter_replace(ocelot, filter); in ocelot_cls_flower_replace()
892 filter = ocelot_vcap_filter_create(ocelot, port, ingress, f); in ocelot_cls_flower_replace()
896 ret = ocelot_flower_parse(ocelot, port, ingress, f, filter); in ocelot_cls_flower_replace()
912 return ocelot_vcap_dummy_filter_add(ocelot, filter); in ocelot_cls_flower_replace()
916 if (ocelot->ops->psfp_filter_add) in ocelot_cls_flower_replace()
917 return ocelot->ops->psfp_filter_add(ocelot, port, f); in ocelot_cls_flower_replace()
923 return ocelot_vcap_filter_add(ocelot, filter, f->common.extack); in ocelot_cls_flower_replace()
927 int ocelot_cls_flower_destroy(struct ocelot *ocelot, int port, in ocelot_cls_flower_destroy() argument
939 if (ocelot->ops->psfp_filter_del) in ocelot_cls_flower_destroy()
940 return ocelot->ops->psfp_filter_del(ocelot, f); in ocelot_cls_flower_destroy()
945 block = &ocelot->block[block_id]; in ocelot_cls_flower_destroy()
952 return ocelot_vcap_dummy_filter_del(ocelot, filter); in ocelot_cls_flower_destroy()
957 return ocelot_vcap_filter_replace(ocelot, filter); in ocelot_cls_flower_destroy()
960 return ocelot_vcap_filter_del(ocelot, filter); in ocelot_cls_flower_destroy()
964 int ocelot_cls_flower_stats(struct ocelot *ocelot, int port, in ocelot_cls_flower_stats() argument
977 if (ocelot->ops->psfp_stats_get) { in ocelot_cls_flower_stats()
978 ret = ocelot->ops->psfp_stats_get(ocelot, f, &stats); in ocelot_cls_flower_stats()
988 block = &ocelot->block[block_id]; in ocelot_cls_flower_stats()
994 ret = ocelot_vcap_filter_stats_update(ocelot, filter); in ocelot_cls_flower_stats()