]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: fix get wrong pfc_en when query PFC configuration
authorGuangbin Huang <huangguangbin2@huawei.com>
Thu, 26 Aug 2021 11:22:01 +0000 (19:22 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 26 Aug 2021 14:24:17 +0000 (07:24 -0700)
commit8c1671e0d13d4a0ba4fb3a0da932bf3736d7ff73
treecbd9007ad520cd9909a6be2f4da67a2f033d2bd4
parent3462207d2d684658d97499ca77c00c9ac7c87ea8
net: hns3: fix get wrong pfc_en when query PFC configuration

Currently, when query PFC configuration by dcbtool, driver will return
PFC enable status based on TC. As all priorities are mapped to TC0 by
default, if TC0 is enabled, then all priorities mapped to TC0 will be
shown as enabled status when query PFC setting, even though some
priorities have never been set.

for example:
$ dcb pfc show dev eth0
pfc-cap 4 macsec-bypass off delay 0
prio-pfc 0:off 1:off 2:off 3:off 4:off 5:off 6:off 7:off
$ dcb pfc set dev eth0 prio-pfc 0:on 1:on 2:on 3:on
$ dcb pfc show dev eth0
pfc-cap 4 macsec-bypass off delay 0
prio-pfc 0:on 1:on 2:on 3:on 4:on 5:on 6:on 7:on

To fix this problem, just returns user's PFC config parameter saved in
driver.

Fixes: cacde272dd00 ("net: hns3: Add hclge_dcb module for the support of DCB feature")
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_dcb.c