lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210107120737.3b21a5a8@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Thu, 7 Jan 2021 12:07:37 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Bjørn Mork <bjorn@...k.no>,
        Kristian Evensen <kristian.evensen@...il.com>
Cc:     netdev@...r.kernel.org
Subject: Re: [PATCH net-next] qmi_wwan: Increase headroom for QMAP SKBs

On Wed, 06 Jan 2021 15:31:10 +0100 Bjørn Mork wrote:
> Kristian Evensen <kristian.evensen@...il.com> writes:
> 
> > When measuring the throughput (iperf3 + TCP) while routing on a
> > not-so-powerful device (Mediatek MT7621, 880MHz CPU), I noticed that I
> > achieved significantly lower speeds with QMI-based modems than for
> > example a USB LAN dongle. The CPU was saturated in all of my tests.
> >
> > With the dongle I got ~300 Mbit/s, while I only measured ~200 Mbit/s
> > with the modems. All offloads, etc.  were switched off for the dongle,
> > and I configured the modems to use QMAP (16k aggregation). The tests
> > with the dongle were performed in my local (gigabit) network, while the
> > LTE network the modems were connected to delivers 700-800 Mbit/s.
> >
> > Profiling the kernel revealed the cause of the performance difference.
> > In qmimux_rx_fixup(), an SKB is allocated for each packet contained in
> > the URB. This SKB has too little headroom, causing the check in
> > skb_cow() (called from ip_forward()) to fail. pskb_expand_head() is then
> > called and the SKB is reallocated. In the output from perf, I see that a
> > significant amount of time is spent in pskb_expand_head() + support
> > functions.
> >
> > In order to ensure that the SKB has enough headroom, this commit
> > increases the amount of memory allocated in qmimux_rx_fixup() by
> > LL_MAX_HEADER. The reason for using LL_MAX_HEADER and not a more
> > accurate value, is that we do not know the type of the outgoing network
> > interface. After making this change, I achieve the same throughput with
> > the modems as with the dongle.
> >
> > Signed-off-by: Kristian Evensen <kristian.evensen@...il.com>  
> 
> Nice work!
> 
> Just wondering: Will the same problem affect the usbnet allocated skbs
> as well in case of raw-ip? They will obviously be large enough, but the
> reserved headroom probably isn't when we put an IP packet there without
> any L2 header?
> 
> In any case:
> 
> Acked-by: Bjørn Mork <bjorn@...k.no>

Applied, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ