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 EE98FA0C4F for ; Mon, 26 Jul 2021 23:36:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1CDD0410F1; Mon, 26 Jul 2021 23:36:42 +0200 (CEST) Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) by mails.dpdk.org (Postfix) with ESMTP id 87318410E6; Mon, 26 Jul 2021 23:36:39 +0200 (CEST) Received: by mail-lf1-f46.google.com with SMTP id h14so18035124lfv.7; Mon, 26 Jul 2021 14:36:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=s1hv3u5+UEh59KxkSpfMdsGntyZFHWgft0lirfKoSLc=; b=G+C+Jd+EE9vp8cISn9WWAa5LGBK5vV2UvMJg+ssN+rBqNcyTooVc1SLATUzBdfnjV9 RseAvSWLQLN5CKgUn87PXTkSvl3c0G1M5AwTBQqvRiM6dPstQJ6dsxNYJO8fXlhEVEf8 D5uwCZYJSxfWl84jrWTKzW0gj9bgNPtvOkQ60HnhgGcaXQ/4wK4KHFJY8hDBrtetk/h9 kkHps5pz1CX5CLSDS2+H1bWBl1vlAHDGZpLn15ypC+1zY1izEfrgCNZkhF0gQlFy3MgK 6jRYPbGvGJ568Hv0/S/92qwssguFQP18fsIuxpzEzC8HSZtWtabNU3Dxzss6ZTLqiFO4 3QAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=s1hv3u5+UEh59KxkSpfMdsGntyZFHWgft0lirfKoSLc=; b=kSkcrrcAF8JgQplrJHxFWizKngnXxCy1HTAzIPNcFJw4zkqHy3UxCvsfYvB/0dgqHR b0W5cuSpiZhHpGkU+LJ0WM9/jBH3ht+EkgpxTfq/+q/SzBGCABFsVCVDWq4HUcMe9FbR xHnZrLchKaDmoxszdqfzt360exVIRefxHo2kdY/KwzJI/E3jGnEKc/hXBKCuq9gDWl27 K57lkn9wDmETTDAvia3fcfMlBdldMF7sli9B9gVpNFnmNUxlR8HdcIZ+twvzPlrPP6cx BolyZGux+hNnjUeSlm3m/dZPABRqmOroyXBAsHbEhyQRNk2iJ6PbQJK5DWUlV7CAE4p9 tJzw== X-Gm-Message-State: AOAM5325/uo9oguUUx3MsO2hZMj1F+zIc8YtxlxGUJ5oukvrBGAIg5cC FZk9Ex+/cCnz/t1xZPu9VGlzDzTS3gQ= X-Google-Smtp-Source: ABdhPJyKO0Zu6biNr8a8iRzxQ2vbUqtH2YTBpKQJnPGKpGOSK4zox+3Srv8Z/QwgjcOBQEVDHZ4Z5w== X-Received: by 2002:a05:6512:303:: with SMTP id t3mr14408138lfp.12.1627335398700; Mon, 26 Jul 2021 14:36:38 -0700 (PDT) Received: from sovereign.. (broadband-37-110-65-23.ip.moscow.rt.ru. [37.110.65.23]) by smtp.gmail.com with ESMTPSA id n7sm109980lfl.123.2021.07.26.14.36.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jul 2021 14:36:37 -0700 (PDT) From: Dmitry Kozlyuk To: dev@dpdk.org Cc: Dmitry Kozlyuk , stable@dpdk.org, Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam Date: Tue, 27 Jul 2021 00:36:32 +0300 Message-Id: <20210726213632.143296-1-dmitry.kozliuk@gmail.com> X-Mailer: git-send-email 2.29.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] eal/windows: cleanup virt2phys handle 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" eal_mem_virt2phys_init() opens a handle for use by rte_mem_virt2phy(). Close this handle on EAL cleanup. Fixes: 2a5d547a4a9b ("eal/windows: implement basic memory management") Cc: stable@dpdk.org Signed-off-by: Dmitry Kozlyuk --- lib/eal/windows/eal.c | 1 + lib/eal/windows/eal_memory.c | 7 +++++++ lib/eal/windows/eal_windows.h | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c index 5413d4d87f..3d8c520412 100644 --- a/lib/eal/windows/eal.c +++ b/lib/eal/windows/eal.c @@ -261,6 +261,7 @@ rte_eal_cleanup(void) eal_get_internal_configuration(); eal_intr_thread_cancel(); + eal_mem_virt2iova_cleanup(); /* after this point, any DPDK pointers will become dangling */ rte_eal_memory_detach(); eal_cleanup_config(internal_conf); diff --git a/lib/eal/windows/eal_memory.c b/lib/eal/windows/eal_memory.c index 4db048ccb5..71741fc07e 100644 --- a/lib/eal/windows/eal_memory.c +++ b/lib/eal/windows/eal_memory.c @@ -198,6 +198,13 @@ eal_mem_virt2iova_init(void) return ret; } +void +eal_mem_virt2iova_cleanup(void) +{ + if (virt2phys_device != INVALID_HANDLE_VALUE) + CloseHandle(virt2phys_device); +} + phys_addr_t rte_mem_virt2phy(const void *virt) { diff --git a/lib/eal/windows/eal_windows.h b/lib/eal/windows/eal_windows.h index 7cc811485d..23ead6d30c 100644 --- a/lib/eal/windows/eal_windows.h +++ b/lib/eal/windows/eal_windows.h @@ -79,6 +79,11 @@ void eal_intr_thread_cancel(void); */ int eal_mem_virt2iova_init(void); +/** + * Cleanup resources used for virtual to physical address translation. + */ +void eal_mem_virt2iova_cleanup(void); + /** * Locate Win32 memory management routines in system libraries. * -- 2.29.3