summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOleksandr Kuchmystyi <o.kuchmystyi@vyos.io>2025-12-25 16:48:03 +0300
committerOleksandr Kuchmystyi <o.kuchmystyi@vyos.io>2026-01-22 10:52:44 +0300
commitf01ff15b7530053e18bb79cd529a84e3f15b294a (patch)
tree9c06fa894c41017ac4f70bdea4de5292622999ff /src
parent774de4b11330e7d3d30ddf6af0ad75e8be0f7bb3 (diff)
downloadvyos-1x-f01ff15b7530053e18bb79cd529a84e3f15b294a.tar.gz
vyos-1x-f01ff15b7530053e18bb79cd529a84e3f15b294a.zip
ethtool: T7730: Add configuration coalesce for interface
This change introduces CLI support for configuring network interface interrupt coalescing parameters via `netlink`. Note: Not all NIC drivers support interrupt coalescing. On unsupported interfaces, `netlink` returns an error and the VyOS commit will fail.
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 599421c72..ca993b5e8 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)