So I built a fresh build of openwrt from git head, patched in my preliminary patch to the switch, compiled it with oprofile support, and turned on -O2 rather than -Os, in my usual approach to all-up testing that makes it hard to track down what's really going on without backtracking.<br>
<br>The net result with iperf was better than before,<br>with iptables and qos turned entirely off, no nat, etc. <br>pings stayed very flat and well below 8ms, down from 100ms.<br><br>elara: [ 3] 0.0-60.0 sec 435 MBytes 60.7 Mbits/sec<br>
io: [ 3] 0.0-60.0 sec 495 MBytes 69.2 Mbits/sec<br>leda: [ 3] 0.0-60.9 sec 226 MBytes 31.1 Mbits/sec<br>thebe: [ 3] 0.0-60.0 sec 105 MBytes 14.7 Mbits/sec<br clear="all"><br>(how all this stuff is routed is beyond the scope of this, but only partially explains the discrepancies above)<br>
<br>Oprofiling a later run, we're spending a lot of time in an unaligned trap, and I have no idea why iptables and conntrack even register. <br><br>I am not sure at the moment how to track down the source of the alignment fault, I assume I can look at the performance counter somehow, and backtrack that to a given function or functions. It's late...<br>
<br>samples cum. samples % cum. % app name symbol name<br>14992 14992 22.7158 22.7158 vmlinux do_ade<br>10054 25046 15.2338 37.9496 ip_tables /ip_tables<br>
7257 32303 10.9958 48.9454 nf_conntrack /nf_conntrack<br>3398 35701 5.1486 54.0941 vmlinux handle_adel_int<br>2613 38314 3.9592 58.0533 vmlinux ip_rcv<br>
2356 40670 3.5698 61.6231 vmlinux nf_iterate<br>1869 42539 2.8319 64.4550 iptable_nat /iptable_nat<br>1626 44165 2.4637 66.9187 vmlinux r4k_dma_cache_inv<br>
1544 45709 2.3395 69.2582 nf_conntrack_ipv4 /nf_conntrack_ipv4<br>1331 47040 2.0167 71.2749 vmlinux ag71xx_poll<br>1011 48051 1.5319 72.8068 vmlinux ip_route_input_common<br>
988 49039 1.4970 74.3038 vmlinux ret_from_exception<br><br><br><br>asmlinkage void do_ade(struct pt_regs *regs)<br>{<br> unsigned int __user *pc;<br> mm_segment_t seg;<br><br>
perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS,<br> 1, 0, regs, regs->cp0_badvaddr);<br> /*<br> * Did we catch a fault trying to load an instruction?<br> * Or are we running in MIPS16 mode?<br>
*/<br> if ((regs->cp0_badvaddr == regs->cp0_epc) || (regs->cp0_epc & 0x1))<br> goto sigbus;<br><br> pc = (unsigned int __user *) exception_epc(regs);<br> if (user_mode(regs) && !test_thread_flag(TIF_FIXADE))<br>
goto sigbus;<br> if (unaligned_action == UNALIGNED_ACTION_SIGNAL)<br> goto sigbus;<br> else if (unaligned_action == UNALIGNED_ACTION_SHOW)<br> show_registers(regs);<br>
<br> /*<br> * Do branch emulation only if we didn't forward the exception.<br> * This is all so but ugly ...<br> */<br> seg = get_fs();<br> if (!user_mode(regs))<br> set_fs(KERNEL_DS);<br>
emulate_load_store_insn(regs, (void __user *)regs->cp0_badvaddr, pc);<br> set_fs(seg);<br><br> return;<br><br><br>-- <br>Dave Täht<br>SKYPE: davetaht<br>US Tel: 1-239-829-5608<br><a href="http://the-edge.blogspot.com" target="_blank">http://the-edge.blogspot.com</a> <br>