Bug 2091671

Summary: rust doesn't support bond options as integer
Product: Red Hat Enterprise Linux 9 Reporter: Mingyu Shi <mshi>
Component: nmstateAssignee: Gris Ge <fge>
Status: CLOSED ERRATA QA Contact: Mingyu Shi <mshi>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.1CC: ferferna, fge, jiji, jishi, network-qe, till
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 10:00:45 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:
Attachments:
Description Flags
reproducer.sh none

Description Mingyu Shi 2022-05-30 17:12:51 UTC
Created attachment 1885217 [details]
reproducer.sh

Description of problem:
According to the document https://www.kernel.org/doc/Documentation/networking/bonding.txt ,for some options(such as fail_over_mac), both descriptive text and type number are acceptable.
The two formats both work well in nmstate python, or in nmstate rust on RHEL 9.0.
But on RHEL 9.1, a number like 1 or "1" 

Version-Release number of selected component (if applicable):
nmstate-2.1.1-0.alpha.20220519.437e4a9.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
./reproducer.sh

Actual results:
serde_yaml::Error: invalid type: integer `1`, expected string or map

Expected results:
No failure

Additional info:

Comment 1 Mingyu Shi 2022-05-30 17:18:33 UTC
(In reply to Mingyu Shi from comment #0)

> According to the document
> https://www.kernel.org/doc/Documentation/networking/bonding.txt ,for some
> options(such as fail_over_mac), both descriptive text and type number are
> acceptable.

It seems that some options, like "fail_over_mac" here, are not changeable in kernel on RHEL 9.1.
I'm confirming it.

Comment 2 Mingyu Shi 2022-05-30 17:44:44 UTC
(In reply to Mingyu Shi from comment #0)

> The two formats both work well in nmstate python, or in nmstate rust on RHEL
> 9.0.
> But on RHEL 9.1, a number like 1 or "1" 
> 

I was misled by the error of may-be-unchangeable "fail_over_mac", need to correct here:
String "1" works, but integer 1 doesn't, such as the option "primary_reselect", using '1' or 'better' is OK.

Comment 3 Mingyu Shi 2022-05-31 04:20:58 UTC
(In reply to Mingyu Shi from comment #1)
> (In reply to Mingyu Shi from comment #0)
> 
> > According to the document
> > https://www.kernel.org/doc/Documentation/networking/bonding.txt ,for some
> > options(such as fail_over_mac), both descriptive text and type number are
> > acceptable.
> 
> It seems that some options, like "fail_over_mac" here, are not changeable in
> kernel on RHEL 9.1.
> I'm confirming it.

fail_over_mac is another issue: https://bugzilla.redhat.com/show_bug.cgi?id=1811873

Comment 4 Mingyu Shi 2022-05-31 04:22:15 UTC
(In reply to Mingyu Shi from comment #3)
> (In reply to Mingyu Shi from comment #1)
> > (In reply to Mingyu Shi from comment #0)
> > 
> > > According to the document
> > > https://www.kernel.org/doc/Documentation/networking/bonding.txt ,for some
> > > options(such as fail_over_mac), both descriptive text and type number are
> > > acceptable.
> > 
> > It seems that some options, like "fail_over_mac" here, are not changeable in
> > kernel on RHEL 9.1.
> > I'm confirming it.
> 
> fail_over_mac is another issue:
> https://bugzilla.redhat.com/show_bug.cgi?id=1811873

The wrong link above, this is correct:
https://bugzilla.redhat.com/show_bug.cgi?id=2091775

Comment 5 Gris Ge 2022-07-18 07:09:02 UTC
Patch sent up upstream: https://github.com/nmstate/nmstate/pull/1972

Both integer or quoted integer is supported for bond mode.

Comment 6 Gris Ge 2022-07-18 07:12:18 UTC
For bond options, any kernel supported integer should be also supported by last nmstate build. If not, please state the property name.

Comment 9 Mingyu Shi 2022-08-02 03:06:43 UTC
Hi, according to my test with cli "nmstatectl" (nmstate-2.1.3-1.el9.x86_64):

For the `mode`, string like "0" "1" works but integer 0 1 doesn't

For the options, the followings only support string like "0" or descriptive text, don't support integer like 0, 1
all_slaves_active
arp_all_targets
arp_validate
fail_over_mac
primary_reselect
xmit_hash_policy
ad_select
lacp_rate

Comment 10 Gris Ge 2022-08-02 12:43:03 UTC
New patch sent to upstream: https://github.com/nmstate/nmstate/pull/1993

Comment 16 Mingyu Shi 2022-08-24 05:40:33 UTC
Verified with:
nmstate-2.1.4-1.el9.x86_64
NetworkManager-1.39.90-1.el9.x86_64

Comment 18 errata-xmlrpc 2022-11-15 10:00:45 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (nmstate bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:7991