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 4838E42D79; Wed, 28 Jun 2023 04:37:37 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF4CE42D2C; Wed, 28 Jun 2023 04:37:36 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 04A3B40151; Wed, 28 Jun 2023 04:37:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687919855; x=1719455855; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=JRYfjQxfVM64ARFgOxQVcn7PyVRGCsKDrdv/UMbE9Z4=; b=EmOdkBPjkuv+Gaz25Te2R5fBSK07IibwNEEqhDIcDp4R7NoARV1vHRC1 /Bb09m5viprSDJ71BA1tb+sBReg5kVeC87G1Ye4h39WMtPuKnnj+BjvPq cm7GpUM4+Z24wsyrcLb3onrZKBiLgpiMfgdBuq1HM1vKqvQGYMlvrwliW 3VXlNEc9VQLyHHjugTX24cogyvxS1cX6KpIsiwckbirp568ZiIg1QthCc wGz/q6AwhwbeDh4g61ztG+8zeorl8RyYFaPI7mVSGWOb6Mt9yqamo8HGT xT1WoGaHQ647LVM7/7OGH442I7IRc/WCYFTG9TKqmBaDhsTnfC8qs+4AR Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10754"; a="365188042" X-IronPort-AV: E=Sophos;i="6.01,164,1684825200"; d="scan'208";a="365188042" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Jun 2023 19:37:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10754"; a="1047216735" X-IronPort-AV: E=Sophos;i="6.01,164,1684825200"; d="scan'208";a="1047216735" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga005.fm.intel.com with ESMTP; 27 Jun 2023 19:37:33 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 27 Jun 2023 19:37:33 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) 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.27; Tue, 27 Jun 2023 19:37:32 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Tue, 27 Jun 2023 19:37:32 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.44) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Tue, 27 Jun 2023 19:37:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X9MuU2knLlsX/HrxGGUQkvbiTYAD9jWJSvheoNpu1rNqLQmjl4ms+991FVwalNe98nregRXm8IaHDC51UVuj4XY71A1cGJ/kh1awHRL+/ZrS5tPafCG3f/kEwxyyDYheYkvqUDZLfTsliEMIwwYq5Smsm4Yp0e2JVGoPmG3QEfrKrwES1+E22p4Emh8rfhbsdN7cDvQ9JCxZxs9x64qH/uK1/nY5ZlCcVg8r96y7095jXDMYQtnXTOLHMCT28J1PT7kb5WonebaRSYEi0tie51dEHGFWRc741VDJCROlERjn0sbBZPoWa7bSVKZ+vCHNF7da6ByirWmIpDp/G/AU/Q== 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=JRYfjQxfVM64ARFgOxQVcn7PyVRGCsKDrdv/UMbE9Z4=; b=M9hJTBECLgbAoCBUgu3c5/m9f5z4pC1EMMtdRPKCYALVXdtIP2G9ShKsy3H2KEv0k7poe/ggd/gyipifAJIldxh1hOjs16IKYkwKIfuZ82G2ei+XW49W6Ro/tmNC10PhJAYXTPW4M0pSj567lDXkn2izTaz4c7fxe1lCHDjkPNSeRedRSC6JGZvM/jR9Nz4R8gj+nveHzTQ8nCWU23pe8OdIkzlIRjDt5aGuLrHoy4jmJ46pZl2JZ8T6BHawNhju8gCrXwBOMIm4JrSWDTLyqS2g3SwICEl/elTTFl8iz9O3HnogXbiIRpw7czf7cJ+7678MHTrjt248+OnWfxri9Q== 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 SN7PR11MB7065.namprd11.prod.outlook.com (2603:10b6:806:298::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Wed, 28 Jun 2023 02:37:30 +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 02:37:30 +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+fbWAAgAAhFbCAAALVAA== Date: Wed, 28 Jun 2023 02:37:29 +0000 Message-ID: References: <20230614051423.176572-1-junfeng.guo@intel.com> <1980494.zToM8qfIzz@thomas> 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: DM6PR11MB3723:EE_|SN7PR11MB7065:EE_ x-ms-office365-filtering-correlation-id: 92227709-52de-45a2-7dd5-08db77809e5c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1UyL7iFq9xVVoZjOrUvxwFpCtm6maXV07kH3uR2rUz3PxSMWjQ4VXebwX6snaBaJQifVe3PCHsUs20Lbvir5k96voq0dBx/RcQ+OMivsBX+ZG3SSritMnRZc2YDRy2VosDqdEIcmGGeTKtzsWIHMIRAl1/9Lcx1bJ7n12vxuD2eu8+KKj7wmy58ctamdOOoVm8XOTQwf2gagjuAOU4PHXO2Bcxphg6/WLHXMtqOXLvBadLIEkmxMBYn5YiOZOSL4epYYYrh3m0I+FmvQ1Wil4x3hfmN21UQq3v3IsG9D4KWkqtEsJ38NATIE898zKuAfwBnWWWRB9DS6ty19O5zIHt2RBb2jOw6HT3pWM/ftJoq715y35z17WwR8mtJCCUz2xiP9sE5s0BOBiDnUrF6ibTdEAoLkj9Aq1TmQiJ/ctXShWpArNGl/ARQnm3Ia7M1+H5ksS9HzidHnmMA8jrlN7CeQXIeXzxorcIWWR8bSjBzMNdjnV3nmJ9icI4NtWQyV3X+cW6QK+9gw10vTKbISVk6a9RzxnfIDxRY4IV1l5S9ujlgxpKSk6/y6vacspNbrX8seMwFaH9MM5lsi3B+4eWK4oA9lOIlQna41cMVYurlMdBYYD2kDsZtPVSJ3TF+X 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)(346002)(396003)(39860400002)(376002)(136003)(366004)(451199021)(5660300002)(52536014)(66946007)(4326008)(76116006)(33656002)(66556008)(64756008)(66446008)(66476007)(478600001)(316002)(6636002)(8936002)(8676002)(2906002)(110136005)(55016003)(54906003)(38070700005)(41300700001)(71200400001)(186003)(7696005)(86362001)(26005)(6506007)(53546011)(38100700002)(9686003)(2940100002)(107886003)(122000001)(82960400001)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?rkxO0qK9UjDfwdQcwcSfHVBZDL7CzWNFr6HfteSo78PwYEBfoQu9VJ8FoXAF?= =?us-ascii?Q?NQlAuvzdumwTTDitsGEoK9ubwXo0uN0dOlBhrV7n+OzkbjLlk+c91mL9GtNy?= =?us-ascii?Q?59LmbCJTXTQr0vL4cRBSfAjys6gNx8c+8X5Gi8LqKOFDAMMJj3fuo6Bn2t0g?= =?us-ascii?Q?BEuNmSf1nEhhY/cAyrkrgoLgXDy7omsklvqR6aYdl7aGW8CRKiTcZeP3pLDl?= =?us-ascii?Q?NbP80v7d86AI0Ew1qKKTlZmGWoVigcGxQj5NCbNjyB6j+hlhWdPJgWss6vEV?= =?us-ascii?Q?MCaV3315ME3I/ffnBp6hWTzWAKp4bmqJqAGu+bdiS7WTVjO5I40Swk8IM2Hb?= =?us-ascii?Q?nsvDfnZMSAOaEzsVArlPlcEMpxrJAirN3hpQFxAGujz5Sc++JXXp1qE1HEP6?= =?us-ascii?Q?zer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CqEAAMp?= =?us-ascii?Q?NRLfxsTHMBl4BfiZYdqG7DmKnOf8uK/Erf3wGxFhhP2UYdoXQiCUxRkn31ww?= =?us-ascii?Q?fsvXUrAnrJpEqLMrI4TMCqmGxnv9PF3qcjDGOpK3HzmOl1X1FNi+N4rz3gt8?= =?us-ascii?Q?KoYwKy8rZe/b6AI1Sg+429Lhu5Y/Q+WeZLFhk5VBdjfxoQvfzkcwvkmy2bg5?= =?us-ascii?Q?TVoJnQlgnw4hWOSlX8eTmekzUirYEnmHfBS0FoLN1rI+pjEwTjkDI2Nlurrg?= =?us-ascii?Q?rZ4ENWMAf3JFQeiD1O47T7d/e+OIki21OZLRa1jx?= 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: 92227709-52de-45a2-7dd5-08db77809e5c X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jun 2023 02:37:29.8860 (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: zyOQ/4pGduuusVfdHJ/V9zQG1Hs2oXsvZkIj0GDBGEtmwdFQ9B/FxcdZLwJTbuJpud78X9TOG3dq+YAgyfJIKQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7065 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: Guo, Junfeng > Sent: Wednesday, June 28, 2023 10:19 > 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 >=20 >=20 >=20 > > -----Original Message----- > > From: Thomas Monjalon > > Sent: Wednesday, June 28, 2023 08:12 > > 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 > > > > 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 for > > > 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. >=20 > Thanks for the comment! >=20 > 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 > The interrupt disabling process is part of 'dev_close' ops, and will be > called twice (one in EAL cleanup, another in ntb example cleanup). >=20 > 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 > Regards, > Junfeng >=20 > >