net: hns3: fix port vlan filter not disabled issue
authorYonglong Liu <liuyonglong@huawei.com>
Tue, 7 May 2024 13:42:23 +0000 (21:42 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 9 May 2024 08:47:32 +0000 (10:47 +0200)
commitf5db7a3b65c84d723ca5e2bb6e83115180ab6336
treea5165fcdadf2ec2682f0329232ecdd0f516bb155
parent094c281228529d333458208fd02fcac3b139d93b
net: hns3: fix port vlan filter not disabled issue

According to hardware limitation, for device support modify
VLAN filter state but not support bypass port VLAN filter,
it should always disable the port VLAN filter. but the driver
enables port VLAN filter when initializing, if there is no
VLAN(except VLAN 0) id added, the driver will disable it
in service task. In most time, it works fine. But there is
a time window before the service task shceduled and net device
being registered. So if user adds VLAN at this time, the driver
will not update the VLAN filter state,  and the port VLAN filter
remains enabled.

To fix the problem, if support modify VLAN filter state but not
support bypass port VLAN filter, set the port vlan filter to "off".

Fixes: 184cd221a863 ("net: hns3: disable port VLAN filter when support function level VLAN filter control")
Fixes: 2ba306627f59 ("net: hns3: add support for modify VLAN filter state")
Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c