Bug 2228819

Summary: correct the nmcli command to remove coalesce settings from ignore to NULL
Product: Red Hat Enterprise Linux 9 Reporter: suresh kumar <surkumar>
Component: DocumentationAssignee: Marc Muehlfeld <mmuehlfe>
Documentation sub component: default QA Contact: RHEL DPM <rhel-docs>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: high    
Priority: high CC: rhel-docs
Version: 9.0Keywords: Documentation, EasyFix
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-03 13:49:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description suresh kumar 2023-08-03 10:53:07 UTC
Document URL: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/configuring_and_managing_networking/assembly_configuring-ethtool-coalesce-settings_configuring-and-managing-networking

Section Number and Name: 36.2, "Procedure"

Describe the issue: 
The command 'ignore' is not working and giving 'Error'.

+++
$nmcli connection modify enp1s0 ethtool.coalesce-rx-frames ignore
"failed to modify ethtool.coalesce-rx-frames: 'ignore' is out of range [0, 4294967295].   <-----------------
+++


Suggestions for improvement: 

We have NetworManager commit which suggest to use NULL  for removing the settings:

+++
commit 61d6f1abc2244d0a83553e4e947bc3a680133857
Author: Antonio Cardace <acardace>
Date:   Thu May 14 17:06:41 2020 +0200

    cli: let nmcli remove individual coalesce settings

    Remove coalesce settings by setting them to NULL.

    eg:
    $ nmcli c mod $conn ethtool.$coalesce-setting ''

diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c
index 272c089d98..aca6c396a7 100644
--- a/clients/common/nm-meta-setting-desc.c
+++ b/clients/common/nm-meta-setting-desc.c
@@ -4144,6 +4144,13 @@ _set_fcn_ethtool (ARGS_SET_FCN)
        NMEthtoolID ethtool_id = property_info->property_typ_data->subtype.ethtool.ethtool_id;

        if (nm_ethtool_id_is_coalesce (ethtool_id)) {
+
+               if (_SET_FCN_DO_RESET_DEFAULT (property_info, modifier, value)) {
+                       nm_setting_ethtool_clear_coalesce (NM_SETTING_ETHTOOL (setting),
+                                                          nm_ethtool_data[ethtool_id]->optname);
+                       return TRUE;
+               }
+
                i64 = _nm_utils_ascii_str_to_int64 (value, 10, 0, G_MAXUINT32, -1);

                if (i64 == -1) {
+++

Additional information: 

Test result in our VM

+++
$ uname -r
5.14.0-70.22.1.el9_0.x86_64
[user1@localhost ~]$ rpm -qa |grep NetworkManager
NetworkManager-libnm-1.36.0-4.el9_0.x86_64
NetworkManager-1.36.0-4.el9_0.x86_64
NetworkManager-wifi-1.36.0-4.el9_0.x86_64
NetworkManager-wwan-1.36.0-4.el9_0.x86_64
NetworkManager-team-1.36.0-4.el9_0.x86_64
NetworkManager-bluetooth-1.36.0-4.el9_0.x86_64
NetworkManager-adsl-1.36.0-4.el9_0.x86_64
NetworkManager-tui-1.36.0-4.el9_0.x86_64
NetworkManager-config-server-1.36.0-4.el9_0.noarch



[user1@localhost ~]$ nmcli connection modify ethernet-ens3 ethtool.coalesce-rx-frames '10'
[user1@localhost ~]$ nmcli connection show ethernet-ens3 |grep coalesce
ethtool.coalesce-rx-frames:             10

[user1@localhost ~]$ nmcli connection modify ethernet-ens3 ethtool.coalesce-rx-frames ignore
Error: failed to modify ethtool.coalesce-rx-frames: 'ignore' is out of range [0, 4294967295].   <---- Error

[user1@localhost ~]$ nmcli connection modify ethernet-ens3 ethtool.coalesce-rx-frames ''
[user1@localhost ~]$ nmcli connection show ethernet-ens3 |grep coalesce
[user1@localhost ~]$ 
+++

Comment 1 Marc Muehlfeld 2023-08-03 12:18:48 UTC
Fernando Fernandez Mancera (NM developer) confirmed:

"ignore" works for settings that take Booleans. For other settings, a NULL string ("") is required. However, the NULL string also works to unset Booleans, so we will update to use this.