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 D65DCA034F for ; Wed, 10 Nov 2021 07:52:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CCCBD40142; Wed, 10 Nov 2021 07:52:52 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2052.outbound.protection.outlook.com [40.107.236.52]) by mails.dpdk.org (Postfix) with ESMTP id 4F04640142 for ; Wed, 10 Nov 2021 07:52:51 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=exv6XLSXPVsOGDAL4dKaJM5mNJPtXMXfdRQaxsZ4vVU7osL2//UtO5yFnLarl1ivVIBHJHP6yHZiiYy1tVn1QiWF1EC/i0Yii6TtI78mZHnHg09TCAuS+Hc2gEos6S5QsiA+pAs0eMe+ED79kjUL9P228x1BSJJ4lqfLTPSW0aQ04qSvYkFA17MMdhwkKIquMP4+UUtHr0vOiqMiAv54tkJRG6oJVGa5GkHXqF2K/DUlJ1ewpF2v9wBxYBg5eRvmPuoyQuh1OzK2EIt6NTV50z3b5rZILIpX+CCfI0qYmnv3vWwlNAJqjbZUdoJR8SyyvLdWCu2nBstg4XICvzX6AQ== 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=uWjl4jNCtnvlK69g9c1icm6DEKpF+DWAnpfR8xuTVns=; b=O8On1gVxNowblTTn2X3tFMJJ9LERX439m3rI6G0aXYQ9J/Z1t2lkp7VY0Ks2+CrW3VD4E7QSbcmRdtMBuma9hJDdUsC8wNeyd8bzRL97XRhisVByp1YxFFLfYYDlJXe9aQ1p81/v4q/uu8iOnLJ5X4gqQEC5NryoVSflLXqGFyt8fPI10bTbquxtRvLFUO9uuuj2jIVxBCRwSxDItqAc4bTT6KSgVqMdFHBtsTIGIi2zEEnyFmUR7C5PEkE5TH2XghcVVHDev0a3LVjaB0Nc+uI81pitrs/G67CV9dO4MFWnHBRJxbMlSQc6VIYM57mwc45+mA8BbRW7SQYJMYR94g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.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=uWjl4jNCtnvlK69g9c1icm6DEKpF+DWAnpfR8xuTVns=; b=b37Oc8aygWJR5pxfmJXDVDHyy4QqvGh7uZtxBoTbcqk0MmrRst/sQK01Ds3PXW21wDpH0MYUHTFRWaJ8cKDcb0xHz15T+TrO/QzWq2HtM7Agzu9MiiibYGGvBK1YXcC2bQYDjoe6FbodkPDOXpLtXg8SDrd9QnJagyYObQkdzzwJ/SzY+FaHTlH/lFzFpH8zjSGZMM1X5SQ8FrXZB2GvwtKA8i1mN/uN/27bmSR08iqSA7Prv5iBqv8SluTPKJ/mzuBiZ0vfRawWcCNP27cb3WgSJoE+eo+AG5lAz5nKeTTqFcY7aHnZWC+eKbiaY98ZF7pi198uptFRShdU+zKkBg== Received: from BN9PR03CA0804.namprd03.prod.outlook.com (2603:10b6:408:13f::29) by BYAPR12MB4629.namprd12.prod.outlook.com (2603:10b6:a03:111::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15; Wed, 10 Nov 2021 06:52:49 +0000 Received: from BN8NAM11FT016.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13f:cafe::b3) by BN9PR03CA0804.outlook.office365.com (2603:10b6:408:13f::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13 via Frontend Transport; Wed, 10 Nov 2021 06:52:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;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 BN8NAM11FT016.mail.protection.outlook.com (10.13.176.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:52:49 +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:52:47 +0000 From: Xueming Li To: Huisong Li CC: Luca Boccassi , Ferruh Yigit , dpdk stable Date: Wed, 10 Nov 2021 14:31:07 +0800 Message-ID: <20211110063216.2744012-184-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: 9e14345d-e66a-41b3-2360-08d9a416b5a6 X-MS-TrafficTypeDiagnostic: BYAPR12MB4629: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZGtjVgk8P9DS32VW5eG2FOGqREpOC//ct3LQ3ima0lNn0haYP+uYKRswSP4oc7QZDV6dGJSyfpxNCC3CmHF2HUejDmAuueVo81rOtzLQn6Sx6caZ+g0es2Q/7m16l+LpqjF1wwPkF/a8JbN0qaYPTkexfdQtzrwMDaGmy1/euZ/JxLVqGd1bKID3I0dMf01CXhpY/zmRVI155W1xG/4QJtTGczCrE5D8U/6Spytu3NJxBBzPXorMVACnmUMsYdNO3v7Sl3vrkXn7OuNuUwEaBZPL4mlAjerX9A2PJGHbtj68BTdNGA+dzwW1PtMaRP2BTt0rXHgpTihoB7aAJWX+lMeyZvKH5uwcgMw1ZAtCEaWCUYF1OvpMTHI3ja5z+9IzWx63WA9zumqI8h/SXFMH4x79sOebd8FaxwcA8ShV9LFVu0/8BDIGMXcTGMEvkGcHMoKK2Mu0cPbwCF2MiY6jC4zlwKPBN49+hmRjEvC3YtNzoV8rx5peJyXVYBN1GdRR05u7tsCvLOdn+4q5bWCQTU4JEB4T67TQcVscsOejySu4ZW73ZEysg++F7t1QX/9WvZ9YqGVmpgbL9bWuWRghh0aC+scSw9ssB+sLAy/4/RXl831ZxGBqHGjWb5lK1xtNr3lDrOoUMhKi8vAS+Q5KybA0HMvskw/vh9WVE014no6m/IJ+hCCouvDqOBfrc4CAtsWUQinySIbAE/Nb41BKgm/+Y+7hQVWHGmrfLKikSCHIpsTrO/zmn0IBgVGAsJwNBagsw/Iz6SXna51clFdea/dS5iPRNb8EkJGM2VYdOTU/nYJ6rIuLiIl28OVd012+vQmFkMl8aY+yqLZa91qJ1A== 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)(36840700001)(46966006)(316002)(356005)(6666004)(26005)(36906005)(8936002)(5660300002)(966005)(16526019)(336012)(54906003)(8676002)(186003)(70206006)(36860700001)(6916009)(53546011)(83380400001)(70586007)(4326008)(7636003)(7696005)(4001150100001)(47076005)(82310400003)(86362001)(426003)(1076003)(2616005)(2906002)(6286002)(55016002)(508600001)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:52:49.1107 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9e14345d-e66a-41b3-2360-08d9a416b5a6 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: BN8NAM11FT016.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB4629 Subject: [dpdk-stable] patch 'ethdev: fix PCI device release in secondary process' 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/89980fc3cec1259a81bd3c3fb53624b24fa26046 Thanks. Xueming Li --- >From 89980fc3cec1259a81bd3c3fb53624b24fa26046 Mon Sep 17 00:00:00 2001 From: Huisong Li Date: Thu, 21 Oct 2021 10:24:21 +0800 Subject: [PATCH] ethdev: fix PCI device release in secondary process Cc: Xueming Li [ upstream commit 17faaed85449b58b209150906d2ad2cbfd853150 ] In secondary process, rte_eth_dev_close() doesn't clear eth_dev->data. If calling rte_dev_remove() after rte_eth_dev_close(), in rte_eth_dev_pci_generic_remove() function, the released eth device still can be found by its name in shared memory. As a result, the eth device will be released repeatedly. The state of the eth device is modified to RTE_ETH_DEV_UNUSED after rte_eth_dev_close(). So this state can be used to avoid this problem. Fixes: dcd5c8112bc3 ("ethdev: add PCI driver helpers") Signed-off-by: Huisong Li Reviewed-by: Ferruh Yigit --- lib/librte_ethdev/rte_ethdev_pci.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_ethdev_pci.h index bf715896ae..0eba781917 100644 --- a/lib/librte_ethdev/rte_ethdev_pci.h +++ b/lib/librte_ethdev/rte_ethdev_pci.h @@ -151,6 +151,16 @@ rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev, if (!eth_dev) return 0; + /* + * In secondary process, a released eth device can be found by its name + * in shared memory. + * If the state of the eth device is RTE_ETH_DEV_UNUSED, it means the + * eth device has been released. + */ + if (rte_eal_process_type() == RTE_PROC_SECONDARY && + eth_dev->state == RTE_ETH_DEV_UNUSED) + return 0; + if (dev_uninit) { ret = dev_uninit(eth_dev); if (ret) -- 2.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:10.048414506 +0800 +++ 0183-ethdev-fix-PCI-device-release-in-secondary-process.patch 2021-11-10 14:17:01.990745109 +0800 @@ -1 +1 @@ -From 17faaed85449b58b209150906d2ad2cbfd853150 Mon Sep 17 00:00:00 2001 +From 89980fc3cec1259a81bd3c3fb53624b24fa26046 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 17faaed85449b58b209150906d2ad2cbfd853150 ] @@ -15 +17,0 @@ -Cc: stable@dpdk.org @@ -20 +22 @@ - lib/ethdev/ethdev_pci.h | 10 ++++++++++ + lib/librte_ethdev/rte_ethdev_pci.h | 10 ++++++++++ @@ -23,4 +25,4 @@ -diff --git a/lib/ethdev/ethdev_pci.h b/lib/ethdev/ethdev_pci.h -index 12015b6b87..59c5d7b40f 100644 ---- a/lib/ethdev/ethdev_pci.h -+++ b/lib/ethdev/ethdev_pci.h +diff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_ethdev_pci.h +index bf715896ae..0eba781917 100644 +--- a/lib/librte_ethdev/rte_ethdev_pci.h ++++ b/lib/librte_ethdev/rte_ethdev_pci.h