RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1929132 - copy-mac-from failed when changing targeted subordinate port's mac at the same time in balance-alb/tlb mode
Summary: copy-mac-from failed when changing targeted subordinate port's mac at the sam...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: nmstate
Version: 8.4
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: rc
: 8.5
Assignee: Gris Ge
QA Contact: Mingyu Shi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-16 09:27 UTC by Mingyu Shi
Modified: 2022-01-11 15:26 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-01-11 15:26:06 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Mingyu Shi 2021-02-16 09:27:09 UTC
Description of problem:
When using balance-alb/tlb mode, it will fail if use copy-mac-from and modify targeted slave's mac in one transaction.
2 conditions:

Version-Release number of selected component (if applicable):
nmstate-1.0.2-0.3.el8.noarch
nispor-1.0.1-3.el8.x86_64
NetworkManager-1.30.0-0.10.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
ip link add dummy0 type dummy
ip link add dummy1 type dummy
echo "interfaces:
- name: bond0
  type: bond
  state: up
  copy-mac-from: dummy1
  link-aggregation:
    mode: balance-tlb #or balance-alb
    port:
    - dummy0
    - dummy1
- name: dummy1
  state: up
  type: dummy
  mac-address: d4:ee:07:25:42:5a" | nmstatectl set -

Actual results:
failed

Expected results:
no failure

Additional info:
1. copy-mac-from dummy0 and changing dummy0 work well, as dummy0 is in 1st order by name
2. to reproduce: dummy1 should be created before apply the above desired state(in contrast, using slave as 'type: veth' will always fail, whatever a veth slave was created first or created in one transaction)

Comment 3 Gris Ge 2021-09-18 08:01:02 UTC
Hi Mingyu,

Could you check whether this works for real NIC instead of veth or dummy?

The use case of `copy-mac-from` is designed for pre-exist interface instead of creating them in the same transaction.

Comment 5 Mingyu Shi 2021-10-25 02:34:24 UTC
Gris, I tried on physical interfaces, nmstate-1.2.0-0.1.alpha1.el8.noarch

Set bond0 with enp5s0f0 and enp5s0f1, copy mac from enp5s0f1 and change the mac of enp5s0f1 in one transaction.
nmstate prompted applied, however the mac of bond0 wasn't copied from the new mac of enp5s0f1:

[10:19:51@dell-per730-03 ~]0# nmcli d
DEVICE    TYPE      STATE         CONNECTION  
eno1      ethernet  connected     System eno1 
eno2      ethernet  disconnected  --          
eno3      ethernet  disconnected  --          
eno4      ethernet  disconnected  --          
enp5s0f0  ethernet  disconnected  --          
enp5s0f1  ethernet  disconnected  --          
lo        loopback  unmanaged     --          
[10:19:58@dell-per730-03 ~]0# code 1.yaml
[10:20:09@dell-per730-03 ~]0# nmstatectl set 1.yaml 
/tmp/nmstatelog/2021-10-25-10:21:20-543135941.log
Desired state applied: 
---
interfaces:
- name: bond0
  type: bond
  state: up
  copy-mac-from: enp5s0f1
  link-aggregation:
    mode: balance-tlb
    port:
    - enp5s0f0
    - enp5s0f1
- name: enp5s0f1
  type: ethernet
  state: up
  mac-address: d4:ee:07:25:42:5a
/tmp/nmstatelog/2021-10-25-10:21:20-543135941.0.log nmstatectl set 1.yaml return 0

### changed enp5s0f1 to d4:ee:07:25:42:5a, while the bond0 was a0:36:9f:ab:36:b6
[10:21:23@dell-per730-03 ~]0# ip link show bond0
8: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether a0:36:9f:ab:36:b6 brd ff:ff:ff:ff:ff:ff
[10:21:35@dell-per730-03 ~]0# ip link show enp5s0f1
7: enp5s0f1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP mode DEFAULT group default qlen 1000
    link/ether d4:ee:07:25:42:5a brd ff:ff:ff:ff:ff:ff permaddr a0:36:9f:ab:36:b6
[10:21:54@dell-per730-03 ~]0# ip link show enp5s0f0
6: enp5s0f0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond0 state UP mode DEFAULT group default qlen 1000
    link/ether a0:36:9f:ab:36:b6 brd ff:ff:ff:ff:ff:ff permaddr a0:36:9f:ab:36:b4
[10:22:01@dell-per730-03 ~]0# nmcli c
NAME         UUID                                  TYPE      DEVICE   
System eno1  e3c87730-fa85-4ac5-871c-90afef5f87d8  ethernet  eno1     
bond0        374cc3e8-9455-4f35-b8a7-26914cfc12c7  bond      bond0    
enp5s0f0     9913dc41-6d74-44a4-8230-a083fc8559e6  ethernet  enp5s0f0 
enp5s0f1     bd4d81b6-3946-4296-a26e-72e8021d4df7  ethernet  enp5s0f1

Comment 6 Mingyu Shi 2021-10-25 02:53:12 UTC
As nmstate refers to both `permaddr` and `perm_hwaddr`, I did another test and found something tricky:

# I've changed the mac of physical eno4 to d4:ee:07:25:42:5a, while it has kept the original 44:a8:42:49:41:f7 as `permaddr`:
[10:40:15@dell-per730-03 ~]0# ip -d link show eno4
5: eno4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether d4:ee:07:25:42:5a brd ff:ff:ff:ff:ff:ff permaddr 44:a8:42:49:41:f7 promiscuity 0 minmtu 60 maxmtu 9000 addrgenmode none numtxqueues 5 numrxqueues 5 gso_max_size 65536 gso_max_segs 65535 
[10:40:22@dell-per730-03 ~]0# cat 3.yml 
interfaces:
- name: bond2
  type: bond
  state: up
  copy-mac-from: eno4
  link-aggregation:
    mode: balance-rr
    port:
    - eno4
[10:40:26@dell-per730-03 ~]0# nmstatectl set 3.yml 
/tmp/nmstatelog/2021-10-25-10:40:30-998687107.log
Desired state applied: 
---
interfaces:
- name: bond2
  type: bond
  state: up
  copy-mac-from: eno4
  link-aggregation:
    mode: balance-rr
    port:
    - eno4
/tmp/nmstatelog/2021-10-25-10:40:30-998687107.0.log nmstatectl set 3.yml return 0

# after copy-mac-from eno4, bond2 read the mac 44:a8:42:49:41:f7, which was the `permaddr` of eno4
[10:40:31@dell-per730-03 ~]0# ip -d link show bond2
16: bond2: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether 44:a8:42:49:41:f7 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535 
    bond mode balance-rr miimon 100 updelay 0 downdelay 0 peer_notify_delay 0 use_carrier 1 arp_interval 0 arp_validate none arp_all_targets any primary_reselect always fail_over_mac none xmit_hash_policy layer2 resend_igmp 1 num_grat_arp 1 all_slaves_active 0 min_links 0 lp_interval 1 packets_per_slave 1 lacp_rate slow ad_select stable tlb_dynamic_lb 1 addrgenmode none numtxqueues 16 numrxqueues 16 gso_max_size 65536 gso_max_segs 65535 
[10:40:40@dell-per730-03 ~]0# ip -d link show eno4
5: eno4: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master bond2 state UP mode DEFAULT group default qlen 1000
    link/ether 44:a8:42:49:41:f7 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 60 maxmtu 9000 
    bond_slave state ACTIVE mii_status UP link_failure_count 0 perm_hwaddr d4:ee:07:25:42:5a queue_id 0 addrgenmode none numtxqueues 5 numrxqueues 5 gso_max_size 65536 gso_max_segs 65535


in this case, permaddr != perm_hwaddr. So, looks like for nmstate, there is no chance to copy mac from a user-defined-mac physical interface, nmstate will always copy `permaddr` when it exists.

Comment 7 Gris Ge 2021-10-26 08:14:36 UTC
Nmstate will always use permaddr when it exists. This is design choice to make sure nmstate is idempotent.

Comment 8 Fernando F. Mancera 2022-01-11 15:26:06 UTC
I am closing this as won't fix as there is no customer case and it is low risk. Thank you for reporting this, please if you consider this issue is important, re-open it.


Note You need to log in before you can comment on or make changes to this bug.