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 4DF39A0C4D; Tue, 24 Aug 2021 11:00:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E63D40687; Tue, 24 Aug 2021 11:00:26 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 100004014E for ; Tue, 24 Aug 2021 11:00:24 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10085"; a="217273537" X-IronPort-AV: E=Sophos;i="5.84,346,1620716400"; d="scan'208";a="217273537" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Aug 2021 02:00:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,346,1620716400"; d="scan'208";a="493423023" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga008.fm.intel.com with ESMTP; 24 Aug 2021 02:00:00 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Tue, 24 Aug 2021 02:00:00 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10 via Frontend Transport; Tue, 24 Aug 2021 02:00:00 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.42) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Tue, 24 Aug 2021 02:00:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J0jl+0HZNo0dUMBD2Loc6LNBESn6PWUR4VxYIgNMU8jQAvdY9F79wfDDmdx/2ml2qrwv3ujviNmMSV7NlnzTvy+RqKtE/z7PM7ArNphm+on794koq4eYhNHmwi4U8WNKekyMwQQ785L0jYfuR+dFmBiMI4QMMn2Bw7veaWRl62NPfa4EvlKoCsOrbNRcqPNQmuIZb7Xixk9rr2/5EdIs6jdoyv5S3I901zTyU246KWxxG1AL9+cpl8wssbtq/L3TNLiyy9J/T7+d4Xo1nNeDyjws7/mYqkqvHlOgeaeiZpGigAFZ0GjbwbTYl1HlcEDPi1EE7EeODnYrkrdQ+5PYig== 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-SenderADCheck; bh=zPOjp+933HQvhz05EC8or/+e98HaIJQM/eOZ78+bqOE=; b=HUWIA3g6ta01zS/SXJKFTGyBy1vSVo0PTv4EdDrsxGMyVKmdsKC5gA+RNrKwll+ZddLkWf9QDOHaO1xo0Jfr5Dbu+1sDQ6pF6MJfFiGt4/zJUPxL6UhB/+rFAFTzgsq7ryx6BlzzXsaUpm4sHIT/JH4cdI5EEaOAuzrQsvd6Z9yFluMo+l/B3D6XbwLX6uEpjskwoCUvuaGCwsM82iatUmmXcerbpEFzf6k88PlJkGg/xg1YU2Ni+P4TM5ZS98oTJ5NCJ1OZTGF6XsN4lcJI8HsKws6FASgReQmaPFd8XydD4KyNR8UI72mWSg/9eE9Ub9UkCDLKQkFu3WclME8mkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zPOjp+933HQvhz05EC8or/+e98HaIJQM/eOZ78+bqOE=; b=F4PgZ+DJWeDwwJ5qAmCiljQME552sdllgXkTi/o9sBSs22EcgnPJ30akzP9PtmovQt16pWHZGzCDZ7LOkJ4dFtEvKCoddHku7i0VN+Kd7Lug4gALUJks0+3cf6yZenBURkefUnQRXJE8+IFFkNBdfwA4GWuphfBZou2nynoPIdY= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by PH0PR11MB4871.namprd11.prod.outlook.com (2603:10b6:510:30::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Tue, 24 Aug 2021 08:59:54 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::2979:70ca:38a:dbaf]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::2979:70ca:38a:dbaf%6]) with mapi id 15.20.4436.024; Tue, 24 Aug 2021 08:59:54 +0000 To: "Yan, Xiaoping (NSB - CN/Hangzhou)" , "dev@dpdk.org" CC: Reshma Pattan References: From: Ferruh Yigit X-User: ferruhy Message-ID: <6a0c57ab-869c-46b4-2e60-8c2a1c4d205a@intel.com> Date: Tue, 24 Aug 2021 09:59:44 +0100 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: DBBPR09CA0001.eurprd09.prod.outlook.com (2603:10a6:10:c0::13) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.206] (37.228.236.146) by DBBPR09CA0001.eurprd09.prod.outlook.com (2603:10a6:10:c0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 08:59:53 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d0c29e4c-0ad2-466c-4c1d-08d966dd8a1b X-MS-TrafficTypeDiagnostic: PH0PR11MB4871: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q26pcfFBHS9lNJ+NAi42jYlJZ4JiVMiU5sXvUQ+5Tgf0nWTZfIKuMRHTz9gRO+jpndIVTojAO7HgQrZu4LxOC1xkq65W4u6qwav0KBUpGCQrgESFM1H0GtslbKwSzRdMTQggWI4npRnbhfddRJwdQygldz0RtkX5bUI1bmzztcXwKU1O+krY3/2QMy1YuUjps0nhAPR5eaIa7LtqfLf/somfQG9iiYFPDk6Thj3Q3W2Uogf1vrZ96YTGgUeOuxEmK1/RDgKbZqGpPXF6fUu0kd0eeU6g+OLIGs+XazUIkwKwefNJ8xtSyEgcVbun0T9jl18ib60ZY5N4iIlGGJjeh3SFQ829r/KHnr+0V/VFZRAyMp4Xn0Y2lIECUfdzjz73Wxkrl1H81r9imZiKj8tGzQWZAnwoQL+vRQ54qpDMvJ6JcSiB9HekuWpbynd+93xpuh5DgFWNiyKOWck6qh9WIME/GOFlEHT+4V4niWWo3S3JwTQPs/O4EBKMrF+7hFWANLu7/uGvxEidXcHJq51kGegPfMdTUrg6K+LglOi1QHPeJfQK0pDSU4DK8VUChA7esn7xOUm/jBKznKVhzvbYJ/TdW6nEe6cYtxIiASB0xiHFdXxAlgytqdjgtvRXBO2BcEWvjWNzXNeGirRjw12NVsvgSNpQ0m1B7pvj9IxksTBLdxF4PBNsVingjTzNGyaG7ZoeV3exQRjCa0rCGP9OnA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(39860400002)(136003)(346002)(376002)(6666004)(8936002)(316002)(4326008)(6486002)(66946007)(66556008)(5660300002)(53546011)(66476007)(86362001)(16576012)(107886003)(110136005)(8676002)(36756003)(31686004)(478600001)(38100700002)(2616005)(2906002)(956004)(83380400001)(186003)(44832011)(26005)(31696002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Z0Z5WnloK3NpVXh3YmZNN2pHK0dSQjRHNjlHNFpna09PWFN4L3planRqL0U5?= =?utf-8?B?NytBM2t2cTNBUHFwbnNKQ3JqSjR2RVIwYlU1Z3JLbmxpV0IzUXV6dGZ6dGor?= =?utf-8?B?TUcyOHJNYnBlNW1TWm80Y1oxWUx0UDBreWtTaS9KYzROTW9xSEFOOGZYWGky?= =?utf-8?B?YzR4Rk8vTWNVUmgrR2VDWHhXOXJUOXM3WGg1MFJybU5LT2hvNTNYN2dzcFV5?= =?utf-8?B?NTltWFJWaUNNQjFhQ2NlNGI0Y0d1T2tHMmM4Y1NKTmU0Qnd5QnFFZVJjbDY4?= =?utf-8?B?NStxUUFYMHhmYUxvZi9nWEM5UFJRc2tzMnM5ak5XWXdhaENjWnFucWhYWnll?= =?utf-8?B?RkJwb0Rxeno5ekZkSExHS2cwdzFxUk9NcjJGcHhpMUlQM1BvQVU1NjNMRG1k?= =?utf-8?B?SmF1TENPS0JGdFdOSDB3R3Bxa0NJVHJWaVlDeXJPOEp4Qk9ncWZUMkN4cC8r?= =?utf-8?B?TkhaZUlESlNDc0FYT2RHUklVMDgwUnpZUnFCOTV5Y3c1M3lJeS9zcXZRdkN5?= =?utf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QzhYWVBWV0pyV0Nl?= =?utf-8?B?NEZqaEdmSjZpbnN1V2U4YmRlYjZ6Tmk0WWUxdHZ6LzJlZVdLMlM5aUZzcTZu?= =?utf-8?B?cjI4OWY5a0lzM1NiQVhkWk9aNUR2TVFwNW00TVVEa0FqbHEyQUQ3OUIvQ0Jp?= =?utf-8?B?U2tyOGpxU1YwdnlmRlQrU1NnT3F6Kzl4VkF1KzZjT0FZaHlHTE9Sd0JvVEIx?= =?utf-8?B?SHpYY3VPc0xyZUFmWDJOMGRYS1ptaFNLV2ZvRVRGVGpVZjFpZFVzNmhQVTQ1?= =?utf-8?B?OWU4S1dZcG5NYWNRN0RrWWlabkhEbVk0Z1VCeVhZL1NsRFdxWnllendxMm5q?= =?utf-8?Q?9Yjqpd+UDaiRq4EyTKsyCqRxlBhEit0CKEzWhKg?= X-MS-Exchange-CrossTenant-Network-Message-Id: d0c29e4c-0ad2-466c-4c1d-08d966dd8a1b X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 08:59:54.1581 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: frq+8oJK7RlMT4xenHGVpLVihNmV7VAlR7Cft1FomOXncNkmaxIFPeVWn/oMwNtEFp6GginBH37FR2O/ooIDHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4871 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] remove dpdk-pdump pcap file, disk space is not freed X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" (Please avoid top-post, I have updated the order of the messages. Please find the reply at the bottom of the email.) >> -----Original Message----- >> From: Ferruh Yigit >> Sent: 2021年8月23日 18:04 >> To: Yan, Xiaoping (NSB - CN/Hangzhou) ; dev@dpdk.org >> Cc: Reshma Pattan >> Subject: Re: [dpdk-dev] remove dpdk-pdump pcap file, disk space is not freed >> >> On 8/23/2021 5:14 AM, Yan, Xiaoping (NSB - CN/Hangzhou) wrote: >>> Hi, >>> >>> Before I run pdump, 21MB is used in /tmp >>> tmpfs 63G 21M 63G 1% /tmp >>> Then I run pdump with such command: >>> dpdk-pdump -c 0x4001000400100 -a 0000:03:00.6 -a 0000:03:06.1 >>> --legacy-mem --base-virtaddr 0x2aaa2aa000 --file-prefix l2rt -- >>> --pdump >>> port=1,queue=*,rx-dev=/tmp/l2biprt.pcap,tx-dev=/tmp/l2biprt.pcap,mbuf- >>> size=10240,total-num-mbufs=10000 >>> After stop, it generates a 14MB file >>> -rw-rw-r--. 1 9999 9999 14M Aug 23 03:58 l2biprt.pcap >>> And 35M is used in /tmp >>> tmpfs 63G 35M 63G 1% /tmp >>> And fuser show there are still several users of this file. (all these pids are of running dpdk primary and secondary processes ) >>> # fuser /tmp/l2biprt.pcap >>> /tmp/l2biprt.pcap: 139 342 347 434 >>> Then after I rm the file (l2biprt.pcap), disk space in tmp is not freed (still 35MB used) >>> rm l2biprt.pcap >>> df -h >>> tmpfs 63G 35M 63G 1% /tmp >>> >>> >>> It seems it goes like this: >>> pdump start->pdump send vdev hotplug add request->primary and secondary process calls pmd_pcap_probe() which opens the pcap file-> >>> pdump stop-> pdump send vdev hotplug remove request-> >>> primary and secondary process does not close the pcap file >>> >>> To properly close the pcap file and release disk space, it seems we should: >>> >>> * somehow close the pcap file in "vdev hotplug remove", or >>> * don't open the pcap file in "vdev hotplug add"( pmd_pcap_probe()), it seems pcap eth_dev_start will open the pcap file in case it was not opened. >>> >>> Any comment is appreciated, thank you. >> >> >> Hi Yan, >> >> I can't reproduce the behavior you mentioned, for my case the .pcap file is closed when pdump is terminated and there is no active user of the file after that point. >> >> Removing the pcap device cause closing the .pcap files. >> >> When you terminate pdump application it will remove the pcap devices, and since it is a secondary process a message sent to primary to remove it too, making both process closing the pcap files. >> >> When I use testpmd as primary application, I am getting following log from testpmd when pdump terminated: >> "Port 2 is closed" >> Can you please test with testpmd? You can use '--log-level=*:debug' eal parameter to get more log for multi process communication. >> >> Btw, what is your DPDK version? I tested with latest DPDK (21.11.0-rc0). >> >> > On 8/24/2021 8:36 AM, Yan, Xiaoping (NSB - CN/Hangzhou) wrote: > Hi, > > I'm using dpdk 20.11. (it's a bit difficult for me to upgrade my applications to latest dpdk) > > I tested dpdk-pdump with dpdk-tespmd, result is same (disk space not freed.) > [root@up-0:/] > # ps aux > USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND > root 78 99.1 0.0 67407568 102268 pts/0 SLl+ 07:15 2:32 dpdk-testpmd --base-virtaddr 0 > root 144 0.3 0.0 67332948 7708 pts/1 Sl+ 07:17 0:00 dpdk-pdump -l 14 -a 0000:b3:02 > > # fuser /tmp/l2biprt.pcap > /tmp/l2biprt.pcap: 78 144 > > When stop pdump, indeed testpmd prints: > EAL: msg: eal_dev_mp_request > eth_dev_close(): Closing pcap ethdev on NUMA socket 0 > Port 1 is closed > EAL: reply: eal_dev_mp_request > But testpmd does not close the file: > [root@up-0:/] > # fuser /tmp/l2biprt.pcap > /tmp/l2biprt.pcap: 78 > > And remove the pcap file, disk space is not freed: > # df -h /tmp/ > Filesystem Size Used Avail Use% Mounted on > tmpfs 94G 900K 94G 1% /tmp > [root@up-0:/] > # ls -lh /tmp/ > total 900K > -rw-r--r--. 1 root root 897K Aug 24 07:18 l2biprt.pcap > drwxrwxrwx. 2 root root 18 Aug 24 07:14 nes > [root@up-0:/] > # rm /tmp/l2biprt.pcap > [root@up-0:/] > # ls -lh /tmp/ > total 0 > drwxrwxrwx. 2 root root 18 Aug 24 07:14 nes > [root@up-0:/] > # df -h /tmp/ > Filesystem Size Used Avail Use% Mounted on > tmpfs 94G 900K 94G 1% /tmp > > Could you please kindly check the same for your test? > It seems the testpmd close pcap device via pmd_pcap_remove(), but pcap_dump_close is not called. > Could you please kindly help to check how testpmd in your case close the pcap file (if possible with function call stack?)? > > Thank you. > > I can reproduce the issue with v20.11. The problems seems fixed by commit [1] in the latest DPDK, the commit title gives the hint ;) Backporting that commit can solve the issue. Regards, ferruh [1] Fixes: e412a138db91 ("net/pcap: fix file descriptor leak on close")