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-next>] [day] [month] [year] [list]
Message-ID: <1318186948.5276.49.camel@edumazet-laptop>
Date:	Sun, 09 Oct 2011 21:02:28 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	netdev <netdev@...r.kernel.org>
Subject: [RFC] truesize lies

I noticed on my laptop a difference if I use wifi or wired internet
connectivity.

On wifi mode, I can see netstat -s giving sign of bad rcvbuf tuning :

   371 packets collapsed in receive queue due to low socket buffer

After some analysis, I found full sized tcp skbs (len=1440) had a 2864
bytes truesize on my wifi adapter. Ouch...

On tg3 adapter, truesize is MTU + NET_SKB_PAD + sizeof(sk_buff).

On some devices (say... NIU, but other drivers have same problem :
bnx2x, ), truesize is sizeof(sk_buff) + frame_length.

So if 'truesize' really means to account exact memory cost of frames
(including the empty space after used part), I would say :

1) NIU is lying (it should account in niu_rx_skb_append() not the used
part of the page, but reserved part : PAGE_SIZE/rbr_blocks_per_page)

2) Autotuning is a bit pessimistic : It works only if truesize is MSS +
sizeof(sk_buff) + 16 + MAX_TCP_HEADER


I guess most driver writers adjust truesize to please TCP stack and get
nice performance numbers.

skb->truesize = frame_len + sizeof(sk_buff);

What should we do exactly ?



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ