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 7E4E241DBF; Fri, 10 Mar 2023 13:00:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F1F840A81; Fri, 10 Mar 2023 13:00:33 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2057.outbound.protection.outlook.com [40.107.212.57]) by mails.dpdk.org (Postfix) with ESMTP id 95E8140685 for ; Fri, 10 Mar 2023 13:00:31 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=imyCmvHfaC4Z6uVKZT5tnu/8jYkArbD7tQ57nmWn6BQNULTXBRFQ0OcQFTlELJjXCe1H2uLPnYEGWxIx7V8tkll1JqyzdpCF7NT8+sje0Z9ta/N4nwnZ5yxcz6QWH7ou74+Fd2DKLr07eRIM1eaEO2Cuf+9lHuuA5T0y0XZLddfvt1b00+HUve34GEDxH/m/pYIH0NG0Ux+Z6NxOwgKZWZPSiDqLQC3ygsSmrpL8LGx2Cf9ErxPeEmPsb44oC4T+IlVUSbCfN+473hyKyoUvaNdQK0XPBUTmWTEceQpAHa6uCo88PwDX5JrVye/n74oPrAOaBHNx3Mq/Sv6Ub4Op4Q== 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=UCRmPTBQRwVvAMdtamgjdJMWpNPm1rLLYWdfMIBAMZA=; b=aykuQLY7ujLxR1t2NhqhihHm5J7RHZ6g3LMaIgZpWNzsE9SqelmzwYjUUvw9qqoXjNVwQsMsVAL2NCK4qCZRNPd595Sg1aF6mNBSogSeQCs7VNXE348+HMNXi4mgmLo56gYsWF8om9dnjDMX+5msI4VODOBbGTpfY+7v7Qf/9LnL21YwleXpo4vl1WSFx0nGIxARn3Y9MzN2m/Ecr3wCbqIUuFdbKmEeGr9I2/5bLyA/ZGIAp6sLx/UUb9TNUT5FMfavWIJaU9Ouq/zDCR3P8NGcvV5byH0d9ITJOw6I+RKYR2A/NDFRXIKWp3bcHKKWvDphSi7WsU7c2s6KMgJQkg== 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=UCRmPTBQRwVvAMdtamgjdJMWpNPm1rLLYWdfMIBAMZA=; b=XstAsyt5QNsz5PfSIqsmCVMfuFaS7bMjRtiE/XQnMzhV5kp/Y4ghvcYAnc9G+k38SD53RFwqjbqpp8A6XSnKWH4TEUMM4AZ8ShUzccv3HC+sLrZlPZz6c/2M4gw8r+3esMrLMqfV/xyQ/ROGrQScq3VeddB7mgRMqSaBFot+KbE= 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 DS0PR12MB7801.namprd12.prod.outlook.com (2603:10b6:8:140::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Fri, 10 Mar 2023 12:00:28 +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 12:00:28 +0000 Message-ID: <10c16ee4-1c6c-8686-00a6-b5628f415267@amd.com> Date: Fri, 10 Mar 2023 12:00:22 +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" , Aman Singh , Yuying Zhang Cc: "dev@dpdk.org" , "R, Kamalakannan" , "Suresh Narayane, Harshad" References: <20230309144249.1199517-1-yogesh.jangra@intel.com> <20230309083109.01baaebb@hermes.local> 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: LO4P123CA0256.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:194::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_|DS0PR12MB7801:EE_ X-MS-Office365-Filtering-Correlation-Id: 4e253af9-ddc8-45ee-81bd-08db215f0a58 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0A7JVCj00OF50xX3tslDH9erT+2wNCKA/Kc/vk52Gi06hsTGvapylP1lZmUnBEgUq5snIJ70ZI5Z189iS/XU781C+PIKSEwJtl+2RiQce7uqki12uTS1op2lyyI45SMIaZ1SVG9VT8uUuZ7FVvy+Js2Mz7m3hh/f9e0cvKtVdXTLIqKCYyotu4t18T2hHomdRO1vtxaMmr2lzecSwE5jkC1KwjbFqnd15zazk2EYW5qDZChtKmkC0gczcCXCvA7mvFSjt54pZ+xSRn6sgfiZyxVtN7OqUjw8vYLsWwLXOj+J8uqFaC4ASKg1rvQq2naCJzqyU+yuUzqIIcERn00TJ7gNpdag10dYLBRniXB6cjAV6FW+h0LtomD9eQdl9KjV5ykt/Nr+M8FgJPNHY27P/H0PjeHRIoYlAlbRWpqw5/VIdfIdg/FJsMtyqTrOoexGJwDXUhiCGoqiPjVGUVeE+mTZJ+KEMH7SPvYYzA/A7lBN9IsvOJbu8tjnj3yR0h88QY1VRxshHl87MJcGFkYBT0f2UgBfnu6NOtxR0U0+gJe2jsAyVGSZrJh8QpTAYEcDyFjHDsAVDSu2o6GhFPIqmw/i+vaF/8h6BoDaGj4Rxve9jbv9Jg3cN6tQlIr3X/f59SgjnRiUjN5zFkNhtZuyM1YCzaHoD7h+6ZN8sZqZiLHwsnYU7a0CwVQEEasECg95Kvzu/9vsJNp+bkS/Xnf5rMJnBI5T9lwJARSLRXiIk3M= 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)(39860400002)(136003)(396003)(366004)(376002)(346002)(451199018)(36756003)(83380400001)(6666004)(6512007)(53546011)(26005)(186003)(6486002)(2616005)(31696002)(41300700001)(8676002)(66476007)(66946007)(8936002)(66556008)(86362001)(4326008)(5660300002)(2906002)(44832011)(6506007)(38100700002)(316002)(478600001)(110136005)(54906003)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RU1aOUlXMDFWRTI1azRuREF5Y0U1YTZSTG1hRlQ2TmFUWDNzMWplb2R0YkZY?= =?utf-8?B?Tk03VTVYUTJHT0pRVXdYOEtRU0pmUjFFQnFtbWRUQzFReHViYVpwN2I4cnZt?= =?utf-8?B?RmZSLy85NVBwL21BVHYyYW9pQno2TXk0M1gvd2hQZlJRMFpMeUdwc3B3ank2?= =?utf-8?B?TVI1SFM3MnhkUU83REoxTTBvYmUwVFEzOGZrRmZPN29iQ2ErdXhlMTdzLy94?= =?utf-8?B?Nmc2ZTRDbGxQV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EN3BVUHBmWnZxcFVrOXJh?= =?utf-8?B?Ny84bUpVUlUveHRWZERmS2w3Undhd0hUQUFjZFNISGttVUVEalEySEhsRXc1?= =?utf-8?Q?gFm8g5PDVz/n0HV/gdpTBUfQS?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e253af9-ddc8-45ee-81bd-08db215f0a58 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2023 12:00:28.4426 (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: uTM90yxEXOy18ZXMU2BclO1SdrCKbjdIY7Reclo+aqEjJ1aYrTQT5e7ZveKtU6Lr X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7801 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/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? > 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