Bug 1951951

Summary: [RFE] Bonding: add option lacp active
Product: Red Hat Enterprise Linux 9 Reporter: Hangbin Liu <haliu>
Component: kernelAssignee: Jonathan Toppins <jtoppins>
kernel sub component: Bonding QA Contact: LiLiang <liali>
Status: CLOSED ERRATA Docs Contact: Jaroslav Klech <jklech>
Severity: high    
Priority: high CC: jarod, jklech, jtoppins, liali, mschmidt, network-qe
Version: 9.0Keywords: FutureFeature, Triaged
Target Milestone: beta   
Target Release: 9.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kernel-5.14.0-60.el9 Doc Type: Enhancement
Doc Text:
.A new parameter for the kernel `bonding` module: `lacp_active` RHEL 9 introduces the `lacp_active` parameter for the `bonding` kernel module. This parameter specifies whether to send Link Aggregation Control Protocol Data Unit (LACPDU) frames at specified intervals. The options are as follows: * `on` (default) - enables to send the LACPDU frames along with the configured `lacp_rate` parameter * `off` - the LACPDU frames act as "speak when spoken to" Note that the LACPDU state frames are still sent when you initialize or unbind port.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 15:38:02 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:
Bug Depends On:    
Bug Blocks: 1951910    

Description Hangbin Liu 2021-04-21 08:27:04 UTC
Description of problem:

As we plan to deprecate teaming on RHEL9 and ask customers to move to bonding.
We need to fix the feature gaps between bonding and teaming. This bug is intend to add teaming feature 'lacp active' for bonding.

runner.active (bool): If active is true LACPDU frames are sent along the configured links periodically. If not, it acts as "speak when spoken to".

There are 1124 use cases in sos reports.

Comment 3 Michal Schmidt 2021-08-31 14:05:50 UTC
This is v5.15 material, so not yet in 9-Beta.

Comment 4 Hangbin Liu 2021-12-02 10:06:18 UTC
Re-assign to Jonathan so he could handle this bug based on his schedule.

Comment 5 Jonathan Toppins 2022-01-21 21:11:59 UTC
I moved back the ITM by 1 week because features cannot be accepted after ITM 26 and this series is already posted.

Comment 6 LiLiang 2022-01-22 02:43:52 UTC
(In reply to Jonathan Toppins from comment #5)
> I moved back the ITM by 1 week because features cannot be accepted after ITM
> 26 and this series is already posted.

That's ok.

Comment 10 LiLiang 2022-02-10 07:29:02 UTC
There are 3 problems.

[root@hp-dl380g9-05 lacp_active]# uname -r
5.14.0-54.mr385_220204_1824.el9.x86_64

1.lacp_active doesn't work when using it as a modprobe parameter.

# specify lacp_active=0
[root@hp-dl380g9-05 lacp_active]# modprobe -v bonding mode=4 miimon=100 max_bonds=1 lacp_active=0
insmod /lib/modules/5.14.0-54.mr385_220204_1824.el9.x86_64/kernel/drivers/net/bonding/bonding.ko.xz max_bonds=0 mode=4 miimon=100 max_bonds=1 lacp_active=0

# but it is 1 in sysfs
[root@hp-dl380g9-05 lacp_active]# cat /sys/class/net/bond0/bonding/lacp_active 
on 1

2. after changing lacp_active to 0, bond still send one lacp packet actively.

[root@hp-dl380g9-05 lacp_active]# cat re
modprobe -v bonding mode=4 miimon=100 max_bonds=1 lacp_active=0
echo 0 > /sys/class/net/bond0/bonding/lacp_active
ip link set bond0 up
ifenslave bond0 ens2f0np0 ens2f1np1
ip addr add 172.20.121.1/24 dev bond0
timeout 70s tcpdump -i ens2f0np0 ether proto 0x8809 -Q out -ev

[root@hp-dl380g9-05 lacp_active]# source re
+ source re
++ modprobe -v bonding mode=4 miimon=100 max_bonds=1 lacp_active=0
insmod /lib/modules/5.14.0-54.mr385_220204_1824.el9.x86_64/kernel/drivers/net/bonding/bonding.ko.xz max_bonds=0 mode=4 miimon=100 max_bonds=1 lacp_active=0
++ echo 0
++ ip link set bond0 up
++ ifenslave bond0 ens2f0np0 ens2f1np1
++ ip addr add 172.20.121.1/24 dev bond0
++ timeout 70s tcpdump -i ens2f0np0 ether proto 0x8809 -Q out -ev
dropped privs to tcpdump
tcpdump: listening on ens2f0np0, link-type EN10MB (Ethernet), snapshot length 262144 bytes
02:18:19.465790 e4:1d:2d:c0:85:aa (oui Unknown) > 01:80:c2:00:00:02 (oui Unknown), ethertype Slow Protocols (0x8809), length 124: LACPv1, length 110
	Actor Information TLV (0x01), length 20
	  System e4:1d:2d:c0:85:aa (oui Unknown), System Priority 65535, Key 15, Port 1, Port Priority 255
	  State Flags [Activity, Aggregation, Synchronization, Default, Expired]
	Partner Information TLV (0x02), length 20
	  System 00:00:00:00:00:00 (oui Ethernet), System Priority 65535, Key 1, Port 1, Port Priority 255
	  State Flags [Activity, Timeout]
	Collector Information TLV (0x03), length 16
	  Max Delay 0
	Terminator TLV (0x00), length 0

1 packet captured
1 packet received by filter
0 packets dropped by kernel

3. nmcli doesn't support lacp_active
[root@hp-dl380g9-05 lacp_active]# nmcli con add type bond ifname bond0 bond.options "mode=802.3ad,miimon=100,lacp_active=0" ipv4.addresses 192.168.10.110/24
Error: failed to modify bond.options: 'lacp_active' not among [mode, miimon, downdelay, updelay, arp_interval, arp_ip_target, arp_validate, primary, primary_reselect, fail_over_mac, use_carrier, ad_select, xmit_hash_policy, resend_igmp, lacp_rate, active_slave, ad_actor_sys_prio, ad_actor_system, ad_user_port_key, all_slaves_active, arp_all_targets, min_links, num_grat_arp, num_unsol_na, packets_per_slave, tlb_dynamic_lb, lp_interval, peer_notif_delay].

Comment 11 Hangbin Liu 2022-02-10 07:37:52 UTC
(In reply to LiLiang from comment #10)
> There are 3 problems.
> 
> 1.lacp_active doesn't work when using it as a modprobe parameter.

That's as expected. Upstream doesn't allow new bond module parameters now.


> 2. after changing lacp_active to 0, bond still send one lacp packet actively.

I will check this issue

> 3. nmcli doesn't support lacp_active

This is expected. We haven't opened a NM bug for this option yet. Maybe we can open one after this bug verified.

Thanks
Hangbin

Comment 12 Hangbin Liu 2022-02-10 07:47:40 UTC
(In reply to LiLiang from comment #10)
> 2. after changing lacp_active to 0, bond still send one lacp packet actively.
> [root@hp-dl380g9-05 lacp_active]# source re
> + source re
> ++ modprobe -v bonding mode=4 miimon=100 max_bonds=1 lacp_active=0

Oh, here you try to set the lacp_active with modprobe, which is not allowed as I said.
So this setting is not working and the lacp_active value should still be 1/on.

> insmod
> /lib/modules/5.14.0-54.mr385_220204_1824.el9.x86_64/kernel/drivers/net/
> bonding/bonding.ko.xz max_bonds=0 mode=4 miimon=100 max_bonds=1 lacp_active=0
> ++ echo 0
> ++ ip link set bond0 up
> ++ ifenslave bond0 ens2f0np0 ens2f1np1
> ++ ip addr add 172.20.121.1/24 dev bond0
> ++ timeout 70s tcpdump -i ens2f0np0 ether proto 0x8809 -Q out -ev

So you can still capture LACP message. Please try set bond0 down and
echo 0 > /sys/class/net/bond0/bonding/lacp_active. Then try again.

Thanks
Hangbin

Comment 13 LiLiang 2022-02-10 08:10:16 UTC
Hangbin,

I have did this in my reproducer, see line 2:

```
modprobe -v bonding mode=4 miimon=100 max_bonds=1 lacp_active=0
echo 0 > /sys/class/net/bond0/bonding/lacp_active
ip link set bond0 up
ifenslave bond0 ens2f0np0 ens2f1np1
ip addr add 172.20.121.1/24 dev bond0
timeout 70s tcpdump -i ens2f0np0 ether proto 0x8809 -Q out -ev
```

Comment 14 Hangbin Liu 2022-02-10 08:39:49 UTC
(In reply to LiLiang from comment #13)
> echo 0 > /sys/class/net/bond0/bonding/lacp_active

Opps, sorry I didn't notice this one. I will check the reason.

Comment 15 Hangbin Liu 2022-02-11 03:48:26 UTC
Hi LiLiang,

Just found this in the patch description. So I think this should be expected behavior... What do you think?

"Note, the LACPDU state frames still will be sent when init or unbind port. "

Thanks
Hangbin

Comment 16 LiLiang 2022-02-11 04:24:38 UTC
Thanks Hangbin, Tested.

Comment 18 LiLiang 2022-02-16 00:42:23 UTC
verified on kernel -360

[root@dell-per740-84 lacp_active]# uname -r
5.14.0-60.el9.x86_64

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   lacp_active 0
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 19:29:55 ] :: [   PASS   ] :: Command 'sync_wait server bonding_parameters_lacp_active_start' (Expected 0, got 0)
:: [ 19:30:17 ] :: [   PASS   ] :: Command 'slaves='enp59s0f0 enp59s0f1'' (Expected 0, got 0)
:: [ 19:30:17 ] :: [   PASS   ] :: Command 'slave1=enp59s0f0' (Expected 0, got 0)
:: [ 19:30:17 ] :: [   PASS   ] :: Command 'slave2=enp59s0f1' (Expected 0, got 0)
:: [ 19:30:17 ] :: [   PASS   ] :: Command 'modprobe -v bonding mode=4 miimon=100 max_bonds=1' (Expected 0, got 0)
:: [ 19:30:18 ] :: [   PASS   ] :: Command 'echo 0 > /sys/class/net/bond0/bonding/lacp_active' (Expected 0, got 0)
:: [ 19:30:18 ] :: [   PASS   ] :: Command 'ip link set bond0 up' (Expected 0, got 0)
:: [ 19:30:18 ] :: [   PASS   ] :: Command 'ifenslave bond0 enp59s0f0 enp59s0f1' (Expected 0, got 0)
:: [ 19:30:18 ] :: [   PASS   ] :: Command 'ip addr add 172.20.95.1/24 dev bond0' (Expected 0, got 0)
:: [ 19:30:48 ] :: [   PASS   ] :: Command 'sleep 30' (Expected 0, got 0)
:: [ 19:31:38 ] :: [   PASS   ] :: Command 'timeout 50s tcpdump -i enp59s0f0 ether proto 0x8809 -ev -Q out -c 1' (Expected 1-254, got 124)
:: [ 19:32:29 ] :: [   PASS   ] :: Command 'timeout 50s tcpdump -i enp59s0f1 ether proto 0x8809 -ev -Q out -c 1' (Expected 1-254, got 124)
:: [ 19:33:17 ] :: [   PASS   ] :: Command 'timeout 90s bash -c "until ping -c 3 172.20.95.2 -I bond0;do sleep 5;done"' (Expected 0, got 0)
:: [ 19:33:18 ] :: [   PASS   ] :: Command 'timeout 50s tcpdump -i enp59s0f0 ether proto 0x8809 -ev -Q out -c 1' (Expected 0, got 0)
:: [ 19:33:18 ] :: [   PASS   ] :: Command 'timeout 50s tcpdump -i enp59s0f1 ether proto 0x8809 -ev -Q out -c 1' (Expected 0, got 0)
:: [ 19:33:19 ] :: [   PASS   ] :: Command 'modprobe -rv bonding' (Expected 0, got 0)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 260s
::   Assertions: 16 good, 0 bad
::   RESULT: PASS (lacp_active 0)


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   lacp_active 1
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 19:33:39 ] :: [   PASS   ] :: Command 'modprobe -v bonding mode=4 miimon=100 max_bonds=1' (Expected 0, got 0)
:: [ 19:33:40 ] :: [   PASS   ] :: Command 'echo 1 > /sys/class/net/bond0/bonding/lacp_active' (Expected 0, got 0)
:: [ 19:33:40 ] :: [   PASS   ] :: Command 'ip link set bond0 up' (Expected 0, got 0)
:: [ 19:33:40 ] :: [   PASS   ] :: Command 'ifenslave bond0 enp59s0f0 enp59s0f1' (Expected 0, got 0)
:: [ 19:33:40 ] :: [   PASS   ] :: Command 'ip addr add 172.20.95.1/24 dev bond0' (Expected 0, got 0)
:: [ 19:34:10 ] :: [   PASS   ] :: Command 'sleep 30' (Expected 0, got 0)
:: [ 19:34:14 ] :: [   PASS   ] :: Command 'timeout 50s tcpdump -i enp59s0f0 ether proto 0x8809 -ev -Q out -c 1' (Expected 0, got 0)
:: [ 19:34:45 ] :: [   PASS   ] :: Command 'timeout 50s tcpdump -i enp59s0f1 ether proto 0x8809 -ev -Q out -c 1' (Expected 0, got 0)
:: [ 19:35:22 ] :: [   PASS   ] :: Command 'timeout 90s bash -c "until ping -c 3 172.20.95.2 -I bond0;do sleep 5;done"' (Expected 0, got 0)
:: [ 19:35:23 ] :: [   PASS   ] :: Command 'timeout 50s tcpdump -i enp59s0f0 ether proto 0x8809 -ev -Q out -c 1' (Expected 0, got 0)
:: [ 19:35:24 ] :: [   PASS   ] :: Command 'timeout 50s tcpdump -i enp59s0f1 ether proto 0x8809 -ev -Q out -c 1' (Expected 0, got 0)
:: [ 19:35:24 ] :: [   PASS   ] :: Command 'modprobe -rv bonding' (Expected 0, got 0)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 126s
::   Assertions: 12 good, 0 bad
::   RESULT: PASS (lacp_active 1)


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   change lacp_active to 0
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 19:35:45 ] :: [   PASS   ] :: Command 'modprobe -v bonding mode=4 miimon=100 max_bonds=1' (Expected 0, got 0)
:: [ 19:35:46 ] :: [   PASS   ] :: Command 'echo 1 > /sys/class/net/bond0/bonding/lacp_active' (Expected 0, got 0)
:: [ 19:35:46 ] :: [   PASS   ] :: Command 'ip link set bond0 up' (Expected 0, got 0)
:: [ 19:35:46 ] :: [   PASS   ] :: Command 'ifenslave bond0 enp59s0f0 enp59s0f1' (Expected 0, got 0)
:: [ 19:35:46 ] :: [   PASS   ] :: Command 'ip addr add 172.20.95.1/24 dev bond0' (Expected 0, got 0)
:: [ 19:35:46 ] :: [   PASS   ] :: Command 'ip link set bond0 down' (Expected 0, got 0)
:: [ 19:35:46 ] :: [   PASS   ] :: Command 'echo 0 > /sys/class/net/bond0/bonding/lacp_active' (Expected 0, got 0)
:: [ 19:35:46 ] :: [   PASS   ] :: Command 'ip link set bond0 up' (Expected 0, got 0)
:: [ 19:36:16 ] :: [   PASS   ] :: Command 'sleep 30' (Expected 0, got 0)
:: [ 19:36:16 ] :: [   PASS   ] :: Command 'new_value=0' (Expected 0, got 0)
:: [ 19:36:16 ] :: [   PASS   ] :: Command 'test 0 -eq 0' (Expected 0, got 0)
:: [ 19:37:06 ] :: [   PASS   ] :: Command 'timeout 50s tcpdump -i enp59s0f0 ether proto 0x8809 -ev -Q out -c 1' (Expected 1-254, got 124)
:: [ 19:37:56 ] :: [   PASS   ] :: Command 'timeout 50s tcpdump -i enp59s0f1 ether proto 0x8809 -ev -Q out -c 1' (Expected 1-254, got 124)
:: [ 19:38:33 ] :: [   PASS   ] :: Command 'timeout 90s bash -c "until ping -c 3 172.20.95.2 -I bond0;do sleep 5;done"' (Expected 0, got 0)
:: [ 19:38:34 ] :: [   PASS   ] :: Command 'timeout 50s tcpdump -i enp59s0f0 ether proto 0x8809 -ev -Q out -c 1' (Expected 0, got 0)
:: [ 19:38:34 ] :: [   PASS   ] :: Command 'timeout 50s tcpdump -i enp59s0f1 ether proto 0x8809 -ev -Q out -c 1' (Expected 0, got 0)
:: [ 19:38:34 ] :: [   PASS   ] :: Command 'modprobe -rv bonding' (Expected 0, got 0)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 190s
::   Assertions: 17 good, 0 bad
::   RESULT: PASS (change lacp_active to 0)


::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   change lacp_active to 1
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:: [ 19:38:55 ] :: [   PASS   ] :: Command 'modprobe -v bonding mode=4 miimon=100 max_bonds=1' (Expected 0, got 0)
:: [ 19:38:56 ] :: [   PASS   ] :: Command 'echo 0 > /sys/class/net/bond0/bonding/lacp_active' (Expected 0, got 0)
:: [ 19:38:56 ] :: [   PASS   ] :: Command 'ip link set bond0 up' (Expected 0, got 0)
:: [ 19:38:56 ] :: [   PASS   ] :: Command 'ifenslave bond0 enp59s0f0 enp59s0f1' (Expected 0, got 0)
:: [ 19:38:56 ] :: [   PASS   ] :: Command 'ip addr add 172.20.95.1/24 dev bond0' (Expected 0, got 0)
:: [ 19:38:56 ] :: [   PASS   ] :: Command 'ip link set bond0 down' (Expected 0, got 0)
:: [ 19:38:56 ] :: [   PASS   ] :: Command 'echo 1 > /sys/class/net/bond0/bonding/lacp_active' (Expected 0, got 0)
:: [ 19:38:56 ] :: [   PASS   ] :: Command 'ip link set bond0 up' (Expected 0, got 0)
:: [ 19:39:26 ] :: [   PASS   ] :: Command 'sleep 30' (Expected 0, got 0)
:: [ 19:39:26 ] :: [   PASS   ] :: Command 'new_value=1' (Expected 0, got 0)
:: [ 19:39:26 ] :: [   PASS   ] :: Command 'test 1 -eq 1' (Expected 0, got 0)
:: [ 19:39:31 ] :: [   PASS   ] :: Command 'timeout 50s tcpdump -i enp59s0f0 ether proto 0x8809 -ev -Q out -c 1' (Expected 0, got 0)
:: [ 19:40:02 ] :: [   PASS   ] :: Command 'timeout 50s tcpdump -i enp59s0f1 ether proto 0x8809 -ev -Q out -c 1' (Expected 0, got 0)
:: [ 19:40:43 ] :: [   PASS   ] :: Command 'timeout 90s bash -c "until ping -c 3 172.20.95.2 -I bond0;do sleep 5;done"' (Expected 0, got 0)
:: [ 19:40:44 ] :: [   PASS   ] :: Command 'timeout 50s tcpdump -i enp59s0f0 ether proto 0x8809 -ev -Q out -c 1' (Expected 0, got 0)
:: [ 19:40:45 ] :: [   PASS   ] :: Command 'timeout 50s tcpdump -i enp59s0f1 ether proto 0x8809 -ev -Q out -c 1' (Expected 0, got 0)
:: [ 19:40:45 ] :: [   PASS   ] :: Command 'modprobe -rv bonding' (Expected 0, got 0)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::   Duration: 130s
::   Assertions: 17 good, 0 bad
::   RESULT: PASS (change lacp_active to 1)

Comment 22 errata-xmlrpc 2022-05-17 15:38:02 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 (new packages: kernel), 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:3907