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 22B09A0A0E for ; Mon, 10 May 2021 18:18:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1919440140; Mon, 10 May 2021 18:18:55 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2052.outbound.protection.outlook.com [40.107.237.52]) by mails.dpdk.org (Postfix) with ESMTP id 8388F40140 for ; Mon, 10 May 2021 18:18:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RRgSOkwz0MwdO3DpBDx9p7SdSrQFsOfSOpdnzhTnuLjSNnE557xmjfuhaPqa05RUc9xCfvI8r16/PYg5gSqnud/ZNKr1pEdnQffQzbyHKMV20bL3pghipmHp2BDJQDXcLggDI5jvNgp7/15tKJxRrT0LtPTfjdedKPT7pq1oXblUqV7JoGkmrEDCwDvykhUiR+6+l/zGX89/mW+8dNvptQNWAB+9k2TXMUznoiIf0xQLd30tq9W43xUbok9lBtbDUNKiMQNgl6cDTUs9ZueLf6fr/zznhWVl+oY3yqHpO7j63hjVwb+uuVXuW9VHoDiMuQrCvONeWgHy1mD2kRB7VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lhM9eIMb/Cgv0kNkYX3s/9IjCQuNlJzRJSwslY76sZI=; b=MA5VejShiASseQ8MVLvnAj5t6/fewNFifKr402bcwBMMOkkB5buSGvyz/49DTBPXKH0K16EhMasP281KzYB/UJ25wMRcqVIj/91u9aG8oWgaZekfxkLSWAyJTNoviO+lfrpN5Om6oFlhUnGPHCm3y8jJ2uu/D3hJdBAUrh+QQVjvtlyZeP817b+ifunE1lN+yvpI4Z8UcLm2ie0guUHw29ufiGbAyd37pIq7U6TzD9qV32Lo0IBbLK8kBtbpvUfs1x7xb+3A44hTGe7jBlbwLcxBb6Jgj2gfOi1JC6sRCN0loRXn4xOPnzhl+AWYyvFBfbsiCoFpbIhQJvVVbRt+Ww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=huawei.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lhM9eIMb/Cgv0kNkYX3s/9IjCQuNlJzRJSwslY76sZI=; b=W04g+QuoB0B+Rvxal93a9fScRy+kRCC/+O34NJdaYh3QVw31/tuNpSe9c8UMcquynukmG85kBqIorKop4j1BmYQHxC/7mUhRtVwJSKbwF4AuisgsD4Nfsxg6c+4m3K6aYrdPAr4R5oBqW2C8LrTEIvZleS15GoPsCPvY1uqWm+mK71JlXIb6H7g4GjpaHR52AMUGG4OBBD0DmC3cAOEiNb5V7mbkZa8+LzZzTjhxhDfIeqgofrrHG/C3bprfvVkBdrDe2DDYkD0bChijP/DzSCNoZabkvbBqkdhbcADtOTLj82m/6glIt6azuoFDZqSR8FWAljdffPzSn8Gg3OL3nQ== Received: from DM5PR20CA0022.namprd20.prod.outlook.com (2603:10b6:3:93::32) by BL0PR12MB4707.namprd12.prod.outlook.com (2603:10b6:208:8a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.27; Mon, 10 May 2021 16:18:52 +0000 Received: from DM6NAM11FT003.eop-nam11.prod.protection.outlook.com (2603:10b6:3:93:cafe::e4) by DM5PR20CA0022.outlook.office365.com (2603:10b6:3:93::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:18:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT003.mail.protection.outlook.com (10.13.173.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Mon, 10 May 2021 16:18:51 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 10 May 2021 16:18:49 +0000 From: Xueming Li To: Chengchang Tang CC: Luca Boccassi , Min Hu , dpdk stable Date: Tue, 11 May 2021 00:01:45 +0800 Message-ID: <20210510160258.30982-156-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210510160258.30982-1-xuemingl@nvidia.com> References: <20210510160258.30982-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9c671965-6b11-4a08-1532-08d913cf4cf6 X-MS-TrafficTypeDiagnostic: BL0PR12MB4707: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sqGyCvPtJ6SjhgDKOPbODU+5L8VtHrhJmM+16hmRRrsH1nE9j2aFcUgXDfnnwnKZrbfvR264V9yxVEyfcSfk/2UaJk0hOIYS/3LBQ31xKapQ7A74MqP6r6u4JEkkDAQAM8O18TVqGKJUdEWXSxseO3nevF7cviaAvQjxQ1eS5UcghZIID2aqkkYHmex0qDYvOo9xcmLlFZxvV2VM8r3Ssak/j7jhKSKuZ6oqjVunCBqu55ZRSgRTF7Ce88FmntVvePZueMe/fve4sgPj0MrNsR89FoKBtpoNN/catfnq7shkDe0fbG6M0diCQ9FQIAkAxyIFT9gpHI+3H+fLQXqKGiIm2Gt180APzQttiAkaPpDy1x5ZDqeAqKpX3YOmj4kkaD14+m2PuPkM+PcZ4mV12XT8IBravyTMl5EDb2jHP4QBD+d4J3vdSQbH0kY1PtN6088EUnWsBUEXipj8NSLLeW9TjbahBkVrRQi3fZFXYcpuvpzTw9zKlM2zajygtD1V1n4KE8IvsOqCQKnPAura15Ee/at84PPM0uRjmfVlIBTWUOiehl8EnijXiGlYrQMbXplwxzo5/9HndK7+1152EznsavCmsHDxhOjeaKrYUrIGo3hM+qL6OZ1IP2CCUgamkdtfY+k67r0EePdvoBhF70uUvgDASn2QyQsa7oPMs8tSHbT1o9/cB9vmNCsiyLt0Yo+h2YpLYwn7iJeUJUlt7eciuMhFm4fnbbgNo4gPuoVXflw4CTAPnIqJsCXY9r95fZoqX4zjzMYaQX0q+S5gDA== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(136003)(376002)(346002)(396003)(39860400002)(46966006)(36840700001)(966005)(70206006)(2616005)(70586007)(1076003)(8676002)(478600001)(336012)(186003)(6916009)(16526019)(8936002)(47076005)(426003)(82740400003)(7636003)(7696005)(54906003)(4326008)(26005)(5660300002)(36860700001)(6666004)(82310400003)(53546011)(356005)(316002)(36906005)(36756003)(83380400001)(55016002)(86362001)(6286002)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2021 16:18:51.9030 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c671965-6b11-4a08-1532-08d913cf4cf6 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT003.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB4707 Subject: [dpdk-stable] patch 'net/hns3: fix rollback after setting PVID failure' has been queued to stable release 20.11.2 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.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/12/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/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/73db182cb0e16e646c58fa32df9ff19c24191b12 Thanks. Xueming Li --- >From 73db182cb0e16e646c58fa32df9ff19c24191b12 Mon Sep 17 00:00:00 2001 From: Chengchang Tang Date: Wed, 31 Mar 2021 18:01:38 +0800 Subject: [PATCH] net/hns3: fix rollback after setting PVID failure Cc: Luca Boccassi [ upstream commit 39c4fe7042acaeea7a4dff0213ed3fd453a2c255 ] Currently, three hardware operations are involved in setting the PVID. If any operation fails, a failure will be returned. And there may be residual hardware configurations because no rollback is performed. This patch adds rollback operation for setting PVID to avoid residual hardware configuration after the PVID fails to be configured. Fixes: 411d23b9eafb ("net/hns3: support VLAN") Signed-off-by: Chengchang Tang Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_ethdev.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 6acee8d46d..b5a02dfc13 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -894,7 +894,7 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on) { struct hns3_hw *hw = &hns->hw; uint16_t port_base_vlan_state; - int ret; + int ret, err; if (on == 0 && pvid != hw->port_base_vlan_cfg.pvid) { if (hw->port_base_vlan_cfg.pvid != HNS3_INVALID_PVID) @@ -917,7 +917,7 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on) if (ret) { hns3_err(hw, "failed to config rx vlan strip for pvid, " "ret = %d", ret); - return ret; + goto pvid_vlan_strip_fail; } if (pvid == HNS3_INVALID_PVID) @@ -926,13 +926,27 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on) if (ret) { hns3_err(hw, "failed to update vlan filter entries, ret = %d", ret); - return ret; + goto vlan_filter_set_fail; } out: hw->port_base_vlan_cfg.state = port_base_vlan_state; hw->port_base_vlan_cfg.pvid = on ? pvid : HNS3_INVALID_PVID; return ret; + +vlan_filter_set_fail: + err = hns3_en_pvid_strip(hns, hw->port_base_vlan_cfg.state == + HNS3_PORT_BASE_VLAN_ENABLE); + if (err) + hns3_err(hw, "fail to rollback pvid strip, ret = %d", err); + +pvid_vlan_strip_fail: + err = hns3_vlan_txvlan_cfg(hns, hw->port_base_vlan_cfg.state, + hw->port_base_vlan_cfg.pvid); + if (err) + hns3_err(hw, "fail to rollback txvlan status, ret = %d", err); + + return ret; } static int -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-05-10 23:59:30.660632300 +0800 +++ 0157-net-hns3-fix-rollback-after-setting-PVID-failure.patch 2021-05-10 23:59:26.600000000 +0800 @@ -1 +1 @@ -From 39c4fe7042acaeea7a4dff0213ed3fd453a2c255 Mon Sep 17 00:00:00 2001 +From 73db182cb0e16e646c58fa32df9ff19c24191b12 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 39c4fe7042acaeea7a4dff0213ed3fd453a2c255 ] @@ -14 +16,0 @@ -Cc: stable@dpdk.org @@ -23 +25 @@ -index a4d17ed0f4..56b3032e6b 100644 +index 6acee8d46d..b5a02dfc13 100644 @@ -26 +28 @@ -@@ -981,7 +981,7 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on) +@@ -894,7 +894,7 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on) @@ -35 +37 @@ -@@ -1004,7 +1004,7 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on) +@@ -917,7 +917,7 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on) @@ -44 +46 @@ -@@ -1013,13 +1013,27 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on) +@@ -926,13 +926,27 @@ hns3_vlan_pvid_configure(struct hns3_adapter *hns, uint16_t pvid, int on)