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]
Date:	Mon, 24 Feb 2014 10:42:19 +0000
From:	David Laight <David.Laight@...LAB.COM>
To:	'Daniel Borkmann' <dborkman@...hat.com>
CC:	"davem@...emloft.net" <davem@...emloft.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"linux-sctp@...r.kernel.org" <linux-sctp@...r.kernel.org>
Subject: RE: [PATCH net-next] loopback: sctp: add NETIF_F_SCTP_CSUM to
 device features

From: Daniel Borkmann 
> On 02/24/2014 11:17 AM, David Laight wrote:
> > From: Daniel Borkmann
> >> Drivers are allowed to set NETIF_F_SCTP_CSUM if they have
> >> hardware crc32c checksumming support for the SCTP protocol.
> >> Currently, NETIF_F_SCTP_CSUM flag is available in igb,
> >> ixgbe, i40e/i40evf drivers and for vlan devices.
> >>
> >> If we don't have NETIF_F_SCTP_CSUM then crc32c is done
> >> through CPU instructions, invoked from crypto layer, or
> >> if not available as slow-path fallback in software.
> >>
> >> Currently, loopback device propagates checksum offloading
> >> feature flags in dev->features, but is missing SCTP checksum
> >> offloading. Therefore, account for NETIF_F_SCTP_CSUM as
> >> well.
> >>
> >> Before patch:
> >>
> >> ./netperf_sctp -H 192.168.0.100 -t SCTP_STREAM_MANY
> >> SCTP 1-TO-MANY STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.0.100 () port 0 AF_INET
> >> Recv   Send    Send
> >> Socket Socket  Message  Elapsed
> >> Size   Size    Size     Time     Throughput
> >> bytes  bytes   bytes    secs.    10^6bits/sec
> >>
> >> 4194304 4194304   4096    10.00    4683.50
> >>
> >> After patch:
> > ...
> >> 4194304 4194304   4096    10.00    15348.26
> >
> > That seems a much larger increase than you'd expect from removing
> > a software CRC of the data chunks.
> > Are you sure that some other difference in the data flows wasn't
> > also triggered.
> 
> Yes, I run this multiple times with similar results and I double-checked
> it with perf. Current code triggers crc32c implementation in software
> fallback on my machine which is very expensive.

I'm sure it shouldn't be that expensive, you are implying that it spent
about 70% of the time doing crc32.
The loop should be dominated by the per-byte lookup in a 256 word table.
With 4k data the table will soon be in the data cache.
Unless it is (stupidly) generating the table on each call, or trying
to use a crc32 instruction, faulting, and emulating it, I wouldn't
really have expected more than a few % improvement.

> > I'm also not sure that 4096 is a representative message size for SCTP.
> 
> I used netperf default in this case.

I was just pointing out that the defaults may not be appropriate here.

	David



--
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