From f01ff15b7530053e18bb79cd529a84e3f15b294a Mon Sep 17 00:00:00 2001 From: Oleksandr Kuchmystyi Date: Thu, 25 Dec 2025 16:48:03 +0300 Subject: 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. --- src/conf_mode/interfaces_ethernet.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src') 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) -- cgit v1.2.3