From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6AD18A04FA; Wed, 5 Feb 2020 13:07:24 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A1AC91C12C; Wed, 5 Feb 2020 13:07:23 +0100 (CET) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id F248A1C121 for ; Wed, 5 Feb 2020 13:07:21 +0100 (CET) Received: by mail-wr1-f67.google.com with SMTP id m16so2385567wrx.11 for ; Wed, 05 Feb 2020 04:07:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ahURo6a/NxoP50jZPudBZ054N3CVxzblfHqKq1To4x4=; b=oGmwORtlg4M90UGXYtwTwNNcTceGLLDmtka35O9GsLctpLe0OucJnmB3yshDodlLUB njAq3EtRIUsYtjWrwR+xh7OuSveHhimtFmqadmmTjRQSHbquNJXMv78qQfazDoQmj55p q3S03SmWxoWWSGIl+TEan0RP81/D/li7YD+XRESvRo8a//A16iZtr0HUZ341Eko39sza g2qWDH4WS9IkFhxVJHkVtDf1VCeQ/OIpwgGIKa7dMFHm8DW8eyi7XB+JvT7xPapLqodr C78U8DdCzYGfmrQugJa8g//z8vfBlztXQsZZY4GRnjc8Sb2M9h5vL2MhH9M/uA8K67yD qKXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ahURo6a/NxoP50jZPudBZ054N3CVxzblfHqKq1To4x4=; b=gr+fHlUrDxLhMqz61iQXtLADAZK+pxgSC4fkMxatZ8qWIluvZ3qLyymWqvZP2AM/L4 jfidLDcRQp3HYTSnax2IEC0PQFDyE69hjoxqsgkrez4AWTtf8KgYiaIxws8QKhrnfiTI BSpVMXlW1MKX4ZLroLlTSBYSsuKP5fLLbty8QzCu2w6AdnJF3BT2VeX9reokotHT6UPx bpV/vEHcQRxP3lL+7d2nJmquB0l6HYBAzVD95x/ldzxnRy3Tx5L6/l1nSWqzC2k9nuM8 Aj37iqEMroAgTwf6FxRM32EKBCOY8DhTjei5s/f8u4AsiWDRgfsIMkKDPbCf5z9ZwDiY XNuQ== X-Gm-Message-State: APjAAAXoLA6/LGpqstBSEIzZL2bT7aF8SiCmBs2OgtJ2jQXIwNhwwfQv XqpGlUUwEWO196m+WFtKiWOu4Q== X-Google-Smtp-Source: APXvYqyCP5k9TvGIl89sJi4mHL2gCP/NYe3+f7Ybkn4TboL0YK5lCy7JxagmqFaicwP39dcjaWkcPQ== X-Received: by 2002:a5d:528e:: with SMTP id c14mr28766817wrv.308.1580904441453; Wed, 05 Feb 2020 04:07:21 -0800 (PST) Received: from shemminger-XPS-13-9360 ([212.187.182.163]) by smtp.gmail.com with ESMTPSA id r15sm7639103wmh.21.2020.02.05.04.07.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Feb 2020 04:07:21 -0800 (PST) Date: Wed, 5 Feb 2020 04:07:19 -0800 From: Stephen Hemminger To: David Marchand Cc: dev , Luca Boccassi , Bruce Richardson Message-ID: <20200205040719.0e429ae8@shemminger-XPS-13-9360> In-Reply-To: References: <20200104013341.19809-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 00/14] cleanup resources on shutdown X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 5 Feb 2020 10:32:49 +0100 David Marchand wrote: > Hello Stephen, > > On Sat, Jan 4, 2020 at 2:34 AM Stephen Hemminger > wrote: > > > > Recently started using valgrind with DPDK, and the results > > are not clean. > > > > The DPDK has a function that applications can use to tell it > > to cleanup resources on shutdown (rte_eal_cleanup). But the > > current coverage of that API is spotty. Many internal parts of > > DPDK leave files and allocated memory behind. > > > > This patch set is a start at getting the sub-parts of > > DPDK to cleanup after themselves. These are the easier ones, > > the harder and more critical ones are in the drivers > > and the memory subsystem. > > > > There are no visible API or ABI changes here. > > Could you share what you did to run a dpdk application with valgrind? > > I tried with testpmd and a 3.15 valgrind (fc30), but I get an init > failure on the cpu flags. > > $ LD_LIBRARY_PATH=/home/dmarchan/builds/build-gcc-shared/install/usr/local/lib64 > valgrind /home/dmarchan/builds/build-gcc-shared/install/usr/local/bin/dpdk-testpmd > -c 3 --no-huge -m 20 -d librte_mempool_ring.so -d librte_pmd_null.so > -w 0:0.0 --vdev net_null1 --vdev net_null2 -- --no-mlockall > --total-num-mbufs=2048 -ia > ==10258== Memcheck, a memory error detector > ==10258== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. > ==10258== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info > ==10258== Command: > /home/dmarchan/builds/build-gcc-shared/install/usr/local/bin/dpdk-testpmd > -c 3 --no-huge -m 20 -d librte_mempool_ring.so -d librte_pmd_null.so > -w 0:0.0 --vdev net_null1 --vdev net_null2 -- --no-mlockall > --total-num-mbufs=2048 -ia > ==10258== > ERROR: This system does not support "RDSEED". > Please check that RTE_MACHINE is set correctly. > EAL: FATAL: unsupported cpu type. > EAL: unsupported cpu type. > EAL: Error - exiting with code: 1 > Cause: Cannot init EAL: Operation not supported > ==10258== > ==10258== HEAP SUMMARY: > ==10258== in use at exit: 1,388 bytes in 49 blocks > ==10258== total heap usage: 97 allocs, 48 frees, 89,426 bytes allocated > ==10258== > ==10258== LEAK SUMMARY: > ==10258== definitely lost: 0 bytes in 0 blocks > ==10258== indirectly lost: 0 bytes in 0 blocks > ==10258== possibly lost: 0 bytes in 0 blocks > ==10258== still reachable: 1,388 bytes in 49 blocks > ==10258== suppressed: 0 bytes in 0 blocks > ==10258== Rerun with --leak-check=full to see details of leaked memory > ==10258== > ==10258== For lists of detected and suppressed errors, rerun with: -s > ==10258== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) > I am testing with valgrind on ARM. It should be possible on x86 but you need to dial down the RTE_MACHINE choice to something valgrind understands.