diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2020-02-29 16:31:06 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-03 18:57:29 -0800 |
commit | a56d7a345dd67995ba415a26a0164a72780f2d02 (patch) | |
tree | 5e954faeeafdfaf82fae3b71d2e43d6e9bb743f6 /include/soc | |
parent | 29e59fd4fb488cdafde587c2dca6e8fc4123b6e8 (diff) | |
download | linux-a56d7a345dd67995ba415a26a0164a72780f2d02.tar.bz2 |
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>
Diffstat (limited to 'include/soc')
-rw-r--r-- | include/soc/mscc/ocelot.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index 068f96b1a83e..74e7c63adad4 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -406,6 +406,11 @@ struct ocelot_ops { int (*reset)(struct ocelot *ocelot); }; +struct ocelot_acl_block { + struct list_head rules; + int count; +}; + struct ocelot_port { struct ocelot *ocelot; @@ -455,6 +460,8 @@ struct ocelot { struct list_head multicast; + struct ocelot_acl_block acl_block; + /* Workqueue to check statistics for overflow with its lock */ struct mutex stats_lock; u64 *stats; |