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 B74FA43CAD for ; Thu, 14 Mar 2024 01:10:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B263542E46; Thu, 14 Mar 2024 01:10:38 +0100 (CET) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mails.dpdk.org (Postfix) with ESMTP id D6B294021E for ; Thu, 14 Mar 2024 01:10:37 +0100 (CET) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-413f26b1729so442775e9.2 for ; Wed, 13 Mar 2024 17:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710375037; x=1710979837; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Xe0noayRinz/OFW+QkYtAz6DOsbP08Ky5eHiRNlfbJc=; b=I+nSvAzSFio6IIUn2g44VwQUJ70kxUcArmaJzwQCM/AavB8FeInl0phEwVBJPDNRwS QUtZvDpQ1bzu9g6hGb0amh6e+2HDAclPEZ+kQPXH9tsq+VZ12/etsLfaVvwnIOKeT5L8 76wmywuQtA2RlJ/HeVrvlCTj2We+sdYw8MScLk0QpXEQHxjjDY7CriSwdBEvau6dNnzT wDoURFvOdm9PsJ3VZ28yhU9VOL8TsFCSMwQv8oAuxBFnckFcqG5tTXApH4/EE2e2WI4q 6t21OM/TJxIhTOiz3n4wsNZUYGQyiW7c4zoBt9KowQ+q1pw32j+NgwkAnO66P6xTtyf7 06Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710375037; x=1710979837; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xe0noayRinz/OFW+QkYtAz6DOsbP08Ky5eHiRNlfbJc=; b=fdLG04apbt7l7HoF8/5mheGiEfG0lTTplqrwrIVLh4oVPDSu7WoTXV/bU8MvKc6xY3 ibdAv4C5taHrCAdGDYYQJoXEL42AuqAyyHW8g+l1impCRkuOQ9GdcnMu3V3TDyDtgsX9 ocX+K1fSB8CPQ/xnCq1JCBuWJpbEtfd7o9KjfOgXK8p0ccCIBOWyaS3zzVylh4PoiWzh PX+dzlKJw60o28ChZ4npnL+wSJ3XoeD7LPH0GIRc+1Npm/6Dpgu5KVvkM91naC1RzRki P1nbAFmAaSI47TsZ+MtNtLY1Q9QfOk8Yc+pYK1OC1UhwZMEnd6VIEl8bMiS6nKa2M1+g UjPw== X-Forwarded-Encrypted: i=1; AJvYcCX2bSy652bGrEf2xMI+TW5EC/gk5founH50tn0nisOPHxeJcIfPnunaH4z/3qarLXsCHQh87PdB/Mvoc1FTTzo= X-Gm-Message-State: AOJu0YwXPmaZfaippyOzVDHwxqKExsQ6wtCk19UpIgSbDqhnBRQXiBrC i+W8VxYDhPK3EyeTv8ycSthc+nQbgFxW4yQ9Hj26K+K6HL7VGRjr X-Google-Smtp-Source: AGHT+IHvGoJIzYH1jh7iX5zsOZ2+oZqALHS936ZZqZIV7mNr2EGR1oj1JnBq5hB9i0FxG1RPNHCPvQ== X-Received: by 2002:a05:600c:a0e:b0:413:eb5d:d8c3 with SMTP id z14-20020a05600c0a0e00b00413eb5dd8c3mr192267wmp.32.1710375037529; Wed, 13 Mar 2024 17:10:37 -0700 (PDT) Received: from localhost ([2a01:4b00:d036:ae00:7aef:1aaa:3dff:d546]) by smtp.gmail.com with ESMTPSA id e10-20020a05600c4e4a00b0041316e91c99sm621459wmq.1.2024.03.13.17.10.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 17:10:36 -0700 (PDT) From: luca.boccassi@gmail.com 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 22.11.5 Date: Thu, 14 Mar 2024 00:09:10 +0000 Message-Id: <20240314000957.2810803-14-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240314000957.2810803-1-luca.boccassi@gmail.com> References: <20240307013159.1735343-102-luca.boccassi@gmail.com> <20240314000957.2810803-1-luca.boccassi@gmail.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 22.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/16/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://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/fde6a99f1c2d3007ab3a40e4e411367d8798a891 Thanks. Luca Boccassi --- >From fde6a99f1c2d3007ab3a40e4e411367d8798a891 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 [ 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 70af6267d8..3c976dd6e0 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -938,6 +938,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 @@ -970,11 +973,8 @@ eth_dev_close(struct rte_eth_dev *dev) break; xsk_socket__delete(rxq->xsk); - if (__atomic_sub_fetch(&rxq->umem->refcnt, 1, __ATOMIC_ACQUIRE) - == 0) { - (void)xsk_umem__delete(rxq->umem->umem); + if (__atomic_sub_fetch(&rxq->umem->refcnt, 1, __ATOMIC_ACQUIRE) - 1 == 0) xdp_umem_destroy(rxq->umem); - } /* free pkt_tx_queue */ rte_free(rxq->pair); -- 2.39.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-03-14 00:09:21.421754652 +0000 +++ 0014-net-af_xdp-fix-leak-on-XSK-configuration-failure.patch 2024-03-14 00:09:20.577614507 +0000 @@ -1 +1 @@ -From 955acb9594cec548ae57319bfc99d4297d773675 Mon Sep 17 00:00:00 2001 +From fde6a99f1c2d3007ab3a40e4e411367d8798a891 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 955acb9594cec548ae57319bfc99d4297d773675 ] + @@ -11 +12,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 2d151e45c7..268a130c49 100644 +index 70af6267d8..3c976dd6e0 100644 @@ -24 +25 @@ -@@ -960,6 +960,9 @@ remove_xdp_program(struct pmd_internals *internals) +@@ -938,6 +938,9 @@ remove_xdp_program(struct pmd_internals *internals) @@ -34 +35 @@ -@@ -992,11 +995,8 @@ eth_dev_close(struct rte_eth_dev *dev) +@@ -970,11 +973,8 @@ eth_dev_close(struct rte_eth_dev *dev) @@ -38 +39 @@ -- if (__atomic_fetch_sub(&rxq->umem->refcnt, 1, __ATOMIC_ACQUIRE) - 1 +- if (__atomic_sub_fetch(&rxq->umem->refcnt, 1, __ATOMIC_ACQUIRE) @@ -41 +42 @@ -+ if (__atomic_fetch_sub(&rxq->umem->refcnt, 1, __ATOMIC_ACQUIRE) - 1 == 0) ++ if (__atomic_sub_fetch(&rxq->umem->refcnt, 1, __ATOMIC_ACQUIRE) - 1 == 0)