]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
net: hns3: fix bug when PF set the duplicate MAC address for VFs
authorJian Shen <shenjian15@huawei.com>
Thu, 24 Mar 2022 12:54:47 +0000 (20:54 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 20 May 2022 12:39:36 +0000 (14:39 +0200)
commit41da96745f16580af2b40d5bbeadd7e23aac2f32
tree4bcd518af34431bad75c04e08e1b4cb7c92b20c3
parent1c3c1519b4417d5c2f663382b25a99ef5c113072
net: hns3: fix bug when PF set the duplicate MAC address for VFs

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit ccb18f05535c96d26e2d559d402acb87700fc5a7 ]

If the MAC address A is configured to vport A and then vport B. The MAC
address of vport A in the hardware becomes invalid. If the address of
vport A is changed to MAC address B, the driver needs to delete the MAC
address A of vport A. Due to the MAC address A of vport A has become
invalid in the hardware entry, so "-ENOENT" is returned. In this case, the
"used_umv_size" value recorded in driver is not updated. As a result, the
MAC entry status of the software is inconsistent with that of the hardware.

Therefore, the driver updates the umv size even if the MAC entry cannot be
found. Ensure that the software and hardware status is consistent.

Fixes: ee4bcd3b7ae4 ("net: hns3: refactor the MAC address configure")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 5e528c0e06188b5c1395b126ccd7854fb6d3bc88)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c