]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net: hns3: add common validation in hclge_dcb
authorYunsheng Lin <linyunsheng@huawei.com>
Mon, 19 Nov 2018 13:02:15 +0000 (21:02 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 14 Jan 2019 09:28:55 +0000 (09:28 +0000)
commita37983ccc2b1b6d6ab37a2af1129f9e652c73c9d
treec7d97ff5a2070d46e84fddb174cb72a843763777
parent268868f8f4629954a09e1eb3c198e34dfd9f91fa
net: hns3: add common validation in hclge_dcb

BugLink: https://bugs.launchpad.net/bugs/1810457
Before setting tm related configuration to hardware, driver
needs to check the configuration provided by user is valid.
Currently hclge_ieee_setets and hclge_setup_tc both implement
their own checking, which has a lot in common.

This patch addes hclge_dcb_common_validate to do the common
checking. The checking in hclge_tm_prio_tc_info_update
and hclge_tm_schd_info_update is unnecessary now, so change
the return type to void, which removes the need to do error
handling when one of the checking fails.

Also, ets->prio_tc is indexed by user prio and ets->tc_tsa is
indexed by tc num, so this patch changes them to use different
index.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e432abfb99e5642a7e7fcaa1c8cb0e80c8fcf58e)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h