for coalesce, setting in ethtool_coalesce.items():
if setting is not None:
if isinstance(setting, bool):
setting = int(setting)
configured_coalesce.append(
"%s %s" % (coalesce.replace("_", "-"), setting)
) # ^^^ code about configuring coalesce setting in Network role
Some people suggested to remove the normalization - setting = int(setting). I do not think we should remove if isinstance(setting, bool): setting = int(setting) for coalesce setting. Because the data type for adaptive_rx and adaptive_tx in Network role is bool, see
ArgValidatorBool("adaptive_rx", default_value=None),
ArgValidatorBool("adaptive_tx", default_value=None),
But In NetworkManager[1], we have to set it to either 0 or 1 when modify the ethtool.coalesce-adaptive-rx and ethtool.coalesce-adaptive-tx setting.
[root@localhost ~]# nmcli connection modify testnic1 ethtool.coalesce-adaptive-rx True
Error: failed to modify ethtool.coalesce-adaptive-rx: 'True' is out of range [0, 4294967295].# Is anything wrong with the error msg?
[root@localhost ~]# nmcli connection modify testnic1 ethtool.coalesce-adaptive-rx 1
[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/src/libnm-core-impl/nm-setting-ethtool.c#L312
Some people suggested to remove the normalization -
setting = int(setting). I do not think we should removeif isinstance(setting, bool): setting = int(setting)for coalesce setting. Because the data type foradaptive_rxandadaptive_txin Network role is bool, seeBut In NetworkManager[1], we have to set it to either 0 or 1 when modify the
ethtool.coalesce-adaptive-rxandethtool.coalesce-adaptive-txsetting.[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/src/libnm-core-impl/nm-setting-ethtool.c#L312