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 5ADA3A034F for ; Wed, 10 Nov 2021 07:57:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54D6340142; Wed, 10 Nov 2021 07:57:40 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2053.outbound.protection.outlook.com [40.107.212.53]) by mails.dpdk.org (Postfix) with ESMTP id 485DE40142 for ; Wed, 10 Nov 2021 07:57:39 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hkEJPzqgqkBVlcHvVXJ9cU5rpDLdDIWwyZAoM61F0uj/X7m1kEMbvHNKbPFn7djtmjjfyhOm6AjwB4decim6VFJWMSlEDd6NyxB9quLP11arBd6QtlKD7EVIWssOk/1Y50PVFqRVONMmuRAWif68b/vj+e3n/mjU0yM0J9im+d0W+vL4KJBrvEdY3xGph7Dg3mGRLYT6F7aRo76qU7MI5z1EjE67d15v7tOSrUnbhIYF+RytpTw1FuFv8Ltv3M7H5k/wZRtosOS4z+zxAfv+/hd9HytdtrKmOAZbP1vpiZZFMgQCvT1aVh/u9p4V/XvTMrKInHLp7YXehetyxKAy2Q== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b21ZalbVpl9RZjyCefjz4QlnMZ49yKeLcWOFYhIatzc=; b=fJlUFvrJkJrEevmWh1JWBDps/KnZ4GEWMmRazPyumg8sHJC+1rwEilqUf0/vH3n5iitKwBSOLkQc9IvoUZZVjHQlg4OSvYLxtsSIb2exbtWRLipH+0ORwg+qE3nIMJUF9hbohpVh5ogxPpZMPxuUb5wMulfBDBqCYGCMkwBqXokxfFjjsRyufV+DDoc2wCwTftjI2C1riY31Ya09WeRv2fVzoFbWQz5wVqRadlDJVndBElAPgGiy+VNVVaelo3LhES7u/VQoIdQQ2rN7MP5Kg2/JirU14A2HmPqZvYiGEZuoFNprt37g6tsz2U8Z76LL02gma6yqtk6oaBXt4+wGFg== 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=quarantine sp=quarantine 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=b21ZalbVpl9RZjyCefjz4QlnMZ49yKeLcWOFYhIatzc=; b=YBCT+fahg4rK5gUcJvcNYkxC44mcUwntMGN0vG+FVlgrXzTQ+a5ejGkU95Mi+q1ZKYLdBPapxB2dw5EIV/gS/KkAvjHgudSEV/QQWIqo+P4H+y1v52mA7+u4FxEJe6mW3KLTb3JwEsllWWh/FA7caB6SQEjU6sFUm6quROMVFLkr/FEoadUx+gUXbl4XBVmr8wdN3qg6VV6j0gtFljNTRhniWXIUYXXBw8VQf2/PdsHGv3xqNNtwubdXcyaC4DlfyRPQWD//M0rN0OrqpTJnKu7RAUMli+lCc1/AqxR2RRAj6xfgPSY1p2S3PcQ231t7sPd52vbHIpQi6FHLsSRYKg== Received: from DM5PR07CA0108.namprd07.prod.outlook.com (2603:10b6:4:ae::37) by DM6PR12MB2650.namprd12.prod.outlook.com (2603:10b6:5:4a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Wed, 10 Nov 2021 06:57:36 +0000 Received: from DM6NAM11FT051.eop-nam11.prod.protection.outlook.com (2603:10b6:4:ae:cafe::a7) by DM5PR07CA0108.outlook.office365.com (2603:10b6:4:ae::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 06:57:36 +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 DM6NAM11FT051.mail.protection.outlook.com (10.13.172.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4669.10 via Frontend Transport; Wed, 10 Nov 2021 06:57:35 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:57:29 +0000 From: Xueming Li To: Huisong Li CC: Luca Boccassi , Min Hu , dpdk stable Date: Wed, 10 Nov 2021 14:31:50 +0800 Message-ID: <20211110063216.2744012-227-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 95d34269-5a3b-46be-bafd-08d9a4176078 X-MS-TrafficTypeDiagnostic: DM6PR12MB2650: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LHckV62L08wESM9crORrMP5hXFOjDVs2FKZqav3/3ATs+qmM6fbDevkc0GZzIYci187Ww22+puGxQXnyBDpKWyp4ZZb3QCIbLt6f8SgDAM/7e4y2C1N6y/bIi9PVDmI2viF4X4rCDXYHfMmx1wofNVku1yoiECllpBGxdJoRXjy60coTYI4NPK74DJZy++XYzFAUfBISy1PwUPo2BuEPa+gSF3Hc2lOwq8kcEXvopkirAJ5U3YfZDQnKBFLf/+gdasKz+otXFVx3qXNC5EhFpMgoYR3N30q/7FmYA+LYbjuW21vTlCHvK5ZR5+RT9d7+fEb1dgxP6Yt/OoDmSUprn7XUQB8hpnHuTGHQ+c+WZTCWb3zQHEQCpdVRqm/dRW8ATTn7levZ66B4SSZyBa1GUvG5uEVcUPmkG6/b4QnnfUGDUuOcyOj4m1o1J21qhBUrgM/PA8FCIdX513TuQZAK3oodKJIcbVA3vOABmpKMz5gz6BPExP9h6HM+XSTEZBd+gOFNhE/jX7kAA3Vwi8L7FFO2+x6G6FV9a9xYYhj6PQF8xhPqmSQuK2BmqS+n0KFq3sLWjKNdZxpcOsh4CHBjCh+V/e8fRItj7P40gjd7GNOfDAWDVBExHLeRc02EkbaAK4robtEflfqNwPzKZPe2lKa1lSoMUEmtDbki7/UgJOINEsIAk4tZPQtV0Lwyw+qfddN5oQ7wz1dvhaGATSE5lEj/EQo79vDZK5AnD66Ks/o/sgjkSBswdm+HJnLNCq53IcOYGkl7ytQaYQGjLI0FMNTw/iZLsqkIKNJTNs0rMqpS3p6iMBAmVc1kUUKbMRKefkWSRvtlab55A9xazPrU8Q== 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)(46966006)(36840700001)(53546011)(47076005)(2616005)(1076003)(70206006)(6916009)(55016002)(86362001)(4326008)(7696005)(83380400001)(966005)(426003)(36756003)(6666004)(336012)(5660300002)(508600001)(8936002)(54906003)(2906002)(7636003)(6286002)(26005)(70586007)(82310400003)(36860700001)(316002)(356005)(4001150100001)(16526019)(8676002)(186003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:57:35.4146 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 95d34269-5a3b-46be-bafd-08d9a4176078 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: DM6NAM11FT051.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB2650 Subject: [dpdk-stable] patch 'net/hns3: unregister MP action on close for secondary' has been queued to stable release 20.11.4 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.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/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/04633406305865d907991c45507bbc4b64397cea Thanks. Xueming Li --- >From 04633406305865d907991c45507bbc4b64397cea Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Tue, 2 Nov 2021 09:38:28 +0800 Subject: [PATCH] net/hns3: unregister MP action on close for secondary Cc: Xueming Li [ upstream commit 443242212baeb67d298c54cc927553c92aa29bec ] This patch fixes lack of unregistering MP action for secondary process when PMD is closed. Fixes: 9570b1fdbdad ("net/hns3: check multi-process action register result") Fixes: 23d4b61fee5d ("net/hns3: support multiple process") Signed-off-by: Huisong Li Signed-off-by: Min Hu (Connor) --- drivers/net/hns3/hns3_ethdev.c | 6 ++++-- drivers/net/hns3/hns3_ethdev_vf.c | 6 ++++-- drivers/net/hns3/hns3_mp.c | 5 +---- drivers/net/hns3/hns3_mp.h | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 46dfbe5d69..0cce6e6561 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -5201,6 +5201,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev) if (rte_eal_process_type() != RTE_PROC_PRIMARY) { __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED); + hns3_mp_uninit(); return 0; } @@ -5217,7 +5218,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev) hns3_uninit_pf(eth_dev); hns3_free_all_queues(eth_dev); rte_free(hw->reset.wait_data); - hns3_mp_uninit_primary(); + hns3_mp_uninit(); hns3_warn(hw, "Close port %u finished", hw->data->port_id); return ret; @@ -6371,7 +6372,7 @@ err_init_pf: rte_free(hw->reset.wait_data); err_init_reset: - hns3_mp_uninit_primary(); + hns3_mp_uninit(); err_mp_init_primary: err_mp_init_secondary: @@ -6392,6 +6393,7 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev) if (rte_eal_process_type() != RTE_PROC_PRIMARY) { __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED); + hns3_mp_uninit(); return 0; } diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 87859c45a4..b47b0b2bf9 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -1993,6 +1993,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev) if (rte_eal_process_type() != RTE_PROC_PRIMARY) { __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED); + hns3_mp_uninit(); return 0; } @@ -2008,7 +2009,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev) hns3vf_uninit_vf(eth_dev); hns3_free_all_queues(eth_dev); rte_free(hw->reset.wait_data); - hns3_mp_uninit_primary(); + hns3_mp_uninit(); hns3_warn(hw, "Close port %u finished", hw->data->port_id); return ret; @@ -2846,7 +2847,7 @@ err_init_vf: rte_free(hw->reset.wait_data); err_init_reset: - hns3_mp_uninit_primary(); + hns3_mp_uninit(); err_mp_init_primary: err_mp_init_secondary: @@ -2868,6 +2869,7 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev) if (rte_eal_process_type() != RTE_PROC_PRIMARY) { __atomic_fetch_sub(&hw->secondary_cnt, 1, __ATOMIC_RELAXED); + hns3_mp_uninit(); return 0; } diff --git a/drivers/net/hns3/hns3_mp.c b/drivers/net/hns3/hns3_mp.c index 6461ded2d2..8d7fb93065 100644 --- a/drivers/net/hns3/hns3_mp.c +++ b/drivers/net/hns3/hns3_mp.c @@ -212,10 +212,7 @@ int hns3_mp_init_primary(void) return 0; } -/* - * Un-initialize by primary process. - */ -void hns3_mp_uninit_primary(void) +void hns3_mp_uninit(void) { process_data.eth_dev_cnt--; diff --git a/drivers/net/hns3/hns3_mp.h b/drivers/net/hns3/hns3_mp.h index 758ffa70ac..94c0c957e0 100644 --- a/drivers/net/hns3/hns3_mp.h +++ b/drivers/net/hns3/hns3_mp.h @@ -15,7 +15,7 @@ extern struct hns3_process_local_data process_data; void hns3_mp_req_start_rxtx(struct rte_eth_dev *dev); void hns3_mp_req_stop_rxtx(struct rte_eth_dev *dev); int hns3_mp_init_primary(void); -void hns3_mp_uninit_primary(void); +void hns3_mp_uninit(void); int hns3_mp_init_secondary(void); #endif /* _HNS3_MP_H_ */ -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:11.874678014 +0800 +++ 0226-net-hns3-unregister-MP-action-on-close-for-secondary.patch 2021-11-10 14:17:02.050744618 +0800 @@ -1 +1 @@ -From 443242212baeb67d298c54cc927553c92aa29bec Mon Sep 17 00:00:00 2001 +From 04633406305865d907991c45507bbc4b64397cea Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 443242212baeb67d298c54cc927553c92aa29bec ] @@ -22 +25 @@ -index 874854da61..88abbb84ea 100644 +index 46dfbe5d69..0cce6e6561 100644 @@ -25 +28 @@ -@@ -5852,6 +5852,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev) +@@ -5201,6 +5201,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev) @@ -33 +36 @@ -@@ -5868,7 +5869,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev) +@@ -5217,7 +5218,7 @@ hns3_dev_close(struct rte_eth_dev *eth_dev) @@ -42 +45 @@ -@@ -7463,7 +7464,7 @@ err_init_pf: +@@ -6371,7 +6372,7 @@ err_init_pf: @@ -51 +54 @@ -@@ -7486,6 +7487,7 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev) +@@ -6392,6 +6393,7 @@ hns3_dev_uninit(struct rte_eth_dev *eth_dev) @@ -60 +63 @@ -index 91acd1f5dd..f7f615bf72 100644 +index 87859c45a4..b47b0b2bf9 100644 @@ -63 +66 @@ -@@ -1895,6 +1895,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev) +@@ -1993,6 +1993,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev) @@ -71 +74 @@ -@@ -1910,7 +1911,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev) +@@ -2008,7 +2009,7 @@ hns3vf_dev_close(struct rte_eth_dev *eth_dev) @@ -80 +83 @@ -@@ -2769,7 +2770,7 @@ err_init_vf: +@@ -2846,7 +2847,7 @@ err_init_vf: @@ -89 +92 @@ -@@ -2793,6 +2794,7 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev) +@@ -2868,6 +2869,7 @@ hns3vf_dev_uninit(struct rte_eth_dev *eth_dev) @@ -98 +101 @@ -index 1a79d249b8..6d33bf49cd 100644 +index 6461ded2d2..8d7fb93065 100644 @@ -101 +104 @@ -@@ -244,10 +244,7 @@ int hns3_mp_init_primary(void) +@@ -212,10 +212,7 @@ int hns3_mp_init_primary(void) @@ -114 +117 @@ -index b49532f985..5738ab74a5 100644 +index 758ffa70ac..94c0c957e0 100644 @@ -117,3 +120,3 @@ -@@ -18,7 +18,7 @@ void hns3_mp_req_start_tx(struct rte_eth_dev *dev); - void hns3_mp_req_stop_tx(struct rte_eth_dev *dev); - +@@ -15,7 +15,7 @@ extern struct hns3_process_local_data process_data; + void hns3_mp_req_start_rxtx(struct rte_eth_dev *dev); + void hns3_mp_req_stop_rxtx(struct rte_eth_dev *dev);