Unloading unused kernel modules (NAT speed)

Rafał Miłecki zajec5 at gmail.com
Mon Feb 6 03:36:45 PST 2023


On 6.02.2023 12:28, Rafał Miłecki wrote:
> On 3.02.2023 21:26, Florian Fainelli wrote:
>> Have you managed to get a `perf record` or `perf top` capture to see whether we might be going a little too far into iptables-raw code rather than bailing out early if we are not utilizing it?
> 
> Just did.
> 
> It doesn't hele me much but maybe you can figure out sth out of it. It
> seems that with iptable_raw loaded v7_dma_inv_range() starts getting
> partially called from swapper. Without iptable_raw it's called from
> ksoftirqd only.

I used FlameGraph to visualize perf results. The best summary is
generated diff one:

http://files.zajec.net/openwrt/bcm53xx-iptable_raw-nat-slow-down/diff.svg


It shows CPU spends more time executing nf_hook_slow which in turn calls
ip_tables.

We also also see CPU spending LESS time executing v7_dma_* which is BAD
for my case as that is what actually handles packets.


Full FlameGraphs:
http://files.zajec.net/openwrt/bcm53xx-iptable_raw-nat-slow-down/fast-without-iptable_raw.svg
http://files.zajec.net/openwrt/bcm53xx-iptable_raw-nat-slow-down/slow-with-iptable_raw.svg



More information about the openwrt-devel mailing list