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 713B841E3A; Fri, 10 Mar 2023 10:09:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 55A1B40ED9; Fri, 10 Mar 2023 10:09:44 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id EB63440685 for ; Fri, 10 Mar 2023 10:09:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678439383; x=1709975383; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=lv3kkHtdwgUnatiEFcJ2rQ2+XJMPUmD7bJd9Ip6RhCo=; b=Sfv4q9tcK63qVDhP0vsHYQWRpElZyZtKCBiqShUXFMIZKS3YdYAkM5oD FMuT9Ww+8Xnf70fmxzrjCqOt8FjjEL0ItcPFDDxyJWtBqNBYfNg3sM8d0 Uf0BUenISuCYsGcGVAGVMxu5TznwG0722eW9hMPs3pYygPOcTiFNfIK5/ gNqz6DX5MiSyVcys1ZCupev/O3w0GohZVLu3Vd3fw7SVD14T+lrwBN6cH w3vGIeJvlmtecjD4Jl11M/7byxxhCP4nbg3RhsMwVkJLBS72Lr1Y+EXqb CXy3mGJoTIJ3rDjYMiTrUARNtV0xOZmQR89+x+pHZ4ZwMXSIazYfKDDJF A==; X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="325037464" X-IronPort-AV: E=Sophos;i="5.98,249,1673942400"; d="scan'208";a="325037464" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2023 01:09:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="710213641" X-IronPort-AV: E=Sophos;i="5.98,249,1673942400"; d="scan'208";a="710213641" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga001.jf.intel.com with ESMTP; 10 Mar 2023 01:09:41 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Fri, 10 Mar 2023 01:09:41 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Fri, 10 Mar 2023 01:09:41 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.175) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Fri, 10 Mar 2023 01:09:40 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T+UiNNRuIhqsH7ud33rzsAeQJp5sJWJIns10JbcLT+xCp7G2fWRUFsd/t5f3qTfBsZ2yyak42Nw0sMiIInPUhCgCbA3CJ+vrAV9ThKpIXZps88HvKnqMWg6QmrvBjzZt053UxaMYxpSvGmL0ahB1fBdpZP4XIaLoQj4JRah+GTz44KgpbEKUTfYgsDv8K+sX7h2bLuVPXQLNy3+U3jYWilSaV79JLZEbdqaJx/HNiToAF+60qjvJl50AXrPZiPLO0KaCAE966nlJntHdchKFV+XF8+IYStd+cuhmAnFOwJ150WlZQNqaiLwi5hyOXDsF7tVwslvhQi4OZP2S1rNTnQ== 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=nGMcu/AOFg/KYvUet5NAhFHr+tR03qVSI3RxAEeKNfc=; b=Df6xUiiDWnwA2NRiCa6z+bMJml0+k5IYPMdBpRz4z/D5GTL9pLWGMj5qT1/tRN/f2rU+iYUOWrv41FeWhXji5O2R8lRJ0EditDh18BiE5jqu6gSsY45krU9jJ5SzyOTwHYi2rExL31YDgtY53WemxWyZsEnDyeffdO2mCm5BBAn2k1O+lrct9NPRdXsNqfHv9n9qbWbAMSLpDDaMQESmkAahbvhca5M0gnFGWkG2Pe37imm63WBVeNBb+jnxWsP/TbrcKcoi4dEjqmFDLnLXMEDonoitS2F9Rk5Pt6efo1GickyiHIojuC6VKXUrEP21GpJjpciL6BIba3wPQBMvWA== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MWHPR11MB0062.namprd11.prod.outlook.com (2603:10b6:301:67::34) by DS0PR11MB7214.namprd11.prod.outlook.com (2603:10b6:8:139::18) 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 09:09:39 +0000 Received: from MWHPR11MB0062.namprd11.prod.outlook.com ([fe80::944c:b2ed:2b29:99fd]) by MWHPR11MB0062.namprd11.prod.outlook.com ([fe80::944c:b2ed:2b29:99fd%3]) with mapi id 15.20.6178.017; Fri, 10 Mar 2023 09:09:39 +0000 Message-ID: <41d07191-7057-1c32-a57a-1f3d60848ed2@intel.com> Date: Fri, 10 Mar 2023 14:39:27 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: [PATCH] app/testpmd: fix closing softnic port before ethdev ports To: Stephen Hemminger , "Dumitrescu, Cristian" CC: "Jangra, Yogesh" , "dev@dpdk.org" , "R, Kamalakannan" , "Suresh Narayane, Harshad" References: <20230309144249.1199517-1-yogesh.jangra@intel.com> <20230309083109.01baaebb@hermes.local> <20230309122218.5ba9e848@hermes.local> Content-Language: en-US From: "Singh, Aman Deep" In-Reply-To: <20230309122218.5ba9e848@hermes.local> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN2PR01CA0008.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:25::13) To MWHPR11MB0062.namprd11.prod.outlook.com (2603:10b6:301:67::34) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR11MB0062:EE_|DS0PR11MB7214:EE_ X-MS-Office365-Filtering-Correlation-Id: a2aeb805-4e7d-413c-f543-08db21472ce3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tqucEsddHntugAr2NzJhu6BjQNAS9j+ccLOOKU5IcBjNMiW1UeMVzkyaMCVV/0TyIasA05O0KdFyc4AQvjqAaxULD5bDjWh8cp5R09vv5ipv7qjTY/zbvXZsC+cJIaLPBhc8uwYzQ4LutdZMnJBDrv/+OAfBX/HyBR/IKHiE7PrC0JKZdxCYIWuYDV7VLXipS+6MaiVibh6VNwQE3nsJMtsCbcPg4ZEUGBW3A5YEx6+C9Yyu7vSrZ77ojWmwblohz8XsoWEuxS8u9YChCMCuJboM6fmdaYsX4CEZ8aMYq+6Xuuv0T8h4T8D1geoHxaD7paDHMuNl3DiZpbDfTJbeZf6qvhOPJ0HBdKN2KL04bzWJ2TGHnzS4xHuo5hFmYiJxjc2CMlrhDha8VmA4jnRQmD+fS+tjKeqTM+R9JP6lQWz/+Wv82U4NdSeAq12ILNKLOod6oJhBIeNS+DL5jJmkbFlM/oIHonybPJQQlmHF+ILFv4Cwj/n1iHYckkAxsfA7Z2D5Tg/YWXYoxjB+BVKjHCYMwBGIPHyMmP7m4WjY6VXHTDh8kX9uxHiW7uB28izDszwzFK0CusvXVRT9HwPL4D5PeqxHsIbuIh1R+1+A/9rDGY7icnFHr4Vmk8HdpXOqvdgY6k+nJwKz5IrpmagrG0JqPBYOypES5yw8hC7qbOYdcra7kRvVMVAtUy7Rc24AeAQa+aI4nbDxoNVm7IbdkZRdkYst1T995Q2TSL9t4Hc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB0062.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(39860400002)(136003)(366004)(396003)(346002)(376002)(451199018)(31686004)(26005)(6506007)(107886003)(6512007)(6486002)(2616005)(53546011)(83380400001)(186003)(54906003)(6636002)(6666004)(316002)(66476007)(8676002)(66946007)(66556008)(110136005)(8936002)(82960400001)(41300700001)(5660300002)(4326008)(2906002)(38100700002)(31696002)(86362001)(478600001)(36756003)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?M1NIUFdjZUt1MjlYWDE1aEpiQ3J1dmJsOHAxSWFZZ3RrTTBPOGc3TUlwYTkx?= =?utf-8?B?MGI0cm5jUVhSYlR2YnMzYzRQRjhFTkRwNGZ1TS9EU0MzM0o3dDVUdWRjQy9k?= =?utf-8?B?UHhaZXpMcWJQcGQydExjWHFEWkQ3cEJRL1JnYWJLM1pnVVFOczZUOG1lR21R?= =?utf-8?B?TUM2SHg1MTRTTXZCeG8zdmdoOUJ2L0NrRzhKS1lUZmZKME1LZ1FMTkVnZk5P?= =?utf-8?B?OVJaTTN2YkhQWGxTclVkZnAwOEpSZU5XWjhia2tSMVZWNnd6OWhPR3dKV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nlkNDIxMmxC?= =?utf-8?B?ZDUzM2hPU3Z0c1FOZjhGcjFCMUZDZHEyYTJRMWhVdUVJU0c1SjJlTDhKNzJC?= =?utf-8?B?eWc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: a2aeb805-4e7d-413c-f543-08db21472ce3 X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB0062.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2023 09:09:38.6494 (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: cRhpsWwwJ7w+CN6UudU63Mn1iPblPtH/2D0IXzNUX0KC3eXVSGoeYmh3mI/yJHBdI4ceiyGJ2/cQ9neAekwQnPN9RXOe5xvBbFopggi81XA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7214 X-OriginatorOrg: intel.com 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:52 AM, Stephen Hemminger wrote: > On Thu, 9 Mar 2023 17:19:59 +0000 > "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(). >> >> 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 > If the application has to do this then something is wrong with the architecture. > > > You aren't propagating state changes through in a safe manner. > Other applications will have same issue. > > If LAG or virtual devices have similar problems then a generic solution is needed. At exit, there is call to stop_packet_forwarding(). Shouldn't that stop SoftNic from polling of the queues ?