u-boot/drivers/net
Claudiu Manoil ff98da0667 sandbox: Add a DSA sandbox driver and unit test
The DSA sandbox driver is used for unit testing the DSA class code.
It implements a simple 2 port switch plus 1 CPU port, and uses a
very simple tag to identify the ports.

The DSA sandbox device is connected via CPU port to a regular Ethernet
sandbox device, called 'dsa-test-eth, managed by the existing eth
sandbox driver.  The 'dsa-test-eth' is not intended for testing the
eth class code however, but it is used to emulate traffic through the
'lan0' and 'lan1' front pannel switch ports.  To achieve this the dsa
sandbox driver registers a tx handler for the 'dsa-test-eth' device.
The switch ports, labeled as 'lan0' and 'lan1', are also registered
as eth devices by the dsa class code this time.  So pinging through
these switch ports is as easy as:

=> setenv ethact lan0
=> ping 1.2.3.5

Unit tests for the dsa class code were also added.  The 'dsa_probe'
test exercises most API functions from dsa.h.  The 'dsa' unit test
simply exercises ARP/ICMP traffic through the two switch ports,
including tag injection and extraction, with the help of the dsa
sandbox driver.

I took care to minimize the impact on the existing eth unit tests,
though some adjustments needed to be made with the addition of
extra eth interfaces used by the dsa unit tests. The additional eth
interfaces also require MAC addresses, these have been added to the
sandbox default environment.

Signed-off-by: Alex Marginean <alexandru.marginean@nxp.com>
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Message-Id: <20210216224804.3355044-5-olteanv@gmail.com>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
2021-04-15 14:22:17 +05:30
..
fm ppc: Remove Cyrus_P5020 and P5040 boards 2021-04-10 08:05:07 -04:00
fsl-mc image: Adjust the workings of fit_check_format() 2021-02-15 22:31:52 -05:00
ldpaa_eth common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
mscc_eswitch drivers: net: Add Felix DSA switch driver 2021-02-16 12:38:36 -05:00
octeontx common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
octeontx2 dm: Avoid accessing seq directly 2020-12-18 20:32:21 -07:00
pfe_eth image: Adjust the workings of fit_check_format() 2021-02-15 22:31:52 -05:00
phy net: phy: fixed: Support the old DT binding 2021-04-15 14:22:17 +05:30
qe uec.h: fix COFIG_DM typo 2021-02-21 18:46:41 -05:00
ti common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
8390.h drivers/net : move net drivers to drivers/net 2007-11-25 18:35:17 +01:00
ag7xxx.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
altera_tse.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
altera_tse.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
armada100_fec.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
armada100_fec.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
at91_emac.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
ax88180.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
ax88180.h AX88180: use standard I/O accessors 2010-07-12 00:14:29 -07:00
bcm-sf2-eth-gmac.c common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
bcm-sf2-eth-gmac.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bcm-sf2-eth.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
bcm-sf2-eth.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bcm6348-eth.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
bcm6368-eth.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
bcmgenet.c dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
calxedaxgmac.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
cortina_ni.c net: cortina_ni: buffer overrun 2021-02-24 16:51:49 -05:00
cortina_ni.h net: cortina_ni: Add eth support for Cortina Access CAxxxx SoCs 2021-01-27 10:47:44 -05:00
cs8900.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
cs8900.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
dc2114x.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
designware.c net: designware: remove amlogic compatibles 2021-04-06 11:10:29 +02:00
designware.h dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
dm9000x.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
dm9000x.h dm9000 remove dead external phy support, gpio fix 2008-08-26 23:08:19 -07:00
dnet.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
dnet.h dnet: driver for Dave DNET ethernet controller 2009-02-10 00:16:27 +01:00
dsa_sandbox.c sandbox: Add a DSA sandbox driver and unit test 2021-04-15 14:22:17 +05:30
dwc_eth_qos.c net: eqos: Reduce the MDIO wait time 2021-02-08 14:01:15 +05:30
dwmac_meson8b.c net: designware: add Amlogic Meson8b & later glue driver 2021-04-06 11:10:29 +02:00
dwmac_s700.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
dwmac_socfpga.c net: designware: socfpga: Add ATF support for MAC driver 2021-01-15 17:48:37 +08:00
e1000.c net: e1000: Add missing address translations 2021-01-27 08:25:31 -05:00
e1000.h net: e1000: add defaults for i210 TX/RX PBSIZE 2020-10-14 11:16:34 -04:00
e1000_spi.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
eepro100.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
ep93xx_eth.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
ep93xx_eth.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
eth-phy-uclass.c dm: Use access methods for dev/uclass private data 2021-01-05 12:24:40 -07:00
ethoc.c dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
fec_mxc.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
fec_mxc.h treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
fsl_enetc.c dm: core: Access device ofnode through functions 2021-01-05 12:24:41 -07:00
fsl_enetc.h drivers: net: Add Felix DSA switch driver 2021-02-16 12:38:36 -05:00
fsl_enetc_mdio.c dm: core: Access device ofnode through functions 2021-01-05 12:24:41 -07:00
fsl_ls_mdio.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
fsl_mcdmafec.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
fsl_mdio.c dm: treewide: Rename 'platdata' variables to just 'plat' 2020-12-13 16:51:08 -07:00
ftgmac100.c net: ftgmac100: Read and retain MAC address 2021-01-19 09:15:02 -05:00
ftgmac100.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
ftmac100.c Merge branch '2021-02-02-drop-asm_global_data-when-unused' 2021-02-15 10:16:45 -05:00
ftmac100.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
ftmac110.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
ftmac110.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
gmac_rockchip.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
higmacv300.c dm: Avoid accessing seq directly 2020-12-18 20:32:21 -07:00
Kconfig sandbox: Add a DSA sandbox driver and unit test 2021-04-15 14:22:17 +05:30
ks8851_mll.c net: ks8851: Reset internal RXFC count on bad packet 2021-01-19 09:15:02 -05:00
ks8851_mll.h net: ks8851_mll: add ethernet support 2013-06-24 19:11:14 -05:00
lan91c96.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
lan91c96.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
lpc32xx_eth.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
macb.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
macb.h net: macb: Add DMA 64-bit address support for macb 2021-01-18 11:06:38 +08:00
Makefile sandbox: Add a DSA sandbox driver and unit test 2021-04-15 14:22:17 +05:30
mcffec.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
mcfmii.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
mdio-ipq4019.c dm: core: Access device ofnode through functions 2021-01-05 12:24:41 -07:00
mdio_mux_i2creg.c dm: core: Access device ofnode through functions 2021-01-05 12:24:41 -07:00
mdio_mux_meson_g12a.c net: add Amlogic Meson G12A MDIO MUX driver 2021-04-06 11:10:29 +02:00
mdio_mux_mmioreg.c net: add MMIO Register MDIO MUX driver 2021-04-06 11:10:29 +02:00
mdio_mux_sandbox.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
mdio_sandbox.c dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
mpc8xx_fec.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
mt7620-eth.c net: add ethernet driver for MediaTek MT7620 SoC 2021-01-24 21:39:27 +01:00
mt7628-eth.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
mtk_eth.c dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
mtk_eth.h eth: mtk-eth: enable mt7629 sgmii mode support in mediatek eth driver 2020-07-28 22:44:00 -04:00
mvgbe.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
mvgbe.h net: mvgbe: convert to DM 2018-07-26 14:08:21 -05:00
mvmdio.c dm: core: Access device ofnode through functions 2021-01-05 12:24:41 -07:00
mvneta.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
mvpp2.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
natsemi.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
ne2000.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
ne2000.h NE2000: Fix regresssion introduced by e710185aae on non AX88796 2008-04-28 22:26:36 -07:00
ne2000_base.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
ne2000_base.h common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
netconsole.c common: Drop log.h from common header 2020-05-18 21:19:18 -04:00
ns8382x.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
pch_gbe.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
pch_gbe.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
pcnet.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
pic32_eth.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
pic32_eth.h common: Drop linux/bitops.h from common header 2020-05-18 21:19:23 -04:00
pic32_mdio.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
ravb.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
rtl8139.c dm: treewide: Rename dev_get_platdata() to dev_get_plat() 2020-12-13 16:51:09 -07:00
rtl8169.c dm: treewide: Rename ..._platdata variables to just ..._plat 2020-12-13 16:51:09 -07:00
sandbox-raw-bus.c dm: core: Create a new header file for 'compat' features 2020-02-05 19:33:46 -07:00
sandbox-raw.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
sandbox.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
sh_eth.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
sh_eth.h sh: Remove sh7757lcr board 2021-02-15 10:16:24 -05:00
smc911x.c dm: treewide: Rename ofdata_to_platdata() to of_to_plat() 2020-12-13 16:51:09 -07:00
smc911x.h common: Drop net.h from common header 2020-05-18 17:33:31 -04:00
smc91111.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
smc91111.h common: Drop net.h from common header 2020-05-18 17:33:31 -04:00
sni_ave.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
sun8i_emac.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
sunxi_emac.c dm: Use access methods for dev/uclass private data 2021-01-05 12:24:40 -07:00
tsec.c net: tsec: Use dm_eth_phy_connect() directly for the DM case 2021-04-15 14:22:17 +05:30
uli526x.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
vsc7385.c common: Drop linux/delay.h from common header 2020-05-18 21:19:23 -04:00
vsc9953.c treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
xilinx_axi_emac.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
xilinx_emaclite.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
zynq_gem.c net: gem: Fix setting PCS auto-negotiation state 2021-03-30 09:18:47 +02:00