]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: refactor ocelot_xtr_irq_handler into ocelot_xtr_poll
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sat, 13 Feb 2021 22:37:59 +0000 (00:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Feb 2021 01:31:44 +0000 (17:31 -0800)
commitc9c52f1c25cf49831aa97e368a96fc74e3405e66
tree1fa5e0019b7f30c28f137830dc7f75cfc2a1dde9
parent0ed19e4b67359e689e01f45351844a8a7d9051f7
net: mscc: ocelot: refactor ocelot_xtr_irq_handler into ocelot_xtr_poll

Since the felix DSA driver will need to poll the CPU port module for
extracted frames as well, let's create some common functions that read
an Extraction Frame Header, and then an skb, from a CPU extraction
group.

We abuse the struct ocelot_ops :: port_to_netdev function a little bit,
in order to retrieve the DSA port net_device or the ocelot switchdev
net_device based on the source port information from the Extraction
Frame Header, but it's all in the benefit of code simplification -
netdev_alloc_skb needs it. Originally, the port_to_netdev method was
intended for parsing act->dev from tc flower offload code.

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>
drivers/net/ethernet/mscc/ocelot.c
drivers/net/ethernet/mscc/ocelot_vsc7514.c
include/soc/mscc/ocelot.h