2019-05-31 15:16:56 +08:00
|
|
|
/* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
|
|
|
|
/* Microsemi Ocelot Switch driver
|
|
|
|
* Copyright (c) 2019 Microsemi Corporation
|
|
|
|
*/
|
|
|
|
|
2020-06-20 23:43:46 +08:00
|
|
|
#ifndef _MSCC_OCELOT_VCAP_H_
|
|
|
|
#define _MSCC_OCELOT_VCAP_H_
|
2019-05-31 15:16:56 +08:00
|
|
|
|
|
|
|
#include "ocelot.h"
|
2021-01-29 09:00:00 +08:00
|
|
|
#include <soc/mscc/ocelot_vcap.h>
|
|
|
|
#include <net/flow_offload.h>
|
2019-05-31 15:16:56 +08:00
|
|
|
|
2020-10-02 20:02:20 +08:00
|
|
|
#define OCELOT_POLICER_DISCARD 0x17f
|
|
|
|
|
2020-06-20 23:43:46 +08:00
|
|
|
int ocelot_vcap_filter_stats_update(struct ocelot *ocelot,
|
|
|
|
struct ocelot_vcap_filter *rule);
|
2019-05-31 15:16:56 +08:00
|
|
|
|
2020-09-30 06:27:26 +08:00
|
|
|
void ocelot_detect_vcap_constants(struct ocelot *ocelot);
|
2020-06-20 23:43:46 +08:00
|
|
|
int ocelot_vcap_init(struct ocelot *ocelot);
|
2019-05-31 15:16:56 +08:00
|
|
|
|
net: mscc: ocelot: simplify tc-flower offload structures
The ocelot tc-flower offload binds a second flow block callback (apart
from the one for matchall) just because it uses a different block
private structure (ocelot_port_private for matchall, ocelot_port_block
for flower).
But ocelot_port_block just appears to be boilerplate, and doesn't help
with anything in particular at all, it's just useless glue between the
(global!) struct ocelot_acl_block *block pointer, and a per-netdevice
struct ocelot_port_private *priv.
So let's just simplify that, and make struct ocelot_port_private be the
private structure for the block offload. This makes us able to use the
same flow callback as in the case of matchall.
This also reveals that the struct ocelot_acl_block *block is used rather
strangely, as mentioned above: it is defined globally, allocated at
probe time, and freed at unbind time. So just move the structure to the
main ocelot structure, which gives further opportunity for
simplification.
Also get rid of backpointers from struct ocelot_acl_block and struct
ocelot_ace_rule back to struct ocelot, by reworking the function
prototypes, where necessary, to use a more DSA-friendly "struct ocelot
*ocelot, int port" format.
And finally, remove the debugging prints that were added during
development, since they provide no useful information at this point.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Allan W. Nielsen <allan.nielsen@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-02-29 22:31:06 +08:00
|
|
|
int ocelot_setup_tc_cls_flower(struct ocelot_port_private *priv,
|
|
|
|
struct flow_cls_offload *f,
|
|
|
|
bool ingress);
|
2019-05-31 15:16:57 +08:00
|
|
|
|
2020-06-20 23:43:46 +08:00
|
|
|
#endif /* _MSCC_OCELOT_VCAP_H_ */
|