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 8960CA0C41 for ; Tue, 30 Nov 2021 17:41:00 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8248A410F7; Tue, 30 Nov 2021 17:41:00 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id D3CDF41177 for ; Tue, 30 Nov 2021 17:40:57 +0100 (CET) Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id A2AC83F1B1 for ; Tue, 30 Nov 2021 16:40:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638290457; bh=JALScztN4SL8xxYyrrbJpuvy3ol5nEk95tgGpccpkbU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cMAGkIPT6fi+I1VS1g+NTHtso86+QPR/G7FPSmzQx2IwNy9oEDFj/YVYcpR2q9X1G U6ymeVhPU/sU1vFHwUM3wcDRmsxYu8DqX45s/A+xmNWU9WLfFE7oCRPyegoqAyzbRv pVDJ74wjohLuJJP2dBwygVutQ+QvsdyEYM3JG5qA3PFTMt277D/F7KUI2UYfnxwdD+ EC/t7qp4Zkx0OJpxB4Dp5/LWL6eQ4Uyk5pt0Cv92Gtdd9usqFN6b9XYbM5wdpAgSPz 2u9WgnuO82BevtRGstumO+Zk+MRsN6kScyY10azzrCrwCPzKMYQEPCCaJWduP2s3b+ nW0Bklm0YfdRg== Received: by mail-ed1-f71.google.com with SMTP id d13-20020a056402516d00b003e7e67a8f93so17528039ede.0 for ; Tue, 30 Nov 2021 08:40:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JALScztN4SL8xxYyrrbJpuvy3ol5nEk95tgGpccpkbU=; b=YSc04bKka09ZPoDo5Jphu6cf+58NmVvt9KxkjRmXdnuMtAKWT7i3Q+PKmgYDGUhqcp EPrU9R5G1WucTsjNkDub0nz+HpoIJY1sV1r2XH7802OyEVAGrxL2vtrSzwUgs+UeDoJc 0SLNK2r6bC1GDAEPqyaaJ1nLDQP0o+gxM7li3H6jSZwx6X4BU4wmimC3UBkc6DUvRkPH KJ0gwFm7bKrYXgr+0sRH0Wf2yGDxAi7J1I5KWotpCiyr0YyreNBbaXA2ubIQ7FgeZryJ AIslmQosWdKxqbeylxFoRo7qy+pNXJ4e4SX+Q5mcYsvLT13IDSw2kXcpOxgBZYirxr7/ KK2w== X-Gm-Message-State: AOAM533EfIa7HPD9JSj9/Znr2RyB3bnAvBgZJFDxMc5hZKYqq/9aMcV1 i+SGl6GWkiBQQ6qe9e7h5IvYrTBg4+mCJu/tWi6dGlCXgqdcLcqsVkeF+CxE4AQzxO9bqDtKsv5 GoZYEbWels0LgRi9//pHhILdJ X-Received: by 2002:a17:907:60d0:: with SMTP id hv16mr168505ejc.425.1638290457359; Tue, 30 Nov 2021 08:40:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJwTyE0HuPPkd/1CwjLrWBoUTvhmDq6PCdfORCenRmYOpShGxbwYDsQt1klEnnBIkjt+HA3AmA== X-Received: by 2002:a17:907:60d0:: with SMTP id hv16mr168486ejc.425.1638290457179; Tue, 30 Nov 2021 08:40:57 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id gz26sm9213928ejc.100.2021.11.30.08.40.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 08:40:56 -0800 (PST) From: christian.ehrhardt@canonical.com To: Huisong Li Cc: Ferruh Yigit , dpdk stable Subject: patch 'ethdev: fix PCI device release in secondary process' has been queued to stable release 19.11.11 Date: Tue, 30 Nov 2021 17:34:58 +0100 Message-Id: <20211130163605.2460997-94-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> References: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Hi, FYI, your patch has been queued to stable release 19.11.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before December 10th 2021. 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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/77153554589c77b9926fa85fcff37c5232a8e8ec Thanks. Christian Ehrhardt --- >From 77153554589c77b9926fa85fcff37c5232a8e8ec 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 [ 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 d44a8e2a39..7dae0d5a44 100644 --- a/lib/librte_ethdev/rte_ethdev_pci.h +++ b/lib/librte_ethdev/rte_ethdev_pci.h @@ -164,6 +164,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.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-30 16:50:11.358642521 +0100 +++ 0094-ethdev-fix-PCI-device-release-in-secondary-process.patch 2021-11-30 16:50:05.890874264 +0100 @@ -1 +1 @@ -From 17faaed85449b58b209150906d2ad2cbfd853150 Mon Sep 17 00:00:00 2001 +From 77153554589c77b9926fa85fcff37c5232a8e8ec Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 17faaed85449b58b209150906d2ad2cbfd853150 ] + @@ -15 +16,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ - lib/ethdev/ethdev_pci.h | 10 ++++++++++ + lib/librte_ethdev/rte_ethdev_pci.h | 10 ++++++++++ @@ -23,5 +24,5 @@ -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 -@@ -151,6 +151,16 @@ rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev, +diff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_ethdev_pci.h +index d44a8e2a39..7dae0d5a44 100644 +--- a/lib/librte_ethdev/rte_ethdev_pci.h ++++ b/lib/librte_ethdev/rte_ethdev_pci.h +@@ -164,6 +164,16 @@ rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev,