]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/log
mirror_ubuntu-disco-kernel.git
5 years agoiscsi_ibft: Fix missing break in switch statement
Gustavo A. R. Silva [Mon, 11 Feb 2019 18:43:23 +0000 (12:43 -0600)]
iscsi_ibft: Fix missing break in switch statement

BugLink: https://bugs.launchpad.net/bugs/1820318
commit df997abeebadaa4824271009e2d2b526a70a11cb upstream.

Add missing break statement in order to prevent the code from falling
through to case ISCSI_BOOT_TGT_NAME, which is unnecessary.

This bug was found thanks to the ongoing efforts to enable
-Wimplicit-fallthrough.

Fixes: b33a84a38477 ("ibft: convert iscsi_ibft module to iscsi boot lib")
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agoInput: elan_i2c - add id for touchpad found in Lenovo s21e-20
Vincent Batts [Sat, 9 Mar 2019 23:48:04 +0000 (15:48 -0800)]
Input: elan_i2c - add id for touchpad found in Lenovo s21e-20

BugLink: https://bugs.launchpad.net/bugs/1820318
commit e154ab69321ce2c54f19863d75c77b4e2dc9d365 upstream.

Lenovo s21e-20 uses ELAN0601 in its ACPI tables for the Elan touchpad.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agoInput: wacom_serial4 - add support for Wacom ArtPad II tablet
Jason Gerecke [Sat, 9 Mar 2019 23:32:13 +0000 (15:32 -0800)]
Input: wacom_serial4 - add support for Wacom ArtPad II tablet

BugLink: https://bugs.launchpad.net/bugs/1820318
commit 44fc95e218a09d7966a9d448941fdb003f6bb69f upstream.

Tablet initially begins communicating at 9600 baud, so this command
should be used to connect to the device:

    $ inputattach --daemon --baud 9600 --wacom_iv /dev/ttyS0

https://github.com/linuxwacom/xf86-input-wacom/issues/40

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agomedia: uvcvideo: Fix 'type' check leading to overflow
Alistair Strachan [Wed, 19 Dec 2018 01:32:48 +0000 (20:32 -0500)]
media: uvcvideo: Fix 'type' check leading to overflow

BugLink: https://bugs.launchpad.net/bugs/1820318
commit 47bb117911b051bbc90764a8bff96543cbd2005f upstream.

When initially testing the Camera Terminal Descriptor wTerminalType
field (buffer[4]), no mask is used. Later in the function, the MSB is
overloaded to store the descriptor subtype, and so a mask of 0x7fff
is used to check the type.

If a descriptor is specially crafted to set this overloaded bit in the
original wTerminalType field, the initial type check will fail (falling
through, without adjusting the buffer size), but the later type checks
will pass, assuming the buffer has been made suitably large, causing an
overflow.

Avoid this problem by checking for the MSB in the wTerminalType field.
If the bit is set, assume the descriptor is bad, and abort parsing it.

Originally reported here:
https://groups.google.com/forum/#!topic/syzkaller/Ot1fOE6v1d8
A similar (non-compiling) patch was provided at that time.

Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Alistair Strachan <astrachan@google.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agoUBUNTU: Start new release
Seth Forshee [Wed, 13 Mar 2019 14:10:07 +0000 (09:10 -0500)]
UBUNTU: Start new release

Ignore: yes
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
5 years agoUBUNTU: Ubuntu-5.0.0-8.9 Ubuntu-5.0.0-8.9
Thadeu Lima de Souza Cascardo [Tue, 12 Mar 2019 19:15:44 +0000 (16:15 -0300)]
UBUNTU: Ubuntu-5.0.0-8.9

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agoUBUNTU: link-to-tracker: update tracking bug
Thadeu Lima de Souza Cascardo [Tue, 12 Mar 2019 19:13:04 +0000 (16:13 -0300)]
UBUNTU: link-to-tracker: update tracking bug

BugLink: https://bugs.launchpad.net/bugs/1819759
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agoUBUNTU: [Config] update gcc version to 8.3
Thadeu Lima de Souza Cascardo [Tue, 12 Mar 2019 18:00:18 +0000 (15:00 -0300)]
UBUNTU: [Config] update gcc version to 8.3

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agoscsi: hisi_sas: Add debugfs ITCT file and add file operations
Luo Jiaxing [Fri, 25 Jan 2019 14:22:29 +0000 (22:22 +0800)]
scsi: hisi_sas: Add debugfs ITCT file and add file operations

BugLink: https://bugs.launchpad.net/bugs/1819500
This patch creates debugfs file for ITCT and adds file operations.

Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 5979f33b982dca807ea802b512480bc62f81396a)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agoscsi: hisi_sas: Fix type casting and missing static qualifier in debugfs code
John Garry [Fri, 25 Jan 2019 14:22:28 +0000 (22:22 +0800)]
scsi: hisi_sas: Fix type casting and missing static qualifier in debugfs code

BugLink: https://bugs.launchpad.net/bugs/1819500
Sparse can detect some type casting issues in the debugfs code, so fix it
up.

Also a missing static qualifier is added to hisi_sas_debugfs_to_reg_name().

Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 5b0eeac4bed4b1a261acf3cd893f929e68814a0d)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agoscsi: hisi_sas: No need to check return value of debugfs_create functions
John Garry [Fri, 25 Jan 2019 14:22:27 +0000 (22:22 +0800)]
scsi: hisi_sas: No need to check return value of debugfs_create functions

BugLink: https://bugs.launchpad.net/bugs/1819500
When calling debugfs functions, there is no need to ever check the return
value. The function can work or not, but the code logic should never do
something different based on this.

Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit c2c7e740577154e755ec373712e32e5864e88315)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agoscsi: hisi_sas: Add debugfs IOST file and add file operations
Luo Jiaxing [Wed, 19 Dec 2018 15:56:46 +0000 (23:56 +0800)]
scsi: hisi_sas: Add debugfs IOST file and add file operations

BugLink: https://bugs.launchpad.net/bugs/1819500
This patch create debugfs file for IOST and add file operations.

Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 1afb4b8524797f95b15480a6654780571cde4e56)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agoscsi: hisi_sas: Add debugfs DQ file and add file operations
Luo Jiaxing [Wed, 19 Dec 2018 15:56:45 +0000 (23:56 +0800)]
scsi: hisi_sas: Add debugfs DQ file and add file operations

BugLink: https://bugs.launchpad.net/bugs/1819500
This patch create debugfs file for DQ and add file operations

Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 148e379f60c5ce0a9741ccdada46ba91579a9df7)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agoscsi: hisi_sas: Add debugfs CQ file and add file operations
Luo Jiaxing [Wed, 19 Dec 2018 15:56:44 +0000 (23:56 +0800)]
scsi: hisi_sas: Add debugfs CQ file and add file operations

BugLink: https://bugs.launchpad.net/bugs/1819500
This patch create debugfs file for CQ and add file operations.

Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 971afae7cf4f784c37ea89459c1b3627bcf601ff)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agoscsi: hisi_sas: Add debugfs for port registers
Luo Jiaxing [Wed, 19 Dec 2018 15:56:43 +0000 (23:56 +0800)]
scsi: hisi_sas: Add debugfs for port registers

BugLink: https://bugs.launchpad.net/bugs/1819500
This patch create debugfs file for port register and add file operations.

Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 61a6ebf3f584288e68254ccaddc536fcc602e5ae)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agoscsi: hisi_sas: Debugfs global register create file and add file operations
Luo Jiaxing [Wed, 19 Dec 2018 15:56:42 +0000 (23:56 +0800)]
scsi: hisi_sas: Debugfs global register create file and add file operations

BugLink: https://bugs.launchpad.net/bugs/1819500
This patch create debugfs file for global register and add file
operations.

Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit caefac1996764d19e4fa39d8d33651da257dcab2)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agoscsi: hisi_sas: Take debugfs snapshot for all regs
Luo Jiaxing [Wed, 19 Dec 2018 15:56:41 +0000 (23:56 +0800)]
scsi: hisi_sas: Take debugfs snapshot for all regs

BugLink: https://bugs.launchpad.net/bugs/1819500
This patch takes snapshot for global regs, port regs, CQ, DQ, IOST, ITCT.

Add code for snapshot trig and generate dump directory.

Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 49159a5e4175f9f7a5149e7e27f583de04e934c2)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agoscsi: hisi_sas: Alloc debugfs snapshot buffer memory for all registers
Luo Jiaxing [Wed, 19 Dec 2018 15:56:40 +0000 (23:56 +0800)]
scsi: hisi_sas: Alloc debugfs snapshot buffer memory for all registers

BugLink: https://bugs.launchpad.net/bugs/1819500
This patch allocates snapshot memory for global reg, port regs, CQ, DQ,
IOST, ITCT.

When we fail to allocate memory for some registers, we free the memory
and set hisi_sas_debugfs_enable as 0 to stop loading debugfs from running.

Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit eb1c2b72b7694c984d520300c901f5fc1fa8ea9e)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agoscsi: hisi_sas: Create root and device debugfs directories
Luo Jiaxing [Wed, 19 Dec 2018 15:56:39 +0000 (23:56 +0800)]
scsi: hisi_sas: Create root and device debugfs directories

BugLink: https://bugs.launchpad.net/bugs/1819500
This patch creates root directory at hisi_sas_init() and generates device
directory when we probe device driver.

And we remove the root directory at hisi_sas_exit(), but recursively
delete device directory when we remove device driver.

Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(backported from commit ef63464bcf8feaa793e1aee4d3d186dfd1fff05f)
[dannf: trivial offset fix]
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix to stop multiple HNS reset due to the AER changes
Shiju Jose [Sun, 10 Mar 2019 06:47:51 +0000 (14:47 +0800)]
net: hns3: fix to stop multiple HNS reset due to the AER changes

BugLink: https://bugs.launchpad.net/bugs/1819535
The commit bfcb79fca19d
("PCI/ERR: Run error recovery callbacks for all affected devices")
affected the non-fatal error recovery logic for the HNS and RDMA devices.
This is because each HNS PF under PCIe bus receive callbacks
from the AER driver when an error is reported for one of the PF.
This causes unwanted PF resets because
the HNS decides which PF to reset based on the reset type set.
The HNS error handling code sets the reset type based on the hw error
type detected.

This patch provides fix for the above issue for the recovery of
the hw errors in the HNS and RDMA devices.

This patch needs backporting to the kernel v5.0+

Fixes: 332fbf576579 ("net: hns3: add handling of hw ras errors using new set of commands")
Reported-by: Xiaofei Tan <tanxiaofei@huawei.com>
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 69b51bbb03f73e04c486f79d1556b2d9becf4dbc)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: add dma_rmb() for rx description
Jian Shen [Wed, 6 Mar 2019 03:26:37 +0000 (11:26 +0800)]
net: hns3: add dma_rmb() for rx description

BugLink: https://bugs.launchpad.net/bugs/1819535
HW can not guarantee complete write desc->rx.size, even though
HNS3_RXD_VLD_B has been set. Driver needs to add dma_rmb()
instruction to make sure desc->rx.size is always valid.

Fixes: e55970950556 ("net: hns3: Add handling of GRO Pkts not fully RX'ed in NAPI poll")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d394d33bee22421b39a0bcdc51ca6d68ba308625)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: Fix a logical vs bitwise typo
Dan Carpenter [Wed, 6 Mar 2019 08:12:34 +0000 (11:12 +0300)]
net: hns3: Fix a logical vs bitwise typo

BugLink: https://bugs.launchpad.net/bugs/1819535
There were a couple logical ORs accidentally mixed in with the bitwise
ORs.

Fixes: e8149933b1fa ("net: hns3: remove hnae3_get_bit in data path")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f4772dee101c7ac66e395d07b3140d457901fa18)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns: use struct_size() in devm_kzalloc()
Gustavo A. R. Silva [Tue, 26 Feb 2019 00:27:57 +0000 (18:27 -0600)]
net: hns: use struct_size() in devm_kzalloc()

BugLink: https://bugs.launchpad.net/bugs/1819535
One of the more common cases of allocation size calculations is finding
the size of a structure that has a zero-sized array at the end, along
with memory for some number of elements for that array. For example:

struct foo {
    int stuff;
    struct boo entry[];
};

instance = devm_kzalloc(dev, sizeof(struct foo) + sizeof(struct boo) * count, GFP_KERNEL);

Instead of leaving these open-coded and prone to type mistakes, we can
now use the new struct_size() helper:

instance = devm_kzalloc(dev, struct_size(instance, entry, count), GFP_KERNEL);

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d89ea4acfc039f6968f8b5a1dfae5d3cbf611444)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix improper error handling for hns3_client_start
Huazhong Tan [Sat, 23 Feb 2019 09:22:19 +0000 (17:22 +0800)]
net: hns3: fix improper error handling for hns3_client_start

BugLink: https://bugs.launchpad.net/bugs/1819535
If hns3_client_start() failed in the hns3_client_init(),
register_dev() should be undo in its error handling.

Fixes: a6d818e31d08 ("net: hns3: Add vport alive state checking support")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 186551284e6ec3d7c87b0e48da570816a39e9afc)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix setting of the hns reset_type for rdma hw errors
Shiju Jose [Sat, 23 Feb 2019 09:22:18 +0000 (17:22 +0800)]
net: hns3: fix setting of the hns reset_type for rdma hw errors

BugLink: https://bugs.launchpad.net/bugs/1819535
Presently the hns reset_type for the roce errors is set
in the hclge_log_and_clear_rocee_ras_error function.
This function is also called to detect and clear roce errors
while enabling the rdma error interrupts. However there is no hns
reset requested for this case. This can cause issue of wrong
reset_type used with subsequent hns reset as the
reset_type set in the above case was not cleared.

This patch moves setting of hns reset_type for the roce errors from
hclge_log_and_clear_rocee_ras_error function
to hclge_handle_rocee_ras_error.

Fixes: 630ba007f475 ("net: hns3: add handling of RDMA RAS errors")
Reported-by: Huazhong Tan <tanhuazhong@huawei.com>
Reported-by: Xiaofei Tan <tanxiaofei@huawei.com>
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit eb4c2ccbad6c688be791e0c08640a40124558c03)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix get VF RSS issue
Jian Shen [Sat, 23 Feb 2019 09:22:17 +0000 (17:22 +0800)]
net: hns3: fix get VF RSS issue

BugLink: https://bugs.launchpad.net/bugs/1819535
For revision 0x20, VF shares the same RSS config with PF.
In original codes, it always return 0 when query RSS hash
key for VF. This patch fixes it by return the hash key
got from PF.

Fixes: 374ad291762a ("net: hns3: net: hns3: Add RSS general configuration support for VF")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a638b1d8cc875ae819591be787503fc1db053d5f)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: enable VF VLAN filter for each VF when initializing
Jian Shen [Sat, 23 Feb 2019 09:22:16 +0000 (17:22 +0800)]
net: hns3: enable VF VLAN filter for each VF when initializing

BugLink: https://bugs.launchpad.net/bugs/1819535
For revision 0x21, the switch of VF VLAN filter is per function.
It's necessary to enable VF VLAN filter for each VF when initializing.
Otherwise, VF will be able to receive broadcast packets with unknown
VLAN when PF enters promisc mode.

Fixes: 64d114f0a750 ("net: hns3: Add egress/ingress vlan filter for revision 0x21")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 30ebc576d7773c7d8b53fa7941c2c56e488589fd)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: add support to config depth for tx|rx ring separately
Peng Li [Sat, 23 Feb 2019 09:22:15 +0000 (17:22 +0800)]
net: hns3: add support to config depth for tx|rx ring separately

BugLink: https://bugs.launchpad.net/bugs/1819535
This patch adds support to config depth for tx|rx ring separately
by ethtool command "-G".

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c04259442395a6d9648e8dd105e9058726b2451a)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: remove hnae3_get_bit in data path
Yunsheng Lin [Sat, 23 Feb 2019 09:22:14 +0000 (17:22 +0800)]
net: hns3: remove hnae3_get_bit in data path

BugLink: https://bugs.launchpad.net/bugs/1819535
The hnae3_get_bit uses hnae3_get_field, and hnae3_get_field
masks the data, which is unnecessary in data path.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e8149933b1fab774e892f8ab605d241df673291c)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: replace hnae3_set_bit and hnae3_set_field in data path
Yunsheng Lin [Sat, 23 Feb 2019 09:22:13 +0000 (17:22 +0800)]
net: hns3: replace hnae3_set_bit and hnae3_set_field in data path

BugLink: https://bugs.launchpad.net/bugs/1819535
hnae3_set_bit and hnae3_set_field masks the data before setting
the field or bit, which is unnecessary because the data is already
zero initialized.

Suggested-by: John Garry <john.garry@huawei.com>
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit cde4ffada8290c803e5b68423466118e5421c774)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: add unlikely for error handling in data path
Yunsheng Lin [Sat, 23 Feb 2019 09:22:12 +0000 (17:22 +0800)]
net: hns3: add unlikely for error handling in data path

BugLink: https://bugs.launchpad.net/bugs/1819535
This patch adds unlikely hint for error handling in critical data
path.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0cccebac710a2ac1ee9a18744e9ee24746f7d947)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: remove some ops in struct hns3_nic_ops
Yunsheng Lin [Sat, 23 Feb 2019 09:22:11 +0000 (17:22 +0800)]
net: hns3: remove some ops in struct hns3_nic_ops

BugLink: https://bugs.launchpad.net/bugs/1819535
The fill_desc ops has only one implementation, and
get_rxd_bnum has not been used, so this patch removes
them.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d40fa7eeab55dc1f0ab5f81d1c53af31dbcdd9ac)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: limit some variable scope in critical data path
Yunsheng Lin [Sat, 23 Feb 2019 09:22:10 +0000 (17:22 +0800)]
net: hns3: limit some variable scope in critical data path

BugLink: https://bugs.launchpad.net/bugs/1819535
This patch limits some variables' scope as much as possible in
hns3_fill_desc.

Also, only set l3_type and l4_type when necessary.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 47e7b13b0aff869465585d36a8d5075fe17cb90a)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: avoid mult + div op in critical data path
Yunsheng Lin [Sat, 23 Feb 2019 09:22:09 +0000 (17:22 +0800)]
net: hns3: avoid mult + div op in critical data path

BugLink: https://bugs.launchpad.net/bugs/1819535
This patch uses shift offset to avoid doing mult and div operation.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3fe13ed95dd3c4aede3313a2dd2d589c207b51d0)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: add xps setting support for hns3 driver
Yunsheng Lin [Sat, 23 Feb 2019 09:22:08 +0000 (17:22 +0800)]
net: hns3: add xps setting support for hns3 driver

BugLink: https://bugs.launchpad.net/bugs/1819535
This patch adds xps setting support for hns3 driver based on
the interrupt affinity info.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 2a73ac3e6c9d7cd80af731bcb699c180d95c8166)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: clear command queue's registers when unloading VF driver
Huazhong Tan [Wed, 20 Feb 2019 02:32:51 +0000 (10:32 +0800)]
net: hns3: clear command queue's registers when unloading VF driver

BugLink: https://bugs.launchpad.net/bugs/1819535
According to the hardware's description, the driver should clear
the command queue's registers when uloading VF driver. Otherwise,
these existing value may lead the IMP get into a wrong state.

Fixes: fedd0c15d288 ("net: hns3: Add HNS3 VF IMP(Integrated Management Proc) cmd interface")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 34f81f049e354082f638820afe5e59bbd243fb18)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: uninitialize command queue while unloading PF driver
Huazhong Tan [Wed, 20 Feb 2019 02:32:50 +0000 (10:32 +0800)]
net: hns3: uninitialize command queue while unloading PF driver

BugLink: https://bugs.launchpad.net/bugs/1819535
According to the hardware's description, the driver should clear
the command queue's registers when uloading driver. Otherwise,
these existing value may lead the IMP get into a wrong state.

Also this patch adds hclge_cmd_uninit() to do the command queue
uninitialization which includes clearing registers and freeing
memory.

Fixes: 68c0a5c70614 ("net: hns3: Add HNS3 IMP(Integrated Mgmt Proc) Cmd Interface Support")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 232d0d55fca6ab589d5267c74a376210f341d71e)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: Record VF vlan tables
liuzhongzhu [Wed, 20 Feb 2019 02:32:49 +0000 (10:32 +0800)]
net: hns3: Record VF vlan tables

BugLink: https://bugs.launchpad.net/bugs/1819535
Record the vlan tables that the VF sends to the chip.
After the VF exception, the PF actively clears the VF to chip config.

Signed-off-by: liuzhongzhu <liuzhongzhu@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c6075b193462d9a3930fb41f587f94720658752a)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: Record VF unicast and multicast tables
liuzhongzhu [Wed, 20 Feb 2019 02:32:48 +0000 (10:32 +0800)]
net: hns3: Record VF unicast and multicast tables

BugLink: https://bugs.launchpad.net/bugs/1819535
Record the unicast and multicast tables that the VF sends to the chip.
After the VF exception, the PF actively clears the VF to chip config.

Signed-off-by: liuzhongzhu <liuzhongzhu@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6dd86902f21d096ed7ef2dcc921ee80c73807313)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix 6th bit of ppp mpf abnormal errors
Weihang Li [Wed, 20 Feb 2019 02:32:47 +0000 (10:32 +0800)]
net: hns3: fix 6th bit of ppp mpf abnormal errors

BugLink: https://bugs.launchpad.net/bugs/1819535
This patch modify print message of 6th bit of ppp mpf abnormal errors,
there is a extra letter e in it.

Signed-off-by: Weihang Li <liweihang@hisilicon.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3aff0ac97391fe4181fd68f06b8fec345f7d1bc5)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: enable 8~11th bit of mac common msi-x error
Weihang Li [Wed, 20 Feb 2019 02:32:46 +0000 (10:32 +0800)]
net: hns3: enable 8~11th bit of mac common msi-x error

BugLink: https://bugs.launchpad.net/bugs/1819535
These bits are enabled now and have been test.

Signed-off-by: Weihang Li <liweihang@hisilicon.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d1f55d6bfcf007691a6392ca421cf5fa1b007d1c)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: some bugfix of ppu(rcb) ras errors
Weihang Li [Wed, 20 Feb 2019 02:32:45 +0000 (10:32 +0800)]
net: hns3: some bugfix of ppu(rcb) ras errors

BugLink: https://bugs.launchpad.net/bugs/1819535
The 3rd and 4th of PPU(RCB) PF Abnormal is RAS errors instead of MSI-X
like other bits. This patch adds process of handling and logging this
two bits. Otherwise, this patch modifies print message of 28th and 29th
bit of PPU MPF Abnormal errors, which keep same with other errors now.

Fixes: f69b10b317f9 ("net: hns3: handle hw errors of PPU(RCB)")
Signed-off-by: Weihang Li <liweihang@hisilicon.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 747fc3f351baa061b41a1e2a81821bc963e4f794)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: modify print message of ssu common ecc errors
Weihang Li [Wed, 20 Feb 2019 02:32:44 +0000 (10:32 +0800)]
net: hns3: modify print message of ssu common ecc errors

BugLink: https://bugs.launchpad.net/bugs/1819535
This patch add information of specific bit in log to be consistent
with other type of errors, so that we can know which memory of ssu
has occurred a ecc ras errors.

Signed-off-by: Weihang Li <liweihang@hisilicon.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3d69e59f42bdd57c2a185da52f9579c33dec7121)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix port info query issue for copper port
Jian Shen [Wed, 20 Feb 2019 02:32:43 +0000 (10:32 +0800)]
net: hns3: fix port info query issue for copper port

BugLink: https://bugs.launchpad.net/bugs/1819535
In original codes, for copper port which doesn't connect to phy,
it always returns -EOPNOTSUPP when query port information. This
patch fixes it by return the port information of MAC.

Fixes: 5f373b158523 ("net: hns3: Fix speed/duplex information loss problem when executing ethtool ethx cmd of VF")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f18635d52c23594259da2f741399abc6c6f41f15)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: convert mac advertize and supported from u32 to link mode
Jian Shen [Wed, 20 Feb 2019 02:32:42 +0000 (10:32 +0800)]
net: hns3: convert mac advertize and supported from u32 to link mode

BugLink: https://bugs.launchpad.net/bugs/1819535
The link mode with bits has been up to more than 31 for some MAC
and phy. Convert to using a linkmode bitmap, which can support all
link modes.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit db68ca0ef7c98bb39cb193571c63b22ca99f633f)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: Check variable is valid before assigning it to another
Yonglong Liu [Wed, 20 Feb 2019 02:32:41 +0000 (10:32 +0800)]
net: hns3: Check variable is valid before assigning it to another

BugLink: https://bugs.launchpad.net/bugs/1819535
In hnae3_register_ae_dev(), ae_algo->ops is assigned to ae_dev->ops
before check that ae_algo->ops is valid.

And in hnae3_register_ae_algo(), missing check for ae_algo->ops.

This patch fixes them.

Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 676131f7c53ecdd79e29fc8cfcdefe6f9f2485e8)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: add pointer checking at the beginning of the exported functions.
Yonglong Liu [Wed, 20 Feb 2019 02:32:40 +0000 (10:32 +0800)]
net: hns3: add pointer checking at the beginning of the exported functions.

BugLink: https://bugs.launchpad.net/bugs/1819535
These functions are exported, add pointer checking at the beginning
can make them more safe.

Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit bdd59d661153a59af79112676565276ae2a1f457)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: make function hclge_set_all_vf_rst() static
Wei Yongjun [Sat, 16 Feb 2019 08:15:52 +0000 (08:15 +0000)]
net: hns3: make function hclge_set_all_vf_rst() static

BugLink: https://bugs.launchpad.net/bugs/1819535
Fixes the following sparse warning:

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c:2431:5: warning:
 symbol 'hclge_set_all_vf_rst' was not declared. Should it be static?

Fixes: aa5c4f175be6 ("net: hns3: add reset handling for VF when doing PF reset")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e511f17b1fb40248e63677a6ab81a29b9b32080d)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: MAC table entry count function increases operation 0 value protection...
liuzhongzhu [Sat, 2 Feb 2019 14:39:37 +0000 (22:39 +0800)]
net: hns3: MAC table entry count function increases operation 0 value protection measures

BugLink: https://bugs.launchpad.net/bugs/1819535
When updating the available MAC VLAN table counts,
MAC VLAN table entry count function adds
operation 0 value protection measures.

Signed-off-by: liuzhongzhu <liuzhongzhu@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 54a395b63e470696884fc12629b12e24d9379111)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: modify the upper limit judgment condition
liuzhongzhu [Sat, 2 Feb 2019 14:39:36 +0000 (22:39 +0800)]
net: hns3: modify the upper limit judgment condition

BugLink: https://bugs.launchpad.net/bugs/1819535
In order to prevent the variable anomaly from being larger than desc_num,
the upper limit judgment condition becomes >=.

Signed-off-by: liuzhongzhu <liuzhongzhu@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6104ca87e12a5119d3e53e926bb6fe468bb328e2)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: don't allow user to change vlan filter state
Jian Shen [Sat, 2 Feb 2019 14:39:35 +0000 (22:39 +0800)]
net: hns3: don't allow user to change vlan filter state

BugLink: https://bugs.launchpad.net/bugs/1819535
When user disables vlan filter, and adds vlan device, it won't
notify the driver the update the vlan filter. In this case, when
user enables vlan filter again, the packets with new vlan tag
will be filtered by vlan filter.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 77af09c6780b1394a1e888a6862d49cadc0247fa)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: optimize the maximum TC macro
liuzhongzhu [Sat, 2 Feb 2019 14:39:34 +0000 (22:39 +0800)]
net: hns3: optimize the maximum TC macro

BugLink: https://bugs.launchpad.net/bugs/1819535
Multiple macros with the largest number of TCs in the system,
optimized to HCLGE_MAX_TC_NUM.

Signed-off-by: liuzhongzhu <liuzhongzhu@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f9f07091b43e3a758bd197eb99ef5f011efce7fc)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix the problem that the supported port is empty
liuzhongzhu [Sat, 2 Feb 2019 14:39:33 +0000 (22:39 +0800)]
net: hns3: fix the problem that the supported port is empty

BugLink: https://bugs.launchpad.net/bugs/1819535
Run ethtool ethx when displaying device information in VF,
the supported port and link mode items will be empty.

This patch fixes it.

Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support")
Signed-off-by: liuzhongzhu <liuzhongzhu@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9194d18b0577a63f313a6eb2e0d4723add2c32e6)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix a wrong checking in the hclge_tx_buffer_calc()
Huazhong Tan [Sat, 2 Feb 2019 14:39:32 +0000 (22:39 +0800)]
net: hns3: fix a wrong checking in the hclge_tx_buffer_calc()

BugLink: https://bugs.launchpad.net/bugs/1819535
Only the TC is enabled, we need to check whether the buffer is enough,
otherwise it may lead to a wrong -ENOMEM case.

Fixes: 9ffe79a9c2ee ("net: hns3: Support for dynamically assigning tx buffer to TC")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b6b4f987c5c4fe488f3f68460b9addc08482b164)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: move some set_bit statement into hclge_prepare_mac_addr
Weihang Li [Sat, 2 Feb 2019 14:39:31 +0000 (22:39 +0800)]
net: hns3: move some set_bit statement into hclge_prepare_mac_addr

BugLink: https://bugs.launchpad.net/bugs/1819535
This patch does not change the code logic. There are some same
set_bit statements called by add/rm_uc/mc_addr_common, and move
this statements into hclge_prepare_mac_addr to reduce duplicate
code.

Signed-off-by: Weihang Li <liweihang@hisilicon.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 3a586422a5533a6c78376a779860f48ed72b9d83)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: add hclge_cmd_check_retval() to parse comman's return value
Weihang Li [Sat, 2 Feb 2019 14:39:30 +0000 (22:39 +0800)]
net: hns3: add hclge_cmd_check_retval() to parse comman's return value

BugLink: https://bugs.launchpad.net/bugs/1819535
For simplifying the code, this patch adds hclge_cmd_check_retval() to
check the return value of the command.

Also, according the IMP's description, when there are several descriptors
in a command, then the IMP will save the return value on the last
description, so hclge_cmd_check_retval() just check the last one for this
case.

Signed-off-by: Weihang Li <liweihang@hisilicon.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b671b723e0d235b516dc33c163e6296df9b4f0ca)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: code optimization for hclge_rx_buffer_calc
Yunsheng Lin [Sat, 2 Feb 2019 14:39:29 +0000 (22:39 +0800)]
net: hns3: code optimization for hclge_rx_buffer_calc

BugLink: https://bugs.launchpad.net/bugs/1819535
There are four steps to calcuate the rx private buffer, each step
can be done in a function to avoid code duplication and aid code
readability.

This patch adds three separate functions do the job. Also, the
function name more or less make the comment redundant, so remove
some obvious comment.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8ca754b13f3c3b99d946665385b3b76e66aab96d)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: Modify parameter type from int to bool in set_gro_en
Yonglong Liu [Sat, 2 Feb 2019 14:39:28 +0000 (22:39 +0800)]
net: hns3: Modify parameter type from int to bool in set_gro_en

BugLink: https://bugs.launchpad.net/bugs/1819535
The second parameter to the hook function set_gro_en is always passed in
true/false, so modify it's type from int to bool.

Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1731be4c73bb4d5bbfb4b15aaab3f183ccba6fe6)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix an issue for hns3_update_new_int_gl
Peng Li [Sat, 2 Feb 2019 14:39:27 +0000 (22:39 +0800)]
net: hns3: fix an issue for hns3_update_new_int_gl

BugLink: https://bugs.launchpad.net/bugs/1819535
HNS3 supports setting rx-usecs|tx-usecs as 0, but it will not
update dynamically when adaptive-tx or adaptive-rx is enable.
This patch removes the Redundant check.

Fixes: a95e1f8666e9 ("net: hns3: change the time interval of int_gl calculating")
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6241e71e7207102ffc733991f7a00f74098d7da0)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix a code style issue for hns3_update_new_int_gl()
Peng Li [Sat, 2 Feb 2019 14:39:26 +0000 (22:39 +0800)]
net: hns3: fix a code style issue for hns3_update_new_int_gl()

BugLink: https://bugs.launchpad.net/bugs/1819535
Use the same code style for rx_group and tx_group in the
hns3_update_new_int_gl().

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9e50dc11b856f19908559bafe1a3eca0ddc632b2)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: Check for allocation failure
Dan Carpenter [Fri, 1 Feb 2019 08:32:26 +0000 (11:32 +0300)]
net: hns3: Check for allocation failure

BugLink: https://bugs.launchpad.net/bugs/1819535
We should return -ENOMEM if the kcalloc() fails.

Fixes: d174ea75c96a ("net: hns3: add statistics for PFC frames and MAC control frame")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 39ee6e8204b9d4bd46d57ad838fa852f5d293f99)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: keep flow director state unchanged when reset
Jian Shen [Wed, 30 Jan 2019 20:55:52 +0000 (04:55 +0800)]
net: hns3: keep flow director state unchanged when reset

BugLink: https://bugs.launchpad.net/bugs/1819535
In orginal codes, driver always enables flow director when
intializing. When user disable flow director with command
ethtool -K, the flow director will be enabled again after
resetting.

This patch fixes it by only enabling it when first initialzing.

Fixes: 6871af29b3ab ("net: hns3: Add reset handle for flow director")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9abeb7d8cf8719bf221bf371f97fbf0971657be3)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: stop sending keep alive msg to PF when VF is resetting
Jian Shen [Wed, 30 Jan 2019 20:55:51 +0000 (04:55 +0800)]
net: hns3: stop sending keep alive msg to PF when VF is resetting

BugLink: https://bugs.launchpad.net/bugs/1819535
When VF is resetting, it can't communicate to PF with mailbox msg.
This patch adds reset state checking before sending keep alive msg
to PF.

Fixes: a6d818e31d08 ("net: hns3: Add vport alive state checking support")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c59a85c07e77a7669e5b4d2ffa878b6894ec3953)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix an issue for hclgevf_ae_get_hdev
Peng Li [Wed, 30 Jan 2019 20:55:50 +0000 (04:55 +0800)]
net: hns3: fix an issue for hclgevf_ae_get_hdev

BugLink: https://bugs.launchpad.net/bugs/1819535
HNS3 VF driver support NIC and Roce, hdev stores NIC
handle and Roce handle, should use correct parameter for
container_of.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit eed9535f9f716a532ec0c5d6cc7a48584acdf435)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix improper error handling in the hclge_init_ae_dev()
Huazhong Tan [Wed, 30 Jan 2019 20:55:49 +0000 (04:55 +0800)]
net: hns3: fix improper error handling in the hclge_init_ae_dev()

BugLink: https://bugs.launchpad.net/bugs/1819535
While hclge_init_umv_space() failed in the hclge_init_ae_dev(),
we should undo all the operation which has been done successfully,
the last success operation maybe hclge_mac_mdio_config(), so if
hclge_init_umv_space() failed, we also need to undo it.

Fixes: 288475b2ad01 ("{topost} net: hns3: refine umv space allocation")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9fc55413270fffe1b5ebdea03489d763c62c0305)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix for rss result nonuniform
Jian Shen [Wed, 30 Jan 2019 20:55:48 +0000 (04:55 +0800)]
net: hns3: fix for rss result nonuniform

BugLink: https://bugs.launchpad.net/bugs/1819535
The rss result is more uniform when use recommended hash key from
microsoft, instead of the one generated by netdev_rss_key_fill().
Also using hash algorithm "xor" is better than "toeplitz".

This patch modifies the default hash key and hash algorithm.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 472d7ecee20e8fea18e6223cc1d383b6c3483502)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix netif_napi_del() not do problem when unloading
Huazhong Tan [Wed, 30 Jan 2019 20:55:47 +0000 (04:55 +0800)]
net: hns3: fix netif_napi_del() not do problem when unloading

BugLink: https://bugs.launchpad.net/bugs/1819535
When the driver is unloading, if a global reset occurs,
unmap_ring_from_vector() in the hns3_nic_uninit_vector_data() will
fail, and hns3_nic_uninit_vector_data() just return. There may be
some netif_napi_del() not be done.

Since hardware will unmap all ring while resetting, so
hns3_nic_uninit_vector_data() should ignore this error, and do the
rest uninitialization.

Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e215278548f9ea412e2be794efa1c84c6817c657)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: Fix NULL deref when unloading driver
Huazhong Tan [Wed, 30 Jan 2019 20:55:46 +0000 (04:55 +0800)]
net: hns3: Fix NULL deref when unloading driver

BugLink: https://bugs.launchpad.net/bugs/1819535
When the driver is unloading, if there is a calling of ndo_open occurs
between phy_disconnect() and unregister_netdev(), it will end up
causing the kernel to eventually hit a NULL deref:

[14942.417828] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000048
[14942.529878] Mem abort info:
[14942.551166]   ESR = 0x96000006
[14942.567070]   Exception class = DABT (current EL), IL = 32 bits
[14942.623081]   SET = 0, FnV = 0
[14942.639112]   EA = 0, S1PTW = 0
[14942.643628] Data abort info:
[14942.659227]   ISV = 0, ISS = 0x00000006
[14942.674870]   CM = 0, WnR = 0
[14942.679449] user pgtable: 4k pages, 48-bit VAs, pgdp = 00000000224ad6ad
[14942.695595] [0000000000000048] pgd=00000021e6673003, pud=00000021dbf01003, pmd=0000000000000000
[14942.723163] Internal error: Oops: 96000006 [#1] PREEMPT SMP
[14942.729358] Modules linked in: hns3(O) hclge(O) pv680_mii(O) hnae3(O) [last unloaded: hclge]
[14942.738907] CPU: 1 PID: 26629 Comm: kworker/u4:13 Tainted: G           O      4.18.0-rc1-12928-ga960791-dirty #145
[14942.749491] Hardware name: Huawei Technologies Co., Ltd. D05/D05, BIOS Hi1620 FPGA TB BOOT BIOS B763 08/17/2018
[14942.760392] Workqueue: events_power_efficient phy_state_machine
[14942.766644] pstate: 80c00009 (Nzcv daif +PAN +UAO)
[14942.771918] pc : test_and_set_bit+0x18/0x38
[14942.776589] lr : netif_carrier_off+0x24/0x70
[14942.781033] sp : ffff0000121abd20
[14942.784518] x29: ffff0000121abd20 x28: 0000000000000000
[14942.790208] x27: ffff0000164d3cd8 x26: ffff8021da68b7b8
[14942.795832] x25: 0000000000000000 x24: ffff8021eb407800
[14942.801445] x23: 0000000000000000 x22: 0000000000000000
[14942.807046] x21: 0000000000000001 x20: 0000000000000000
[14942.812672] x19: 0000000000000000 x18: ffff000009781708
[14942.818284] x17: 00000000004970e8 x16: ffff00000816ad48
[14942.823900] x15: 0000000000000000 x14: 0000000000000008
[14942.829528] x13: 0000000000000000 x12: 0000000000000f65
[14942.835149] x11: 0000000000000001 x10: 00000000000009d0
[14942.840753] x9 : ffff0000121abaa0 x8 : 0000000000000000
[14942.846360] x7 : ffff000009781708 x6 : 0000000000000003
[14942.851970] x5 : 0000000000000020 x4 : 0000000000000004
[14942.857575] x3 : 0000000000000002 x2 : 0000000000000001
[14942.863180] x1 : 0000000000000048 x0 : 0000000000000000
[14942.868875] Process kworker/u4:13 (pid: 26629, stack limit = 0x00000000c909dbf3)
[14942.876464] Call trace:
[14942.879200]  test_and_set_bit+0x18/0x38
[14942.883376]  phy_link_change+0x38/0x78
[14942.887378]  phy_state_machine+0x3dc/0x4f8
[14942.891968]  process_one_work+0x158/0x470
[14942.896223]  worker_thread+0x50/0x470
[14942.900219]  kthread+0x104/0x130
[14942.903905]  ret_from_fork+0x10/0x1c
[14942.907755] Code: d2800022 8b400c21 f9800031 9ac32044 (c85f7c22)
[14942.914185] ---[ end trace 968c9e12eb740b23 ]---

So this patch fixes it by modifying the timing to do phy_connect_direct()
and phy_disconnect().

Fixes: 256727da7395 ("net: hns3: Add MDIO support to HNS3 Ethernet driver for hip08 SoC")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c8a8045b2d0a974149d65bbe6a7acbcde93cf85b)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: only support tc 0 for VF
Yunsheng Lin [Wed, 30 Jan 2019 20:55:45 +0000 (04:55 +0800)]
net: hns3: only support tc 0 for VF

BugLink: https://bugs.launchpad.net/bugs/1819535
When the VF shares the same TC config as PF, the business
running on PF and VF must have samiliar module.

For simplicity, we are not considering VF sharing the same tc
configuration as PF use case, so this patch removes the support
of TC configuration from VF and forcing VF to just use single
TC.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit de67a690cc27024c22328ce8ff3a2ed32f30fe7d)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: change hnae3_register_ae_dev() to int
Huazhong Tan [Wed, 30 Jan 2019 20:55:44 +0000 (04:55 +0800)]
net: hns3: change hnae3_register_ae_dev() to int

BugLink: https://bugs.launchpad.net/bugs/1819535
hnae3_register_ae_dev() may fail, and it should return a error code
to its caller, so change hnae3_register_ae_dev() return type to int.

Also, when hnae3_register_ae_dev() return error, hns3_probe() should
do some error handling and return the error code.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 74354140a579008fd164241e3697d9c37e5b8989)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: use the correct interface to stop|open port
Peng Li [Wed, 30 Jan 2019 20:55:43 +0000 (04:55 +0800)]
net: hns3: use the correct interface to stop|open port

BugLink: https://bugs.launchpad.net/bugs/1819535
dev_close() stop the netdev and the service base on the netdev
will stop. But ndev->netdev_ops->ndo_stop() may only stop HW
and stack queue, the service base on the netdev can still work.

Fixes: 5668abda0931 ("net: hns3: add support for set_ringparam")
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit fc0c174f4223b7340999e1b3004dbc3b3b9b06de)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix VF dump register issue
Jian Shen [Wed, 30 Jan 2019 20:55:42 +0000 (04:55 +0800)]
net: hns3: fix VF dump register issue

BugLink: https://bugs.launchpad.net/bugs/1819535
In original codes, the .get_regs_len and .get_regs were missed
assigned. This patch fixes it.

Fixes: 1600c3e5f23e ("net: hns3: Support "ethtool -d" for HNS3 VF driver")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8e1445a653c9f9a51fca6f80b8df82b523e1c4ba)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: reuse the definition of l3 and l4 header info union
liyongxin [Wed, 30 Jan 2019 20:55:41 +0000 (04:55 +0800)]
net: hns3: reuse the definition of l3 and l4 header info union

BugLink: https://bugs.launchpad.net/bugs/1819535
Union l3_hdr_info and l4_hdr_info have already been defined in
the hns3_enet.h, so it is unnecessary to define them elsewhere.

This patch removes the redundant definition, and reuses the one
defined in the hns3_enet.h.

Signed-off-by: liyongxin <liyongxin1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1a6e552df33c0dca4fecd0a179833d1b5233012a)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: don't allow vf to enable promisc mode
Jian Shen [Sat, 26 Jan 2019 16:49:21 +0000 (00:49 +0800)]
net: hns3: don't allow vf to enable promisc mode

BugLink: https://bugs.launchpad.net/bugs/1819535
VF can receive packets of other functions when in promisc
mode. It's not safe, so don't allow VF to enable promisc
mode.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit f01f5559cac89e57f2420aa77abf35f2e7b09104)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: add initialization for nic state
Jian Shen [Sat, 26 Jan 2019 16:49:20 +0000 (00:49 +0800)]
net: hns3: add initialization for nic state

BugLink: https://bugs.launchpad.net/bugs/1819535
This patch adds initialization for nic state, sets flag
HNS3_NIC_STATE_DOWN when initialize, clears it before
vectors and napi being enabled in the hns3_nic_net_up(),
and sets it back in the error handler.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit b7b585c286ab021bdb1d0c14b93c58b6bfbe3ef0)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: add 8 BD limit for tx flow
Peng Li [Sat, 26 Jan 2019 16:49:19 +0000 (00:49 +0800)]
net: hns3: add 8 BD limit for tx flow

BugLink: https://bugs.launchpad.net/bugs/1819535
A single transmit packet can span up to 8 descriptors according
to the HW limit. If a skb has more than 8 frags, driver uses
skb_copy to get a new skb which has less frags.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 51e8439f34962794f6c5010a44893fe58450b8df)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: call hns3_nic_set_real_num_queue with netdev down
Yunsheng Lin [Sat, 26 Jan 2019 16:49:18 +0000 (00:49 +0800)]
net: hns3: call hns3_nic_set_real_num_queue with netdev down

BugLink: https://bugs.launchpad.net/bugs/1819535
hns3_client_setup_tc in enet is for updating TC configuration to
stack, and hclge_setup_tc in hclge_dcb is mainly for setting the
configuration to hardware.

This patch removes the hns3_nic_set_real_num_queue from
hns3_setup_tc in enet, and call hclge_client_setup_tc to update
TC configuration to stack with netdev down, because the netdev
down operation is done in hclge_dcb now.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1cce5eb6506d8e4924927062398e8d9ff6411536)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: remove dcb_ops->map_update in hclge_dcb
Yunsheng Lin [Sat, 26 Jan 2019 16:49:17 +0000 (00:49 +0800)]
net: hns3: remove dcb_ops->map_update in hclge_dcb

BugLink: https://bugs.launchpad.net/bugs/1819535
After doing down/uninit/init/up in hclge_dcb, it is not necessary
to call dcb_ops->map_update in enet, so hclge_map_update can be
called directly in hclge_dcb.

This is for preparing to call hns3_nic_set_real_num_queue with
netdev down when user changes mqprio configuration.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit a1ef124e6e8621e9472098a7a37655ef4bace423)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: do reinitialization while mqprio configuration changed
Yunsheng Lin [Sat, 26 Jan 2019 16:49:16 +0000 (00:49 +0800)]
net: hns3: do reinitialization while mqprio configuration changed

BugLink: https://bugs.launchpad.net/bugs/1819535
When user changes the mqprio configuration, enet need to be
uninited and inited besides down'ed and up'ed, because the queue
num may change when the TC num changes.

Also, it is more suitable to do the down/unint/init/up operation
in hclge module using hclge_notify_client, because this config
change may affect PF and its VF.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c2a39d981da7a04874d3ba17ac6122b8e62ec8e1)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: After setting the loopback, add the status of getting MAC
liuzhongzhu [Sat, 26 Jan 2019 16:49:15 +0000 (00:49 +0800)]
net: hns3: After setting the loopback, add the status of getting MAC

BugLink: https://bugs.launchpad.net/bugs/1819535
After setting the serdes loopback, you need to determine
the status of the MAC negotiation. If a status exception
is obtained after 200ms, a timeout error is returned.

Signed-off-by: liuzhongzhu <liuzhongzhu@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 350fda0a0af9d077e895c7b01a4901d354ae656e)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix broadcast promisc issue for revision 0x20
Jian Shen [Sat, 26 Jan 2019 16:49:14 +0000 (00:49 +0800)]
net: hns3: fix broadcast promisc issue for revision 0x20

BugLink: https://bugs.launchpad.net/bugs/1819535
For revision 0x20, vlan filter is always bypassed when enable
broadcast promisc mode. In this case, broadcast packets with
any vlan id can be accpeted. We should disable broadcast promisc
mode until user want enable it.

Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 28673b33c75621b52971b5d5aeed0be59de0bda5)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix return value handle issue for hclge_set_loopback()
Jian Shen [Sat, 26 Jan 2019 16:49:13 +0000 (00:49 +0800)]
net: hns3: fix return value handle issue for hclge_set_loopback()

BugLink: https://bugs.launchpad.net/bugs/1819535
In current code, it always return 0, even loopback mode setting failed.
It's incorrect. This patch fixes return value handle for loopback test.

Fixes: 0f29fc23b21d ("net: hns3: Fix for loopback selftest failed problem")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 47ef6deccdfffaef8f56c5021a83a774fc77ee13)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: add error handling in hclge_ieee_setets
Yunsheng Lin [Sat, 26 Jan 2019 16:49:12 +0000 (00:49 +0800)]
net: hns3: add error handling in hclge_ieee_setets

BugLink: https://bugs.launchpad.net/bugs/1819535
Currently hclge_ieee_setets returns error directly when there is
error, which may cause netdev not up problem.

This patch adds some error handling when setting ETS configuration
fails.

Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1821dce9ae6c6d70e9e9ea93638855e7a27797ca)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: clear pci private data when unload hns3 driver
Jian Shen [Sat, 26 Jan 2019 16:49:11 +0000 (00:49 +0800)]
net: hns3: clear pci private data when unload hns3 driver

BugLink: https://bugs.launchpad.net/bugs/1819535
When unload hns3 driver, we should clear the pci private data.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ac864c2346d087dd3739435af1b8d36be5f60c75)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: don't update packet statistics for packets dropped by hardware
Jian Shen [Sat, 26 Jan 2019 16:49:10 +0000 (00:49 +0800)]
net: hns3: don't update packet statistics for packets dropped by hardware

BugLink: https://bugs.launchpad.net/bugs/1819535
Packet statistics for netdev should not include the packets dropped
by hardware.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 217e288c9718b383d68cacec50e37ec2c085c485)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix PFC not setting problem for DCB module
Yunsheng Lin [Tue, 22 Jan 2019 23:39:38 +0000 (07:39 +0800)]
net: hns3: fix PFC not setting problem for DCB module

BugLink: https://bugs.launchpad.net/bugs/1819535
The PFC enabling is based on user priority, currently it is
based on TC, which may cause PFC not setting correctly when pri
to TC mapping is not one to one relation.

This patch adds pfc_en in tm_info to fix it.

Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d3ad430ac531e65f29c9737f86744c425c9173ef)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: add statistics for PFC frames and MAC control frames
liuzhongzhu [Tue, 22 Jan 2019 23:39:37 +0000 (07:39 +0800)]
net: hns3: add statistics for PFC frames and MAC control frames

BugLink: https://bugs.launchpad.net/bugs/1819535
In the old firmware version, statistics acquisition of
PFC frames and MAC control frames is not supported.
Add command retrieves statistics for PFC frames and
MAC control frames from the firmware.

Signed-off-by: liuzhongzhu <liuzhongzhu@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d174ea75c96a12287354af53dc17cb24f328f90a)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: add ETS TC weight setting in SSU module
Yunsheng Lin [Tue, 22 Jan 2019 23:39:36 +0000 (07:39 +0800)]
net: hns3: add ETS TC weight setting in SSU module

BugLink: https://bugs.launchpad.net/bugs/1819535
This patch sets the TC weight in SSU module according to
info in tm_info.

Also, zero weight of TC weight in SSU ETS module means enabling
strict priority, so do not allow zero weight when in ETS mode.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 330baff5423b143fba698f2acc9eff3cfb1a0776)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: do not return GE PFC setting err when initializing
Yunsheng Lin [Tue, 22 Jan 2019 23:39:35 +0000 (07:39 +0800)]
net: hns3: do not return GE PFC setting err when initializing

BugLink: https://bugs.launchpad.net/bugs/1819535
GE MAC does not support PFC, when driver is initializing and MAC
is in GE Mode, ignore the fw not supported error, otherwise
initialization will fail.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 44e59e375bf7785660a250f61e802996894d148a)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: Change fw error code NOT_EXEC to NOT_SUPPORTED
Yunsheng Lin [Tue, 22 Jan 2019 23:39:34 +0000 (07:39 +0800)]
net: hns3: Change fw error code NOT_EXEC to NOT_SUPPORTED

BugLink: https://bugs.launchpad.net/bugs/1819535
According to firmware error code definition, the error code of 2
means NOT_SUPPORTED, this patch changes it to NOT_SUPPORTED.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4a402f47cfce904051cd8b31bef4fe2910d9dce9)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: clear param in ring when free ring
Peng Li [Tue, 22 Jan 2019 23:39:33 +0000 (07:39 +0800)]
net: hns3: clear param in ring when free ring

BugLink: https://bugs.launchpad.net/bugs/1819535
Param pending_buf and skb may be not NULL when free ring.
This patch clears them when free ring.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit ac574b80a1ba834be01932d8cd4976acda775a36)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix bug of ethtool_ops.get_channels for VF
Huazhong Tan [Tue, 22 Jan 2019 23:39:32 +0000 (07:39 +0800)]
net: hns3: fix bug of ethtool_ops.get_channels for VF

BugLink: https://bugs.launchpad.net/bugs/1819535
The current code returns the number of all queues that can be used and
the number of queues that have been allocated, which is incorrect.
What should be returned is the number of queues allocated for each enabled
TC and the number of queues that can be allocated.

This patch fixes it.

Fixes: 849e46077689 ("net: hns3: add ethtool_ops.get_channels support for VF")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 8be7362186bd5ccb5f6f72be49751ad2778e2636)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix for shaper not setting when TC num changes
Yunsheng Lin [Tue, 22 Jan 2019 23:39:31 +0000 (07:39 +0800)]
net: hns3: fix for shaper not setting when TC num changes

BugLink: https://bugs.launchpad.net/bugs/1819535
Shaper setting does not change currently, when TC num changes,
which may cause shaper parameter not setting problem.

This patch fixes it by setting the shaper parameter when TC num
changes.

Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9e5157ba440f2bf87071c017545d6c4ba627e501)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix rss configuration lost problem when setting channel
Yunsheng Lin [Tue, 22 Jan 2019 23:39:30 +0000 (07:39 +0800)]
net: hns3: fix rss configuration lost problem when setting channel

BugLink: https://bugs.launchpad.net/bugs/1819535
Currently rss configuration set by user will be lost when setting
channel.

This patch fixes it by not setting rss configuration to default
if user has configured the rss.

Fixes: 09f2af6405b8 ("net: hns3: add support to modify tqps number")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 90c68a41db7d02ac031e612c0c97147a58e20515)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: refactor the statistics updating for netdev
Jian Shen [Tue, 22 Jan 2019 23:39:29 +0000 (07:39 +0800)]
net: hns3: refactor the statistics updating for netdev

BugLink: https://bugs.launchpad.net/bugs/1819535
In origin codes, there are some statistics item are got from mac, which
also include the packets statistics of VF. It is unreasonable. This
patch fixes it by counting them in the rx/tx processing flow.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit d3ec4ef669379bf69891415b4f1397a26a81932c)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: add rx multicast packets statistic
Jian Shen [Tue, 22 Jan 2019 23:39:28 +0000 (07:39 +0800)]
net: hns3: add rx multicast packets statistic

BugLink: https://bugs.launchpad.net/bugs/1819535
This patch adds rx multicast packets statistic for each ring.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c376fa1aae6328beb5551e92fa84f4441fdde399)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: add calling roce callback function when link status change
Peng Li [Tue, 22 Jan 2019 23:39:27 +0000 (07:39 +0800)]
net: hns3: add calling roce callback function when link status change

BugLink: https://bugs.launchpad.net/bugs/1819535
This patch adds calling roce callback function when link status
change.

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 45e92b7e4e27a427de7e87d5c4d63d4ce7ba02ab)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: add HNAE3_RESTORE_CLIENT interface in enet module
Yunsheng Lin [Fri, 18 Jan 2019 08:13:14 +0000 (16:13 +0800)]
net: hns3: add HNAE3_RESTORE_CLIENT interface in enet module

BugLink: https://bugs.launchpad.net/bugs/1819535
The HNAE3_INIT_CLIENT interface is also used when changing tc
configuration, vlan/mac hardware table does not need to be restored
when tc configuration changes.

This patch adds a HNAE3_RESTORE_CLIENT interface to restore the
vlan/mac hardware table when resetting.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1f60949297ceb92f8dbf0571f5f502988bbb0273)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: do reinitialization while ETS configuration changed
Huazhong Tan [Fri, 18 Jan 2019 08:13:13 +0000 (16:13 +0800)]
net: hns3: do reinitialization while ETS configuration changed

BugLink: https://bugs.launchpad.net/bugs/1819535
When the ETS information is changed, the network device needs to be
re-initialized, otherwise the information such as the receiving queue
will be incorrect.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit af013903c5c5dc4a251e0ac49eaab9411293f9f9)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
5 years agonet: hns3: fix wrong combined count returned by ethtool -l
Huazhong Tan [Fri, 18 Jan 2019 08:13:12 +0000 (16:13 +0800)]
net: hns3: fix wrong combined count returned by ethtool -l

BugLink: https://bugs.launchpad.net/bugs/1819535
The current code returns the number of all queues that can be used and
the number of queues that have been allocated, which is incorrect.
What should be returned is the number of queues allocated for each enabled
TC and the number of queues that can be allocated.

This patch fixes it.

Fixes: 482d2e9c1cc7 ("net: hns3: add support to query tqps number")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c3b9c50d1567aa12be4448fe85b09626eba2499c)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>