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 34042A00C3; Tue, 29 Nov 2022 15:11:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C46F540693; Tue, 29 Nov 2022 15:11:23 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2043.outbound.protection.outlook.com [40.107.212.43]) by mails.dpdk.org (Postfix) with ESMTP id EB2C84067E; Tue, 29 Nov 2022 15:11:22 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kkK/SDj76bvszt2tdU1T1FjX90wBOLDgeOTIMYwxDGVTLvhb51KYi9Lfrk4d/gg2z95nM/PC2U60ZfsrzgQF0RjMOMSCizHWDkWPFIaGeEf4Gl2k4a/K1oN8XKzVehuju5JnHFnjsypQV3z9gooK1dE9FINC6JD42tLGWiX/WXh6MsyhP6stPrs1qM0g3BK8hCGIwtbbtUNO7kfGUTKGvNyR1P8rJj/+0J7HDeJn/FSbDyLLOfKWGgw6L4JG6LtiUkjyRZ72bO++pqHl9BbSiZO5TaR9cC7AYZ5iZoS1SnL/c7nYBtU7CSsR4cUDmOMVwxhS5Q12IkHJ9zcjICRgqA== 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=dJ+701/fxt0M2vIGXNaPw6USkqYX1DeFcMfJROpYitw=; b=eQzs+kjAMbk24wbjAa9xHRh0Prch7/xTysVD2NHWIYiavYOm+W2PgfQMLIvhCE+azqGgJi6HKnbYqNC2ykhoJYScuOgPl3lc4etpOSR0SpyYNRDuydBRFSaQ/ejN8PazwZ2W1EC4m8OwQFSKIwfDww8I/NWJEh7UHOVxvRO+eBCJEbrLxHsukJBqokh7XHuR6FMZY0N4AUHNNlbHr0Mu5Ro5tj4sfFCdHmHHjJ8U6aLVzs8lj48mu7zu7ZWAGLa42PwocjYx8Gs4sygLpwjRlM7YskI7AGDPkbQdW9Cu8/qFHXsmzD5x3Rcvqt4EX+pSCfGv5pjBDk1iLN7EzvlKqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dJ+701/fxt0M2vIGXNaPw6USkqYX1DeFcMfJROpYitw=; b=KXA1TAp1ahO4HPPjjbFtFgx1Y7eLHISvfygZXArC6lTm7tWkZoXvPvhmtePgEre7zvau8WX2zLJPDlBL9RSDmPRakq1CggXiggkB2euJpFakAulNBttJsvU254aM3GIDejxJ+0u8sWfWdEBOOKUTzeIPPQpWdqZmCeJ/LsBhXQg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by CH2PR12MB5004.namprd12.prod.outlook.com (2603:10b6:610:62::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.23; Tue, 29 Nov 2022 14:11:21 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::b482:d5bd:c7d0:3842]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::b482:d5bd:c7d0:3842%9]) with mapi id 15.20.5857.023; Tue, 29 Nov 2022 14:11:20 +0000 Message-ID: <2ac0bac2-33d7-bcf2-3be2-af0ad98ecca2@amd.com> Date: Tue, 29 Nov 2022 14:11:13 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Content-Language: en-US To: "Zhou, YidingX" Cc: "dev@dpdk.org" , "Burakov, Anatoly" , "He, Xingguang" , "stable@dpdk.org" , Stephen Hemminger References: <20220825072041.10768-1-yidingx.zhou@intel.com> <20220906080511.46088-1-yidingx.zhou@intel.com> <20220906075737.2fb429a5@hermes.local> From: Ferruh Yigit Subject: Re: [PATCH v2] net/pcap: fix timeout of stopping device In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0569.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:276::9) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|CH2PR12MB5004:EE_ X-MS-Office365-Filtering-Correlation-Id: d0a926cc-cb86-4905-c284-08dad213964b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VR5CSWckPFkXxG4MdSbBYzwJobhI611OYhx4/CrFTSJXXa2h9d3cex+JbeEd1Fv/Q6r9sjzGRoufZN68zMk9Pph5YZKouGJwQ2B8meJbauOmejMk2SYEpcaBOp4Dmt9sfIoJcD/oyTx7M1CaCwC90W0lUtIev40vKudv3sxWALtWMe9ovP+NqOmnOgWFB3bg3pWbgKR4aVobJmpLZ6rVjxCFUqqNXU52ZqRU4q/9EtMiWyxJbS+ffQ0dplLTx3yk4/H6xkL7bzWnDeO4ayw+mwBLlgo6x/KxAK9bPK5bZx3QWdyycmLcq4EPEO8E/rTXRVVMNqyoHfUi14JtmvIB/m/OgOCw89B0W6AeROf4qeAFKamqH/GkrTEYvS6j3ephX1WvaRYZLf8M1ev6i/4sznCipevsgp/+8fu3eSP3KY2mMOU6LeqAwmP8fwEhZ3dDXD6AMGRl9AoTGYJyHllzQBpxIwvwCELFZ48I4DMZtL/TrRLQHZRxLxpem2symxfJ4Njma+9tPfKsZdZj9y1zXRfBFOH15oc6W6iJenqCgSAI9bFqqWDe9VqGa4hfdmbr86QC6pD7YlkZB+4e22yXaMPNxv/CYbJPnKnK+Z+ifCOGR8bS0DSabxmRCZkspedkR86O3SQSXXNnpC3lytFhH3088zqoWck+QS/gbGosdbJn7dEyppHYJnBkON1HmBHkWiMsanX3ygyWZ+SdsB4vMN0hRHB7me/wajOqPnrgz2Y= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(376002)(346002)(396003)(366004)(136003)(39860400002)(451199015)(478600001)(316002)(2906002)(6486002)(6916009)(36756003)(54906003)(66946007)(83380400001)(6666004)(38100700002)(26005)(6506007)(86362001)(6512007)(53546011)(31696002)(186003)(2616005)(44832011)(5660300002)(41300700001)(8936002)(66476007)(66556008)(31686004)(4326008)(8676002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YnV2bTFoKzdsdlJpOTBTek8vcHdGZzJ3bzNMVzhxWnRkOHkrY1c2N2FRL2oz?= =?utf-8?B?MkEwdnZoenhYdkQrekhEMEJTY2lYQlFid0Myb3RUQ0FiSmxSaExHaVpENmlo?= =?utf-8?B?K1RkVFhpM0pkK25KeU1Sb1N6L2s3dzRERVpyRmQ2VVREMjF3aFptZ2QzN1pp?= =?utf-8?B?dmdnblFvZFdLWDlLLzJEdUJOTEFIRGlIdDM1UVBaQVZ0WGgyeEx2MTRnNlVW?= =?utf-8?B?eWhqM085L2NYSTYwWFlvZFhGUzdDS3FEZEJIcU04NjErWWhwajY3T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ZGNUxrOXFBNmJPRHp0Vmp2Y0UvMjhQK3NUU28r?= =?utf-8?Q?HPZWJFUD6o18kgeoaaLKjpJrC?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: d0a926cc-cb86-4905-c284-08dad213964b X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2022 14:11:20.8491 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: W1Hs7hxSoy42CxkuiJ0SkyBeWJrqgYLhq2gQk56KUKrJsTm5vL4SSYolHtOpMV3T X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB5004 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 On 11/22/2022 9:25 AM, Zhou, YidingX wrote: > > >> -----Original Message----- >> From: Zhou, YidingX >> Sent: Wednesday, September 21, 2022 3:15 PM >> To: Stephen Hemminger ; Zhang, Qi Z >> >> Cc: dev@dpdk.org; Burakov, Anatoly ; He, >> Xingguang ; stable@dpdk.org >> Subject: RE: [PATCH v2] net/pcap: fix timeout of stopping device >> >> >> >>> -----Original Message----- >>> From: Stephen Hemminger >>> Sent: Tuesday, September 6, 2022 10:58 PM >>> To: Zhou, YidingX >>> Cc: mailto:dev@dpdk.org; Zhang, Qi Z ; Burakov, Anatoly >>> ; He, Xingguang ; >>> mailto:stable@dpdk.org >>> Subject: Re: [PATCH v2] net/pcap: fix timeout of stopping device >>> >>> On Tue, 6 Sep 2022 16:05:11 +0800 >>> Yiding Zhou wrote: >>> >>>> The pcap file will be synchronized to the disk when stopping the device. >>>> It takes a long time if the file is large that would cause the >>>> 'detach sync request' timeout when the device is closed under >>>> multi-process scenario. >>>> >>>> This commit fixes the issue by using alarm handler to release dumper. >>>> >>>> Fixes: 0ecfb6c04d54 ("net/pcap: move handler to process private") >>>> Cc: mailto:stable@dpdk.org >>>> >>>> Signed-off-by: Yiding Zhou >>> >>> >>> I think you need to redesign the handshake if this the case. >>> Forcing 30 second delay at the end of all uses of pcap is not acceptable. >> >> @Zhang, Qi Z Do we need to redesign the handshake to fix this? > > Hi, Ferruh > Sorry for the late reply. > I did not receive your email on Oct 6, I got your comments from patchwork. > > "Can you please provide more details on multi-process communication and > call trace, to help us think about a solution to address this issue in a > more generic way (not just for pcap but for any case device close takes > more than multi-process timeout)?" > > I try to explain this issue with a sequence diagram, hope it can be displayed correctly in the mail. > > thread intr thread intr thread thread > of secondary of secondary of primary of primary > | | | | > | | | | > rte_eal_hotplug_remove > rte_dev_remove > eal_dev_hotplug_request_to_primary > rte_mp_request_sync ------------------------------------------------------->| > | > handle_secondary_request > |<-----------------| > | > __handle_secondary_request > eal_dev_hotplug_request_to_secondary > |<------------------------------------- rte_mp_request_sync > | > handle_primary_request--------->| > | > __handle_primary_request > local_dev_remove(this will take long time) > rte_mp_reply -------------------------------->| > | > local_dev_remove > |<------------------------------------------------- rte_mp_reply > > The marked 'local_dev_remove()' in the secondary process will perform a pcap file synchronization operation. > When the pcap file is too large, it will take a lot of time (according to my test 100G takes 20+ seconds). > This caused the processing of hot_plug message to time out. Hi Yiding, Thanks for the information, Right now all MP operations timeout is hardcoded in the code and it is 5 seconds. Do you think does it work to have an API to set custom timeout, something like `rte_mp_timeout_set()`, and call this from pdump? This gives a generic solution for similar cases, not just for pcap. But my concern is if this is too much multi-process related internal detail to update, @Anatoly may comment on this.