From: nabijaczleweli Date: Wed, 29 Apr 2020 16:38:56 +0000 (+0200) Subject: link: Add units and fix typo in (Rx|Tx)BufferSize= manpage. Clean up the implementati... X-Git-Tag: v246-rc1~472^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=80af9bdabe2aa6421568d5d20f4c513cf49a3e43;p=thirdparty%2Fsystemd.git link: Add units and fix typo in (Rx|Tx)BufferSize= manpage. Clean up the implementation slightly --- diff --git a/man/systemd.link.xml b/man/systemd.link.xml index e04618340bd..34d4834cca7 100644 --- a/man/systemd.link.xml +++ b/man/systemd.link.xml @@ -691,13 +691,15 @@ RxBufferSize= - Takes a integer. Specifies the NIC receive ring buffer size. When unset, the kernel's default will be used. + Takes an integer. Specifies the maximum number of pending packets in the NIC receive buffer. + When unset, the kernel's default will be used. TxBufferSize= - Takes a integer. Specifies the NIC transmit ring buffer size. When unset, the kernel's default will be used. + Takes an integer. Specifies the maximum number of pending packets in the NIC transmit buffer. + When unset, the kernel's default will be used. diff --git a/src/shared/ethtool-util.c b/src/shared/ethtool-util.c index fe29af24d07..703e48025eb 100644 --- a/src/shared/ethtool-util.c +++ b/src/shared/ethtool-util.c @@ -431,18 +431,14 @@ int ethtool_set_nic_buffer_size(int *ethtool_fd, const char *ifname, netdev_ring if (r < 0) return -errno; - if (ring->rx_pending_set) { - if (ecmd.rx_pending != ring->rx_pending) { - ecmd.rx_pending = ring->rx_pending; - need_update = true; - } + if (ring->rx_pending_set && ecmd.rx_pending != ring->rx_pending) { + ecmd.rx_pending = ring->rx_pending; + need_update = true; } - if (ring->tx_pending_set) { - if (ecmd.tx_pending != ring->tx_pending) { - ecmd.tx_pending = ring->tx_pending; - need_update = true; - } + if (ring->tx_pending_set && ecmd.tx_pending != ring->tx_pending) { + ecmd.tx_pending = ring->tx_pending; + need_update = true; } if (need_update) {