ltp-ddt eth_switch_config学习

# @name ALE Table test using SWITCH-CONFIG
# @desc Checks default entries in ALE table and verifies addition and deletion of multicast entries.
# @requires net
 
ETHSWITCH_XS_FUNC_DUMP_UNICAST source 'common.sh'; dual_mac=`find /proc/device-tree/ -name dual_emac`; if [[ ! -z "$dual_mac" ]]; then die "This is a dual mac case, use a different dtb to test switch mode"; fi; iface=`get_eth_iface_name.sh` || die "error getting eth interface name"; mac_address=`cat /sys/class/net/$iface/address`; if [ -z "`switch-config -d|grep -i ucast| grep $mac_address`" ]; then die "TEST has failed since there is no unicast entry with the mac address of ethernet interface in ALE table."; fi
 
执行过程中会报找不到switch-config命令的错误
 
在网上查了很久,顺藤摸瓜找到了
ALE和CPSW相关
 
 

TI Common Platform Ethernet Switch (CPSW) is a three port switch (one CPU port and two external ports). The CPSW or Ethernet Switch driver follows the standard Linux network interface architecture.

The driver supports the following features:

  1. 10/100/1000 Mbps mode of operation.
  2. Auto negotiation.
  3. Linux NAPI support
  4. Switch Support
  5. VLAN (Subscription common for all ports)
  6. Ethertool (Supports only Slave 0 decided in cpsw DT node)
  7. Dual Standalone EMAC mode
下图并不怎么懂,但是可以看到ALE和CPSW

Dual Standalone EMAC mode

Block Diagram for Dual EMAC Implementation
 
ALE:address lookup engine 地址查询引擎,是TI创造的一种对于双网卡选择的方式:
TI对于网卡设备的通用管理是CPSW方式,分为host和slave
参考:

https://blog.csdn.net/tinylaker/article/details/80564614

psoc:
# ethtool -i eth0
driver: st_gmac
如果有cpsw
# ethtool -i eth0

driver: cpsw

原文地址:https://www.cnblogs.com/idyllcheung/p/10824540.html