linux_dsm_epyc7002/drivers/net/ethernet/mscc/ocelot_police.h
Joergen Andreasen 2c1d029a01 net: mscc: ocelot: Implement port policers via tc command
Hardware offload of matchall classifier and police action are now
supported via the tc command.
Supported police parameters are: rate and burst.

Example:

Add:
tc qdisc add dev eth3 handle ffff: ingress
tc filter add dev eth3 parent ffff: prio 1 handle 2	\
	matchall skip_sw				\
	action police rate 100Mbit burst 10000

Show:
tc -s -d qdisc show dev eth3
tc -s -d filter show dev eth3 ingress

Delete:
tc filter del dev eth3 parent ffff: prio 1
tc qdisc del dev eth3 handle ffff: ingress

Signed-off-by: Joergen Andreasen <joergen.andreasen@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-05-29 21:37:49 -07:00

23 lines
489 B
C

/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
/* Microsemi Ocelot Switch driver
*
* Copyright (c) 2019 Microsemi Corporation
*/
#ifndef _MSCC_OCELOT_POLICE_H_
#define _MSCC_OCELOT_POLICE_H_
#include "ocelot.h"
struct ocelot_policer {
u32 rate; /* kilobit per second */
u32 burst; /* bytes */
};
int ocelot_port_policer_add(struct ocelot_port *port,
struct ocelot_policer *pol);
int ocelot_port_policer_del(struct ocelot_port *port);
#endif /* _MSCC_OCELOT_POLICE_H_ */