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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACVXFVOYgVG5cZE8YPn2z6_xu5akLvUURJ3_pE4Stbh7U8L_AA@mail.gmail.com>
Date:	Fri, 6 Jul 2012 09:16:32 +0800
From:	Ming Lei <ming.lei@...onical.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	David Miller <davem@...emloft.net>,
	netdev <netdev@...r.kernel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Allan Chou <allan@...x.com.tw>,
	Trond Wuellner <trond@...omium.org>,
	Grant Grundler <grundler@...omium.org>
Subject: Re: [PATCH net-next] asix: avoid copies in tx path

On Thu, Jul 5, 2012 at 10:31 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> From: Eric Dumazet <edumazet@...gle.com>
>
> I noticed excess calls to skb_copy_expand() or memmove() in asix driver.
>
> This driver needs to push 4 bytes in front of frame (packet_len)
> and maybe add 4 bytes after the end (if padlen is 4)
>
> So it should set needed_headroom & needed_tailroom to avoid
> copies. But its not enough, because many packets are cloned
> before entering asix_tx_fixup() and this driver use skb_cloned()
> as a lazy way to check if it can push and put additional bytes in frame.
>
> Avoid skb_copy_expand() expensive call, using following rules :
>
> - We are allowed to push 4 bytes in headroom if skb_header_cloned()
>   is false (and if we have 4 bytes of headroom)
>
> - We are allowed to put 4 bytes at tail if skb_cloned()
>   is false (and if we have 4 bytes of tailroom)
>
> TCP packets for example are cloned, but skb_header_release()
> was called in tcp stack, allowing us to use headroom for our needs.
>
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Cc: Allan Chou <allan@...x.com.tw>
> Cc: Trond Wuellner <trond@...omium.org>
> Cc: Grant Grundler <grundler@...omium.org>
> Cc: Paul Stewart <pstew@...omium.org>
> Cc: Ming Lei <tom.leiming@...il.com>

After testing the patch on beagle-xm with external DLINK DUB-E100 NIC,
the transmit performance is increased from ~75Mbps to ~91Mbps when
DEBUG_SLAB is enabled, follows the test command and result:

[root@...t]#iperf -c 192.168.0.103 -w 131072 -t 10
------------------------------------------------------------
Client connecting to 192.168.0.103, TCP port 5001
TCP window size:   256 KByte (WARNING: requested   128 KByte)
------------------------------------------------------------
[  3] local 192.168.0.102 port 57888 connected with 192.168.0.103 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec    109 MBytes  91.6 Mbits/sec

Tested-by: Ming Lei <ming.lei@...onical.com>

Thanks,
--
Ming Lei
--
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