OpenBSD CVS

CVS log for src/sys/net/toeplitz.h


[BACK] Up to [local] / src / sys / net

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.11 / (download) - annotate - [select for diffs], Wed May 17 10:22:17 2023 UTC (12 months, 3 weeks ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.10: +3 -3 lines
Diff to previous 1.10 (colored)

fix stoeplitz_hash_h32.

discussed with and ok tb@

Revision 1.10 / (download) - annotate - [select for diffs], Tue Dec 27 20:13:03 2022 UTC (17 months, 2 weeks ago) by patrick
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

Fix array bounds mismatch with clang 15

New warning -Warray-parameter is a bit overzealous.
ok millert@ tb@

Revision 1.9 / (download) - annotate - [select for diffs], Thu Dec 22 04:43:52 2022 UTC (17 months, 2 weeks ago) by dlg
Branch: MAIN
Changes since 1.8: +3 -1 lines
Diff to previous 1.8 (colored)

provide stoeplitz_n32()

Revision 1.8 / (download) - annotate - [select for diffs], Wed Feb 24 23:44:04 2021 UTC (3 years, 3 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.7: +17 -1 lines
Diff to previous 1.7 (colored)

add support for hashing 64 and 32 bit numbers in host byte order.

Revision 1.7 / (download) - annotate - [select for diffs], Wed Feb 24 12:33:50 2021 UTC (3 years, 3 months ago) by dlg
Branch: MAIN
Changes since 1.6: +2 -2 lines
Diff to previous 1.6 (colored)

white space tweak, no functional change

Revision 1.6 / (download) - annotate - [select for diffs], Wed Feb 24 12:33:22 2021 UTC (3 years, 3 months ago) by dlg
Branch: MAIN
Changes since 1.5: +3 -3 lines
Diff to previous 1.5 (colored)

fix stoeplitz_n16 and stoeplitz_h16

Revision 1.5 / (download) - annotate - [select for diffs], Sun Feb 21 15:56:25 2021 UTC (3 years, 3 months ago) by deraadt
Branch: MAIN
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

how about sticking to standard C.

Revision 1.4 / (download) - annotate - [select for diffs], Sun Feb 21 02:37:38 2021 UTC (3 years, 3 months ago) by dlg
Branch: MAIN
Changes since 1.3: +6 -1 lines
Diff to previous 1.3 (colored)

add stoeplitz_eaddr, for getting a hash value from an ethernet address.

Revision 1.3 / (download) - annotate - [select for diffs], Fri Jun 19 08:48:15 2020 UTC (3 years, 11 months ago) by dlg
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

let stoeplitz_to_key take a void * argument instead of uint8_t *.

ix(4) wants an array of uint32_ts to push into 32bit registers.

Revision 1.2 / (download) - annotate - [select for diffs], Thu Jun 18 12:22:39 2020 UTC (3 years, 11 months ago) by tb
Branch: MAIN
Changes since 1.1: +8 -1 lines
Diff to previous 1.1 (colored)

Introduce stoeplitz_hash_n32() and use it to simplify the hash_ip*
functions further.

ok dlg

Revision 1.1 / (download) - annotate - [select for diffs], Tue Jun 16 04:46:49 2020 UTC (3 years, 11 months ago) by dlg
Branch: MAIN

Add a symmetric toeplitz implementation, with integration for nics.

This is another bit of the puzzle for supporting multiple rx rings
and receive side scaling (RSS) on nics. It borrows heavily from
DragonflyBSD, but I've made some tweaks on the way.

The interesting bits that dfly came up with was a way to use Toeplitz
hashing so the kernel AND network interfaces hash packets so packets
in both directions onto the same bucket. The other interesting thing
is that the optimised the hash calculation by building a cache of
all the intermediate results possible for each input byte. Their
hash calculation is simply xoring these intermediate reults together.

So this diff adds an API for the kernel to use for calculating a
hash for ip addresses and ports, and adds a function for network
drivers to call that gives them a key to use with RSS. If all drivers
use the same key, then the same flows should be steered to the same
place when they enter the network stack regardless of which hardware
they came in on.

The changes I made relative to dfly are around reducing the size
of the caches. DragonflyBSD builds a cache of 32bit values, but
because of how the Toeplitz key is constructed, the 32bits are made
up of a repeated 16bit pattern. We can just store the 16 bits and
reconstruct the 32 bits if we want. Both us and dragonfly only
use 15 or 16 bits of the result anyway, so 32bits is unecessary.

Secondly, the dfly implementation keeps a cache of values for the
high and low bytes of input, but the values in the two caches are
almost the same. You can byteswap the values in one of the byte
caches to get the values for the other, but you can also just
byteswap values at runtime to get the same value, which is what
this implementation does. The result of both these changes is that
the byte cache is a quarter of the size of the one in dragonflybsd.

tb@ has had a close look at this and found a bunch of other
optimisations that can be implemented, and because he's a
wizard^Wmathematician he has proofs (and also did tests).

ok tb@ jmatthew@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.