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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <787e2b85cd2f4f0f90d7fe871dce85ff@AcuMS.aculab.com>
Date:   Thu, 14 Jan 2021 09:29:23 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Eric Dumazet' <edumazet@...gle.com>
CC:     Eric Dumazet <eric.dumazet@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        netdev <netdev@...r.kernel.org>,
        Alexander Duyck <alexanderduyck@...com>,
        "Paolo Abeni" <pabeni@...hat.com>,
        "Michael S . Tsirkin" <mst@...hat.com>,
        "Greg Thelen" <gthelen@...gle.com>
Subject: RE: [PATCH net] net: avoid 32 x truesize under-estimation for tiny
 skbs

From: Eric Dumazet
> Sent: 14 January 2021 05:17
> 
> On Wed, Jan 13, 2021 at 11:23 PM David Laight <David.Laight@...lab.com> wrote:
> >
> > From: Eric Dumazet
> > > Sent: 13 January 2021 16:18
> > >
> > > From: Eric Dumazet <edumazet@...gle.com>
> > >
> > > Both virtio net and napi_get_frags() allocate skbs
> > > with a very small skb->head
> > >
> > > While using page fragments instead of a kmalloc backed skb->head might give
> > > a small performance improvement in some cases, there is a huge risk of
> > > under estimating memory usage.
> >
> > There is (or was last time I looked) also a problem with
> > some of the USB ethernet drivers.
> >
> > IIRC one of the ASXnnnnnn (???) USB3 ones allocates 64k skb to pass
> > to the USB stack and then just lies about skb->truesize when passing
> > them into the network stack.
> 
> You sure ? I think I have fixed this at some point
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=a9e0aca4b37885b5599e52211f09
> 8bd7f565e749

I might have forgotten that patch :-)
Or possibly only remembered it changing small packets.

> > The USB hardware will merge TCP receives and put multiple ethernet
> > packets into a single USB message.
> > But single frames can end up in very big kernel memory buffers.
> >
> 
> Yeah, this is a known problem.

The whole USB ethernet block is somewhat horrid and inefficient
especially for XHCI/USB3 - which could have high speed ethernet.
It really needs to either directly interface to the XHCI ring
(like a normal ethernet driver) or be given the sequence of
USB rx packets to split/join into ethernet frames.

However I don't have the time to make those changes.
When I was looking at that driver 'dayjob' was actually
trying to make it work.
They dropped that idea later.
I've not got the ethernet dongle any more either.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ