net: dsa: qca8k: add support for mib autocast in Ethernet packet
authorAnsuel Smith <ansuelsmth@gmail.com>
Wed, 2 Feb 2022 00:03:30 +0000 (01:03 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Feb 2022 14:43:59 +0000 (14:43 +0000)
commit5c957c7ca78cce5e4b96866722b0115bd758d945
tree00d8b050ab3a940a4de8c8af31b15403ddfe068c
parent5950c7c0a68c915b336c70f79388626e2d576ab7
net: dsa: qca8k: add support for mib autocast in Ethernet packet

The switch can autocast MIB counter using Ethernet packet.
Add support for this and provide a handler for the tagger.
The switch will send packet with MIB counter for each port, the switch
will use completion API to wait for the correct packet to be received
and will complete the task only when each packet is received.
Although the handler will drop all the other packet, we still have to
consume each MIB packet to complete the request. This is done to prevent
mixed data with concurrent ethtool request.

connect_tag_protocol() is used to add the handler to the tag_qca tagger,
master_state_change() use the MIB lock to make sure no MIB Ethernet is
in progress.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/qca8k.c
drivers/net/dsa/qca8k.h