sys is too slow when configuring NIC vlan operation

Bug #1979931 reported by Fred Kimmy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kunpeng920
Invalid
Low
Unassigned
Ubuntu-20.04-hwe
Invalid
Low
Unassigned

Bug Description

[Bug Description]
It spend 1 - 1.5 hours to configure(add or delete)maximum number of VLANs about NIC Card . In process of configure nic vlan this sys involve ifquery service,but ifquery service result in high CPU load.

[Steps to Reproduce]
1) ip link add dev enp.<vlan_id> link <ethx> type vlan id <vlan_id> (vlan_id ranges from 0 to 4095.)
2) ip link del enp.<vlan_id>
3) Repeat steps 1 to 2 for 3 times.

[Actual Results]
1-2 hours
[Expected Results]
30min

[Reproducibility]
High probability

[Additional information]
(Firmware version, kernel version, affected hardware, etc. if required2022060808428):
kernel version:Linux ubuntu 5.13.0-30-generic #33~20.04.1-Ubuntu SMP Mon Feb 7 14:28:43 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

[Resolution]

Revision history for this message
Ike Panhc (ikepanhc) wrote :

With 5.13 kernel it only takes 2 seconds for 10 times loop of step 1 and 2. I will try 5.15 too.

ubuntu@segers:~$ uname -a;for i in `seq 1 10`; do echo === vlan $i `date` ===;echo ==== add ====;sudo ip link add dev enp.$i link enp125s0f0 type vlan id $i;echo ==== del ====;sudo ip link del enp.$i; done
Linux segers 5.13.0-51-generic #58~20.04.1-Ubuntu SMP Mon Jun 13 20:00:13 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
=== vlan 1 Wed 29 Jun 2022 06:09:01 AM UTC ===
==== add ====
==== del ====
=== vlan 2 Wed 29 Jun 2022 06:09:01 AM UTC ===
==== add ====
==== del ====
=== vlan 3 Wed 29 Jun 2022 06:09:01 AM UTC ===
==== add ====
==== del ====
=== vlan 4 Wed 29 Jun 2022 06:09:01 AM UTC ===
==== add ====
==== del ====
=== vlan 5 Wed 29 Jun 2022 06:09:01 AM UTC ===
==== add ====
==== del ====
=== vlan 6 Wed 29 Jun 2022 06:09:02 AM UTC ===
==== add ====
==== del ====
=== vlan 7 Wed 29 Jun 2022 06:09:02 AM UTC ===
==== add ====
==== del ====
=== vlan 8 Wed 29 Jun 2022 06:09:02 AM UTC ===
==== add ====
==== del ====
=== vlan 9 Wed 29 Jun 2022 06:09:02 AM UTC ===
==== add ====
==== del ====
=== vlan 10 Wed 29 Jun 2022 06:09:02 AM UTC ===
==== add ====
==== del ====

Revision history for this message
Ike Panhc (ikepanhc) wrote :

It only takes 2 seconds with 5.15 kernel. Is there any other condition needed? e.g. NIC driver. enp125s0f0 is using hns3.

Changed in kunpeng920:
status: New → Incomplete
Revision history for this message
Fred Kimmy (kongzizaixian) wrote :

for i in `seq 1 4095`; do echo === vlan $i `date` ===;echo ==== add ====;sudo ip link add dev enp.$i link enp125s0f0 type vlan id $i; done
for i in `seq 1 4095`; do echo ==== del ====;sudo ip link del enp.$i; done

it reproduce it if you use aboving step.

Revision history for this message
Ike Panhc (ikepanhc) wrote :

Your commands will create 4095 interfaces and delete them. Is there any reason we need to create interfaces so many? Or with any kernel version they can be created in 30min?

Revision history for this message
Ike Panhc (ikepanhc) wrote :

Set importance to low because there is no data loss nor function loss.

Changed in kunpeng920:
importance: Undecided → Low
Revision history for this message
Ike Panhc (ikepanhc) wrote :

With Ubuntu kernel 5.15.0-52.58, it takes 1min 40sec to setup 1024 interface and also delete them.
With mainline kernel 6.0, it takes 1min 28sec.

ubuntu@segers:~$ uname -a;date;echo === start ===;for i in `seq 1 1024`; do sudo ip link add dev enp.$i link enp125s0f0 type vlan id $i; done;for i in `seq 1 1024`; do sudo ip link del enp.$i; done;echo === done ===;date
Linux segers 5.15.0-52-generic #58~20.04.1-Ubuntu SMP Thu Oct 13 13:10:09 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
Mon 24 Oct 2022 07:23:16 AM UTC
=== start ===
=== done ===
Mon 24 Oct 2022 07:24:56 AM UTC

ubuntu@segers:~$ uname -a;date;echo === start ===;for i in `seq 1 1024`; do sudo ip link add dev enp.$i link enp125s0f0 type vlan id $i; done;for i in `seq 1 1024`; do sudo ip link del enp.$i; done;echo === done ===;date
Linux segers 6.0.0-060000-generic #202210022231 SMP PREEMPT_DYNAMIC Sun Oct 2 22:34:33 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
Mon 24 Oct 2022 07:35:10 AM UTC
=== start ===
=== done ===
Mon 24 Oct 2022 07:36:38 AM UTC

Revision history for this message
Ike Panhc (ikepanhc) wrote :

To create 4096 interfaces and delete them, it takes Ubuntu 5.15.0-52.58 kernel 18:33 and mainline 6.0 kernel for 15:10. 5.15 Ubuntu kernel is slightly slower but not unacceptable slow.

ubuntu@segers:~$ uname -a;date;echo === start ===;for i in `seq 1 4096`; do sudo ip link add dev enp.$i link enp125s0f0 type vlan id $i; done;for i in `seq 1 4096`; do sudo ip link del enp.$i; done;echo === done ===;date
Linux segers 5.15.0-52-generic #58~20.04.1-Ubuntu SMP Thu Oct 13 13:10:09 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
Mon 24 Oct 2022 08:29:24 AM UTC
=== start ===
Error: 8021q: Invalid VLAN id.
Error: 8021q: Invalid VLAN id.
Cannot find device "enp.4095"
Cannot find device "enp.4096"
=== done ===
Mon 24 Oct 2022 08:47:57 AM UTC

ubuntu@segers:~$ uname -a;date;echo === start ===;for i in `seq 1 4096`; do sudo ip link add dev enp.$i link enp125s0f0 type vlan id $i; done;for i in `seq 1 4096`; do sudo ip link del enp.$i; done;echo === done ===;date
Linux segers 6.0.0-060000-generic #202210022231 SMP PREEMPT_DYNAMIC Sun Oct 2 22:34:33 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
Mon 24 Oct 2022 07:39:35 AM UTC
=== start ===
Error: 8021q: Invalid VLAN id.
Error: 8021q: Invalid VLAN id.
Cannot find device "enp.4095"
Cannot find device "enp.4096"
=== done ===
Mon 24 Oct 2022 07:54:45 AM UTC

Revision history for this message
Ike Panhc (ikepanhc) wrote :

As disscuss with ifquery is working slow when there are huge number of interfaces are created. Since deb ifupdown, which provides ifquery is not critical to bring up/down interfaces, we do not need to install it. This issue can be solved by un-install ifupdown or just not to ifquery.

I am going to close this issue.

Changed in kunpeng920:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.