Discussion:
ag71xx packet loss on AR9342 rev 3 / Zyxel NWA1123-AC
(too old to reply)
Christian Schöbel
2018-05-01 22:03:28 UTC
Permalink
Hi!

I am trying to make OpenWrt work on ZyXEL NWA1123-AC, I have created
the entry on the OpenWrt toh page in 2015:

https://openwrt.org/toh/zyxel/nwa1123-ac

The corresponding forum is:

https://forum.openwrt.org/viewtopic.php?id=56608

I am currently focusing on the LAN part. I fetched OpenWrt
r6796-56ae9f9 and compiled it. Using the board parameter DB120 the LAN
interface somehow works, but with strange packet loss. I realized this
when I tried pinging from both sides:

OpenWrt -> PC: ~22% packet loss
PC -> OpenWrt: ~85% packet loss

I monitored the direction OpenWrt -> PC with wireshark: if a loss
happens, there is no ICMP echo REQUEST packet on the network, so the
problem seems to be with the TX on the OpenWrt side.

For the other direction PC -> OpenWrt I used the output from ifconfig:
if a loss happens, indeed the RX and TX byte values increase, but
there is no ICMP echo REPLY packet from OpenWrt on the network.


The driver used is the ag71xx. I am not sure if the problem is in the
driver for the built-in switch or for the LAN PHY. Perhaps these lines
from the kernel boot messages will be helpful (see the full output
below):

[ 0.978637] libphy: Fixed MDIO Bus: probed
[ 1.002134] libphy: ag71xx_mdio: probed
[ 1.011246] libphy: ag71xx_mdio: probed
[ 1.745154] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00
[uid=004dd072, driver=Atheros 8035 ethernet]
[ 1.756139] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII
[ 2.386369] ag71xx-mdio.1: Found an AR934X built-in switch
[ 2.438864] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:GMII

Can you tell me how I can enable driver debugging? I'd guess there
would be some helpful error messages.

Any other suggestions are gratefully welcomed too!

Thanks in advance!

Cheers,
Christian


Full output from dmesg below:
[ 0.000000] Linux version 4.9.96 (***@charlie) (gcc version 7.3.0
(OpenWrt GCC 7.3.0 r6796-56ae9f9) ) #0 Mon Apr 30 08:12:55 2018
[ 0.000000] MyLoader: sysp=8829cc2d, boardp=82234a80, parts=06091402
[ 0.000000] bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[ 0.000000] SoC: Atheros AR9342 rev 3
[ 0.000000] Determined physical RAM map:
[ 0.000000] memory: 04000000 @ 00000000 (usable)
[ 0.000000] User-defined physical RAM map:
[ 0.000000] memory: 04000000 @ 00000000 (usable)
[ 0.000000] Initrd not found or empty - disabling initrd
[ 0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[ 0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases,
linesize 32 bytes
[ 0.000000] Zone ranges:
[ 0.000000] Normal [mem 0x0000000000000000-0x0000000003ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x0000000003ffffff]
[ 0.000000] Initmem setup node 0 [mem
0x0000000000000000-0x0000000003ffffff]
[ 0.000000] On node 0 totalpages: 16384
[ 0.000000] free_area_init_node: node 0, pgdat 80463dd4,
node_mem_map 81000020
[ 0.000000] Normal zone: 128 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 16384 pages, LIFO batch:3
[ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on.
Total pages: 16256
[ 0.000000] Kernel command line: board=DB120 console=ttyS0,115200
root=31:02 rootfstype=jffs2 init=/sbin/init
mtdparts=spi0.0:256k(u-boot),64k(u-boot-env),8192k(rootfs),960k(uImage),6528k(reserve),256k(config),64k(mib0),64k(ART) mem=64M rootfstype=squashfs
noinitrd
[ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Writing ErrCtl register=00000000
[ 0.000000] Readback ErrCtl register=00000000
[ 0.000000] Memory: 59896K/65536K available (3153K kernel code,
170K rwdata, 792K rodata, 292K init, 213K bss, 5640K reserved, 0K
cma-reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS:51
[ 0.000000] Clocks: CPU:560.000MHz, DDR:400.000MHz, AHB:200.000MHz,
Ref:40.000MHz
[ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles:
0xffffffff, max_idle_ns: 6825930166 ns
[ 0.000010] sched_clock: 32 bits at 280MHz, resolution 3ns, wraps
every 7669584382ns
[ 0.008332] Calibrating delay loop... 278.93 BogoMIPS (lpj=1394688)
[ 0.081153] pid_max: default: 32768 minimum: 301
[ 0.086190] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.093245] Mountpoint-cache hash table entries: 1024 (order: 0,
4096 bytes)
[ 0.103874] clocksource: jiffies: mask: 0xffffffff max_cycles:
0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.114383] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.121555] NET: Registered protocol family 16
[ 0.128120] MIPS: machine is Atheros DB120 reference board
[ 0.141935] registering PCI controller with io_map_base unset
[ 0.388417] ar71xx: using random MAC address for eth1
[ 0.643595] PCI host bridge to bus 0000:00
[ 0.647980] pci_bus 0000:00: root bus resource [mem 0x10000000-0x13ffffff]
[ 0.655351] pci_bus 0000:00: root bus resource [io 0x0000]
[ 0.661281] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[ 0.668518] pci_bus 0000:00: No busn resource found for root bus,
will use [bus 00-ff]
[ 0.676981] pci 0000:00:00.0: [168c:003c] type 00 class 0x028000
[ 0.676993] pci 0000:00:00.0: invalid calibration data
[ 0.682500] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x001fffff 64bit]
[ 0.682555] pci 0000:00:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
[ 0.682638] pci 0000:00:00.0: supports D1 D2
[ 0.682649] pci 0000:00:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[ 0.682907] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[ 0.682941] pci 0000:00:00.0: BAR 0: assigned [mem
0x10000000-0x101fffff 64bit]
[ 0.690743] pci 0000:00:00.0: BAR 6: assigned [mem
0x10200000-0x1020ffff pref]
[ 0.698478] pci 0000:00:00.0: using irq 40 for pin 1
[ 0.704591] clocksource: Switched to clocksource MIPS
[ 0.711252] NET: Registered protocol family 2
[ 0.716854] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.724285] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.731116] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.737988] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.744223] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.751232] NET: Registered protocol family 1
[ 0.755961] PCI: CLS 0 bytes, default 32
[ 0.761263] Crashlog allocated RAM at address 0x3f00000
[ 0.768029] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.782617] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.788874] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME)
(CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.809363] io scheduler noop registered
[ 0.813543] io scheduler deadline registered (default)
[ 0.819509] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[ 0.826811] console [ttyS0] disabled
[ 0.850702] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11,
base_baud = 2500000) is a 16550A
[ 0.859906] console [ttyS0] enabled
[ 0.867327] bootconsole [early0] disabled
[ 0.879683] m25p80 spi0.0: found mx25l12805d, expected m25p80
[ 0.886298] m25p80 spi0.0: mx25l12805d (16384 Kbytes)
[ 0.891469] 8 cmdlinepart partitions found on MTD device spi0.0
[ 0.897524] Creating 8 MTD partitions on "spi0.0":
[ 0.902397] 0x000000000000-0x000000040000 : "u-boot"
[ 0.909196] 0x000000040000-0x000000050000 : "u-boot-env"
[ 0.916540] 0x000000050000-0x000000850000 : "rootfs"
[ 0.923402] mtd: device 2 (rootfs) set to be root filesystem
[ 0.929268] 1 squashfs-split partitions found on MTD device rootfs
[ 0.935565] 0x0000002a0000-0x000000850000 : "rootfs_data"
[ 0.942922] 0x000000850000-0x000000940000 : "uImage"
[ 0.949901] 0x000000940000-0x000000fa0000 : "reserve"
[ 0.956997] 0x000000fa0000-0x000000fe0000 : "config"
[ 0.963926] 0x000000fe0000-0x000000ff0000 : "mib0"
[ 0.970753] 0x000000ff0000-0x000001000000 : "ART"
[ 0.978637] libphy: Fixed MDIO Bus: probed
[ 1.002134] libphy: ag71xx_mdio: probed
[ 1.011246] libphy: ag71xx_mdio: probed
[ 1.745154] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00
[uid=004dd072, driver=Atheros 8035 ethernet]
[ 1.756139] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII
[ 2.386369] ag71xx-mdio.1: Found an AR934X built-in switch
[ 2.438864] eth1: Atheros AG71xx at 0xba000000, irq 5, mode:GMII
[ 2.447009] NET: Registered protocol family 10
[ 2.455859] NET: Registered protocol family 17
[ 2.460556] 8021q: 802.1Q VLAN Support v1.8
[ 2.471583] VFS: Mounted root (squashfs filesystem) readonly on
device 31:2.
[ 2.480760] Freeing unused kernel memory: 292K
[ 2.485313] This architecture does not have kernel memory protection.
[ 2.564606] random: fast init done
[ 3.110325] init: Console is alive
[ 3.114044] init: - watchdog -
[ 4.253749] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[ 4.312917] usbcore: registered new interface driver usbfs
[ 4.318650] usbcore: registered new interface driver hub
[ 4.324160] usbcore: registered new device driver usb
[ 4.335699] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 4.352726] SCSI subsystem initialized
[ 4.362330] ehci-platform: EHCI generic platform driver
[ 4.372986] usbcore: registered new interface driver usb-storage
[ 4.379844] kmodloader: done loading kernel modules from
/etc/modules-boot.d/*
[ 4.389826] init: - preinit -
[ 5.635311] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 5.665309] random: procd: uninitialized urandom read (4 bytes read)
[ 8.756059] eth0: link up (1000Mbps/Full duplex)
[ 8.760789] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 9.010477] jffs2: notice: (392) jffs2_build_xattr_subsystem:
complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan)
and 0 of xref (0 dead, 0 orphan) found.
[ 9.027760] mount_root: switching to jffs2 overlay
[ 9.067426] urandom-seed: Seeding with /etc/urandom.seed
[ 9.205570] eth0: link down
[ 9.222064] procd: - early -
[ 9.225587] procd: - watchdog -
[ 9.853993] procd: - watchdog -
[ 9.857556] procd: - ubus -
[ 9.899720] random: ubusd: uninitialized urandom read (4 bytes read)
[ 9.937888] random: ubusd: uninitialized urandom read (4 bytes read)
[ 9.944968] random: ubusd: uninitialized urandom read (4 bytes read)
[ 9.951473] random: ubusd: uninitialized urandom read (4 bytes read)
[ 9.958602] random: ubusd: uninitialized urandom read (4 bytes read)
[ 9.965191] random: ubusd: uninitialized urandom read (4 bytes read)
[ 9.971864] random: ubusd: uninitialized urandom read (4 bytes read)
[ 9.978557] random: ubusd: uninitialized urandom read (4 bytes read)
[ 9.985488] procd: - init -
[ 10.429170] kmodloader: loading kernel modules from /etc/modules.d/*
[ 10.467320] ip6_tables: (C) 2000-2006 Netfilter Core Team
[ 10.487063] Loading modules backported from Linux version
wt-2017-11-01-0-gfe248fc2c180
[ 10.495259] Backport generated by backports.git v4.14-rc2-1-31-g86cf0e5d
[ 10.505980] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 10.522018] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[ 10.595014] xt_time: kernel timezone is -0000
[ 10.827310] PPP generic driver version 2.4.2
[ 10.834508] NET: Registered protocol family 24
[ 10.870701] PCI: Enabling device 0000:00:00.0 (0000 -> 0002)
[ 10.878784] ath10k_pci 0000:00:00.0: pci irq legacy oper_irq_mode 1
irq_mode 0 reset_mode 0
[ 11.159341] ath10k_pci 0000:00:00.0: Direct firmware load for
ath10k/pre-cal-pci-0000:00:00.0.bin failed with error -2
[ 11.170253] ath10k_pci 0000:00:00.0: Falling back to user helper
[ 11.401627] firmware ath10k!pre-cal-pci-0000:00:00.0.bin:
firmware_loading_store: map pages failed
[ 11.411106] ath10k_pci 0000:00:00.0: Direct firmware load for
ath10k/cal-pci-0000:00:00.0.bin failed with error -2
[ 11.421658] ath10k_pci 0000:00:00.0: Falling back to user helper
[ 11.603674] firmware ath10k!cal-pci-0000:00:00.0.bin:
firmware_loading_store: map pages failed
[ 11.612941] ath10k_pci 0000:00:00.0: Direct firmware load for
ath10k/QCA988X/hw2.0/firmware-6.bin failed with error -2
[ 11.623854] ath10k_pci 0000:00:00.0: Falling back to user helper
[ 11.804295] firmware ath10k!QCA988X!hw2.0!firmware-6.bin:
firmware_loading_store: map pages failed
[ 11.820634] ath10k_pci 0000:00:00.0: qca988x hw2.0 target
0x4100016c chip_id 0x043222ff sub 0000:0000
[ 11.830050] ath10k_pci 0000:00:00.0: kconfig debug 0 debugfs 1
tracing 0 dfs 1 testmode 1
[ 11.844679] ath10k_pci 0000:00:00.0: firmware ver 10.2.4-1.0-00033
api 5 features no-p2p,raw-mode,mfp,allows-mesh-bcast crc32 c41417d0
[ 11.946617] ath10k_pci 0000:00:00.0: Direct firmware load for
ath10k/QCA988X/hw2.0/board-2.bin failed with error -2
[ 11.957266] ath10k_pci 0000:00:00.0: Falling back to user helper
[ 12.069974] firmware ath10k!QCA988X!hw2.0!board-2.bin:
firmware_loading_store: map pages failed
[ 12.104921] ath10k_pci 0000:00:00.0: board_file api 1 bmi_id N/A
crc32 bebc7c08
[ 13.288624] ath10k_pci 0000:00:00.0: htt-ver 2.1 wmi-op 5 htt-op 2
cal otp max-sta 128 raw 0 hwcrypto 1
[ 13.426793] ath: EEPROM regdomain: 0x0
[ 13.426803] ath: EEPROM indicates default country code should be used
[ 13.426807] ath: doing EEPROM country->regdmn map search
[ 13.426822] ath: country maps to regdmn code: 0x3a
[ 13.426828] ath: Country alpha2 being used: US
[ 13.426832] ath: Regpair used: 0x3a
[ 13.596715] ath: EEPROM regdomain: 0x0
[ 13.596725] ath: EEPROM indicates default country code should be used
[ 13.596729] ath: doing EEPROM country->regdmn map search
[ 13.596746] ath: country maps to regdmn code: 0x3a
[ 13.596752] ath: Country alpha2 being used: US
[ 13.596756] ath: Regpair used: 0x3a
[ 13.610410] ieee80211 phy1: Selected rate control algorithm 'minstrel_ht'
[ 13.615187] ieee80211 phy1: Atheros AR9340 Rev:3 mem=0xb8100000, irq=47
[ 13.626660] kmodloader: done loading kernel modules from /etc/modules.d/*
[ 15.020830] random: jshn: uninitialized urandom read (4 bytes read)
[ 22.479102] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 24.596146] eth0: link up (1000Mbps/Full duplex)
[ 24.600888] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 129.914639] random: crng init done
Christian Schöbel
2018-05-03 21:48:33 UTC
Permalink
Good news!

After some googling I have found a solution to the packet loss:

https://gitlab.labs.nic.cz/turris/openwrt/commit/040067669fa6cae8b77cf5642f2d66eb1e638e9c

As a first quick and dirty solution, I've modified the file

arch/mips/ath79/mach-db120.c

according to the hints in the above url and finally there is no packet
loss during the ping tests anymore!

High throughput tests are outstanding.

So I think there is the need to set up a new machine type for the
ZyXEL NWA1123-AC based upon the DB120 but with the above patch applied.
Loading...