net: hns3: add compatible handling for MAC VLAN switch parameter configuration
authorGuangbin Huang <huangguangbin2@huawei.com>
Thu, 14 Nov 2019 02:32:39 +0000 (10:32 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 Nov 2019 02:06:34 +0000 (18:06 -0800)
commit71c5e83bcf1e795e28a9dae6b1e74095452bf26e
tree414382ce5489f6f44e0352ddd86a5a557084b86b
parent15fb35fa9ff456b81159033eba6397fcee85e671
net: hns3: add compatible handling for MAC VLAN switch parameter configuration

Previously, hns3 driver just directly send specific setting bit
and mask bits of MAC VLAN switch parameter to the firmware, it
can not be compatible with the old firmware, because the old one
ignores mask bits and covers all bits with new setting bits.
So when running with old firmware, the communication between PF
and VF will fail after resetting or configuring spoof check, since
they will do the MAC VLAN switch parameter configuration.

This patch fixes this problem by reading switch parameter firstly,
then just modifies the corresponding bit and sends it to firmware.

Fixes: dd2956eab104 ("net: hns3: not allow SSU loopback while execute ethtool -t dev")
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c