opnsense-src/sys
Will Andrews 0e5f55bb95 Improve the distribution of LAGG port traffic.
I edited the original change to retain the use of arc4random() as a seed for
the hashing as a very basic defense against intentional lagg port selection.

The author's original commit message (edited slightly):

sys/net/ieee8023ad_lacp.c
sys/net/if_lagg.c
	In lagg_hashmbuf, use the FNV hash instead of the old
	hash32_buf.  The hash32 family of functions operate one octet
	at a time, and when run on a string s of length n, their output
	is equivalent to :

		   ----- i=n-1
		   \
	       n    \           (n-i-1)              32
	( seed^  +  /        33^        * s[i] ) % 2^
		   /
		   ----- i=0

	The problem is that the last five bytes of input don't get
	multiplied by sufficiently many powers of 33 to rollover 2^32.
	That means that changing the last few bytes (but obviously not
	the very last) of input will always change the value of the
	hash by a multiple of 33.  In the case of lagg_hashmbuf() with
	ipv4 input, the last four bytes are the TCP or UDP port
	numbers.  Since the output of lagg_hashmbuf is always taken
	modulo the port count, and 3 is a common port count for a lagg,
	that's bad.  It means that the UDP or TCP source port will
	never affect which lagg member is selected on a 3-port lagg.

	At 10Gbps, I was not able to measure any difference in CPU
	consumption between the old and new hash.

Submitted by:	asomers (original commit)
Reviewed by:	emaste, glebius
MFC after:	1 week
Sponsored by:	Spectra Logic
MFSpectraBSD:	1001723 on 2013/08/28 (original)
		1114258 on 2015/01/22 (edit)
2015-01-23 00:06:35 +00:00
..
amd64 MOVS instruction emulation. 2015-01-19 06:53:31 +00:00
arm Declare Maxmem on arm. This should have been part of r277532. 2015-01-22 17:46:05 +00:00
boot loader: fix the size of MODINFOMD_MODULEP 2015-01-20 12:28:24 +00:00
bsm IFp4 @1192291: 2014-04-07 20:44:00 +00:00
cam Don't count requests with status sent as overlapping. 2015-01-22 14:49:36 +00:00
cddl Remove commented log messages. 2015-01-21 19:30:01 +00:00
compat Add procctl(2) PROC_TRACE_CTL command to enable or disable debugger 2015-01-18 15:13:11 +00:00
conf Refactor PowerPC (especially AIM) init sequence to be less baroque. 2015-01-18 18:32:43 +00:00
contrib Add missing linuxapi module dependencies and always use the FreeBSD 2015-01-19 21:53:00 +00:00
crypto Add some new modes to OpenCrypto. These modes are AES-ICM (can be used 2014-12-12 19:56:36 +00:00
ddb ddb: ANSI-fy function declarations. 2014-10-12 18:01:52 +00:00
dev style(9) cleanup 2015-01-22 03:56:23 +00:00
fs Stop enforcing additional reference on all cdevs, which was introduced 2015-01-19 17:36:52 +00:00
gdb Add support for gdb's memory searching capabilities to our in-kernel gdb 2014-09-05 16:40:47 +00:00
geom Add devd(8) notifications for creation and destruction of GEOM devices. 2015-01-14 11:15:57 +00:00
gnu reiserfs: Use signed i_nlink 2014-09-25 19:10:32 +00:00
i386 loader: implement multiboot support for Xen Dom0 2015-01-15 16:27:20 +00:00
isa Remove vestiges of knowing the ISA bus, which we gave up on around 20 2014-03-19 21:03:04 +00:00
kern Revert for r277213: 2015-01-22 11:12:42 +00:00
kgssapi Avoid dynamic syscall overhead for statically compiled modules. 2014-10-26 19:42:44 +00:00
libkern Add some new modes to OpenCrypto. These modes are AES-ICM (can be used 2014-12-12 19:56:36 +00:00
mips Add 128-byte cache flushing routines. 2015-01-20 11:10:25 +00:00
modules An update for the i915 GPU driver, which brings the code up to Linux 2015-01-21 16:10:37 +00:00
net Improve the distribution of LAGG port traffic. 2015-01-23 00:06:35 +00:00
net80211 Switch around the order of static inline to be in line with how it's 2015-01-11 18:43:45 +00:00
netgraph When the node receives NGM_FLOW_COOKIE update the if_link_state, instead 2015-01-12 09:50:42 +00:00
netinet Improve CARP logging so that all state transitions are logged. 2015-01-22 17:09:54 +00:00
netinet6 Refactor / restructure the RSS code into generic, IPv4 and IPv6 specific 2015-01-18 18:06:40 +00:00
netipsec In order to reduce use of M_EXT outside of the mbuf allocator and 2015-01-06 12:59:37 +00:00
netnatm Provide includes that are needed in these files, and before were read 2013-10-26 18:18:50 +00:00
netpfil Back out r276841, r276756, r276747, r276746. The change in r276747 is very 2015-01-22 01:23:16 +00:00
netsmb Remove redundant unlock. 2014-04-17 12:22:08 +00:00
nfs Remove the old NFS client and server from head, 2014-12-23 00:47:46 +00:00
nfsclient Remove the old NFS client and server from head, 2014-12-23 00:47:46 +00:00
nfsserver Use M_SIZE() instead of hand-crafted (and mostly correct) NFSMSIZ() macro 2015-01-07 17:22:56 +00:00
nlm Avoid dynamic syscall overhead for statically compiled modules. 2014-10-26 19:42:44 +00:00
ofed Revert for r277213: 2015-01-22 11:12:42 +00:00
opencrypto Add some new modes to OpenCrypto. These modes are AES-ICM (can be used 2014-12-12 19:56:36 +00:00
pc98 Factor out duplicated code from dumpsys() on each architecture into generic 2015-01-07 01:01:39 +00:00
powerpc Allow use of a pre-instantiated RTAS as well as a self-instantiated one. This 2015-01-22 22:04:43 +00:00
rpc Add facility to stop all userspace processes. The supposed use of the 2014-12-13 16:18:29 +00:00
security Adjust printf format specifiers for dev_t and ino_t in kernel. 2014-12-17 07:27:19 +00:00
sparc64 Factor out duplicated code from dumpsys() on each architecture into generic 2015-01-07 01:01:39 +00:00
sys Revert for r277213: 2015-01-22 11:12:42 +00:00
teken mdoc: improvements to SEE ALSO. 2014-12-27 07:07:37 +00:00
tools Allow the make_dtb script to work outside of a "make buildkernel" context 2014-08-30 22:39:15 +00:00
ufs Handle MAKEENTRY cnp flag in the VOP_CREATE(). Curiously, some 2014-12-21 13:29:33 +00:00
vm Revamp the default page clustering strategy that is used by the page fault 2015-01-16 18:17:09 +00:00
x86 loader: fix the size of MODINFOMD_MODULEP 2015-01-20 12:28:24 +00:00
xdr
xen Pacify clang 3.3 by ending the file with a newline. This is common 2015-01-06 21:26:35 +00:00
Makefile Remove "pci" from CSCOPEDIRS. 2014-09-23 06:32:19 +00:00