This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

am335x +DP83848 + DP83867

Other Parts Discussed in Thread: DP83848C, AM3356

项目中使用am335x 的cpsw连接一路百兆网口和一路千兆网口,芯片分别是DP83848(eth0)和DP83867(eth1),百兆网口能够正常工作,千兆网口能够link up,但是无法ping通,设备树配置如下:

&mac {

pinctrl-names = "default", "sleep";

pinctrl-0 = <&cpsw_default>;
pinctrl-1 = <&cpsw_sleep>;
status = "okay";
dual_emac = <1>;
};

&davinci_mdio {
pinctrl-names = "default", "sleep";
pinctrl-0 = <&davinci_mdio_default>;
pinctrl-1 = <&davinci_mdio_sleep>;
status = "okay";
dp83867_0: ethernet-phy@3 {
reg = <3>;
ti,rx-internal-delay = <DP83867_RGMIIDCTL_1_75_NS>;
ti,tx-internal-delay = <DP83867_RGMIIDCTL_1_75_NS>;
ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
ti,min-output-impedance;
ti,dp83867-rxctrl-strap-quirk;
};

dp83848_0: ethernet-phy@7 {
reg = <7>;
};
};

&cpsw_emac0 {
phy_id = <&davinci_mdio>, <7>;
dual_emac_res_vlan = <1>;
phy-mode = "rmii";
};

&cpsw_emac1 {
phy_id = <&davinci_mdio>, <3>;
dual_emac_res_vlan = <2>;
phy-mode = "rgmii-id";
};

内核log如下

Configuring network interfaces...

[ 10.518385] net eth0: initializing cpsw version 1.12 (0)
[ 10.687456] NS DP83848C 10/100 Mbps PHY 4a101000.mdio:07: attached PHY driver [NS DP83848C 10/100 Mbps PHY] (mii_bus:phy_addr=4a101000.mdio:07, irq=POLL)
[ 10.701969] PHY_INTERFACE_MODE_RMII
[ 10.705494] gmii_sel:reg=0xe9
[ 10.718883] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 10.724805] 8021q: adding VLAN 0 to HW filter on device eth0
[ 10.773229] net eth1: initializing cpsw version 1.12 (0)
[ 10.789765] TI DP83867 4a101000.mdio:03: attached PHY driver [TI DP83867] (mii_bus:phy_addr=4a101000.mdio:03, irq=POLL)
[ 10.801731] AM33XX_GMII_SEL_MODE_RGMII
[ 10.805508] gmii_sel:reg=0xe9
[ 10.813426] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[ 10.819411] 8021q: adding VLAN 0 to HW filter on device eth1

[ 12.888081] _cpsw_adjust_link:mac_control=0x20
[ 12.892601] cpsw 4a100000.ethernet eth1: Link is Up - 100Mbps/Full - flow control rx/tx
[ 12.901400] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
其中 gmii_sel为0xe9,根据数据手册寄存器,gmii_sel配置没有问题,千兆网口插入和拔出网口会正常link up和link down,但是无法ping通,请TI的各位帮忙指导下

  • 请完成这个链接的checklist并且将结果贴出来。
    processors.wiki.ti.com/.../5x_CPSW
  • 回复 Nancy Wang:

    root@am335x-evm:~# ./ethtool -S eth1
    NIC statistics:
    Good Rx Frames: 38565
    Broadcast Rx Frames: 9091
    Multicast Rx Frames: 19520
    Pause Rx Frames: 0
    Rx CRC Errors: 0
    Rx Align/Code Errors: 0
    Oversize Rx Frames: 0
    Rx Jabbers: 0
    Undersize (Short) Rx Frames: 0
    Rx Fragments: 0
    Rx Octets: 8405990
    Good Tx Frames: 9970
    Broadcast Tx Frames: 4
    Multicast Tx Frames: 26
    Pause Tx Frames: 0
    Deferred Tx Frames: 0
    Collisions: 0
    Single Collision Tx Frames: 0
    Multiple Collision Tx Frames: 0
    Excessive Collisions: 0
    Late Collisions: 0
    Tx Underrun: 0
    Carrier Sense Errors: 0
    Tx Octets: 680480
    Rx + Tx 64 Octet Frames: 7600
    Rx + Tx 65-127 Octet Frames: 28925
    Rx + Tx 128-255 Octet Frames: 1268
    Rx + Tx 256-511 Octet Frames: 558
    Rx + Tx 512-1023 Octet Frames: 10127
    Rx + Tx 1024-Up Octet Frames: 57
    Net Octets: 9086470
    Rx Start of Frame Overruns: 0
    Rx Middle of Frame Overruns: 0
    Rx DMA Overruns: 0
    Rx DMA chan 0: head_enqueue: 1
    Rx DMA chan 0: tail_enqueue: 19170
    Rx DMA chan 0: pad_enqueue: 0
    Rx DMA chan 0: misqueued: 0
    Rx DMA chan 0: desc_alloc_fail: 0
    Rx DMA chan 0: pad_alloc_fail: 0
    Rx DMA chan 0: runt_receive_buf: 0
    Rx DMA chan 0: runt_transmit_bu: 0
    Rx DMA chan 0: empty_dequeue: 0
    Rx DMA chan 0: busy_dequeue: 18603
    Rx DMA chan 0: good_dequeue: 19043
    Rx DMA chan 0: requeue: 0
    Rx DMA chan 0: teardown_dequeue: 0
    Tx DMA chan 0: head_enqueue: 9970
    Tx DMA chan 0: tail_enqueue: 0
    Tx DMA chan 0: pad_enqueue: 0
    Tx DMA chan 0: misqueued: 0
    Tx DMA chan 0: desc_alloc_fail: 0
    Tx DMA chan 0: pad_alloc_fail: 0
    Tx DMA chan 0: runt_receive_buf: 0
    Tx DMA chan 0: runt_transmit_bu: 9911
    Tx DMA chan 0: empty_dequeue: 9970
    Tx DMA chan 0: busy_dequeue: 0
    Tx DMA chan 0: good_dequeue: 9970
    Tx DMA chan 0: requeue: 0
    Tx DMA chan 0: teardown_dequeue: 0

    root@am335x-evm:~# ./ethtool eth1
    Settings for eth1:
    Supported ports: [ TP MII ]
    Supported link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    1000baseT/Half 1000baseT/Full
    Supported pause frame use: Symmetric Receive-only
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    1000baseT/Half 1000baseT/Full
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Link partner advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Link partner advertised pause frame use: Symmetric Receive-only
    Link partner advertised auto-negotiation: Yes
    Link partner advertised FEC modes: Not reported
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 3
    Transceiver: internal
    Auto-negotiation: on
    Supports Wake-on: d
    Wake-on: d
    Current message level: 0x00000000 (0)
    Link detected: yes
    上面是ethtools -S eth1 和ethtools eth1 命令的状态显示,麻烦帮忙指导下
  • 这个帖子已经参考过了,但是还是没有解决我的问题
  • root@am335x-evm:~# ifconfig eth1
    eth1 Link encap:Ethernet HWaddr 50:8C:B1:DF:90:FA
    inet addr:192.168.1.1 Bcast:0.0.0.0 Mask:255.255.255.0
    inet6 addr: fe80::528c:b1ff:fedf:90fa/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:1256 (1.2 KiB)

    root@am335x-evm:~# uname -a
    Linux am335x-evm 4.14.40+ #172 PREEMPT Wed Jul 31 11:40:05 CST 2019 armv7l GNU/Linux

    pdk版本是ti-processor-sdk-linux-am335x-evm-05.00.00.15
  • Nancy:
    您那边还有什么其他办法吗?
  • 能否提供相应的eth0的输出进行比较?

  • eth0未接网线时候的状态:
    ./ethtool eth0
    Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Supported pause frame use: Symmetric Receive-only
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Speed: 10Mb/s
    Duplex: Half
    Port: MII
    PHYAD: 7
    Transceiver: internal
    Auto-negotiation: on
    Supports Wake-on: d
    Wake-on: d
    Current message level: 0x00000000 (0)
    Link detected: no

    ./ethtool -S eth0
    NIC statistics:
    Good Rx Frames: 0
    Broadcast Rx Frames: 0
    Multicast Rx Frames: 0
    Pause Rx Frames: 0
    Rx CRC Errors: 0
    Rx Align/Code Errors: 0
    Oversize Rx Frames: 0
    Rx Jabbers: 0
    Undersize (Short) Rx Frames: 0
    Rx Fragments: 0
    Rx Octets: 0
    Good Tx Frames: 12
    Broadcast Tx Frames: 0
    Multicast Tx Frames: 12
    Pause Tx Frames: 0
    Deferred Tx Frames: 0
    Collisions: 0
    Single Collision Tx Frames: 0
    Multiple Collision Tx Frames: 0
    Excessive Collisions: 0
    Late Collisions: 0
    Tx Underrun: 0
    Carrier Sense Errors: 0
    Tx Octets: 984
    Rx + Tx 64 Octet Frames: 0
    Rx + Tx 65-127 Octet Frames: 12
    Rx + Tx 128-255 Octet Frames: 0
    Rx + Tx 256-511 Octet Frames: 0
    Rx + Tx 512-1023 Octet Frames: 0
    Rx + Tx 1024-Up Octet Frames: 0
    Net Octets: 984
    Rx Start of Frame Overruns: 0
    Rx Middle of Frame Overruns: 0
    Rx DMA Overruns: 0
    Rx DMA chan 0: head_enqueue: 1
    Rx DMA chan 0: tail_enqueue: 127
    Rx DMA chan 0: pad_enqueue: 0
    Rx DMA chan 0: misqueued: 0
    Rx DMA chan 0: desc_alloc_fail: 0
    Rx DMA chan 0: pad_alloc_fail: 0
    Rx DMA chan 0: runt_receive_buf: 0
    Rx DMA chan 0: runt_transmit_bu: 0
    Rx DMA chan 0: empty_dequeue: 0
    Rx DMA chan 0: busy_dequeue: 0
    Rx DMA chan 0: good_dequeue: 0
    Rx DMA chan 0: requeue: 0
    Rx DMA chan 0: teardown_dequeue: 0
    Tx DMA chan 0: head_enqueue: 12
    Tx DMA chan 0: tail_enqueue: 0
    Tx DMA chan 0: pad_enqueue: 0
    Tx DMA chan 0: misqueued: 0
    Tx DMA chan 0: desc_alloc_fail: 0
    Tx DMA chan 0: pad_alloc_fail: 0
    Tx DMA chan 0: runt_receive_buf: 0
    Tx DMA chan 0: runt_transmit_bu: 0
    Tx DMA chan 0: empty_dequeue: 12
    Tx DMA chan 0: busy_dequeue: 0
    Tx DMA chan 0: good_dequeue: 12
    Tx DMA chan 0: requeue: 0
    Tx DMA chan 0: teardown_dequeue: 0

    ifconfig eth0
    eth0 Link encap:Ethernet HWaddr 50:8C:B1:DF:90:F8
    inet6 addr: fe80::528c:b1ff:fedf:90f8/64 Scope:Link
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:41 errors:0 dropped:4 overruns:0 frame:0
    TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:3195 (3.1 KiB) TX bytes:516 (516.0 B)
    Interrupt:47
  • 千兆网口兼容百兆的网线么
  • 从目前获得的信息来看没有看出来什么原因导致的,你是否有用抓包工具去获取eth1的数据包看一下或者有什么错误出现吗?
    另外能不能麻烦贴出eth0连接网线的输出状态?
  • eth0处于连接状态下的数据
    ./ethtool eth0
    Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Supported pause frame use: Symmetric Receive-only
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Advertised pause frame use: No
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Link partner advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Link partner advertised pause frame use: Symmetric Receive-only
    Link partner advertised auto-negotiation: Yes
    Link partner advertised FEC modes: Not reported
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 7
    Transceiver: internal
    Auto-negotiation: on
    Supports Wake-on: d
    Wake-on: d
    Current message level: 0x00000000 (0)

    Link detected: yes

    ./ethtool -S eth0
    NIC statistics:
    Good Rx Frames: 52241
    Broadcast Rx Frames: 24348
    Multicast Rx Frames: 27287
    Pause Rx Frames: 0
    Rx CRC Errors: 0
    Rx Align/Code Errors: 0
    Oversize Rx Frames: 0
    Rx Jabbers: 0
    Undersize (Short) Rx Frames: 0
    Rx Fragments: 0
    Rx Octets: 6244828
    Good Tx Frames: 504082
    Broadcast Tx Frames: 4
    Multicast Tx Frames: 15
    Pause Tx Frames: 0
    Deferred Tx Frames: 0
    Collisions: 0
    Single Collision Tx Frames: 0
    Multiple Collision Tx Frames: 0
    Excessive Collisions: 0
    Late Collisions: 0
    Tx Underrun: 0
    Carrier Sense Errors: 0
    Tx Octets: 752907262
    Rx + Tx 64 Octet Frames: 20000
    Rx + Tx 65-127 Octet Frames: 20563
    Rx + Tx 128-255 Octet Frames: 8100
    Rx + Tx 256-511 Octet Frames: 3186
    Rx + Tx 512-1023 Octet Frames: 328
    Rx + Tx 1024-Up Octet Frames: 504146
    Net Octets: 759152090
    Rx Start of Frame Overruns: 0
    Rx Middle of Frame Overruns: 0
    Rx DMA Overruns: 0
    Rx DMA chan 0: head_enqueue: 1
    Rx DMA chan 0: tail_enqueue: 24606
    Rx DMA chan 0: pad_enqueue: 0
    Rx DMA chan 0: misqueued: 0
    Rx DMA chan 0: desc_alloc_fail: 0
    Rx DMA chan 0: pad_alloc_fail: 0
    Rx DMA chan 0: runt_receive_buf: 0
    Rx DMA chan 0: runt_transmit_bu: 0
    Rx DMA chan 0: empty_dequeue: 0
    Rx DMA chan 0: busy_dequeue: 22351
    Rx DMA chan 0: good_dequeue: 24479
    Rx DMA chan 0: requeue: 0
    Rx DMA chan 0: teardown_dequeue: 0
    Tx DMA chan 0: head_enqueue: 2020
    Tx DMA chan 0: tail_enqueue: 502062
    Tx DMA chan 0: pad_enqueue: 0
    Tx DMA chan 0: misqueued: 4
    Tx DMA chan 0: desc_alloc_fail: 0
    Tx DMA chan 0: pad_alloc_fail: 0
    Tx DMA chan 0: runt_receive_buf: 0
    Tx DMA chan 0: runt_transmit_bu: 20
    Tx DMA chan 0: empty_dequeue: 2020
    Tx DMA chan 0: busy_dequeue: 251557
    Tx DMA chan 0: good_dequeue: 504082
    Tx DMA chan 0: requeue: 5
    Tx DMA chan 0: teardown_dequeue: 0
    一般使用哪个抓包工具呢?
  • 千兆对应的eth1 ,我用tcpdump抓了下数据如下,50:8c:b1:df:90:fa为eth1对应的mac地址
    ./tcpdump -v -i eth1
    [ 166.306982] device eth1 entered promiscuous mode
    tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 262144 bytes
    06:48:31.649257 IP6 (hlim 255, next-header ICMPv6 (58) payload length: 16) fe80::528c:b1ff:fedf:90fa > ff02::2: [icmp6 sum ok] ICMP6, router solicitation, length 16
    source link-address option (1), length 8 (1): 50:8c:b1:df:90:fa
  • 项目紧急,请TI帮忙看看,谢谢
  • 能否重启一下板子,不连接eth0,只连接eth1,执行以下指令并将结果贴出来。
    ethtool -S eth1
    ethtool eth1
    ifconfig -a
    另外您能否附上一个框图说明开发板如何连接到网络上的
  • 你好,板子是通过网线直连PC端的网口,板子和PC的IP设置的通过网段,单独连接eth1的数据如下:

    1、root@am335x-evm:~# ./ethtool -S eth1

        NIC statistics:

        Good Rx Frames: 72754

        Broadcast Rx Frames: 32469

        Multicast Rx Frames: 39904

        Pause Rx Frames: 0

        Rx CRC Errors: 0

        Rx Align/Code Errors: 0

        Oversize Rx Frames: 0

        Rx Jabbers: 0

        Undersize (Short) Rx Frames: 0

        Rx Fragments: 0

        Rx Octets: 8709316

        Good Tx Frames: 62

        Broadcast Tx Frames: 10

        Multicast Tx Frames: 28

        Pause Tx Frames: 0

        Deferred Tx Frames: 0

        Collisions: 0

        Single Collision Tx Frames: 0

        Multiple Collision Tx Frames: 0

        Excessive Collisions: 0

        Late Collisions: 0

        Tx Underrun: 0

        Carrier Sense Errors: 0

        Tx Octets: 7856

        Rx + Tx 64 Octet Frames: 25740

        Rx + Tx 65-127 Octet Frames: 31798

        Rx + Tx 128-255 Octet Frames: 10102

        Rx + Tx 256-511 Octet Frames: 4420

        Rx + Tx 512-1023 Octet Frames: 385

        Rx + Tx 1024-Up Octet Frames: 371

        Net Octets: 8717172

        Rx Start of Frame Overruns: 0

        Rx Middle of Frame Overruns: 0

        Rx DMA Overruns: 0

        Rx DMA chan 0: head_enqueue: 1

        Rx DMA chan 0: tail_enqueue: 32734

        Rx DMA chan 0: pad_enqueue: 0

        Rx DMA chan 0: misqueued: 0

        Rx DMA chan 0: desc_alloc_fail: 0

        Rx DMA chan 0: pad_alloc_fail: 0

        Rx DMA chan 0: runt_receive_buf: 0

        Rx DMA chan 0: runt_transmit_bu: 0

        Rx DMA chan 0: empty_dequeue: 0

        Rx DMA chan 0: busy_dequeue: 30297

        Rx DMA chan 0: good_dequeue: 32607

        Rx DMA chan 0: requeue: 0

        Rx DMA chan 0: teardown_dequeue: 0

        Tx DMA chan 0: head_enqueue: 62

        Tx DMA chan 0: tail_enqueue: 0

        Tx DMA chan 0: pad_enqueue: 0

        Tx DMA chan 0: misqueued: 0

        Tx DMA chan 0: desc_alloc_fail: 0

        Tx DMA chan 0: pad_alloc_fail: 0

        Tx DMA chan 0: runt_receive_buf: 0

        Tx DMA chan 0: runt_transmit_bu: 19

        Tx DMA chan 0: empty_dequeue: 62

        Tx DMA chan 0: busy_dequeue: 0

        Tx DMA chan 0: good_dequeue: 62

        Tx DMA chan 0: requeue: 0

        Tx DMA chan 0: teardown_dequeue: 0

    2、root@am335x-evm:~# ./ethtool  eth1

           Settings for eth1:

           Supported ports: [ TP MII ]

           Supported link modes:   10baseT/Half 10baseT/Full

                                   100baseT/Half 100baseT/Full

                                   1000baseT/Half 1000baseT/Full

           Supported pause frame use: Symmetric Receive-only

           Supports auto-negotiation: Yes

           Supported FEC modes: Not reported

           Advertised link modes:  10baseT/Half 10baseT/Full

                                   100baseT/Half 100baseT/Full

                                   1000baseT/Half 1000baseT/Full

           Advertised pause frame use: No

           Advertised auto-negotiation: Yes

           Advertised FEC modes: Not reported

           Link partner advertised link modes:  10baseT/Half 10baseT/Full

                                                100baseT/Half 100baseT/Full

                                                1000baseT/Full

           Link partner advertised pause frame use: Symmetric Receive-only

           Link partner advertised auto-negotiation: Yes

           Link partner advertised FEC modes: Not reported

           Speed: 1000Mb/s

           Duplex: Full

           Port: MII

           PHYAD: 3

           Transceiver: internal

           Auto-negotiation: on

           Supports Wake-on: d

           Wake-on: d

           Current message level: 0x00000000 (0)

           Link detected: yes

    3、root@am335x-evm:~# ifconfig -a

    eth0      Link encap:Ethernet  HWaddr 50:8C:B1:DF:90:F8  

             inet addr:192.168.233.98  Bcast:192.168.233.255  Mask:255.255.255.0

             inet6 addr: fe80::528c:b1ff:fedf:90f8/64 Scope:Link

             UP BROADCAST MULTICAST  MTU:1500  Metric:1

             RX packets:32607 errors:0 dropped:2688 overruns:0 frame:0

             TX packets:43 errors:0 dropped:0 overruns:0 carrier:0

             collisions:0 txqueuelen:1000

             RX bytes:2722147 (2.5 MiB)  TX bytes:4510 (4.4 KiB)

             Interrupt:47

    eth1      Link encap:Ethernet  HWaddr 50:8C:B1:DF:90:FA  

             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

             RX packets:0 errors:0 dropped:0 overruns:0 frame:0

             TX packets:19 errors:0 dropped:0 overruns:0 carrier:0

             collisions:0 txqueuelen:1000

             RX bytes:0 (0.0 B)  TX bytes:3098 (3.0 KiB)

    lo        Link encap:Local Loopback  

             inet addr:127.0.0.1  Mask:255.0.0.0

             inet6 addr: ::1/128 Scope:Host

             UP LOOPBACK RUNNING  MTU:65536  Metric:1

             RX packets:0 errors:0 dropped:0 overruns:0 frame:0

             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

             collisions:0 txqueuelen:1000

             RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    sit0      Link encap:IPv6-in-IPv4  

             NOARP  MTU:1480  Metric:1

             RX packets:0 errors:0 dropped:0 overruns:0 frame:0

             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

             collisions:0 txqueuelen:1000

             RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    usb0      Link encap:Ethernet  HWaddr AA:AE:FF:23:19:88  

             BROADCAST MULTICAST  MTU:1500  Metric:1

             RX packets:0 errors:0 dropped:0 overruns:0 frame:0

             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

             collisions:0 txqueuelen:1000

             RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

  • 你上面贴出来的测试结果是没有连接eth0的情况下获取的吗?为什么eth0会获得IP地址?这个地址是静态分配的还是通过ifconfig命令分配的?麻烦再次提供一下只连接eth1的信息。

    ethtool -S eth1

    ethtool eth1

    ethtool eth0 

    ifconfig -a 

    请确保ethtool eth0 测试出来是no link detected 的状态,另外请通过附件上传整个log信息。

  • Nancy,下面是按你的要求列出的信息,内核启动log已添加在附件中,4606.am335x_log.txt请帮忙看看,谢谢

    root@am335x-evm:~# ./ethtool -S eth1

    NIC statistics:

        Good Rx Frames: 0

        Broadcast Rx Frames: 0

        Multicast Rx Frames: 0

        Pause Rx Frames: 0

        Rx CRC Errors: 0

        Rx Align/Code Errors: 0

        Oversize Rx Frames: 0

        Rx Jabbers: 0

        Undersize (Short) Rx Frames: 0

        Rx Fragments: 0

        Rx Octets: 0

        Good Tx Frames: 15

        Broadcast Tx Frames: 0

        Multicast Tx Frames: 15

        Pause Tx Frames: 0

        Deferred Tx Frames: 0

        Collisions: 0

        Single Collision Tx Frames: 0

        Multiple Collision Tx Frames: 0

        Excessive Collisions: 0

        Late Collisions: 0

        Tx Underrun: 0

        Carrier Sense Errors: 0

        Tx Octets: 1206

        Rx + Tx 64 Octet Frames: 0

        Rx + Tx 65-127 Octet Frames: 15

        Rx + Tx 128-255 Octet Frames: 0

        Rx + Tx 256-511 Octet Frames: 0

        Rx + Tx 512-1023 Octet Frames: 0

        Rx + Tx 1024-Up Octet Frames: 0

        Net Octets: 1206

        Rx Start of Frame Overruns: 0

        Rx Middle of Frame Overruns: 0

        Rx DMA Overruns: 0

        Rx DMA chan 0: head_enqueue: 1

        Rx DMA chan 0: tail_enqueue: 127

        Rx DMA chan 0: pad_enqueue: 0

        Rx DMA chan 0: misqueued: 0

        Rx DMA chan 0: desc_alloc_fail: 0

        Rx DMA chan 0: pad_alloc_fail: 0

        Rx DMA chan 0: runt_receive_buf: 0

        Rx DMA chan 0: runt_transmit_bu: 0

        Rx DMA chan 0: empty_dequeue: 0

        Rx DMA chan 0: busy_dequeue: 0

        Rx DMA chan 0: good_dequeue: 0

        Rx DMA chan 0: requeue: 0

        Rx DMA chan 0: teardown_dequeue: 0

        Tx DMA chan 0: head_enqueue: 15

        Tx DMA chan 0: tail_enqueue: 0

        Tx DMA chan 0: pad_enqueue: 0

        Tx DMA chan 0: misqueued: 0

        Tx DMA chan 0: desc_alloc_fail: 0

        Tx DMA chan 0: pad_alloc_fail: 0

        Tx DMA chan 0: runt_receive_buf: 0

        Tx DMA chan 0: runt_transmit_bu: 0

        Tx DMA chan 0: empty_dequeue: 15

        Tx DMA chan 0: busy_dequeue: 0

        Tx DMA chan 0: good_dequeue: 15

        Tx DMA chan 0: requeue: 0

        Tx DMA chan 0: teardown_dequeue: 0

    root@am335x-evm:~# ./ethtool eth1

    Settings for eth1:

           Supported ports: [ TP MII ]

           Supported link modes:   10baseT/Half 10baseT/Full

                                   100baseT/Half 100baseT/Full

                                   1000baseT/Half 1000baseT/Full

           Supported pause frame use: Symmetric Receive-only

           Supports auto-negotiation: Yes

           Supported FEC modes: Not reported

           Advertised link modes:  10baseT/Half 10baseT/Full

                                   100baseT/Half 100baseT/Full

                                   1000baseT/Half 1000baseT/Full

           Advertised pause frame use: No

           Advertised auto-negotiation: Yes

           Advertised FEC modes: Not reported

           Link partner advertised link modes:  10baseT/Half 10baseT/Full

                                                100baseT/Half 100baseT/Full

           Link partner advertised pause frame use: Symmetric Receive-only

           Link partner advertised auto-negotiation: Yes

           Link partner advertised FEC modes: Not reported

           Speed: 100Mb/s

           Duplex: Full

           Port: MII

           PHYAD: 3

           Transceiver: internal

           Auto-negotiation: on

           Supports Wake-on: d

           Wake-on: d

           Current message level: 0x00000000 (0)

           Link detected: yes

    root@am335x-evm:~# ./ethtool eth0

    Settings for eth0:

           Supported ports: [ TP MII ]

           Supported link modes:   10baseT/Half 10baseT/Full

                                   100baseT/Half 100baseT/Full

           Supported pause frame use: Symmetric Receive-only

           Supports auto-negotiation: Yes

           Supported FEC modes: Not reported

           Advertised link modes:  10baseT/Half 10baseT/Full

                                   100baseT/Half 100baseT/Full

           Advertised pause frame use: No

           Advertised auto-negotiation: Yes

           Advertised FEC modes: Not reported

           Speed: 10Mb/s

           Duplex: Half

           Port: MII

           PHYAD: 7

           Transceiver: internal

           Auto-negotiation: on

           Supports Wake-on: d

           Wake-on: d

           Current message level: 0x00000000 (0)

           Link detected: no

    root@am335x-evm:~# ifconfig -a

    eth0      Link encap:Ethernet  HWaddr 50:8C:B1:DF:90:F8  

             UP BROADCAST MULTICAST  MTU:1500  Metric:1

             RX packets:0 errors:0 dropped:0 overruns:0 frame:0

             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

             collisions:0 txqueuelen:1000

             RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

             Interrupt:47

    eth1      Link encap:Ethernet  HWaddr 50:8C:B1:DF:90:FA  

             inet addr:192.168.1.1  Bcast:0.0.0.0  Mask:255.255.255.0

             inet6 addr: fe80::528c:b1ff:fedf:90fa/64 Scope:Link

             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

             RX packets:0 errors:0 dropped:0 overruns:0 frame:0

             TX packets:15 errors:0 dropped:0 overruns:0 carrier:0

             collisions:0 txqueuelen:1000

             RX bytes:0 (0.0 B)  TX bytes:1146 (1.1 KiB)

    lo        Link encap:Local Loopback  

             inet addr:127.0.0.1  Mask:255.0.0.0

             inet6 addr: ::1/128 Scope:Host

             UP LOOPBACK RUNNING  MTU:65536  Metric:1

             RX packets:0 errors:0 dropped:0 overruns:0 frame:0

             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

             collisions:0 txqueuelen:1000

             RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    sit0      Link encap:IPv6-in-IPv4  

             NOARP  MTU:1480  Metric:1

             RX packets:0 errors:0 dropped:0 overruns:0 frame:0

             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

             collisions:0 txqueuelen:1000

             RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    usb0      Link encap:Ethernet  HWaddr FE:4B:3A:7B:63:8E  

             BROADCAST MULTICAST  MTU:1500  Metric:1

             RX packets:0 errors:0 dropped:0 overruns:0 frame:0

             TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

             collisions:0 txqueuelen:1000

             RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

    内核启动log见am335x_log.txt,如下:0160.am335x_log.txt

  • 从以上信息来看,在eth1上没有收到任何数据包。这就解释了为何无法动态获取ip地址:
    udhcpc: sending discovere
    udhcpc: sending discover
    udhcpc: no lease, forking to backgroundwe
    eth1上的ip地址是静态分配的吗?
    是否可以用wireshark抓取eth1的数据包?
  • eth1上的ip地址是静态分配的,确实eth1上收不到数据,用的芯片是am3356,发现cpsw配置两路模式为rmii的百兆网口,也出现了同样的问题,有一路rmii也是无法收到数据。
  • 可否抓包看看?
  • 百兆双网口的问题已经解决,是因为MII2中有个管脚U16 GPMC_A9 mode3有两种定义MMC2_DAT7 or RMII2_CRS_DV,设置成RMII2_CRS_DV,双网口就可以正常工作了,但是千兆网口还没找到问题所在。