0

如果我从设备 ping 到我的 PC,我能够获取 tcpdump 数据包并看到回显返回,但是数据包被丢弃,如下所示:

eth0      Link encap:Ethernet  HWaddr 00:0D:A7:00:0E:5C
      inet addr:10.0.3.150  Bcast:10.0.3.255  Mask:255.255.255.0
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:18714 errors:0 dropped:16850 overruns:0 frame:0
      TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:1380531 (1.3 MiB)  TX bytes:42 (42.0 B)
      Interrupt:194

使用具有以下配置的以下设置发现此故障:

CPU: ARM926EJ-S [41069264] revision 4 (ARMv5TEJ), cr=00053177
Linux version 3.4.52

mach-mx21ads 配置:

static struct smsc911x_platform_config smsc911x_config = {
.irq_polarity   = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
.irq_type       = SMSC911X_IRQ_TYPE_PUSH_PULL,
.flags          = SMSC911X_USE_16BIT,
};

static struct resource smsc911x_resources[] = {
{
    .start          = MX21_CS1_BASE_ADDR,
    .end            = MX21_CS1_BASE_ADDR + MX21ADS_SMSC911X_MMIO_SIZE - 1,
    .flags          = IORESOURCE_MEM,
}, {
    .start          = MX21ADS_SMSC911X_IRQ,
    .end            = MX21ADS_SMSC911X_IRQ,
    .flags          = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING,
},
};

static struct platform_device smsc911x_device = {
.name           = "smsc911x",
.id             = -1,
.num_resources  = ARRAY_SIZE(smsc911x_resources),
.resource       = smsc911x_resources,
.dev            = {
    .platform_data = &smsc911x_config,
},
};

Linux内核日志:

[    1.717445] 0x000001400000-0x000004000000 : "system"
[    1.745103] smsc911x: Driver version 2008-10-21
[    1.760910] smsc911x supply vdd33a not found, using dummy regulator
[    1.780099] smsc911x supply vddvario not found, using dummy regulator
[    1.799922] smsc911x smsc911x: (unregistered net_device): Driver Parameters:
[    1.821212] smsc911x smsc911x: (unregistered net_device): LAN base: 0xC8000000
[    1.842989] smsc911x smsc911x: (unregistered net_device): IRQ: 194
[    1.861629] smsc911x smsc911x: (unregistered net_device): PHY will be autodetected.
[    1.884711] smsc911x smsc911x: (unregistered net_device): BYTE_TEST: 0x87654321
[    1.906753] smsc911x smsc911x: (unregistered net_device): LAN911x identified, idrev: 0x01150002, generation: 2
[    1.939477] smsc911x smsc911x: eth0: Network interface: "eth0"
[    1.957323] smsc911x smsc911x: eth0: HW_CFG EXT_PHY_DET clear, using internal PHY
[    1.982196] smsc911x-mdio: probed
[    1.992494] smsc911x smsc911x: eth0: PHY: addr 1, phy_id 0x0007C0D1
[    2.011538] smsc911x smsc911x: eth0: attached PHY driver [SMSC LAN911x Internal PHY] (mii_bus:phy_addr=smsc911x-fffffff:01, irq=-1)
[    2.047536] smsc911x smsc911x: eth0: Successfully verified loopback packet
[    2.068587] smsc911x smsc911x: eth0: Passed Loop Back Test
[    2.085167] smsc911x smsc911x: eth0: phy initialised successfully
[    2.103647] smsc911x smsc911x: eth0: MAC Address is set to random_ether_addr
[    2.124918] smsc911x smsc911x: eth0: MAC Address: 9e:04:cb:db:dc:fe

~ # /apps/bin/networking
[   33.052642] smsc911x smsc911x: eth0: MAC Address: 00:0d:a7:00:0e:5c
[   33.077692] smsc911x smsc911x: eth0: irq polarity: active low
[   33.095092] smsc911x smsc911x: eth0: irq type: push-pull
[   33.111148] smsc911x smsc911x: eth0: Testing irq handler using IRQ 194
[   33.130867] smsc911x smsc911x: eth0: IRQ handler passed test using IRQ 194
[   33.151606] smsc911x smsc911x: eth0: SMSC911x/921x identified at 0xc8000000, IRQ: 194
[   33.175253] smsc911x smsc911x: eth0: maccr 0x1000000C, HASHH 0x00000000, HASHL 0x00000000
[   33.199962] smsc911x smsc911x: eth0: maccr 0x1000000C, HASHH 0x00000000, HASHL 0x00000000
[   33.224807] smsc911x smsc911x: eth0: maccr 0x1000200C, HASHH 0x00000000, HASHL 0x80000000

            CONFIGURING NETWORK SETTINGS
10.0.3.150
0.0.0.0
255.255.255.0

[   33.343312] smsc911x smsc911x: eth0: maccr 0x1000200C, HASHH 0x00000000, HASHL 0x80000000
[   33.373718] smsc911x smsc911x: eth0: Interface stopped
[   33.396198] smsc911x smsc911x: eth0: irq polarity: active low
[   33.413592] smsc911x smsc911x: eth0: irq type: push-pull
[   33.429650] smsc911x smsc911x: eth0: Testing irq handler using IRQ 194
[   33.449370] smsc911x smsc911x: eth0: IRQ handler passed test using IRQ 194
[   33.470110] smsc911x smsc911x: eth0: SMSC911x/921x identified at 0xc8000000, IRQ: 194
[   33.493756] smsc911x smsc911x: eth0: maccr 0x1000000C, HASHH 0x00000000, HASHL 0x00000000
[   33.518448] smsc911x smsc911x: eth0: maccr 0x1000000C, HASHH 0x00000000, HASHL 0x00000000
[   33.543214] smsc911x smsc911x: eth0: maccr 0x1000200C, HASHH 0x00000000, HASHL 0x80000000
[   33.569623] smsc911x smsc911x: eth0: maccr 0x1000200C, HASHH 0x00000000, HASHL 0x80000000
route: SIOCADDRT: Invalid argument
~ #
~ # [   46.005715] smsc911x smsc911x: eth0: duplex state has changed
[   46.023086] smsc911x smsc911x: eth0: configuring for full duplex mode
[   46.042614] smsc911x smsc911x: eth0: rx pause disabled, tx pause disabled
[   46.063096] smsc911x smsc911x: eth0: carrier state has changed
[   46.080696] smsc911x smsc911x: eth0: configuring for no carrier
[   47.095737] smsc911x smsc911x: eth0: carrier state has changed
[   47.113360] smsc911x smsc911x: eth0: configuring for carrier OK

~ # 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
    Advertised link modes:  10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
    Advertised pause frame use: Symmetric Receive-only
    Advertised auto-negotiation: Yes
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 1
    Transceiver: external
    Auto-negotiation: on
    Current message level: 0x0000ffff (65535)
                           drv probe link timer ifdown ifup rx_err tx_err tx_queued intr     tx_done rx_status pktdata hw wol 0x8000
    Link detected: yes

我已经捕获了被丢弃的数据包。当 netif_receive 返回 1 时,数据包被丢弃。

[ 1211.434930] smsc911x_poll dropped(0) pktwords(268) pktlength(1070) netif_receive(0)             rx_packets(148) rx_bytes(150726)
[ 1211.466585] 0000|9d 08 ed 51 00 00 00 00-0e 05 0c 00 00 00 00 00|..íQ............
[ 1211.489102] 0010|10 11 12 13 14 15 16 17-18 19 1a 1b 1c 1d 1e 1f|................
[ 1211.511614] 0020|20 21 22 23 24 25 26 27-28 29 2a 2b 2c 2d 2e 2f| !"#$%&'()*+,-./
[ 1211.534124] 0030|30 31 32 33 34 35 36 37-38 39 3a 3b 3c 3d 3e 3f|0123456789:;<=>?
[ 1211.556634] 0040|40 41 42 43 44 45 46 47-48 49 4a 4b 4c 4d 4e 4f|@ABCDEFGHIJKLMNO
[ 1211.579145] 0050|50 51 52 53 54 55 56 57-58 59 5a 5b 5c 5d 5e 5f|PQRSTUVWXYZ[\]^_
[ 1211.601655] 0060|60 61 62 63 64 65 66 67-68 69 6a 6b 6c 6d 6e 6f|`abcdefghijklmno
[ 1211.624164] 0070|70 71 72 73 74 75 76 77-78 79 7a 7b 7c 7d 7e 7f|pqrstuvwxyz{|}~.
[ 1211.646674] 0080|80 81 82 83 84 85 86 87-88 89 8a 8b 8c 8d 8e 8f|................
[ 1211.669184] 0090|90 91 92 93 94 95 96 97-98 99 9a 9b 9c 9d 9e 9f|................
[ 1211.691694] 00a0|a0 a1 a2 a3 a4 a5 a6 a7-a8 a9 aa ab ac ad ae af| ¡¢£¤¥¦§¨©ª«¬­®¯
[ 1211.714203] 00b0|b0 b1 b2 b3 b4 b5 b6 b7-b8 b9 ba bb bc bd be bf|°±²³´µ¶·¸¹º»¼½¾¿
[ 1211.736713] 00c0|c0 c1 c2 c3 c4 c5 c6 c7-c8 c9 ca cb cc cd ce cf|ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ
[ 1211.759223] 00d0|d0 d1 d2 d3 d4 d5 d6 d7-d8 d9 da db dc dd de df|ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß
[ 1211.781732] 00e0|e0 e1 e2 e3 e4 e5 e6 e7-e8 e9 ea eb ec ed ee ef|àáâãäåæçèéêëìíîï
[ 1211.804242] 00f0|f0 f1 f2 f3 f4 f5 f6 f7-f8 f9 fa fb fc fd fe ff|ðñòóôõö÷øùúûüýþÿ
[ 1211.826752] 0100|00 01 02 03 04 05 06 07-08 09 0a 0b __ __ __ __|............____
[ 1212.436944] smsc911x_poll dropped(0) pktwords(268) pktlength(1070) netif_receive(0)     rx_packets(149) rx_bytes(151792)
[ 1212.468601] 0000|08 00 e9 ae 0a 1a 00 11-9e 08 ed 51 00 00 00 00|..é®......íQ....
[ 1212.491116] 0010|a4 0c 0c 00 00 00 00 00-10 11 12 13 14 15 16 17|¤...............
[ 1212.513629] 0020|18 19 1a 1b 1c 1d 1e 1f-20 21 22 23 24 25 26 27|........ !"#$%&'
[ 1212.536139] 0030|28 29 2a 2b 2c 2d 2e 2f-30 31 32 33 34 35 36 37|()*+,-./01234567
[ 1212.558650] 0040|38 39 3a 3b 3c 3d 3e 3f-40 41 42 43 44 45 46 47|89:;<=>?@ABCDEFG
[ 1212.581160] 0050|48 49 4a 4b 4c 4d 4e 4f-50 51 52 53 54 55 56 57|HIJKLMNOPQRSTUVW
[ 1212.603669] 0060|58 59 5a 5b 5c 5d 5e 5f-60 61 62 63 64 65 66 67|XYZ[\]^_`abcdefg
[ 1212.626179] 0070|68 69 6a 6b 6c 6d 6e 6f-70 71 72 73 74 75 76 77|hijklmnopqrstuvw
[ 1212.648689] 0080|78 79 7a 7b 7c 7d 7e 7f-80 81 82 83 84 85 86 87|xyz{|}~.........
[ 1212.671198] 0090|88 89 8a 8b 8c 8d 8e 8f-90 91 92 93 94 95 96 97|................
[ 1212.693709] 00a0|98 99 9a 9b 9c 9d 9e 9f-a0 a1 a2 a3 a4 a5 a6 a7|........ ¡¢£¤¥¦§
[ 1212.716219] 00b0|a8 a9 aa ab ac ad ae af-b0 b1 b2 b3 b4 b5 b6 b7|¨©ª«¬­®¯°±²³´µ¶·
[ 1212.738728] 00c0|b8 b9 ba bb bc bd be bf-c0 c1 c2 c3 c4 c5 c6 c7|¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇ
[ 1212.761238] 00d0|c8 c9 ca cb cc cd ce cf-d0 d1 d2 d3 d4 d5 d6 d7|ÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×
[ 1212.783747] 00e0|d8 d9 da db dc dd de df-e0 e1 e2 e3 e4 e5 e6 e7|ØÙÚÛÜÝÞßàáâãäåæç
[ 1212.806257] 00f0|e8 e9 ea eb ec ed ee ef-f0 f1 f2 f3 f4 f5 f6 f7|èéêëìíîïðñòóôõö÷
[ 1212.828767] 0100|f8 f9 fa fb fc fd fe ff-00 01 02 03 __ __ __ __|øùúûüýþÿ....____
[ 1213.437206] smsc911x_poll dropped(0) pktwords(268) pktlength(1070) netif_receive(1)     rx_packets(150) rx_bytes(152858)
[ 1213.468860] 0000|52 2e 08 00 45 00 04 1c-00 00 40 00 40 01 1b 89|R...E.....@.@...
[ 1213.491374] 0010|0a 00 03 c3 0a 00 03 96-08 00 b0 ad 0a 1a 00 12|...Ã......°­....
[ 1213.513885] 0020|9f 08 ed 51 00 00 00 00-dc 0c 0c 00 00 00 00 00|..íQ....Ü.......
[ 1213.536396] 0030|10 11 12 13 14 15 16 17-18 19 1a 1b 1c 1d 1e 1f|................
[ 1213.558906] 0040|20 21 22 23 24 25 26 27-28 29 2a 2b 2c 2d 2e 2f| !"#$%&'()*+,-./
[ 1213.581415] 0050|30 31 32 33 34 35 36 37-38 39 3a 3b 3c 3d 3e 3f|0123456789:;<=>?
[ 1213.603925] 0060|40 41 42 43 44 45 46 47-48 49 4a 4b 4c 4d 4e 4f|@ABCDEFGHIJKLMNO
[ 1213.626435] 0070|50 51 52 53 54 55 56 57-58 59 5a 5b 5c 5d 5e 5f|PQRSTUVWXYZ[\]^_
[ 1213.648944] 0080|60 61 62 63 64 65 66 67-68 69 6a 6b 6c 6d 6e 6f|`abcdefghijklmno
[ 1213.671454] 0090|70 71 72 73 74 75 76 77-78 79 7a 7b 7c 7d 7e 7f|pqrstuvwxyz{|}~.
[ 1213.693964] 00a0|80 81 82 83 84 85 86 87-88 89 8a 8b 8c 8d 8e 8f|................
[ 1213.716474] 00b0|90 91 92 93 94 95 96 97-98 99 9a 9b 9c 9d 9e 9f|................
[ 1213.738983] 00c0|a0 a1 a2 a3 a4 a5 a6 a7-a8 a9 aa ab ac ad ae af| ¡¢£¤¥¦§¨©ª«¬­®¯
[ 1213.761493] 00d0|b0 b1 b2 b3 b4 b5 b6 b7-b8 b9 ba bb bc bd be bf|°±²³´µ¶·¸¹º»¼½¾¿
[ 1213.784003] 00e0|c0 c1 c2 c3 c4 c5 c6 c7-c8 c9 ca cb cc cd ce cf|ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ
[ 1213.806513] 00f0|d0 d1 d2 d3 d4 d5 d6 d7-d8 d9 da db dc dd de df|ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß
[ 1213.829023] 0100|e0 e1 e2 e3 e4 e5 e6 e7-e8 e9 ea eb __ __ __ __|àáâãäåæçèéêë____
[ 1214.437438] smsc911x_poll dropped(0) pktwords(268) pktlength(1070) netif_receive(1)     rx_packets(151) rx_bytes(153924)
[ 1214.469092] 0000|52 2e 08 00 45 00 04 1c-00 00 40 00 40 01 1b 89|R...E.....@.@...
[ 1214.491605] 0010|0a 00 03 c3 0a 00 03 96-08 00 b3 ac 0a 1a 00 13|...Ã......³¬....
[ 1214.514117] 0020|a0 08 ed 51 00 00 00 00-d8 0c 0c 00 00 00 00 00| .íQ....Ø.......
[ 1214.536627] 0030|10 11 12 13 14 15 16 17-18 19 1a 1b 1c 1d 1e 1f|................
[ 1214.559138] 0040|20 21 22 23 24 25 26 27-28 29 2a 2b 2c 2d 2e 2f| !"#$%&'()*+,-./
[ 1214.581645] 0050|30 31 32 33 34 35 36 37-38 39 3a 3b 3c 3d 3e 3f|0123456789:;<=>?
[ 1214.604154] 0060|40 41 42 43 44 45 46 47-48 49 4a 4b 4c 4d 4e 4f|@ABCDEFGHIJKLMNO
[ 1214.626664] 0070|50 51 52 53 54 55 56 57-58 59 5a 5b 5c 5d 5e 5f|PQRSTUVWXYZ[\]^_
[ 1214.649174] 0080|60 61 62 63 64 65 66 67-68 69 6a 6b 6c 6d 6e 6f|`abcdefghijklmno
[ 1214.671684] 0090|70 71 72 73 74 75 76 77-78 79 7a 7b 7c 7d 7e 7f|pqrstuvwxyz{|}~.
[ 1214.694194] 00a0|80 81 82 83 84 85 86 87-88 89 8a 8b 8c 8d 8e 8f|................
[ 1214.716703] 00b0|90 91 92 93 94 95 96 97-98 99 9a 9b 9c 9d 9e 9f|................
[ 1214.739213] 00c0|a0 a1 a2 a3 a4 a5 a6 a7-a8 a9 aa ab ac ad ae af| ¡¢£¤¥¦§¨©ª«¬­®¯
[ 1214.761723] 00d0|b0 b1 b2 b3 b4 b5 b6 b7-b8 b9 ba bb bc bd be bf|°±²³´µ¶·¸¹º»¼½¾¿
[ 1214.784233] 00e0|c0 c1 c2 c3 c4 c5 c6 c7-c8 c9 ca cb cc cd ce cf|ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ
[ 1214.806742] 00f0|d0 d1 d2 d3 d4 d5 d6 d7-d8 d9 da db dc dd de df|ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß
[ 1214.829252] 0100|e0 e1 e2 e3 e4 e5 e6 e7-e8 e9 ea eb __ __ __ __|àáâãäåæçèéêë____
4

0 回答 0