[hns3-0114]net: hns3: fix ETS bandwidth validation bug

Bug #1859569 reported by Fred Kimmy on 2020-01-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kunpeng920
Undecided
Unassigned
Ubuntu-18.04
Undecided
Taihsiang Ho
Ubuntu-18.04-hwe
Undecided
Unassigned
Ubuntu-20.04
Undecided
Unassigned
Upstream-kernel
Undecided
Unassigned
linux (Ubuntu)
Status tracked in Focal
Bionic
Undecided
Unassigned
Eoan
Undecided
Unassigned
Focal
Undecided
Unassigned

Bug Description

When a TC's PFC is disabled or enabled, the RX private buffer for
this TC need to be changed too, otherwise this may cause packet
dropped problem.

[Impact]
The corresponding ethernet interface could not be up again.

[Fix]
cherry picked from commit c2d56897819338eb0ba8b93184f7d10329b36653
net: hns3: fix ETS bandwidth validation bug

[Test Case]
1.lldpad -d
2.lldptool -L -i eth0 adminStatus=rxtx
3.lldptool -T -i eth0 -V ETS-CFG
tsa=0:ets,1:ets,2:ets,3:ets,4:ets,5:ets,6:ets,7:ets
up2tc=0:0,1:0,2:1,3:1,4:2,5:2,6:3,7:3 tcbw=25,25,50,0,0,0,0,0
4.down device
5.up

[Regression Risk]
Low, the patch is only specific to the hns3 driver.

====== Original Bug Description ======

[Bug Description]
When a TC's PFC is disabled or enabled, the RX private buffer for
this TC need to be changed too, otherwise this may cause packet
dropped problem.

[Steps to Reproduce]
1.lldpad -d
2.lldptool -L -i eth0 adminStatus=rxtx
3.lldptool -T -i eth0 -V ETS-CFG tsa=0:ets,1:ets,2:ets,3:ets,4:ets,5:ets,6:ets,7:ets up2tc=0:0,1:0,2:1,3:1,4:2,5:2,6:3,7:3 tcbw=25,25,50,0,0,0,0,0
4.down device
5.up

[Actual Results]
up fail

[Expected Results]
up ok

[Reproducibility]
Inevitably

[Additional information]
Hardware: D06
Firmware: NA
Kernel: NA

[Resolution]
This patch fixes it by calling hclge_buffer_alloc to reallocate
buffer when pfc_en changes.

c2d568978193 net: hns3: fix ETS bandwidth validation bug

Ike Panhc (ikepanhc) on 2020-01-14
description: updated
Ike Panhc (ikepanhc) on 2020-01-14
tags: added: ikeradar
tags: added: tairadar
Ike Panhc (ikepanhc) on 2020-02-27
Changed in kunpeng920:
status: New → In Progress
tags: removed: ikeradar
Taihsiang Ho (taihsiangho) wrote :

The fix landed in eoan kernel 5.3.0-40.32.

===

$ git log lp/master-next --abbrev-commit --pretty=onel
ine --grep="net: hns3: fix ETS bandwidth validation bug"
0afb5b928e17 net: hns3: fix ETS bandwidth validation bug

$ git tag --contains 0afb5b928e17
Ubuntu-5.3.0-40.32
Ubuntu-5.3.0-41.33
Ubuntu-5.3.0-42.34
Ubuntu-raspi2-5.3.0-1018.20
Ubuntu-raspi2-5.3.0-1019.21

$ rmadison -asource linux
<skip>
 linux | 5.3.0-18.19 | eoan | source
 linux | 5.3.0-40.32 | eoan-security | source
 linux | 5.3.0-40.32 | eoan-updates | source
 linux | 5.3.0-42.34 | eoan-proposed | source
<skip>

Taihsiang Ho (taihsiangho) wrote :

The fix begins to show up in upstream v5.4-rc8

======

$ git log origin/master --abbrev-commit --pretty=oneline --grep="net: hns3: fix ETS bandwidth validation bug"
c2d568978193 net: hns3: fix ETS bandwidth validation bug

$ git tag --contains c2d568978193
v5.4
v5.4-rc8
v5.5
v5.5-rc1
v5.5-rc2
v5.5-rc3
v5.5-rc4
v5.5-rc5
v5.5-rc6
v5.5-rc7
v5.6-rc1
v5.6-rc2
v5.6-rc3

Taihsiang Ho (taihsiangho) wrote :

The fix could be cherry-picked cleaning for bionic.

Taihsiang Ho (taihsiangho) wrote :

Similar to the comment #1, the fix should have landed in bionic-hwe.

======

bionic$ git tag --contains 0afb5b928e17
Ubuntu-hwe-5.3.0-40.32_18.04.1
Ubuntu-hwe-5.3.0-41.33_18.04.1
Ubuntu-hwe-5.3.0-42.34_18.04.1
Ubuntu-raspi2-5.3-5.3.0-1018.20_18.04.1
Ubuntu-raspi2-5.3-5.3.0-1019.21_18.04.1

Taihsiang Ho (taihsiangho) wrote :

The fix has been in focal tree.

======

focal$ git log origin/master --abbrev-commit --pretty=oneline --grep="net: hns3: fix ETS bandwidth validation bug"
c2d568978193 net: hns3: fix ETS bandwidth validation bug

focal$ git tag --contains c2d568978193
Ubuntu-5.4-5.4.0-10.13
Ubuntu-5.4-5.4.0-11.14
Ubuntu-5.4-5.4.0-12.15
Ubuntu-5.4-5.4.0-13.16
Ubuntu-5.4-5.4.0-14.17
Ubuntu-5.4.0-15.18
Ubuntu-5.4.0-16.19
Ubuntu-5.4.0-17.20
Ubuntu-5.4.0-17.21
Ubuntu-5.4.0-8.11
Ubuntu-5.4.0-9.12
Ubuntu-raspi2-5.4-5.4.0-1001.1
Ubuntu-raspi2-5.4.0-1003.3
Ubuntu-raspi2-5.4.0-1004.4
v5.4

Taihsiang Ho (taihsiangho) wrote :

I could not reproduce this issue on d06-2 and scobee with bionic 4.15.0-88-generic.

Taihsiang Ho (taihsiangho) wrote :

@Fred , may you please provide more details about the step to reproduce the issue? e.g.

1. Is any device up/down able to reproduce the issue? Or the device should be in connected status.
2. How did you up/down the device? For example, via the "ip link set <DEVICE> down" command?

description: updated

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1859569

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Ike Panhc (ikepanhc) on 2020-03-10
Changed in linux (Ubuntu Focal):
status: Incomplete → Fix Released
Changed in linux (Ubuntu Bionic):
status: New → Incomplete
status: Incomplete → In Progress
Ike Panhc (ikepanhc) on 2020-03-10
Changed in linux (Ubuntu Eoan):
status: New → Fix Released
Taihsiang Ho (taihsiangho) wrote :

This patch https://lists.ubuntu.com/archives/kernel-team/2020-March/108124.html has been tested on bionic to look for regression:

1. ping and is accessible externally via eth

2. checked the loaded kernel modules and enablement log of dmesg

3. checkbox-cli

ubuntu@scobee:~$ checkbox-cli run com.canonical.certification::ethernet/detect com.canonical.certification::ethernet/info_automated com.canonical.certification::ethernet/info_automated_server

Finalizing session that hasn't been submitted anywhere: checkbox-run-2020-03-10T13.13.52
==================================[ Results ]===================================
 ☑ : Hardware Manifest
 ☑ : Detect if at least one ethernet device is detected
 ☑ : Enumerate available system executables
 ☑ : Collect information about hardware devices (udev)
 ☑ : Gather info on current state of network devices
 ☑ : Provide information about detected ethernet devices
ubuntu@scobee:~$

Changed in linux (Ubuntu Bionic):
status: In Progress → Fix Committed

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-bionic' to 'verification-done-bionic'. If the problem still exists, change the tag 'verification-needed-bionic' to 'verification-failed-bionic'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-bionic
Changed in kunpeng920:
status: In Progress → Fix Committed
Taihsiang Ho (taihsiangho) wrote :

Verified via

1. ping and is accessible externally via eth

2. checked the loaded kernel modules and enablement log of dmesg

3. checkbox-cli

$ checkbox-cli run com.canonical.certification::ethernet/detect com.canonical.certification::ethernet/info_automated com.canonical.certification::ethernet/info_automated_server

Finalizing session that hasn't been submitted anywhere: checkbox-run-2020-03-18T18.30.47
==================================[ Results ]===================================
 ☑ : Hardware Manifest
 ☑ : Detect if at least one ethernet device is detected
 ☑ : Enumerate available system executables
 ☑ : Collect information about hardware devices (udev)
 ☑ : Gather info on current state of network devices
 ☑ : Provide information about detected ethernet devices
ubuntu@scobee:~$ uname -a
Linux scobee 4.15.0-92-generic #93-Ubuntu SMP Mon Mar 16 15:40:04 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux

tags: added: verification-done-bionic
removed: verification-needed-bionic
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers