net: hns3: only enable unicast promisc when mac table full
authorJian Shen <shenjian15@huawei.com>
Mon, 18 Sep 2023 07:48:38 +0000 (15:48 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 19 Sep 2023 10:13:08 +0000 (12:13 +0200)
Currently, the driver will enable unicast promisc for the function
once configure mac address fail. It's unreasonable when the failure
is caused by using same mac address with other functions. So only
enable unicast promisc when mac table full.

Fixes: c631c696823c ("net: hns3: refactor the promisc mode setting")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

index 8ca368424436205c00951112a2ed7abaf4700153..c0d03283775f4118a17f63a3d1c5f33cccf721ba 100644 (file)
@@ -8824,7 +8824,7 @@ static void hclge_update_overflow_flags(struct hclge_vport *vport,
        if (mac_type == HCLGE_MAC_ADDR_UC) {
                if (is_all_added)
                        vport->overflow_promisc_flags &= ~HNAE3_OVERFLOW_UPE;
-               else
+               else if (hclge_is_umv_space_full(vport, true))
                        vport->overflow_promisc_flags |= HNAE3_OVERFLOW_UPE;
        } else {
                if (is_all_added)