diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2021-10-20 20:58:49 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-21 14:14:29 +0300 |
commit | 90e0aa8d108d22cb0dd646083fb3dfcc7a43a018 (patch) | |
tree | d5a7f14bb8ab113813c304a39b67bbaf972bc4bb /drivers/clocksource/timer-imx-gpt.c | |
parent | 62a22bcbd30ed01a0f0331288aa0cca9d9aae23b (diff) | |
download | linux-90e0aa8d108d22cb0dd646083fb3dfcc7a43a018.tar.xz |
net: mscc: ocelot: convert the VLAN masks to a list
First and foremost, the driver currently allocates a constant sized
4K * u32 (16KB memory) array for the VLAN masks. However, a typical
application might not need so many VLANs, so if we dynamically allocate
the memory as needed, we might actually save some space.
Secondly, we'll need to keep more advanced bookkeeping of the VLANs we
have, notably we'll have to check how many untagged and how many tagged
VLANs we have. This will have to stay in a structure, and allocating
another 16 KB array for that is again a bit too much.
So refactor the bridge VLANs in a linked list of structures.
The hook points inside the driver are ocelot_vlan_member_add() and
ocelot_vlan_member_del(), which previously used to operate on the
ocelot->vlan_mask[vid] array element.
ocelot_vlan_member_add() and ocelot_vlan_member_del() used to call
ocelot_vlan_member_set() to commit to the ocelot->vlan_mask.
Additionally, we had two calls to ocelot_vlan_member_set() from outside
those callers, and those were directly from ocelot_vlan_init().
Those calls do not set up bridging service VLANs, instead they:
- clear the VLAN table on reset
- set the port pvid to the value used by this driver for VLAN-unaware
standalone port operation (VID 0)
So now, when we have a structure which represents actual bridge VLANs,
VID 0 doesn't belong in that structure, since it is not part of the
bridging layer.
So delete the middle man, ocelot_vlan_member_set(), and let
ocelot_vlan_init() call directly ocelot_vlant_set_mask() which forgoes
any data structure and writes directly to hardware, which is all that we
need.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/clocksource/timer-imx-gpt.c')
0 files changed, 0 insertions, 0 deletions