Defined Type: interface::txqueuelen

Defined in:
modules/interface/manifests/txqueuelen.pp

Overview

SPDX-License-Identifier: Apache-2.0 Definition: interface::txqueuelen

Sets interface txqueuelen

Parameters:

  • $interface: The network interface to operate on

  • $len: desired transmit queue length

Parameters:

  • interface (Any)
  • len (Any)


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'modules/interface/manifests/txqueuelen.pp', line 11

define interface::txqueuelen($interface, $len) {
    $sysfs_txqlen = "/sys/class/net/${interface}/tx_queue_len"
    $setcmd = "echo ${len} > ${sysfs_txqlen}"

    # Set in /etc/network/interfaces
    interface::up_command { "txqueuelen-${interface}":
        interface => $interface,
        command   => $setcmd,
    }

    # And make sure it's always active
    exec { "txqueuelen-${interface}":
        path    => '/usr/bin:/usr/sbin:/bin:/sbin',
        command => $setcmd,
        unless  => "test `cat ${sysfs_txqlen}` = ${len}",
    }
}