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 AD6A341E21; Thu, 9 Mar 2023 20:11:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 48C9140ED7; Thu, 9 Mar 2023 20:11:14 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 13FC140695 for ; Thu, 9 Mar 2023 20:11:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678389073; x=1709925073; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=HCdMaQwQIMaRy7C/lUZOO2/zv+7ALPRKl+KqtJpOpDU=; b=iNOWsiAmUrD7LiTHx/RVp7ulQrxDWWsljQib3VyVNZ/0duOTk/goDpU7 2rZjn8BwuWQyQnBy0tClNy0EvD0NUxiM0+17tw452Gnfbh9Nm01q1yQ+S RRfOxth529JMBNgwSiwZ2ZxXtWoL9Em5kQU8OWuRgg8RZtDdrjZxar2Lv FI2tih0D80YhYfIcxU7D8SwNGcdzCMoM/WDAsVaOkgyvK+XGbkxZ+vf1f jtCsc8MN11/5KRZcyVveLDYEH30nlJVHP541p59juHZ1h5feJNF56ZwrX KZERbl7TEMbPCvyNwCTRTuW+nrRHRk5ZrtujM3rBMYtZK8Eh1wUAaK4j2 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="401394240" X-IronPort-AV: E=Sophos;i="5.98,247,1673942400"; d="scan'208";a="401394240" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2023 11:09:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10644"; a="766547100" X-IronPort-AV: E=Sophos;i="5.98,247,1673942400"; d="scan'208";a="766547100" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by FMSMGA003.fm.intel.com with ESMTP; 09 Mar 2023 11:09:29 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 9 Mar 2023 11:09:29 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Thu, 9 Mar 2023 11:09:28 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Thu, 9 Mar 2023 11:09:28 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.172) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.21; Thu, 9 Mar 2023 11:09:28 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gxhp98Ld7ayFdqPDT7Ibz7SYS5t4aZ0WVOxykm40A8ef1lqMFfxGWlaGL70lKxSjoty7Xe9u+mw443Fyp38JDSXiB/jS8kOfZVS6b+294P6Aty44SzWtDevAVrXXMw3ySu6+VGwWq+QteYnlCWrbrUGOccW8IfxSOH7eAweHuQS2MY6Kdr/W6ZbuCmNURyQNExpfVpQqIxrgKwCKIPlNyriVDdw1DzEl2Gi1DNH3LcEshi6M5gdTWuwaFfDIF/q68OOGprkdxTVPhVwRxbSXdbQUnU9L3AAM8hHlGw8+DRuIqWWmTWOxZVdftJZECRvEGjPVJNhYggcCvtoBwqVfvA== 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=X+GeNwPXE38nllLvs3WLHtLYqXJRNLJDce0/1kMKjJY=; b=f/lLef2lQxfqHIBIHy62OjFFrBco7D8AJAjKbQ0ruOPC9XUjx9xKHMecpYg7a1D9k+XFsOLm959NZhdduC7haQkJk2PpD0KZHn2V+5RUHjvXVlg/tQUAH7H5xMAm3g/bVr7Emxqc0bAAGjCA3kqRR9VgHvL3JtPj8imNV+1Ja5+7KAIco+LWsPFFYgboLNuEHNtT5bsbnzYlQpzEIMa01QGutmkcvAnHW/yJwov18dUPcoczqcPb9v36/XBCjBbZg5I/YGAVfGr2N6ekBEtPCd39v4NPDVWMb8VQP+1JJ5pUvdZ6fO4h+/bwz+KUZe8T+DguWZlnFqDq044dJ+GTvw== 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 Received: from CH0PR11MB5724.namprd11.prod.outlook.com (2603:10b6:610:101::22) by DS7PR11MB7692.namprd11.prod.outlook.com (2603:10b6:8:ef::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Thu, 9 Mar 2023 19:09:26 +0000 Received: from CH0PR11MB5724.namprd11.prod.outlook.com ([fe80::81e6:4df3:9629:7ed4]) by CH0PR11MB5724.namprd11.prod.outlook.com ([fe80::81e6:4df3:9629:7ed4%6]) with mapi id 15.20.6178.019; Thu, 9 Mar 2023 19:09:26 +0000 From: "Dumitrescu, Cristian" 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 Thread-Topic: [PATCH] app/testpmd: fix closing softnic port before ethdev ports Thread-Index: AQHZUpWpARBX8L4J1EaVq7nwtdmnNa7yo/CAgAAKIdCAACHQIA== Date: Thu, 9 Mar 2023 19:09:26 +0000 Message-ID: References: <20230309144249.1199517-1-yogesh.jangra@intel.com> <20230309083109.01baaebb@hermes.local> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CH0PR11MB5724:EE_|DS7PR11MB7692:EE_ x-ms-office365-filtering-correlation-id: 7229c12d-4129-4a7a-a234-08db20d1cd3b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QwT1kFMVNpfBYlr+8yzmUlcPFfwg3w5uc18zgRFYAKK6BUnwerXfFgIvjxGpBah2IKlZNjuaWY7JetGV+4xXcSROBUkvmjXEON7Bxe7gQVxUC64Jw9ou9+RmYAH3SQQscI1R8WHO0V7wXmuiy5E490U1gQ0qYpjLFiB3sAdycD4TSRIDmratsxb3FhpMHmTqv+bDI4Og6zuN+utSKXG3DgbD0EUNKF3jnZjV7HTB7rFt7JzJ4qqyvOnwpintGYjRzvu86SyG0SXwE/yMLydT5FunWUVFNTt0/FzQ0oJPBDRtLdb9KLqZ8HrUZH3/hM71VYceEK7qM6E3MIMSOQph0NH/JTHCP/IaPYuiv1cjjLF1TZOTD9I66ztIryLCyDL7tCIdSXGgfinov8shveIR+8ul20OHuIPKHFnLej+NV8bftLjRdARt+iu5PkGjVK6O8RO5ZEW1W5QgVSnDHIiznhVQ0mjMeWCq9YqoHzF/j95CqP8D86+A8RlAwhtkWnKqxVM3T+HdNF6T2HOMYLDNkpcdq5CwhCTr9bHKSWl8j5cLAZOAbKLEvKARtnYmc7N/nXXqqxbQQTDDbo0M0SMX6mOcx17AC40p8CRmQwZheood04IJ2nyJCHbokyHAAlvDfwIQ3NJ5hu5Z04wHgXVI2u0QkGSk9xQt1e13Pok6Rpl8lOwKp+tVybxL+xP0e/h+E3Q3LPQi+K9MkgVo7qdcpg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH0PR11MB5724.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(136003)(39860400002)(396003)(366004)(346002)(376002)(451199018)(38100700002)(478600001)(122000001)(83380400001)(82960400001)(6636002)(110136005)(186003)(2940100002)(316002)(2906002)(71200400001)(7696005)(53546011)(33656002)(38070700005)(26005)(6506007)(9686003)(54906003)(76116006)(5660300002)(66946007)(66446008)(4326008)(64756008)(66556008)(66476007)(8676002)(55016003)(107886003)(52536014)(8936002)(86362001)(41300700001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Tw3POUrcNnNynAgcq0ktkVt4F5nKKOQPEVq/l42NMXpxCR5SBDbhypCGWIWM?= =?us-ascii?Q?ZKdmaXAQPLd5TCfKe7Y4djxsH+vsz+kRGH6AdSP7R3OnR6nOUNKFscJShRpo?= =?us-ascii?Q?WJf16qtrmnyHR4osY96/iBmnm5qg/o6BHCNdLVpxaMoUDlVu4GKE07KY5OIC?= =?us-ascii?Q?EpOnvaLn5A81S8XtQOdW9LTsJ0P7HJ8o5hAz9ZuEmrReaueEK9Bux03Mhgnh?= =?us-ascii?Q?LAAFKfFm06wgsjuft4h1o1Tqv13m74N9kbXrDubNsTO4oT9u+mRgmy3toAkp?= =?us-ascii?Q?Kv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YZnU6yUKH5Ppm+Zc?= =?us-ascii?Q?RY/s+X+590Kz3/IofG15RjwvAVVB2DRky/Gv8/+N8TEbSyHarSrZXDaFimss?= =?us-ascii?Q?x8Xz+aa3BpnlRBPdR31Ky3W/6IzhaMc0LzwIeNCLZJbQquxbPHAt7ek1HINp?= =?us-ascii?Q?NpYicOlwZ4gEdFseKBjZKvM5ebdayMQqmIfWVZmnmoSgn+7NgBECPo/YnMXN?= =?us-ascii?Q?PoQIlVqBVDiKzCv6I3rul8syRqVh9tiPxmIp8jhHxpsKnETjpGhvRTJphPUm?= =?us-ascii?Q?GxOPiMkev5GB52d9CYlvufDw/DycT8E9Jnc3alfY+Ud11t82UEpILOURWwzB?= =?us-ascii?Q?5AJXecjrsR6eg9Rb4q02cLSR5q/8Lb/0/NAkypUy9OpTyu7AaNC719Qby4QX?= =?us-ascii?Q?BOyr/z3oU9aD2CiF+a+R8mVW964EMjOtua0FXHBxAaYxTVsoEpzPtVp76MAz?= =?us-ascii?Q?Cg=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH0PR11MB5724.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7229c12d-4129-4a7a-a234-08db20d1cd3b X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Mar 2023 19:09:26.5923 (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: 9fcRMWDGSr75zHeCtYh+aMWjHtF1TzhfhwnPeMmIqOT0ELFWtzS84y6fnNx2tu2OcW46hfPbttdM7o4bLffIpBUxrMQAEnKHRJFXmVQ3V4w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB7692 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 > -----Original Message----- > From: Dumitrescu, Cristian > Sent: Thursday, March 9, 2023 5:20 PM > To: Stephen Hemminger ; Jangra, Yogesh > > Cc: dev@dpdk.org; R, Kamalakannan ; Suresh > Narayane, Harshad > Subject: RE: [PATCH] app/testpmd: fix closing softnic port before ethdev = ports >=20 >=20 >=20 > > -----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 ethde= v 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. >=20 > Hi Stephen, >=20 > 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() inst= ead of > close(). >=20 > 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 physica= l > devices after their queues have been freed, the Soft NIC will get a segfa= ult. This > fix is required to protect against this sort of incorrect driver behavior= by simply > stopping the Soft NIC devices first. >=20 > 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. >=20 > Please let us know if this makes sense to you? >=20 > Regards, > Cristian Adding Aman and Yuying, the test-pmd maintainers, to this conversation.