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 BC9E641E65; Fri, 10 Mar 2023 14:59:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9CF1040A81; Fri, 10 Mar 2023 14:59:02 +0100 (CET) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2053.outbound.protection.outlook.com [40.107.101.53]) by mails.dpdk.org (Postfix) with ESMTP id 6CA9C40685 for ; Fri, 10 Mar 2023 14:59:00 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JyhlcSAdqetAvmI4Y/TguT/X7ZP+mvD3koJGUAOKq/uVloLTi51ABHBdU/md6nZUYrlEdNHC3u1fVUAcFhFFgfezp9sfzBOEICHNoqGh78799EIT4mHht4RzBk/5Ei/BGpACYpgK80KrPmyZz4lqe7kUjo2QT4AoE9EIQdAZ4Lr44nrIrNnbnSe6TZaBaPIVaQhVnfgVZFpHka5K/e6+5RsPlz44pBNUcyiuKcGccb6Wg2onSrqQmeY3ZGD+1UTBs31Ks2DW6eqIHsLL5KuMplJY+T6/QP+4HBYxa9Ybj94nQnKoM0i0Vc+iRS8TAOdHbcpiEU6Or1dfw0jnUdi8TQ== 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=RW8MjUmcBPVF0uhWMkM97UIJJxeUjZ/X28ukOnwfFyM=; b=ipRKLcqqM99oLWDdMdM0RU0dFb17LWIGbbudEP1NEr4DEOdYEHsjjxfRsmJ8HfG6iVkfNXUzV9Erj7J+ZsPXcpxdtxojRkgHJFxq9fkT1N93eUb5PZB+eMW7jGv4WrQB93szdN3HlieXvnEwkfdYsLYBJ9jjGjO9pAUi2qn9Tb3IOSAwo3mcve8q24dFhmu8oGd4b2P8e6vcg2NyN08XFgfJeKvFqX+Vc3yQ5id3Zf4F/gm9xtRr8tVCAvZ90ASN84hVIxSBGbkFDhVgw6ly6mFRdBUqJbaWIODMgTruP9v1GU8msT3zLYdGIdtqdJy7r0G2O6GCQp4OdWampM1qUw== 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=RW8MjUmcBPVF0uhWMkM97UIJJxeUjZ/X28ukOnwfFyM=; b=sF46f4f7HI2l5Ix7ZQziBzs18WydQb5RoItiB+tKg4waXR4U7Kmc2hN7Mt3sMtZ5i+n80ydLaj4gYvuZNo5dcSHzoFZzRZTw+KpJEPnFcsePURc6tfiypeE3aR2kTmEXgoIlIHi0HUb1ZGWeJhYegeyg/Wa5Fhq4/+FmElInyJA= 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 PH0PR12MB5433.namprd12.prod.outlook.com (2603:10b6:510:e1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29; Fri, 10 Mar 2023 13:58:58 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640%5]) with mapi id 15.20.6178.019; Fri, 10 Mar 2023 13:58:57 +0000 Message-ID: <0e6b3008-142d-20e0-b27d-05ac48fcf2ca@amd.com> Date: Fri, 10 Mar 2023 13:58:52 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US To: "Dumitrescu, Cristian" , Stephen Hemminger , "Jangra, Yogesh" , "Singh, Aman Deep" , "Zhang, Yuying" Cc: "dev@dpdk.org" , "R, Kamalakannan" , "Suresh Narayane, Harshad" References: <20230309144249.1199517-1-yogesh.jangra@intel.com> <20230309083109.01baaebb@hermes.local> <10c16ee4-1c6c-8686-00a6-b5628f415267@amd.com> From: Ferruh Yigit Subject: Re: [PATCH] app/testpmd: fix closing softnic port before ethdev ports In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LNXP265CA0063.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5d::27) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|PH0PR12MB5433:EE_ X-MS-Office365-Filtering-Correlation-Id: f078e6f2-570a-48a0-0f71-08db216f97e3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RPPCmYaHj93wKosTvIDC5dyoeYTeFYqGap6HbTCfx9/GoyBxvv7IaMcfvRhHOuChdOYKjLC+1wroPcbPCAzziE1HpMg3LfWFCR5YWHxxO0ojVEM9dcLEEjvl2O6enO2InbCyhbQ2pC7NllD/9BiL6PfZNC4GdIGDDaUUCSEYJSAtodPA24vvcdYWOJp47OnN6q3+cjsbNiuhcmrugMlJ2p2qgzxPLNVZInLiDx6TMSnAdI4oQWqPPz9vbU2o/50ituhlmJLUNWTRUbypo+BnKSpLj4HAPNPRpkEXWrI593xBu+Zo4Zvl/e3fFFezpHx2+KA0BJSUeTaZsPyXhtUg6jqxt+xMNtv2dcxk/T84PtVM5J2kQiMcXltj/QihdSkqYc90xXEORvj6zRXEt9ck6FxQoldSQSVKP/Iwyhdk9siRMK0jYwuEPwUAcUSqeUc06H7j6uWhyokt/9UlElvccymaohAI7awIncP7ejQnxLnutgGkGVI2Sb8BmLJ2J+FK+BTvf7l6Gedn9sIsV7zpJE/0bx/b1UxLU33SUHDu8loYB/PvQBraQEcNgl6x9ZgAzlLPiOtU905ZzKnSQrv2+ftNG76FiQjcMb6NzV3KlpMOsFJpsTIIUJJHGrg09ab/v61zss3+MGWHIHa0YT8kTFJVSVrUe2JG5zc0DjYqD7Qo8M+//jd8stHie995ckK9kRKFFzz370phBXF5oR3Npu75EhMA2MtFsFbp7TpSo28= 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:(13230025)(4636009)(366004)(136003)(346002)(396003)(39860400002)(376002)(451199018)(31686004)(36756003)(4326008)(44832011)(5660300002)(6666004)(6506007)(41300700001)(2906002)(8676002)(66946007)(86362001)(38100700002)(8936002)(31696002)(66476007)(66556008)(6486002)(54906003)(110136005)(6512007)(26005)(478600001)(316002)(83380400001)(186003)(53546011)(2616005)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MzVnd2ZMVENYckw2YmZyTEQwbXh0THB2TU8wbElPb001T0lRaFVRV0lod3hQ?= =?utf-8?B?c1pKSkJjQmgvWE1aeGVPTTloYUtiTFJxem1vV2VlbU4zVGhBbm9MT1JrUVR5?= =?utf-8?B?VmluenVtMnVxZHM0cDJTMXpGbEVJWVM1MVNCcFljOXZDa2RraXJ0VlRwU2dB?= =?utf-8?B?OExDa3JSTk5XbFVkeUxNbmE4b2c1NEFXK3lUelRya1VKZHhoZEEyUS9lVG54?= =?utf-8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TIxTlFaYjNSQ2JzUEZtMll1a0paZ09h?= =?utf-8?B?cVlUbFNkMFVYNkVuaDhMd29ackpOc3NieHlINVhWdmFGejF2eWJCRXpLenJj?= =?utf-8?Q?g3J25McXOrcRl6y3TSbXd1UXp?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: f078e6f2-570a-48a0-0f71-08db216f97e3 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2023 13:58:57.8882 (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: p0LlcvTUi4QPsbI3bVqvx+1k4eAoUcGKkLBJf0DoPkmxnDpZOJWyaNb/TRmo/W4C X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5433 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 3/10/2023 1:47 PM, Dumitrescu, Cristian wrote: > > >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Friday, March 10, 2023 12:00 PM >> To: Dumitrescu, Cristian ; Stephen Hemminger >> ; Jangra, Yogesh ; >> Singh, Aman Deep ; Zhang, Yuying >> >> Cc: dev@dpdk.org; R, Kamalakannan ; Suresh >> Narayane, Harshad >> Subject: Re: [PATCH] app/testpmd: fix closing softnic port before ethdev ports >> >> On 3/9/2023 5:19 PM, Dumitrescu, Cristian wrote: >>> >>> >>>> -----Original Message----- >>>> From: Stephen Hemminger >>>> Sent: Thursday, March 9, 2023 4:31 PM >>>> To: Jangra, Yogesh >>>> Cc: dev@dpdk.org; Dumitrescu, Cristian ; R, >>>> Kamalakannan ; Suresh Narayane, Harshad >>>> >>>> Subject: Re: [PATCH] app/testpmd: fix closing softnic port before ethdev >> ports >>>> >>>> On Thu, 9 Mar 2023 14:42:49 +0000 >>>> Yogesh Jangra wrote: >>>> >>>>> + /* >>>>> + * SoftNIC runs on the sevice core, it uses the resources from >>>>> + * the testpmd application. When we run quit command, the >>>> testpmd >>>>> + * application stops ethdev ports first, SoftNIC will try to >>>>> + * access the port and sometimes that result in segmentation >>>>> + * error. So first closing the SoftNIC port. >>>>> + */ >>>>> + RTE_ETH_FOREACH_DEV(pt_id) { >>>>> + if (!strcmp(ports[pt_id].dev_info.driver_name, >>>> "net_softnic")) { >>>>> + stop_port(pt_id); >>>>> + close_port(pt_id); >>>>> + } >>>>> + } >>>>> + >>>> >>>> NAK >>>> No driver specific hacks please. >>>> >>>> Instead fix the driver design or bug please. >>> >>> Hi Stephen, >>> >>> This is not a Soft NIC driver-specific hack, this is required for working around >> some of the ethdev drivers that don't implement the stop() API correctly and >> free up the device queues or some other internal resources on stop() instead of >> close(). >>> >> >> Why not fix the misbehaving drivers, instead of working around for >> softnic, as Stephen suggested? >> >> Is there a list of problematic drivers? >> > > Ferruh, I think this is not a reasonable request. We don't have the expertise to fix all drivers, not the hardware to test all drivers. > Please don't make it over dramatic ;), this is not about having expertise in all drivers or having their hardware to test. You claim some drivers does free up their resources on stop() and continue to polling from them cause segfault. Action is move resource free from stop() to close(). And my intention was not request a fix from you, if you have any particular misbehaving drivers, I can facilitate a fix from those driver maintainers. Eventually drivers freeing resources in stop() is a bigger problem and can hit other applications too, this is not just testpmd problem. >>> The Soft NIC is a meta-device that sits on top of other "physical" ethdev >> devices, so when the Soft NIC device continues to poll the queues of those >> physical devices after their queues have been freed, the Soft NIC will get a >> segfault. This fix is required to protect against this sort of incorrect driver >> behavior by simply stopping the Soft NIC devices first. >>> >>> We already have several driver specific branches in the test-pmd for e.g. LAG >> or virtual devices; IMO this small change falls in the same category and it should >> get accepted. >>> >>> Please let us know if this makes sense to you? >>> >>> Regards, >>> Cristian >