OpenCloudOS-Kernel/drivers/net/ethernet/ti
Vladimir Oltean b0e8181762 net: build all switchdev drivers as modules when the bridge is a module
Currently, all drivers depend on the bool CONFIG_NET_SWITCHDEV, but only
the drivers that call some sort of function exported by the bridge, like
br_vlan_enabled() or whatever, have an extra dependency on CONFIG_BRIDGE.

Since the blamed commit, all switchdev drivers have a functional
dependency upon switchdev_bridge_port_{,un}offload(), which is a pair of
functions exported by the bridge module and not by the bridge-independent
part of CONFIG_NET_SWITCHDEV.

Problems appear when we have:

CONFIG_BRIDGE=m
CONFIG_NET_SWITCHDEV=y
CONFIG_TI_CPSW_SWITCHDEV=y

because cpsw, am65_cpsw and sparx5 will then be built-in but they will
call a symbol exported by a loadable module. This is not possible and
will result in the following build error:

drivers/net/ethernet/ti/cpsw_new.o: in function `cpsw_netdevice_event':
drivers/net/ethernet/ti/cpsw_new.c:1520: undefined reference to
					`switchdev_bridge_port_offload'
drivers/net/ethernet/ti/cpsw_new.c:1537: undefined reference to
					`switchdev_bridge_port_unoffload'

As mentioned, the other switchdev drivers don't suffer from this because
switchdev_bridge_port_offload() is not the first symbol exported by the
bridge that they are calling, so they already needed to deal with this
in the same way.

Fixes: 2f5dc00f7a ("net: bridge: switchdev: let drivers inform which bridge ports are offloaded")
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-27 11:12:57 +01:00
..
Kconfig net: build all switchdev drivers as modules when the bridge is a module 2021-07-27 11:12:57 +01:00
Makefile net: ti: am65-cpsw-nuss: Add switchdev support 2021-02-11 17:52:13 -08:00
am65-cpsw-ethtool.c net: ethernet: ti: ale: add cpsw_ale_get_num_entries api 2020-09-11 17:34:39 -07:00
am65-cpsw-nuss.c net: bridge: switchdev: allow the TX data plane forwarding to be offloaded 2021-07-23 16:32:37 +01:00
am65-cpsw-nuss.h net: ti: am65-cpsw-nuss: Add netdevice notifiers 2021-02-11 17:52:13 -08:00
am65-cpsw-qos.c net: ethernet: ti: am65-cpsw-qos: Demote non-conformant function header 2021-01-16 18:13:10 -08:00
am65-cpsw-qos.h ethernet: ti: am65-cpsw-qos: add TAPRIO offload support 2020-05-14 17:33:30 -07:00
am65-cpsw-switchdev.c net: switchdev: add a context void pointer to struct switchdev_notifier_info 2021-06-28 14:09:03 -07:00
am65-cpsw-switchdev.h net: ti: am65-cpsw-nuss: Add switchdev support 2021-02-11 17:52:13 -08:00
am65-cpts.c net: ethernet: ti: am65-cpts: Use devm_platform_ioremap_resource_byname() 2021-06-09 15:24:43 -07:00
am65-cpts.h ethernet: ti: am65-cpts: Add missing inline qualifier to stub functions 2020-05-15 16:32:27 -07:00
cpmac.c net: cpmac: Fix use correct return type for ndo_start_xmit() 2020-05-06 14:24:06 -07:00
cpsw-common.c
cpsw-phy-sel.c net: ethernet: ti: cpsw-phy-sel: Use devm_platform_ioremap_resource_byname() 2021-06-09 15:27:55 -07:00
cpsw.c net: ti: add pp skb recycling support 2021-06-15 11:50:43 -07:00
cpsw.h
cpsw_ale.c net: ti: Fix wrong struct name in comments 2021-05-17 14:12:39 -07:00
cpsw_ale.h net: ethernet: ti: cpsw_ale: add cpsw_ale_vlan_del_modify() 2020-11-02 16:41:07 -08:00
cpsw_ethtool.c net: ethernet: ti: cpsw: disable PTPv1 hw timestamping advertisement 2020-11-02 14:17:51 -08:00
cpsw_new.c net: bridge: switchdev: allow the TX data plane forwarding to be offloaded 2021-07-23 16:32:37 +01:00
cpsw_priv.c ti: Remove rcu_read_lock() around XDP program invocation 2021-06-24 19:46:39 +02:00
cpsw_priv.h net: ethernet: ti: fix netdevice stats for XDP 2021-02-06 10:48:27 -08:00
cpsw_sl.c
cpsw_sl.h
cpsw_switchdev.c net: switchdev: add a context void pointer to struct switchdev_notifier_info 2021-06-28 14:09:03 -07:00
cpsw_switchdev.h net: ethernet: ti: introduce cpsw switchdev based driver part 2 - switch 2019-11-20 11:25:24 -08:00
cpts.c net: ethernet: ti: cpts: fix ethtool output when no ptp_clock registered 2020-12-28 13:32:34 -08:00
cpts.h net: ethernet: ti: cpts: add support for HW_TS_PUSH events 2020-04-23 12:50:21 -07:00
davinci_cpdma.c drivers/net/ethernet: clean up mis-targeted comments 2020-09-25 16:29:00 -07:00
davinci_cpdma.h
davinci_emac.c net: davinci_emac: Use devm_platform_get_and_ioremap_resource() 2021-06-10 13:02:01 -07:00
davinci_mdio.c drivers: net: davinci_mdio: Use of_device_get_match_data() 2021-01-26 12:17:31 -06:00
k3-cppi-desc-pool.c net: ethernet: ti: fix return value check in k3_cppi_desc_pool_create_name() 2020-04-27 13:27:59 -07:00
k3-cppi-desc-pool.h net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver 2020-03-26 20:01:14 -07:00
netcp.h
netcp_core.c net: netcp: Fix an error message 2021-05-10 14:22:08 -07:00
netcp_ethss.c net: netcp: ethss: use dev_id for ale configuration 2020-09-11 17:34:39 -07:00
netcp_sgmii.c
netcp_xgbepcsr.c
tlan.c net: ti: fix UAF in tlan_remove_one 2021-07-09 11:01:01 -07:00
tlan.h