你们好!我现在在K2E开发板上跑K2_STK_DSP里的GE例程,2-8口我均设置为GE_PORT_NOT_USED,1口设置为ETHERNET_AUTO_NEGOTIAT_SLAVE, GE_PORT_CABLE_CONNECT, ETHERNET_LOOPBACK_DISABLE
DSP往PC发送数据包,我修改了Fill_EMAC_header里的Source_MAC_address和Dest_MAC_address,把88:88:88:00:00:01修改成88:88:88:00:05:55,把88:88:88:00:01:01修改成88:88:88:00:03:33,在PC上用wireshark抓取能成功抓到,如下图所示:
但PC往DSP发送数据包时,我是用xcap软件建立一个数据包发送的,但是只有数据包源MAC地址为88:88:88:00:00:01,目的MAC地址为88:88:88:00:01:01时,DSP才能收到,下列几张图阐述上述情况:
首先是xcap软件建立数据包的图:
建立了两种数据包,第一种数据包(第一行)源MAC地址为88:88:88:00:00:01,目的MAC地址为88:88:88:00:01:01,第二种数据包(第二、三、四行)修改了MAC地址
当发送第一种数据包时,程序打印信息如下所示:
SGMII0 Link Partner Advertised Ability 1000Mbps Full Duplex
SGMII0 Link Partner Advertised Ability 1000Mbps Full Duplex
CPSW_port0.RxGoodFrames =1
CPSW_port0.RxOctets =8210
CPSW_port0.TxGoodFrames =71
CPSW_port0.TxBCastFrames =15
CPSW_port0.TxMCastFrames =14
CPSW_port0.TxOctets =7981
CPSW_port0.Frame64 =13
CPSW_port0.Frame65t127 =54
CPSW_port0.Frame128t255 =4
CPSW_port0.Frame1024tUp =1
CPSW_port0.NetOctets =16191
CPSW_port1.RxGoodFrames =71
CPSW_port1.RxBCastFrames =15
CPSW_port1.RxMCastFrames =14
CPSW_port1.RxOctets =7981
CPSW_port1.TxGoodFrames =1
CPSW_port1.TxOctets =8210
CPSW_port1.Frame64 =13
CPSW_port1.Frame65t127 =54
CPSW_port1.Frame128t255 =4
CPSW_port1.Frame1024tUp =1
CPSW_port1.NetOctets =16191
MDIO LINK flag: 0x00000001
Last external packect from port 0: 96 bytes (last byte=0x11), packet type = 0x0800, from srouce address 0xa41f72745be8 to destination address 0xffffffffffff
Ethernet port 0 TX 1 packets x 8192 bytes, RX 68 packets.
从加粗及下划线部分可以看出:第一种数据包到达P1口后全数传到了P0口,进而传进DSP核
但是当发送第二种数据包时,程序打印信息如下所示:
SGMII0 Link Partner Advertised Ability 1000Mbps Full Duplex
SGMII0 Link Partner Advertised Ability 1000Mbps Full Duplex
CPSW_port0.RxGoodFrames =1
CPSW_port0.RxOctets =146
CPSW_port0.TxGoodFrames =27
CPSW_port0.TxBCastFrames =13
CPSW_port0.TxMCastFrames =14
CPSW_port0.TxOctets =2443
CPSW_port0.Frame64 =13
CPSW_port0.Frame65t127 =10
CPSW_port0.Frame128t255 =5
CPSW_port0.NetOctets =2589
CPSW_port1.RxGoodFrames =69
CPSW_port1.RxBCastFrames =13
CPSW_port1.RxMCastFrames =14
CPSW_port1.RxOctets =7735
CPSW_port1.TxGoodFrames =1
CPSW_port1.TxOctets =146
CPSW_port1.Frame64 =13
CPSW_port1.Frame65t127 =52
CPSW_port1.Frame128t255 =5
CPSW_port1.NetOctets =7881
MDIO ALIVE flag: 0x00000003
MDIO LINK flag: 0x00000001
Last external packect from port 0: 46 bytes (last byte=0x0), packet type = 0x0806, from srouce address 0xa41f72745be8 to destination address 0xffffffffffff
Ethernet port 0 TX 1 packets x 128 bytes, RX 26 packets.
从加粗及下划线部分可以看出:第二种数据包到达P1口后就全部被丢弃了,只有系统自发的多播包和广播包到达P0口
这说明只有发送给DSP的数据包MAC地址符合P0、P1口的MAC地址时才能被传输进DSP内部,但是DSP发送数据包到PC时数据包的MAC地址并不符合P0、P1口的MAC地址也成功传输出去了,我想请问该怎么设置才能使得DSP能接收到不符合P0、P1口MAC地址的数据包呢?
Guangde Wu:
回复 Thomas Yang1:
就是ALE BYPASS问题,我之前no_loopback模式以为ALE模式设置为BYPASS了,结果仔细一看是“!=”,多了个叹号。。。谢谢你!