aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/sysctl/net.txt
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2014-11-16 09:23:05 -0500
committerDavid S. Miller <davem@davemloft.net>2014-11-16 15:59:11 -0500
commit960fb622f85180f36d3aff82af53e2be3db2f888 (patch)
treec567b80d26270e3d4a3437c9710be6ca0f1eddc3 /Documentation/sysctl/net.txt
parentca245024349c0d44434a6381583b99f0eb559c7c (diff)
net: provide a per host RSS key generic infrastructure
RSS (Receive Side Scaling) typically uses Toeplitz hash and a 40 or 52 bytes RSS key. Some drivers use a constant (and well known key), some drivers use a random key per port, making bonding setups hard to tune. Well known keys increase attack surface, considering that number of queues is usually a power of two. This patch provides infrastructure to help drivers doing the right thing. netdev_rss_key_fill() should be used by drivers to initialize their RSS key, even if they provide ethtool -X support to let user redefine the key later. A new /proc/sys/net/core/netdev_rss_key file can be used to get the host RSS key even for drivers not providing ethtool -x support, in case some applications want to precisely setup flows to match some RX queues. Tested: myhost:~# cat /proc/sys/net/core/netdev_rss_key 11:63:99:bb:79:fb:a5:a7:07:45:b2:20:bf:02:42:2d:08:1a:dd:19:2b:6b:23:ac:56:28:9d:70:c3:ac:e8:16:4b:b7:c1:10:53:a4:78:41:36:40:74:b6:15:ca:27:44:aa:b3:4d:72 myhost:~# ethtool -x eth0 RX flow hash indirection table for eth0 with 8 RX ring(s): 0: 0 1 2 3 4 5 6 7 RSS hash key: 11:63:99:bb:79:fb:a5:a7:07:45:b2:20:bf:02:42:2d:08:1a:dd:19:2b:6b:23:ac:56:28:9d:70:c3:ac:e8:16:4b:b7:c1:10:53:a4:78:41 Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation/sysctl/net.txt')
-rw-r--r--Documentation/sysctl/net.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/Documentation/sysctl/net.txt b/Documentation/sysctl/net.txt
index e26c607468a6..666594b43cff 100644
--- a/Documentation/sysctl/net.txt
+++ b/Documentation/sysctl/net.txt
@@ -142,6 +142,28 @@ netdev_max_backlog
142Maximum number of packets, queued on the INPUT side, when the interface 142Maximum number of packets, queued on the INPUT side, when the interface
143receives packets faster than kernel can process them. 143receives packets faster than kernel can process them.
144 144
145netdev_rss_key
146--------------
147
148RSS (Receive Side Scaling) enabled drivers use a 40 bytes host key that is
149randomly generated.
150Some user space might need to gather its content even if drivers do not
151provide ethtool -x support yet.
152
153myhost:~# cat /proc/sys/net/core/netdev_rss_key
15484:50:f4:00:a8:15:d1:a7:e9:7f:1d:60:35:c7:47:25:42:97:74:ca:56:bb:b6:a1:d8: ... (52 bytes total)
155
156File contains nul bytes if no driver ever called netdev_rss_key_fill() function.
157Note:
158/proc/sys/net/core/netdev_rss_key contains 52 bytes of key,
159but most drivers only use 40 bytes of it.
160
161myhost:~# ethtool -x eth0
162RX flow hash indirection table for eth0 with 8 RX ring(s):
163 0: 0 1 2 3 4 5 6 7
164RSS hash key:
16584:50:f4:00:a8:15:d1:a7:e9:7f:1d:60:35:c7:47:25:42:97:74:ca:56:bb:b6:a1:d8:43:e3:c9:0c:fd:17:55:c2:3a:4d:69:ed:f1:42:89
166
145netdev_tstamp_prequeue 167netdev_tstamp_prequeue
146---------------------- 168----------------------
147 169