net: hns3: fix port base vlan add fail when concurrent with reset
authorJian Shen <shenjian15@huawei.com>
Thu, 24 Mar 2022 12:54:48 +0000 (20:54 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 25 Mar 2022 23:37:45 +0000 (16:37 -0700)
commitc0f46de30c965d4ba208b5bf1a6d3437a7556ee2
tree1f43db5ebd353a1662e1f719a0d699f96ff1c196
parentccb18f05535c96d26e2d559d402acb87700fc5a7
net: hns3: fix port base vlan add fail when concurrent with reset

Currently, Port base vlan is initiated by PF and configured to its VFs,
by using command "ip link set <pf name> vf <vf id> vlan <vlan id>".
When a global reset was triggered, the hardware vlan table and the soft
recorded vlan information will be cleared by PF, and restored them until
VFs were ready. There is a short time window between the table had been
cleared and before table restored. If configured a new port base vlan tag
at this moment, driver will check the soft recorded vlan information,
and find there hasn't the old tag in it, which causing a warning print.

Due to the port base vlan is managed by PF, so the VFs's port base vlan
restoring should be handled by PF when PF was ready.

This patch fixes it.

Fixes: 039ba863e8d7 ("net: hns3: optimize the filter table entries handling when resetting")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h