]> git.baikalelectronics.ru Git - kernel.git/commit
net: bridge: allow enslaving some DSA master network devices
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sun, 10 May 2020 16:37:40 +0000 (19:37 +0300)
committerJakub Kicinski <kuba@kernel.org>
Mon, 11 May 2020 02:52:33 +0000 (19:52 -0700)
commit7aae00a1a92b9182cdb89cd2aca21f49bdced145
tree6b41633b856834a8cc2a05bdfde065475b19f702
parent39fa3a498c234491d15e02b0dbbe8b0f0fbb2614
net: bridge: allow enslaving some DSA master network devices

Commit 88191f655b23 ("net: bridge: reject DSA-enabled master netdevices
as bridge members") added a special check in br_if.c in order to check
for a DSA master network device with a tagging protocol configured. This
was done because back then, such devices, once enslaved in a bridge
would become inoperative and would not pass DSA tagged traffic anymore
due to br_handle_frame returning RX_HANDLER_CONSUMED.

But right now we have valid use cases which do require bridging of DSA
masters. One such example is when the DSA master ports are DSA switch
ports themselves (in a disjoint tree setup). This should be completely
equivalent, functionally speaking, from having multiple DSA switches
hanging off of the ports of a switchdev driver. So we should allow the
enslaving of DSA tagged master network devices.

Instead of the regular br_handle_frame(), install a new function
br_handle_frame_dummy() on these DSA masters, which returns
RX_HANDLER_PASS in order to call into the DSA specific tagging protocol
handlers, and lift the restriction from br_add_if.

Suggested-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Suggested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/dsa.h
net/bridge/br_if.c
net/bridge/br_input.c
net/bridge/br_private.h