Patch "net: hns3: fix show wrong state when add existing uc mac address" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: hns3: fix show wrong state when add existing uc mac address

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-hns3-fix-show-wrong-state-when-add-existing-uc-m.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 80ef91634abe73ae95b79e289ef4fc28b774300d
Author: Jian Shen <shenjian15@xxxxxxxxxx>
Date:   Wed Sep 29 17:35:53 2021 +0800

    net: hns3: fix show wrong state when add existing uc mac address
    
    [ Upstream commit 108b3c7810e14892c4a1819b1d268a2c785c087c ]
    
    Currently, if function adds an existing unicast mac address, eventhough
    driver will not add this address into hardware, but it will return 0 in
    function hclge_add_uc_addr_common(). It will cause the state of this
    unicast mac address is ACTIVE in driver, but it should be in TO-ADD state.
    
    To fix this problem, function hclge_add_uc_addr_common() returns -EEXIST
    if mac address is existing, and delete two error log to avoid printing
    them all the time after this modification.
    
    Fixes: 72110b567479 ("net: hns3: return 0 and print warning when hit duplicate MAC")
    Signed-off-by: Jian Shen <shenjian15@xxxxxxxxxx>
    Signed-off-by: Guangbin Huang <huangguangbin2@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 24357e907155..0e869f449f12 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -7581,15 +7581,8 @@ int hclge_add_uc_addr_common(struct hclge_vport *vport,
 	}
 
 	/* check if we just hit the duplicate */
-	if (!ret) {
-		dev_warn(&hdev->pdev->dev, "VF %u mac(%pM) exists\n",
-			 vport->vport_id, addr);
-		return 0;
-	}
-
-	dev_err(&hdev->pdev->dev,
-		"PF failed to add unicast entry(%pM) in the MAC table\n",
-		addr);
+	if (!ret)
+		return -EEXIST;
 
 	return ret;
 }
@@ -7743,7 +7736,13 @@ static void hclge_sync_vport_mac_list(struct hclge_vport *vport,
 		} else {
 			set_bit(HCLGE_VPORT_STATE_MAC_TBL_CHANGE,
 				&vport->state);
-			break;
+
+			/* If one unicast mac address is existing in hardware,
+			 * we need to try whether other unicast mac addresses
+			 * are new addresses that can be added.
+			 */
+			if (ret != -EEXIST)
+				break;
 		}
 	}
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux