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 850F6A00C5 for ; Wed, 20 Jul 2022 10:24:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7D4E140FAE; Wed, 20 Jul 2022 10:24:21 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2087.outbound.protection.outlook.com [40.107.237.87]) by mails.dpdk.org (Postfix) with ESMTP id EB61E4003C for ; Wed, 20 Jul 2022 10:24:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TILLQ/Ws1JD+PQ0OwixZQMf1PSDfmhNA13YqqTMlSiuYXIy4kLRXHV40GiaRTFxjse4LO2hpkzYr6YgNxPxESxGJWjBuHf1pTmqJLCaOl+MQmpYpZD89CO2/kpa+9ZSMmYN0ppOepQ9tdVB05RbhRnxYstvCWAjLaHE2SK9kWOctZf97smnGok3rHXq/+96j74rqlAXk3qMhu6/E9Y0ok7EwVjTkNnkyTxJ40MG8jRKoFDwRVIF0/1igZEx5kMySVLMqScirNNXzqU9BZylTvDlbXmcf2NXJuTGhsQDGZVI+iH6mq4MdHKbuHyYNgdV9zVaUt9w3PERJLT9CgTGfxg== 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=wk7ZSNjT6Z2oH0gPnFtbDnA0qOmKyJgbiWufgWpSLFk=; b=PTzT91DLB5m4WbnaEPdEa49T5pC5aG2/WjFUYVE0l52XmTTt2CvPrMiI96/Qm17e+gOm20UuT1A9KdfpUWoE+YqgGvDdKXj3GUUwAacpt7u6iX2fKmDmMAJSh0nQMdlo5yeMachoReom8EDX74j2CbI0zWnfhQeBD5jM7gZi31jswqlvwmuAehmWwFUyEMyUy2cLFtrZsL12YL6bRTVLDC2bdOWhem9JGo1+Y3A0g4zIdN25+w8DSVS4jJDu+nWYjT8u15eDWAx3OIdGkfRY51vhWMpOLp8lWX8yOoqxlVCthkD2rU3SQ/+INsu4gBBCInp0pS+dEZnpMPXhYMf11g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject 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=wk7ZSNjT6Z2oH0gPnFtbDnA0qOmKyJgbiWufgWpSLFk=; b=UtINdU7nAQDhZXoVkQKYKlEeKTmlvPDaqzbtvsQu76htnypJ4ZckWUDFlX11mevQjdN8r027hQW0IJdD5XtLq59thlAZjTSao6dnpIlxok02OTUWK/VLKqtQbuvZkaV1MH2p35sqVhQ7cnC37/qqxrtkQeLG0FctNct6v9dA8k+815jHfDRaSWz2HW7kFIgxlW7W52u64NpyLkKj5CLwXuowG20fMxKDOPfmPXSxj52zEWbTvAS/XeWC9BKx7Gxw3P7ZGPG1amlwyb1KWXH0jGoVPwWL2if0I1OeM2XKGJsYzHI/96tst3i7jF8Poa9/kx9+lTGYr2mQpmdizvWMXQ== Received: from DM6PR01CA0023.prod.exchangelabs.com (2603:10b6:5:296::28) by PH7PR12MB6787.namprd12.prod.outlook.com (2603:10b6:510:1ad::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Wed, 20 Jul 2022 08:24:18 +0000 Received: from DM6NAM11FT067.eop-nam11.prod.protection.outlook.com (2603:10b6:5:296:cafe::e8) by DM6PR01CA0023.outlook.office365.com (2603:10b6:5:296::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.20 via Frontend Transport; Wed, 20 Jul 2022 08:24:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) 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 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.236) by DM6NAM11FT067.mail.protection.outlook.com (10.13.172.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5458.17 via Frontend Transport; Wed, 20 Jul 2022 08:24:18 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Wed, 20 Jul 2022 08:24:17 +0000 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Wed, 20 Jul 2022 01:24:16 -0700 From: Xueming Li To: Harman Kalra CC: , dpdk stable Subject: patch 'net/octeontx: fix port close' has been queued to stable release 20.11.6 Date: Wed, 20 Jul 2022 11:20:57 +0300 Message-ID: <20220720082132.3954126-28-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220720082132.3954126-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> <20220720082132.3954126-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8251dc5b-8733-4d59-de4f-08da6a293d75 X-MS-TrafficTypeDiagnostic: PH7PR12MB6787:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?CwcrzZH3QLP275xwXSHg0lVLiz05LKzYGNql9Vn9YiT2JtlhWz0K7KEhDSCD?= =?us-ascii?Q?gylAmg49uji65CUk0+ijBHm+yvx44rsTZkJZqXJjytnx/tvlGQxmlzEApfaj?= =?us-ascii?Q?er3IZaxE1vJqQFSRFxd/gcx5f47JPw2tCs87b+okEtqmd3hZ6+6234mu9J+C?= =?us-ascii?Q?MxHfBWqi4wJyGnjaju4rXxpT6FXMaMyVdOso9gyfjoOkhFZ34PlENiBPg2eU?= =?us-ascii?Q?hDaSpciEOTrkNFLArWDQKbclXdGK3qh7d9R2dsF66dTwS6OW7zJuCuVYIY5Z?= =?us-ascii?Q?iToKWP7y05s4CJYgj3TDnBUmv+6ijLNuxBLFfMcitgZImTXkYGCRuQ4Aqium?= =?us-ascii?Q?xGvcA1Ox9YXNDxPypc+05e/zAALixbmGd/elDtEIQS8aTha3rMc8MqtHtqcE?= =?us-ascii?Q?WCUfvM3PqJCV3qRuKIneepbSDJcdyFoj7sGQul7sCU1scQTCRSFw70mQMf1v?= =?us-ascii?Q?I8Gh3acVCUcAkHa4QgR/WxzLnZmZifkpmADh9Njm/rvo2OhvuDkRj2PhetNO?= =?us-ascii?Q?4vmFFxz0Na1SM+DU0TUiKaXmheIpwM8eV0xIjQVuuAWXpW13YCo3/5qdWHs6?= =?us-ascii?Q?nVs2jE6GL+TyG6qkmPqt+eFbXPl544qdyj6xy7lhPUV5x/ntKVEPjK0hTNZL?= =?us-ascii?Q?rCeewtmJLCLuK6wse8m/qaWw0QDDPRirNDqBHkx/O+cXfa/wzcQR3JH3Xb1s?= =?us-ascii?Q?jJyKnU4GtXH7Hxa/ewkXzWDqL2omJ1hBLiQ2ovfq12Wh8C8ado1zNXKWEt8Q?= =?us-ascii?Q?4Zc4TNyxnAtVEhzkdC7C1y7SYw6lQrPQWfIggvk1ykEMgqOCyYfBaeuOypxU?= =?us-ascii?Q?MSD+WKkaxlYInmPvD1Z3IMR5r2livVWc296SEKi+KW2TgjPAwHgi7qUEti0Q?= =?us-ascii?Q?BEdCESk1IKIn5SNVeS3/9vin67cs4FO36smysv4cxz0IOqZevwmVFQz9Z7F9?= =?us-ascii?Q?BRikFiEKhsVH/NHbuIFTcQ=3D=3D?= X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(396003)(376002)(346002)(39860400002)(136003)(46966006)(40470700004)(36840700001)(53546011)(426003)(336012)(478600001)(2616005)(186003)(83380400001)(6286002)(26005)(16526019)(7696005)(41300700001)(1076003)(36860700001)(356005)(47076005)(70206006)(966005)(6916009)(36756003)(86362001)(82310400005)(81166007)(55016003)(54906003)(8936002)(2906002)(82740400003)(8676002)(6666004)(4326008)(40460700003)(70586007)(5660300002)(40480700001)(316002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2022 08:24:18.2591 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8251dc5b-8733-4d59-de4f-08da6a293d75 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT067.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6787 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 20.11.6 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/22/22. 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/ac50182289fb01dbd0206fa6aa15099755ce60d6 Thanks. Xueming Li --- >From ac50182289fb01dbd0206fa6aa15099755ce60d6 Mon Sep 17 00:00:00 2001 From: Harman Kalra Date: Tue, 24 May 2022 14:12:26 +0530 Subject: [PATCH] net/octeontx: fix port close Cc: Xueming Li [ upstream commit 39e07170331f869c581ce4d3cdc0360f7b6b444a ] Segmentation fault has been observed while closing the ethernet port. Reason for the segfault is, eth port close also shuts down event device while other ethernet port is still using the event device. Fixes: da6c687471a3 ("net/octeontx: add start and stop support") Signed-off-by: Harman Kalra --- drivers/net/octeontx/octeontx_ethdev.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index d531a21c95..cf01155c82 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -25,6 +25,11 @@ #include "octeontx_rxtx.h" #include "octeontx_logs.h" +/* Useful in stopping/closing event device if no of + * eth ports are using it. + */ +uint16_t evdev_refcnt; + struct evdev_priv_data { OFFLOAD_FLAGS; /*Sequence should not be changed */ } __rte_cache_aligned; @@ -490,7 +495,11 @@ octeontx_dev_close(struct rte_eth_dev *dev) if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; - rte_event_dev_close(nic->evdev); + /* Stopping/closing event device once all eth ports are closed. */ + if (__atomic_sub_fetch(&evdev_refcnt, 1, __ATOMIC_ACQUIRE) == 0) { + rte_event_dev_stop(nic->evdev); + rte_event_dev_close(nic->evdev); + } octeontx_dev_flow_ctrl_fini(dev); @@ -681,8 +690,6 @@ octeontx_dev_stop(struct rte_eth_dev *dev) PMD_INIT_FUNC_TRACE(); - rte_event_dev_stop(nic->evdev); - ret = octeontx_port_stop(nic); if (ret < 0) { octeontx_log_err("failed to req stop port %d res=%d", @@ -1346,6 +1353,7 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, nic->pko_vfid = pko_vfid; nic->port_id = port; nic->evdev = evdev; + __atomic_add_fetch(&evdev_refcnt, 1, __ATOMIC_ACQUIRE); res = octeontx_port_open(nic); if (res < 0) @@ -1595,6 +1603,7 @@ octeontx_probe(struct rte_vdev_device *dev) } } + __atomic_store_n(&evdev_refcnt, 0, __ATOMIC_RELEASE); /* * Do 1:1 links for ports & queues. All queues would be mapped to * one port. If there are more ports than queues, then some ports -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-07-20 15:01:00.111785026 +0800 +++ 0028-net-octeontx-fix-port-close.patch 2022-07-20 15:00:58.714333824 +0800 @@ -1 +1 @@ -From 39e07170331f869c581ce4d3cdc0360f7b6b444a Mon Sep 17 00:00:00 2001 +From ac50182289fb01dbd0206fa6aa15099755ce60d6 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 39e07170331f869c581ce4d3cdc0360f7b6b444a ] @@ -12 +14,0 @@ -Cc: stable@dpdk.org @@ -20 +22 @@ -index f5ea9de8ef..6469fd0a96 100644 +index d531a21c95..cf01155c82 100644 @@ -23 +25 @@ -@@ -26,6 +26,11 @@ +@@ -25,6 +25,11 @@ @@ -35 +37 @@ -@@ -491,7 +496,11 @@ octeontx_dev_close(struct rte_eth_dev *dev) +@@ -490,7 +495,11 @@ octeontx_dev_close(struct rte_eth_dev *dev) @@ -48 +50 @@ -@@ -671,8 +680,6 @@ octeontx_dev_stop(struct rte_eth_dev *dev) +@@ -681,8 +690,6 @@ octeontx_dev_stop(struct rte_eth_dev *dev) @@ -57 +59 @@ -@@ -1333,6 +1340,7 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, +@@ -1346,6 +1353,7 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, @@ -65 +67 @@ -@@ -1582,6 +1590,7 @@ octeontx_probe(struct rte_vdev_device *dev) +@@ -1595,6 +1603,7 @@ octeontx_probe(struct rte_vdev_device *dev)