mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-15 00:36:14 -04:00
net: dsa: felix: add port policers
This patch is a trivial passthrough towards the ocelot library, which
support port policers since commit 2c1d029a01 ("net: mscc: ocelot:
Implement port policers via tc command").
Some data structure conversion between the DSA core and the Ocelot
library is necessary, for policer parameters.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
342971766c
commit
fc411eaac8
@@ -549,6 +549,11 @@ struct ocelot {
|
||||
spinlock_t ptp_clock_lock;
|
||||
};
|
||||
|
||||
struct ocelot_policer {
|
||||
u32 rate; /* kilobit per second */
|
||||
u32 burst; /* bytes */
|
||||
};
|
||||
|
||||
#define ocelot_read_ix(ocelot, reg, gi, ri) __ocelot_read_ix(ocelot, reg, reg##_GSZ * (gi) + reg##_RSZ * (ri))
|
||||
#define ocelot_read_gix(ocelot, reg, gi) __ocelot_read_ix(ocelot, reg, reg##_GSZ * (gi))
|
||||
#define ocelot_read_rix(ocelot, reg, ri) __ocelot_read_ix(ocelot, reg, reg##_RSZ * (ri))
|
||||
@@ -619,6 +624,9 @@ int ocelot_port_add_txtstamp_skb(struct ocelot_port *ocelot_port,
|
||||
void ocelot_get_txtstamp(struct ocelot *ocelot);
|
||||
void ocelot_port_set_maxlen(struct ocelot *ocelot, int port, size_t sdu);
|
||||
int ocelot_get_max_mtu(struct ocelot *ocelot, int port);
|
||||
int ocelot_port_policer_add(struct ocelot *ocelot, int port,
|
||||
struct ocelot_policer *pol);
|
||||
int ocelot_port_policer_del(struct ocelot *ocelot, int port);
|
||||
int ocelot_cls_flower_replace(struct ocelot *ocelot, int port,
|
||||
struct flow_cls_offload *f, bool ingress);
|
||||
int ocelot_cls_flower_destroy(struct ocelot *ocelot, int port,
|
||||
|
||||
Reference in New Issue
Block a user