summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2026-02-03 15:34:10 +0000
committerGitHub <noreply@github.com>2026-02-03 15:34:10 +0000
commitad3b7eddb696727c80cbf711f4e0567b38ea922c (patch)
treee9659ed57941a6ddd4b5f1f3cb5bb0391d6e1dce /src
parenta12905c3010520db3c1d7e652c90853940be5e75 (diff)
parentf01ff15b7530053e18bb79cd529a84e3f15b294a (diff)
downloadvyos-1x-ad3b7eddb696727c80cbf711f4e0567b38ea922c.tar.gz
vyos-1x-ad3b7eddb696727c80cbf711f4e0567b38ea922c.zip
Merge pull request #4919 from alexandr-san4ez/T7730-current
interfaces: T7730: Add interrupt coalescing settings for Ethernet interfaces
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/interfaces_ethernet.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/conf_mode/interfaces_ethernet.py b/src/conf_mode/interfaces_ethernet.py
index 554f0fa41..2a65855a4 100755
--- a/src/conf_mode/interfaces_ethernet.py
+++ b/src/conf_mode/interfaces_ethernet.py
@@ -37,6 +37,7 @@ from vyos.configverify import verify_vrf
from vyos.configverify import verify_bond_bridge_member
from vyos.configverify import verify_eapol
from vyos.ethtool import Ethtool
+from vyos.netlink import coalesce
from vyos.frrender import FRRender
from vyos.frrender import get_frrender_dict
from vyos.ifconfig import EthernetIf
@@ -256,6 +257,26 @@ def verify_ring_buffer(ethernet: dict, ethtool: Ethtool):
f'size of "{max_tx}" bytes!')
+def verify_coalesce(ethernet: dict, ethtool: Ethtool):
+ """
+ Verify coalesce settings
+ :param ethernet: dictionary which is received from get_interface_dict
+ :type ethernet: dict
+ :param ethtool: Ethernet object
+ :type ethtool: Ethtool
+ """
+ if 'interrupt_coalescing' in ethernet:
+ if not ethtool.check_coalesce():
+ raise ConfigError('Driver does not fully support coalesce configuration!')
+
+ for param in coalesce.get_all_params():
+ if param in ethernet['interrupt_coalescing']:
+ if not ethtool.check_coalesce(param):
+ param_name = param.replace('_', '-')
+ msg = f'Driver does not support "{param_name}" coalesce setting!'
+ raise ConfigError(msg)
+
+
def verify_offload(ethernet: dict, ethtool: Ethtool):
"""
Verify offloading capabilities
@@ -398,6 +419,7 @@ def verify(ethernet):
verify_ring_buffer(ethernet, ethtool)
verify_offload(ethernet, ethtool)
verify_mac_change(ethernet, ethtool)
+ verify_coalesce(ethernet, ethtool)
if 'is_bond_member' in ethernet:
verify_bond_member(ethernet, ethtool)