]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: tag_ocelot: avoid accessing ds->priv in ocelot_rcv
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sat, 13 Feb 2021 22:37:55 +0000 (00:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Feb 2021 01:31:44 +0000 (17:31 -0800)
commita07235df2906b68a6131e37b21c9c27a312916e2
treebe326935ac205fb770cee1293abdd9ec6336756b
parenta4377c5c9fd46d5d951d9dfb1b1f824ded267845
net: dsa: tag_ocelot: avoid accessing ds->priv in ocelot_rcv

Taggers should be written to do something valid irrespective of the
switch driver that they are attached to. This is even more true now,
because since the introduction of the .change_tag_protocol method, a
certain tagger is not necessarily strictly associated with a driver any
longer, and I would like to be able to test all taggers with dsa_loop in
the future.

In the case of ocelot, it needs to move the classified VLAN from the DSA
tag into the skb if the port is VLAN-aware. We can allow it to do that
by looking at the dp->vlan_filtering property, no need to invoke
structures which are specific to ocelot.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/tag_ocelot.c