From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 78625A0C47 for ; Mon, 26 Jul 2021 15:55:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6CC06410F2; Mon, 26 Jul 2021 15:55:25 +0200 (CEST) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mails.dpdk.org (Postfix) with ESMTP id 9FDD340DDA for ; Mon, 26 Jul 2021 15:55:24 +0200 (CEST) Received: by mail-wr1-f42.google.com with SMTP id l18so3530311wrv.5 for ; Mon, 26 Jul 2021 06:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FWJZ+klDEsygLw3BBghccKSfEB0viG9G5Z6IyNyZl/E=; b=SNFag0Bc9KFW7MuwbA7rkpjeaMevIuwLI/LttJzCpqIF6xjERNmv7oNQPyiF8wqfsi qP4ncMayeitu9k+TQOjy2dxak4T/z87vq1ZVtYpFdQf1FXI3/5oUUJNsMiXOdREp2BPV 5Tjl25b/kPalX0p90DEMvS6AGEPsZqjcx15p68C+WA/KWiMyCNMcUcNt9/tbtWJfOYpg HmDtVOUHXGNPmd6wRDxtGV52Y6E9VbMXmlv/h9PehUvQajDUIYPB+maolxsxiKI6bC4R uL8T/tSe19Ff3AL+wz6hhIQR+p1lmh+ECQJTjTWJJLggeW/P3THG+pd3QEuRXi8mnocw J//Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FWJZ+klDEsygLw3BBghccKSfEB0viG9G5Z6IyNyZl/E=; b=EuO/GOQPSVLAXUa2dkyzWT3bOo/eL6XOK818twM3Rnn7N7ILFqTncuyTFOnA72jLan RDQBuAk6qHuiPI00/GhZsZKs9eJBuQvhognIzPKz7+3ViYitJ4DJsxW7vHBVnP52EKn8 usih32aRnKaUTbmtzB2vmMfgUQfuMuMcBsZZTKF5plXoTj9ymXwfBubQQHpJYF4mQEIp xOUpuTeMiFmSI8cgDjHrGkiA5W5+lTXGlDQOumsnVvIDSEajCL1pBP0xhd0JHi4ydWez fVIdEhOs6yZWwPhRf0SBK575A5yDpDhQfXL7lm/gOz+D7ZQLlYfkU/+40DcFIuMGP/RQ Se7Q== X-Gm-Message-State: AOAM531Ofs7NB7/BJsM+BEZgD2ivsywhAMbFqbVERsUlegW1nI/XatI8 AmFVuwZmkYeqHgJzDNP/F+E= X-Google-Smtp-Source: ABdhPJzEVZmN+nZQLPLNAlPqiB+Lz5rwXKCIYCni4HoRmgIhTNmSJf+xwGk944NyT05zfohsBlNVAQ== X-Received: by 2002:a05:6000:1865:: with SMTP id d5mr18478544wri.376.1627307724466; Mon, 26 Jul 2021 06:55:24 -0700 (PDT) Received: from localhost ([137.220.125.106]) by smtp.gmail.com with ESMTPSA id v15sm37275448wmj.11.2021.07.26.06.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 06:55:23 -0700 (PDT) From: luca.boccassi@gmail.com To: Chengchang Tang Cc: Min Hu , dpdk stable Date: Mon, 26 Jul 2021 14:53:03 +0100 Message-Id: <20210726135322.149850-40-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210726135322.149850-1-luca.boccassi@gmail.com> References: <20210712130551.2462159-1-luca.boccassi@gmail.com> <20210726135322.149850-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/hns3: fix residual MAC address entry' has been queued to stable release 20.11.3 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/28/21. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/471ed659c1747d04d992310c8c08fca34e9c26c5 Thanks. Luca Boccassi --- >From 471ed659c1747d04d992310c8c08fca34e9c26c5 Mon Sep 17 00:00:00 2001 From: Chengchang Tang Date: Sat, 17 Jul 2021 10:02:49 +0800 Subject: [PATCH] net/hns3: fix residual MAC address entry [ upstream commit 976ddf2f5a7aa1ade4300de394cdd481a5e79f1c ] Currently, even if we fail to remove the origin MAC address from the HW, the set_default_mac will go on, and add the new MAC address to the HW. Eventually cause the original MAC address entry to remain in the HW, and users may receive unexpected packets. This patch make set_default_mac return directly to failure if deleting the original MAC address fails, simplifying the behavior of the driver and solving the problem of residual MAC address entry. Fixes: 7d7f9f80bbfb ("net/hns3: support MAC address related operations") Signed-off-by: Chengchang Tang Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_ethdev.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 089c94b8e9..1ddb2e1806 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -1666,7 +1666,6 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *oaddr; char mac_str[RTE_ETHER_ADDR_FMT_SIZE]; bool default_addr_setted; - bool rm_succes = false; int ret, ret_val; /* @@ -1686,9 +1685,10 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev, oaddr); hns3_warn(hw, "Remove old uc mac address(%s) fail: %d", mac_str, ret); - rm_succes = false; - } else - rm_succes = true; + + rte_spinlock_unlock(&hw->lock); + return ret; + } } ret = hns3_add_uc_addr_common(hw, mac_addr); @@ -1723,16 +1723,12 @@ err_pause_addr_cfg: } err_add_uc_addr: - if (rm_succes) { - ret_val = hns3_add_uc_addr_common(hw, oaddr); - if (ret_val) { - rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE, - oaddr); - hns3_warn(hw, - "Failed to restore old uc mac addr(%s): %d", + ret_val = hns3_add_uc_addr_common(hw, oaddr); + if (ret_val) { + rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE, oaddr); + hns3_warn(hw, "Failed to restore old uc mac addr(%s): %d", mac_str, ret_val); - hw->mac.default_addr_setted = false; - } + hw->mac.default_addr_setted = false; } rte_spinlock_unlock(&hw->lock); -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-07-26 13:53:17.974758033 +0100 +++ 0040-net-hns3-fix-residual-MAC-address-entry.patch 2021-07-26 13:53:15.905293799 +0100 @@ -1 +1 @@ -From 976ddf2f5a7aa1ade4300de394cdd481a5e79f1c Mon Sep 17 00:00:00 2001 +From 471ed659c1747d04d992310c8c08fca34e9c26c5 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 976ddf2f5a7aa1ade4300de394cdd481a5e79f1c ] + @@ -16 +17,0 @@ -Cc: stable@dpdk.org @@ -25 +26 @@ -index 17b995af15..3699b5636e 100644 +index 089c94b8e9..1ddb2e1806 100644 @@ -28 +29 @@ -@@ -1748,7 +1748,6 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev, +@@ -1666,7 +1666,6 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev, @@ -36 +37 @@ -@@ -1768,9 +1767,10 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev, +@@ -1686,9 +1685,10 @@ hns3_set_default_mac_addr(struct rte_eth_dev *dev, @@ -50 +51 @@ -@@ -1805,16 +1805,12 @@ err_pause_addr_cfg: +@@ -1723,16 +1723,12 @@ err_pause_addr_cfg: @@ -57 +58 @@ -- hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE, +- rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE, @@ -63 +64 @@ -+ hns3_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE, oaddr); ++ rte_ether_format_addr(mac_str, RTE_ETHER_ADDR_FMT_SIZE, oaddr);