summaryrefslogtreecommitdiff
path: root/include/soc
diff options
context:
space:
mode:
authorXiaoliang Yang <xiaoliang.yang_1@nxp.com>2021-11-18 18:12:02 +0800
committerDavid S. Miller <davem@davemloft.net>2021-11-18 12:07:24 +0000
commit77043c37096d4753b9f40e51445f31eb9dc40295 (patch)
tree64a197f27f5ca3e08dcd3379cc2fce3beebc8f12 /include/soc
parent23ae3a7877718931474684ef4fbbaf1d1511ee84 (diff)
net: mscc: ocelot: use index to set vcap policer
Policer was previously automatically assigned from the highest index to the lowest index from policer pool. But police action of tc flower now uses index to set an police entry. This patch uses the police index to set vcap policers, so that one policer can be shared by multiple rules. Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/soc')
-rw-r--r--include/soc/mscc/ocelot.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h
index 5ea72d274d7f..2a41685b5c7d 100644
--- a/include/soc/mscc/ocelot.h
+++ b/include/soc/mscc/ocelot.h
@@ -562,10 +562,17 @@ struct ocelot_ops {
struct flow_stats *stats);
};
+struct ocelot_vcap_policer {
+ struct list_head pol_list;
+ u16 base;
+ u16 max;
+ u16 base2;
+ u16 max2;
+};
+
struct ocelot_vcap_block {
struct list_head rules;
int count;
- int pol_lpr;
};
struct ocelot_bridge_vlan {
@@ -691,6 +698,7 @@ struct ocelot {
struct list_head dummy_rules;
struct ocelot_vcap_block block[3];
+ struct ocelot_vcap_policer vcap_pol;
struct vcap_props *vcap;
struct ocelot_psfp_list psfp;
@@ -905,6 +913,10 @@ int ocelot_mact_learn_streamdata(struct ocelot *ocelot, int dst_idx,
enum macaccess_entry_type type,
int sfid, int ssid);
+int ocelot_vcap_policer_add(struct ocelot *ocelot, u32 pol_ix,
+ struct ocelot_policer *pol);
+int ocelot_vcap_policer_del(struct ocelot *ocelot, u32 pol_ix);
+
#if IS_ENABLED(CONFIG_BRIDGE_MRP)
int ocelot_mrp_add(struct ocelot *ocelot, int port,
const struct switchdev_obj_mrp *mrp);