7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'modules/interface/manifests/rps.pp', line 7
define interface::rps(
String $interface = $name,
Optional[String] $rss_pattern = undef,
Optional[String] $qdisc = '',
Boolean $avoid_cpu0 = false,
) {
require interface::rpstools
require interface::rps::modparams
$cmd = "/usr/local/sbin/interface-rps ${interface}"
$cfg = "/etc/interface-rps.d/${interface}"
file { $cfg:
owner => 'root',
group => 'root',
mode => '0555',
content => template("${module_name}/interface-rps-config.erb"),
}
# Add to ifup commands in /etc/network/interfaces
interface::up_command { "rps-${interface}":
interface => $interface,
command => $cmd,
}
# Exec immediately on script or config change
exec { "rps-${interface}":
command => $cmd,
refreshonly => true,
subscribe => [
File['/usr/local/sbin/interface-rps'],
File[$cfg],
],
}
# Note: tg3 (Broadcom Tigon3): driver defaults to 4 RX queues and 1 TX
# queue, and supports raising the TX queues to 4 optionally as well, but
# there's a comment in the tg3.c source code that says this is a bad idea,
# as hardware may under-perform under some scenarios with multiple TX
# queues (large packets starving access to tx queues full of smaller
# packets). Best left at defaults here!
}
|