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 BBC7943E57 for ; Sat, 13 Apr 2024 14:51:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B536A4067B; Sat, 13 Apr 2024 14:51:42 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2068.outbound.protection.outlook.com [40.107.237.68]) by mails.dpdk.org (Postfix) with ESMTP id 82EAD4067B for ; Sat, 13 Apr 2024 14:51:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mj7zXFrt5B0LWdno9v2TLB0ccR6Ds7hdNCyz5aX++sMGH8OEpNCyFljoIDEr1n19/glkbkuPIG3S97tqxMM18QH0v+BYfif0Hcpqv+iCgqncLx3df34bhMAR3o05DicsWkZJ9Vnpn3TYB0qfgbwPdzHHwcUk0f+Ol7815aGVo8y/CbfUx8CCB+4kMDQgRRQ11wt0v2Xi5afIvZc0jaCM4u+JdvSPSMgqzgBB459mo0NA58oTleTugPIllcyDj/EIa5Cqdxnj+GEDiYlxfo8zfVNKRAvWbI1j7MQm1zlPrbw2zpwHFJGSXxRSpzbY7fCbhA44m+iWfowqD1tNeZo79g== 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=qq+iRCpoxPM+9zg5aZBeBSZpuoVQ5xU1XvDKZGOz5kw=; b=QkLLJjYwFWJRU2XxvdXQfnWYfxOU92Hnhw7euGWGNA1XqJzykkk0Iey8ZQVRPTEMbmqoDNvyadpcJuzxukS9E+DOSA3t7NCFvYqzZkwZVXnPHNnmetGeNyrEafTe7avBCbbT1mziXFkNdbgrLnVbd+eXnI0ywmuVSgnQqqbGlk0wedUkQqJhkREZ+wx2eAm1n2w6+0kllkVhY0Bku4gDDf2oIzx5YpBcD8ADNJwW4HcTcyas7+j+Kn4YQSuy5USTf2OMzX1gEIDq53DNBtghSAzXzICBiryhc99ZrFsWKtl/JXl95Pd13JxAgmoJUqCBli/cKJSl4tLkuY3mnlBYbg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=huawei.com 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 (0) 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=qq+iRCpoxPM+9zg5aZBeBSZpuoVQ5xU1XvDKZGOz5kw=; b=OUn7w/wOZlKbMOhX+lZmCx1/ZVgtYTQa8gpUJonWUo+OBpoA936VGcgZGHOOiED6vJKT8B1lzMo1IRJWnKHwXVmXGCGWDn6zW8NcKM7eptL6tfHoDQLQZ7LruzNUi7ADWd47JsTPZQJ6JSkgqnDsp2BzYVoNVd9LxVsjKvIts1K2UqhgmLSuog7FIuCvgJXiCMVjV/fe/Fu8TWRi2l5igdpnTEBM3x+1WBVmetqw5a47/He/JKks6Uapeofjq0R2iBqUwZfnRfHdnGTNSNK1CoDMHWWf+Y6RZAcE8ELQsBvfGi9rJmlxjweL5XJ+1NHWH2Ces9Nk3BJbuzA3E6HBbw== Received: from BL0PR0102CA0031.prod.exchangelabs.com (2603:10b6:207:18::44) by LV3PR12MB9235.namprd12.prod.outlook.com (2603:10b6:408:1a4::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Sat, 13 Apr 2024 12:51:38 +0000 Received: from BL02EPF00021F6C.namprd02.prod.outlook.com (2603:10b6:207:18:cafe::e3) by BL0PR0102CA0031.outlook.office365.com (2603:10b6:207:18::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7472.31 via Frontend Transport; Sat, 13 Apr 2024 12:51:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL02EPF00021F6C.mail.protection.outlook.com (10.167.249.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Sat, 13 Apr 2024 12:51:38 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Sat, 13 Apr 2024 05:51:27 -0700 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.1258.12; Sat, 13 Apr 2024 05:51:25 -0700 From: Xueming Li To: Yunjian Wang CC: Ciara Loftus , Ferruh Yigit , dpdk stable Subject: patch 'net/af_xdp: fix leak on XSK configuration failure' has been queued to stable release 23.11.1 Date: Sat, 13 Apr 2024 20:48:14 +0800 Message-ID: <20240413125005.725659-14-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240413125005.725659-1-xuemingl@nvidia.com> References: <20240305094757.439387-1-xuemingl@nvidia.com> <20240413125005.725659-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: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00021F6C:EE_|LV3PR12MB9235:EE_ X-MS-Office365-Filtering-Correlation-Id: cf91cb09-0bc1-40f0-30ce-08dc5bb87573 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cL5au0/0QOuAUJAC7L9awnrJXo6TinhGNP+gSomFW2U04j6TCR6SDoQYz67ZYDEMsDKhl1yvbkVZrl/DogdzYM63H1G6NMhCqFhfHkAn//yaJRdMC1W6aJzXM2ib35EDC7WgsurrLIneYg8vkpv+QfVrksoyxz2HPRCi78lq8Pt92/2KzpawlwyKVfxa594TzJ4g2u7K6HkME8wJI2QZc+2R/9Zl1wEhiptchTNx3+dgKR6KP7SseeTrO1LjkvQUpmwXMr3y/hsAzNcCua+O5u42DrBgmueCTAwVwDd14DKBljMvB0fbQwvaR44/jCbgQcaV0TmyLkbgGF/WLHRevNGwQccvSKc3vxwtGHns2a3GBk2n0Qyzeih+Ltpm403mPcMhs7zJ/Y7nBPoDexQs+54BuOrMwMazQhFZyPZdwprLE6TYwtRBXSfwE6E0JuX7vP9IVyimIWdiG3kf0Fg6jKxu6m+5X8FkjRCgdQJaWZLcbQwKOLyyylKypV7FWLnTWZwNxuR/fwKp+xsp7Df9nDhdmgj85VVmmUifxa8DT+J+VEt0xo258LebiS8lg6xUnP5bokvC+I4DBORIgDA42qeDLyGfe2RKkDDf78sCagw4leSGD2IQ960bwdst8dC6KX5YsyX/bdesJr3H9pDkrlVtEpinXV8wFjLczSatOnVBC90Iv/A9qQ1zmmbtzwOl2A8L5XOPOk5gySbltJGK4mmprw8HhnQ/qkpvZjKp4/26ycimS/h5ogifC0GQEFkI X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230031)(36860700004)(376005)(1800799015)(82310400014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2024 12:51:38.0330 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf91cb09-0bc1-40f0-30ce-08dc5bb87573 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF00021F6C.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9235 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 23.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/15/24. 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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=c2d52df5993845a8baac976c631d4794458313ba Thanks. Xueming Li --- >From c2d52df5993845a8baac976c631d4794458313ba Mon Sep 17 00:00:00 2001 From: Yunjian Wang Date: Fri, 23 Feb 2024 09:45:45 +0800 Subject: [PATCH] net/af_xdp: fix leak on XSK configuration failure Cc: Xueming Li [ upstream commit 955acb9594cec548ae57319bfc99d4297d773675 ] In xdp_umem_configure() allocated some resources for the xsk umem, we should delete them when xsk configure fails, otherwise it will lead to resources leak. Fixes: f1debd77efaf ("net/af_xdp: introduce AF_XDP PMD") Signed-off-by: Yunjian Wang Reviewed-by: Ciara Loftus Acked-by: Ferruh Yigit --- drivers/net/af_xdp/rte_eth_af_xdp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index 2d151e45c7..268a130c49 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -960,6 +960,9 @@ remove_xdp_program(struct pmd_internals *internals) static void xdp_umem_destroy(struct xsk_umem_info *umem) { + (void)xsk_umem__delete(umem->umem); + umem->umem = NULL; + #if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG) umem->mb_pool = NULL; #else @@ -992,11 +995,8 @@ eth_dev_close(struct rte_eth_dev *dev) break; xsk_socket__delete(rxq->xsk); - if (__atomic_fetch_sub(&rxq->umem->refcnt, 1, __ATOMIC_ACQUIRE) - 1 - == 0) { - (void)xsk_umem__delete(rxq->umem->umem); + if (__atomic_fetch_sub(&rxq->umem->refcnt, 1, __ATOMIC_ACQUIRE) - 1 == 0) xdp_umem_destroy(rxq->umem); - } /* free pkt_tx_queue */ rte_free(rxq->pair); -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-04-13 20:43:05.577879974 +0800 +++ 0014-net-af_xdp-fix-leak-on-XSK-configuration-failure.patch 2024-04-13 20:43:04.907754049 +0800 @@ -1 +1 @@ -From 955acb9594cec548ae57319bfc99d4297d773675 Mon Sep 17 00:00:00 2001 +From c2d52df5993845a8baac976c631d4794458313ba Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 955acb9594cec548ae57319bfc99d4297d773675 ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org