[hns3-0120]pad the short frame before sending to the hardware

Bug #1860320 reported by Fred Kimmy on 2020-01-20
8
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
Taihsiang Ho
Upstream-kernel
Undecided
Taihsiang Ho
linux (Ubuntu)
Undecided
Unassigned
Bionic
Undecided
Taihsiang Ho

Bug Description

The hardware can not handle short frames below or equal to 32
bytes.

[Impact]
The system may hang or endless event log in /var/log/syslog

[Fix]
Cherry-pick or backport the upstream fix 36c67349a1a1c88b9cf11d7ca7762ababdb38867 net: hns3: pad the short frame before sending to the hardware

[Test Case]
Send a frame less than 33 bytes.

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

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

[Bug Description]
The hardware can not handle short frames below or equal to 32
bytes according to the hardware user manual, and it will trigger
a RAS error when the frame's length is below 33 bytes.

[Steps to Reproduce]
1.send a frame less than 33 bytes.

[Actual Results]
a RAS occurs

[Expected Results]
no RAS

[Reproducibility]
Inevitably

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

[Resolution]
pads the SKB when skb->len is below 33 bytes before sending it to hardware.

net: hns3: pad the short frame before sending to the hardware

Taihsiang Ho (taihsiangho) wrote :

The patch has been in ubuntu focal

commit 0e282454804fc4d1de2ae6847d292da6b67f45c1
Author: Yunsheng Lin <email address hidden>
Date: Wed Jan 15 10:46:45 2020 +0800

    net: hns3: pad the short frame before sending to the hardware

    BugLink: https://bugs.launchpad.net/bugs/1861090

    [ Upstream commit 36c67349a1a1c88b9cf11d7ca7762ababdb38867 ]

    The hardware can not handle short frames below or equal to 32
    bytes according to the hardware user manual, and it will trigger
    a RAS error when the frame's length is below 33 bytes.

    This patch pads the SKB when skb->len is below 33 bytes before
    sending it to hardware.

    Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
    Signed-off-by: Yunsheng Lin <email address hidden>
    Signed-off-by: Huazhong Tan <email address hidden>
    Signed-off-by: David S. Miller <email address hidden>
    Signed-off-by: Greg Kroah-Hartman <email address hidden>
    Signed-off-by: Paolo Pisati <email address hidden>

Taihsiang Ho (taihsiangho) wrote :

The patch has not been in bionic-hwe Ubuntu-hwe-5.3.0-40.32~18.04.1.

description: updated
description: updated
Taihsiang Ho (taihsiangho) wrote :

The patch backported to 18.04. Verified on d06-2 by sending frames < 33 bytes over raw socket to ethernet interface.

Ike Panhc (ikepanhc) on 2020-02-24
Changed in kunpeng920:
status: New → In Progress
Changed in linux (Ubuntu Bionic):
status: New → In Progress
assignee: nobody → Taihsiang Ho (taihsiangho)

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 1860320

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
tags: added: patch
Ike Panhc (ikepanhc) wrote :

In focal kernel already.

$ gitoneline origin/master-next | grep 'pad the short frame before sending'
0e282454804f <email address hidden> 2020-01-30 16:26:32 +0100 net: hns3: pad the short frame before sending to the hardware

Changed in linux (Ubuntu):
status: Incomplete → Fix Released
Taihsiang Ho (taihsiangho) wrote :

In eoan kernel already.

$ git log --grep="net: hns3: pad the short frame before sending to the hardware"
commit 39d592aa888b3cfe3bca86b524775e4d5b8c96fc
Author: Yunsheng Lin <email address hidden>
Date: Wed Jan 15 10:46:45 2020 +0800

    net: hns3: pad the short frame before sending to the hardware

    BugLink: https://bugs.launchpad.net/bugs/1862429

    [ Upstream commit 36c67349a1a1c88b9cf11d7ca7762ababdb38867 ]

    The hardware can not handle short frames below or equal to 32
    bytes according to the hardware user manual, and it will trigger
    a RAS error when the frame's length is below 33 bytes.

    This patch pads the SKB when skb->len is below 33 bytes before
    sending it to hardware.

    Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
    Signed-off-by: Yunsheng Lin <email address hidden>
    Signed-off-by: Huazhong Tan <email address hidden>
    Signed-off-by: David S. Miller <email address hidden>
    Signed-off-by: Greg Kroah-Hartman <email address hidden>
    Signed-off-by: Kamal Mostafa <email address hidden>
    Signed-off-by: Khalid Elmously <email address hidden>

Changed in linux (Ubuntu Bionic):
status: In Progress → Fix Committed
status: Fix Committed → In Progress
tags: added: tairadar
Taihsiang Ho (taihsiangho) wrote :

The patch in Eoan is merged over stable channel https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1862429

Taihsiang Ho (taihsiangho) wrote :

The fix is expected to land bionic-hwe after this SRU cycle completes

---

bionic-hwe kernel tagged Ubuntu-hwe-5.3.0-41.33_18.04.1 and/or Ubuntu-hwe-5.3.0-42.34_18.04.1 have the upstream patch.

    $ git remote -v
    lp git+ssh://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/bionic (fetch)
    lp git+ssh://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/bionic (push)

    $ git log lp/hwe --abbrev-commit --pretty=oneline --grep "net: hns3: pad the short frame before sending to the hardware"
    39d592aa888b net: hns3: pad the short frame before sending to the hardware

    $ git tag --list --contains 39d592aa888b
    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-1019.21_18.04.1

    $ rmadison linux-generic-hwe-18.04
     linux-generic-hwe-18.04 | 5.3.0.40.97 | bionic-security | amd64, arm64, armhf, i386, ppc64el, s390x
     linux-generic-hwe-18.04 | 5.3.0.40.97 | bionic-updates | amd64, arm64, armhf, i386, ppc64el, s390x
     linux-generic-hwe-18.04 | 5.3.0.42.99 | bionic-proposed | amd64, arm64, armhf, i386, ppc64el, s390x
     linux-generic-hwe-18.04 | 5.4.0.14.17 | focal | amd64, arm64, armhf, ppc64el, s390x
     linux-generic-hwe-18.04 | 5.4.0.17.21 | focal-proposed | amd64, arm64, armhf, ppc64el, s390x

And
    "d06-1 5.3.0-40-generic #32~18.04.1-Ubuntu SMP Mon Feb 3 14:08:05 UTC 2020"
could reproduce this issue. /var/log/syslog will output endless log of message
    "Mar 3 15:39:35 d06-1 kernel: [ 6305.142251] hns3 0000:7d:00.2: received event 0x400")

Taihsiang Ho (taihsiangho) wrote :

The fix is expected to hit eoan 5.3 kernel after this SRU completes

    $ rmadison -asource linux | grep eoan
     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

    $ git log upstream/master-next --abbrev-commit --pretty=oneline --grep "net: hns3: pad the short frame before sending to the hardware"
    39d592aa888b net: hns3: pad the short frame before sending to the hardware

    $ git tag --list --contains 39d592aa888b
    Ubuntu-5.3.0-41.33
    Ubuntu-5.3.0-42.34
    Ubuntu-raspi2-5.3.0-1019.21

    $ git remote -v
    upstream git+ssh://<email address hidden>/~ubuntu-kernel/ubuntu/+source/linux/+git/eoan (fetch)
    upstream git+ssh://<email address hidden>/~ubuntu-kernel/ubuntu/+source/linux/+git/eoan (push)

Taihsiang Ho (taihsiangho) wrote :

Current upstream status has this fix commit

    $ git log upstream/master --abbrev-commit --pretty=oneline --grep "net: hns3: pad the short frame before sending to the hardware"
    36c67349a1a1 net: hns3: pad the short frame before sending to the hardware

    $ git tag --list --contains 36c67349a1a1
    v5.5
    v5.5-rc7
    v5.5.1
    v5.5.2
    v5.5.3
    v5.5.4
    v5.5.5
    v5.5.6
    v5.5.7
    v5.6-rc1
    v5.6-rc2
    v5.6-rc3
    v5.6-rc4

    $ git remote -v
    upstream git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git (fetch)
    upstream git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git (push)

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 and the bug is fixed.

- 4.15.0-92-generic, scobee
- 4.15.0-92-generic, d06-2

tags: added: verification-done-bionic
removed: verification-needed-bionic
Taihsiang Ho (taihsiangho) wrote :

I also verified 18.04-hwe 5.3.0-42-generic #34~18.04.1-Ubuntu fixes this issue ( 5.3.0-40-generic #32~18.04.1-Ubuntu still has this issue). Verified on d06-1.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers