]> git.baikalelectronics.ru Git - kernel.git/commit
net: ethernet: ti: introduce cpsw switchdev based driver part 2 - switch
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Tue, 19 Nov 2019 22:19:20 +0000 (00:19 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Nov 2019 19:25:24 +0000 (11:25 -0800)
commit187e91cc4b8c25ab1377818a4b3582b6ac01a715
treec6895ed06681bb2286bdf4c5938206d7171ba394
parentbaf8efc03bda5e8216d8be54f88312d3f1aadb3b
net: ethernet: ti: introduce cpsw switchdev based driver part 2 - switch

CPSW switchdev based driver which is operating in dual-emac mode by
default, thus working as 2 individual network interfaces. The Switch mode
can be enabled by configuring devlink driver parameter "switch_mode" to 1:

devlink dev param set platform/48484000.switch \
name switch_mode value 1 cmode runtime

This can be done regardless of the state of Port's netdevs - UP/DOWN, but
Port's netdev devices have to be UP before joining the bridge to avoid
overwriting of bridge configuration as CPSW switch driver completely
reloads its configuration when first Port changes its state to UP.
When the both interfaces joined the bridge - CPSW switch driver will start
marking packets with offload_fwd_mark flag unless "ale_bypass=0".

All configuration is implemented via switchdev API and notifiers.
Supported:
 - SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS
 - SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS: BR_MCAST_FLOOD
 - SWITCHDEV_ATTR_ID_PORT_STP_STATE
 - SWITCHDEV_OBJ_ID_PORT_VLAN
 - SWITCHDEV_OBJ_ID_PORT_MDB
 - SWITCHDEV_OBJ_ID_HOST_MDB

Hence CPSW switchdev driver supports:
- FDB offloading
- MDB offloading
- VLAN filtering and offloading
- STP

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/Makefile
drivers/net/ethernet/ti/cpsw_new.c
drivers/net/ethernet/ti/cpsw_priv.h
drivers/net/ethernet/ti/cpsw_switchdev.c [new file with mode: 0644]
drivers/net/ethernet/ti/cpsw_switchdev.h [new file with mode: 0644]