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 A6AF642D7E for ; Wed, 28 Jun 2023 10:08:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E13042BAC; Wed, 28 Jun 2023 10:08:42 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 4A3FE40151; Wed, 28 Jun 2023 10:08:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687939719; x=1719475719; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=M06otpKB/1VMiSGwNlb8ovWJqbeHRPmiS7FygXCKXNw=; b=mQ7klAuOsciBv5gunQifAEBeFbX0oqwmN7XMn5o93v69Qvod6tFuQKQn HRlC6PzkwMhDwtxNWO+9ou2vkwG3tIbWvM0bNQs9EO/EwlTwnfh2yJBVR zsAahOp+lpZiBMr8ZYfMEMJVvPu33yjnSVs/P78FuuKiX9ofBBmTE67zW X6MbKxm1+mTaLV/Y9dlFhrgDFcOdHKOc5KUHP9FnoKtzJd/BDd02Z6uGm ZDyKv5lUzTRLT6ByrFJHWE/lHZ7bezR1hCER0YS2l3TPsYpipSMMx2G2D 9nrYxWMgWOURV1A3hcjtXwWiE9z0TOgIJQr94eCwNghV9LMnSiq/O6VV1 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10754"; a="341365045" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="341365045" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Jun 2023 01:08:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10754"; a="752143404" X-IronPort-AV: E=Sophos;i="6.01,165,1684825200"; d="scan'208";a="752143404" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga001.jf.intel.com with ESMTP; 28 Jun 2023 01:08:37 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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.27; Wed, 28 Jun 2023 01:08:36 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 28 Jun 2023 01:08:36 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Wed, 28 Jun 2023 01:08:36 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) 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.27; Wed, 28 Jun 2023 01:08:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bmm7P/b91usfX0e/YKEH2SxemPtCwW25jHhI5hrcVxk4t8mR3/SmyzjyHMK169RByl50Fzjv9h/Gb9xNIhsNs5uI69QQc3520o/cJc/dOpiv350Wk08FPsOIgyCMBjiHoznIRXit1Ikcs40+MUh8YW4tcp6cxxbmEyQCmc+XKKSyO4LAVXThMO1PtaK2vmAzTXZ5ZmAiW5VYik/0lGwhprjXdrtcjH+sc8dwcb3vts1l9WcXB6kIbXP89mztUL+TQ3A1xZuhffEgr0JlMHRXTd09Lj0WBr94hJMxBNoVmQDk7rLn7xB3fcRmB2JMNV7foaKHxqNoPeBRUHvqNEbMtg== 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=M06otpKB/1VMiSGwNlb8ovWJqbeHRPmiS7FygXCKXNw=; b=UHlVebQMephmpEEvafkW+55XlFodLM0lyGZzjH5Fl5x1r9CaGpLigi/fjpPyJHq9I8a5ibdrqW5Gj6ff8uw1+OwXquU1chLSIjPYkDdWBn3c8pbwhrqPgVi7222DTnQFYOcuWa5PuiPH+cx09wZqJCEk3T1luyU8rabwPNDToXxsgKLvkEe/Yj6hVz0KCU9rZ5x1asK8IJpdDM2uUfcp9n9eeo0zphbeTgJGlwJgFHlMz+m+gmcGKG3kX1zp27FYYKG2XcnivqMrDd8rwH0gvkeRmb51tcw3vBg+nlBqazekX2m4P8Z4ENZZP4Ob1paDMk+OC7izCwvNfDZxR2Kq0Q== 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 DM6PR11MB3723.namprd11.prod.outlook.com (2603:10b6:5:13f::25) by CH3PR11MB8561.namprd11.prod.outlook.com (2603:10b6:610:1ad::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Wed, 28 Jun 2023 08:08:32 +0000 Received: from DM6PR11MB3723.namprd11.prod.outlook.com ([fe80::199c:7b:b9f2:8330]) by DM6PR11MB3723.namprd11.prod.outlook.com ([fe80::199c:7b:b9f2:8330%6]) with mapi id 15.20.6521.024; Wed, 28 Jun 2023 08:08:32 +0000 From: "Guo, Junfeng" To: Thomas Monjalon , "Wu, Jingjing" CC: "dev@dpdk.org" , "stable@dpdk.org" , "He, Xingguang" , "Laatz, Kevin" , "Richardson, Bruce" Subject: RE: [PATCH] examples/ntb: remove redundant logic for dev close Thread-Topic: [PATCH] examples/ntb: remove redundant logic for dev close Thread-Index: AQHZnn8fKksuWIuunU2iJeuifQPfVq+fbWAAgAAhFbCAAALVAIAAXO6AgAACJnA= Date: Wed, 28 Jun 2023 08:08:32 +0000 Message-ID: References: <20230614051423.176572-1-junfeng.guo@intel.com> <10294010.qUNvkh4Gvn@thomas> In-Reply-To: <10294010.qUNvkh4Gvn@thomas> 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: DM6PR11MB3723:EE_|CH3PR11MB8561:EE_ x-ms-office365-filtering-correlation-id: c5693fe6-1662-42c5-1bc7-08db77aedd39 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 51TW/78Cf+A7Dp1QCTTwVSf/PqNvnU5ptVXP/+/4q8dcI7lq4qGetngRyNxKmO7hk/Kahppdt72nGDpkijvCXOYg5Pkd5ENqRHc6SNHdsMBNOE64BGOeAH3ZPMGDrPqKF2VkI7l4+vTpOWQgEbTtJ2JDUK60LPSZpOaoNx72GVm38r9G5ossYz5U5z6MvyPPMMnt12Ocwvhvd6ApHPeiecXyABJ9NWKKuUnB1uI2mja3jOni7or02Txhzp0HezPqmrKhwqK2QJOOSOnIbX2+rIVHlwAFylEGJQuKiFuOjXjQ2+55azDn7wH2bAdI8wkHFoJ12cAT0YwXAec7xMm2IlXmEHOnRGC7g5xgbCPv1hYJJL98VXcyTBLijHbvNmsKAEEapCQOdbShE1um6hxkClzWyfN1XEw2umtYnVrVjolFTyhFFLVFGyzgX4mn0sPmWPw0vzkOV+zLvqzFmbdWp1AzZufwrMWTXZmTlDyd48coeAwr+QJOaRnfZSNJJItl+tGpgyhnqO+XbOV547fEpKpaRwyEktIbOivrjkoEtpas1tteX7LYKEEXjK2FSQhL/X4nwn9sC6+u90u61/9kSQ5ms4vgHXz8O6L+nwGC/lEFM1Pk4TT4DLgyuTLU14oF x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB3723.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(366004)(376002)(346002)(136003)(396003)(39860400002)(451199021)(2906002)(186003)(7696005)(71200400001)(122000001)(9686003)(107886003)(83380400001)(38100700002)(82960400001)(6506007)(53546011)(26005)(86362001)(55016003)(110136005)(41300700001)(38070700005)(54906003)(478600001)(316002)(4326008)(66946007)(76116006)(33656002)(66556008)(64756008)(66446008)(66476007)(6636002)(52536014)(5660300002)(8676002)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?3ORSX7EDnp8MvPs65ZFvLFVYqbo3XxCkJ4XAjIuZH1o8sVwewUDkYale8DaK?= =?us-ascii?Q?xwwtp1QWJAZlCgKAkFWb2Vr5t982kI2aZ6fMq+LUlqE9pQejBnYiGfnnjV9L?= =?us-ascii?Q?evAwxmfmK6BTBeVvu5exWGTg3iy+2qbFxIKXmcC5Xxjf/gMnQ73oOQZe4jgR?= =?us-ascii?Q?UKwMIbraLHktu2MftWLV7OgbvsnOSWbWJ5cz11/gbS0IuQ9gT8Gl6e89GxvE?= =?us-ascii?Q?QkVz/y+CzA6R4V94vytSMZtM6yVijo2xtRRh+MYiLy0CmNOdLtdYmElKcua6?= =?us-ascii?Q?8BaGPHfBmywIlu+cAobUI5bVS8do/roxYSzet/k+HQbvO2HybahF4mpJi9qO?= =?us-ascii?Q?7plxuWoaOsgoR1sFxA89EjhOmB1mcaUuACIaUUKA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u3jAsutt2QobDqa4mfCT3Yhqoi69txbtnOh?= =?us-ascii?Q?oK78FKCR3lYFTjCUykQuyWfek1xjn7KFBlBMEj4czjmicjmBgJWau0TqaHT4?= =?us-ascii?Q?Ef1AR3W1JZ1X/TzmuSKl9TM8wC09szsfyQ7UuGQ+NDj7BRMo4ue8WKs8fsdX?= =?us-ascii?Q?g6/24NcbhY5/mKZzuf12PByDpnyXfR6c4EwbFTZpvYAHMh2LksRKb/eL/IT9?= =?us-ascii?Q?nKY28TZ5suYMOb+0Gk5R7xtlO5y4I3dZGGoAZB5monla+OhhQE6SgbYs7N8W?= =?us-ascii?Q?GbWJD81ZOiUrRxL4xqbD5USsYJcfoTnzRuLC1kwk?= 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: DM6PR11MB3723.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c5693fe6-1662-42c5-1bc7-08db77aedd39 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jun 2023 08:08:32.2327 (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: bzPKrQGL3L11ptd+lYcVZNuyDgZeaV9+rwQ2tWVjXgHTzsayq54GH6PdGpDQznX21ebBQCO40LMAjRn0IJIWTQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB8561 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org > -----Original Message----- > From: Thomas Monjalon > Sent: Wednesday, June 28, 2023 15:53 > To: Wu, Jingjing ; Guo, Junfeng > > Cc: dev@dpdk.org; stable@dpdk.org; He, Xingguang > ; Laatz, Kevin ; > Richardson, Bruce > Subject: Re: [PATCH] examples/ntb: remove redundant logic for dev close >=20 > 28/06/2023 04:37, Guo, Junfeng: > > From: Guo, Junfeng > > > From: Thomas Monjalon > > > > 14/06/2023 07:14, Junfeng Guo: > > > > > During EAL cleanup stage, all bus devices are cleaned up properly= . > > > > > Based on this, there is no need to do extra device close process, > > > > > which may call the dev ops '*dev->dev_ops->dev_close' twice. > > > > > > > > > > If this dev ops for ntb was called twice, the interrupt handle fo= r > > > > > EAL will be disabled twice and will lead to error for the seconde > > > > > time. Like this: "EAL: Error disabling MSI-X interrupts for fd xx= " > > > > > > > > You should fix ntb to not disable interrupt twice. > > > > > > Thanks for the comment! > > > > > > Yes, it is exactly what this patch did. > > > > Another solution is to add extra logic in dev_close, i.e., to do the > > interrupt disabling process only when the interrupt handler is valid. > > That is, to disable interrupt only when 'intr_handle->max_intr' or > > 'intr_handle->nb_efd' is non-zero. > > > > But I'm not sure if this method is a better solution. > > Please help give some advice, thanks! >=20 > Yes this is what I suggest. > You cannot fix all applications in the world, > but you can fix the driver, so it is a better way :) Sure! Thanks for the advice! Will update with this solution, thanks! >=20 > > > The interrupt disabling process is part of 'dev_close' ops, and will = be > > > called twice (one in EAL cleanup, another in ntb example cleanup). > > > > > > Now that fixed & covered by the EAL cleanup, there is no need to > > > run dev_close at ntb example. Just remove that redundant logic. >=20 >=20