]> asedeno.scripts.mit.edu Git - linux.git/commit
net: hns3: fix user configuration loss for ethtool -L
authorHuazhong Tan <tanhuazhong@huawei.com>
Fri, 18 Jan 2019 08:13:10 +0000 (16:13 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Jan 2019 23:10:22 +0000 (15:10 -0800)
commit672ad0ede179b129ad1c9dbc080a8b808cce510c
treeff789ad3a297a409960cf8892abed1163daffa27
parentaf95882728e30969d3ef911a0814bcd9ca56ee37
net: hns3: fix user configuration loss for ethtool -L

Ethtool -L option with the combined parameter is for changing the number of
multi-purpose channels of the specified network device. Under the current
scheme, the user configuration information will be lost after the reset or
TC information changed.

This patch fixes this issue. By default, this configuration is set to the
minimum between the number of queues for each enabled TCs and the maximum
number support available in the hardware. When there is a user
configuration, regardless of the reset or TC information change, it should
keep the user's configuration while it is under the hardware limits,
otherwise set to the maximum number support available in the hardware.

Fixes: 09f2af6405b8 ("net: hns3: add support to modify 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>
drivers/net/ethernet/hisilicon/hns3/hnae3.h
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h