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 3E24D41CF1; Tue, 21 Feb 2023 01:29:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2208643114; Tue, 21 Feb 2023 01:29:19 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 9F0F343109 for ; Tue, 21 Feb 2023 01:29:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676939356; x=1708475356; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=mz0VuT4NEQFl7XrTNUDGDQn9/fo6MAbpOkTc4KgwDfc=; b=lcMNa8DmzATjFB4IUXNVjeWKWWypkvI4aOaKbwKClPn3AtLBXUY23lDN 6UXCahEKz8gmPt3T9eILvtzjkhtx7O7TYQk37GtGGwj1wPIY6dOid9tXG 8nyMZPBoYfw8tORmys6CWiBa073v3gjsLtvWz/VZYSeMY3ZT91kZdwKtB R8DDcuw7d+2FexwgXTJwb4GEQaL6WkeLV54LSp+2cCxsgyYeSAfEL6LG1 j3zIeI+lChjW6oW6PZw+m8WitKRFVG7noAafgLpVlnS/ECzM2y5a0HYV+ mtyCiDNhiuSIvcTtKukXKcB/84FsSk/YLr8GM7esPiu9mvyZJ5+3kE9Lq Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10627"; a="332519000" X-IronPort-AV: E=Sophos;i="5.97,314,1669104000"; d="scan'208";a="332519000" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2023 16:29:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10627"; a="664777696" X-IronPort-AV: E=Sophos;i="5.97,314,1669104000"; d="scan'208";a="664777696" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga007.jf.intel.com with ESMTP; 20 Feb 2023 16:29:15 -0800 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 20 Feb 2023 16:29:15 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Mon, 20 Feb 2023 16:29:15 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.173) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Mon, 20 Feb 2023 16:29:13 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=buARrByWWnqgh/TXj8gQSrQDwp4WojLdFh4zCn+vaEvYJKLdtOyJUTcHR7TxyV+dVQZ2pLBOYQwCSXIbzH59IxOir4OzdS7qPa0/OSx81xWdA2iLm250IUefByR+MkeIDnOKUO2I6xUigPYayQnJzFfcV9HFCFe5vlAZD+CwQ1x4MacD/NbFCvW/y0UMMD1xXTZvvaBWJPMKvrn0bdgHSGOhvx4iDiTMxY/kdZuC02OgFuoJGAq27TMPKp0aRm9Tt/eQ9zg43JNba2Ktrbh3Fa7PoG1dX5fcwSWbyH1rcl2EEhvqVdqU/Zda9hTjG0Jv5u8cK5ZmZBNo2HkoDtZ+Ow== 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=OUjOrtiiBWl04VaVOJSqgiDJt6mCb5fthehV7Xj8LL4=; b=XZDYgkrq0KyBmdObs5BQ7dzZzHzMp8+0ithlzJyy2eWzGS3L5HjF65LneZrd/I3Py3vjr/BFl+/MD3Qx7mruZTNC1eMuQQPV3KvYtiShwQIABOW3azgQ8+g1HpWkLSIuRz7QvuB3r1k1r3k6TfRBEb2gWTrI6cPKo/2KSWq9J3BeW6bCLQ5CH3NHhsXRmcFRzGep1/kTCdfxBvSX1m4QO2i/lqRlUtqYWysgJD1erHAzmF1KVfIw80vEQrcm8xK5yIBoRWApiDB0XQRiysM7oxzoYMSjOzjbrMZqrEXTi+XpQWm/mfqn2ePKMsx8naxGEfdjMNZELpTnCf5xXQW5pg== 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 DM4PR11MB5994.namprd11.prod.outlook.com (2603:10b6:8:5d::20) by BL1PR11MB5445.namprd11.prod.outlook.com (2603:10b6:208:30b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.17; Tue, 21 Feb 2023 00:29:11 +0000 Received: from DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::2c5d:49cd:a9b4:f764]) by DM4PR11MB5994.namprd11.prod.outlook.com ([fe80::2c5d:49cd:a9b4:f764%6]) with mapi id 15.20.6111.020; Tue, 21 Feb 2023 00:29:11 +0000 From: "Zhang, Qi Z" To: "Zhang, Ke1X" , "Yang, Qiming" , "dev@dpdk.org" Subject: RE: [PATCH v2] net/ice: fix ice dcf contrl thread crash Thread-Topic: [PATCH v2] net/ice: fix ice dcf contrl thread crash Thread-Index: AQHZP3uCyqL7cdQ430yjN/sE+9gmjK7YlpAw Date: Tue, 21 Feb 2023 00:29:11 +0000 Message-ID: References: <20230208083005.290571-1-ke1x.zhang@intel.com> <20230213070302.325387-1-ke1x.zhang@intel.com> In-Reply-To: <20230213070302.325387-1-ke1x.zhang@intel.com> 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: DM4PR11MB5994:EE_|BL1PR11MB5445:EE_ x-ms-office365-filtering-correlation-id: 079b0190-20d6-4759-a55e-08db13a2a725 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Mk4VWRPRvBVj6cWrT+jHiGEMk2JspZq34SYrY3ECNCq/zk7V/jg9GmUwQMuI1NJIAXJbHA3H7lyTMgyd3bpU7ARoknQ1VPyIHCa6UljYJ1XT54C9ERTZZHP5ljhP4mramg3oKi/jodhAoeT3I85Ts02MMwdCRLGmqUaPggkjIH+/hWQ1FC8kAXO3yh+MTShCBQR2dytfLrnMSSC8YJDW+zN1g+MgI5d064or2yLGdgtsR+pku4d46lP2Aour0WEssYqUGX8VhtnFLSaPX5UDARBDluQy/qg7H+LUJF2IrJ08qsQhY9h1Bdrd1C1SO5ePqYBJSFwSddZUtJ6KihYJtUFaX+WlNn7fGwSXRZnvoNmHSiVzik/S/FJRW0eUKzgMelGiHjHVQMc+vhQ6Udq7eNBsBG/44Xf9cMAr71OStccgoijogMxRUFRHCk2FxpuPAHRHmKZ3+4cpCrCgOVAawMEtFMmRk6AIDa6oSNIedo+JVFvys/Yv1AquCYx8jw0X4qQl+upKX7ipVp6fQX+iBxXDi7WkfYiuPcyMEdraaCk2k74UB9GCsfPMc+2BGNeKVCTWYWZ+hBlvAE3NdGuw+w3cUjLpiYi1QCxnoIHHAwiscBZ8AVt6swpSS52hqcpPgFpRfmhBzltZk7oVhJsweH18VwfL6eki97BjcU9P7gtRhIIXC5WU3R3mAhG4Plt2wq2FJJKG0/5wDlCxq74Vdw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5994.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(39860400002)(136003)(346002)(396003)(366004)(376002)(451199018)(76116006)(66946007)(110136005)(66556008)(66446008)(55016003)(41300700001)(86362001)(2906002)(8676002)(64756008)(316002)(66476007)(8936002)(5660300002)(52536014)(82960400001)(33656002)(53546011)(83380400001)(38100700002)(71200400001)(9686003)(478600001)(122000001)(6506007)(7696005)(186003)(26005)(38070700005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?jvCgwEhtOX+7z5ka/3Ldtb5J7xoJiehBs25zMLuVlB32ksqrv1aIz9C8feDL?= =?us-ascii?Q?5spJzQz21X9P11JJ3J9BHhM3YYUhIUKjD3WLxY0WetEWUap2QqWtwWZE77y1?= =?us-ascii?Q?H9tBw34UXaKTnYowcEml9OUno8P3/eF1ee6PXc05sxjif8uX5sAr+evaetoc?= =?us-ascii?Q?FTAVFx5rh+GGvI42BFherHs/pYDuvlfkMlJBBgjbL0AKVY8PWowZJywjP4WP?= =?us-ascii?Q?jk7NiiL49Kxk3+os5GHl9etTg4hgCw2SqraIVskWoONoyj0ydf9NLZgH7CTV?= =?us-ascii?Q?r2GaffNDft4chyke2+ADTgYfwWcP+aBKJLAouO/G/mURw8qabJDSMqT6UEit?= =?us-ascii?Q?497lc4MVvAkSN1dJFlRHKvrW856Y/6V/+moUGtNfmOuh4tTPLzZoHdtYHdcS?= =?us-ascii?Q?QxgmJX26NVHZuFK6ur0PRHCayYhssCEBCJOY0akuGd+hwRz6u9WaVeze+80O?= =?us-ascii?Q?3QKCcPDIcjMBLsHnwJo+LDF3JiVCNc2q2CF9AY8E+/JZ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A/u0O6wOTLujA6vlK6P1Wt7yJ0fPVY/diI3lF7tWjfHc?= =?us-ascii?Q?n3Z+el+KDP1QEIzytA8SZR/EIso2ZBfxv9ed1uTrCV+snq3qxbbgw+/SCQ1U?= =?us-ascii?Q?KdqtytZcIhLmebkF7WpNE++3N9eDVBIVzUyeQeZAalRaEHujgcyLMZijsc/b?= =?us-ascii?Q?P739nd6Bdvl+usjl0ojRQAZw1aLzCQvPDfxKw3Ws?= 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: DM4PR11MB5994.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 079b0190-20d6-4759-a55e-08db13a2a725 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Feb 2023 00:29:11.2792 (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: HRBrDCJE4qPW97T32cEcnArhiFtJisAe/HIuPZ2kGpfqMLSeaELukCwU5VmVMhDzm9HIhV45ZhKp65IQoZByUA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5445 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: Zhang, Ke1X > Sent: Monday, February 13, 2023 3:03 PM > To: Zhang, Qi Z ; Yang, Qiming > ; dev@dpdk.org > Cc: Zhang, Ke1X > Subject: [PATCH v2] net/ice: fix ice dcf contrl thread crash >=20 > The control thread accesses the hardware resources after the resources > were released, resulting in a segment error. >=20 > This commit fixes the bug by exiting thread before resource released. >=20 > Signed-off-by: Ke Zhang > --- > v2: add pthread_exit() for windows > --- > drivers/net/ice/ice_dcf.c | 4 ++++ > lib/eal/windows/include/pthread.h | 5 +++++ > 2 files changed, 9 insertions(+) >=20 > diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c index > 1c3d22ae0f..e58908caf5 100644 > --- a/drivers/net/ice/ice_dcf.c > +++ b/drivers/net/ice/ice_dcf.c > @@ -543,6 +543,8 @@ ice_dcf_handle_vsi_update_event(struct ice_dcf_hw > *hw) > ice_dcf_disable_irq0(hw); >=20 > for (;;) { > + if (hw->vc_event_msg_cb =3D=3D NULL) > + pthread_exit(NULL); > if (ice_dcf_get_vf_resource(hw) =3D=3D 0 && > ice_dcf_get_vf_vsi_map(hw) >=3D 0) { > err =3D 0; > @@ -760,6 +762,8 @@ ice_dcf_uninit_hw(struct rte_eth_dev *eth_dev, > struct ice_dcf_hw *hw) > rte_intr_callback_unregister(intr_handle, > ice_dcf_dev_interrupt_handler, hw); >=20 > + hw->vc_event_msg_cb =3D NULL; > + > ice_dcf_mode_disable(hw); > iavf_shutdown_adminq(&hw->avf); >=20 > diff --git a/lib/eal/windows/include/pthread.h > b/lib/eal/windows/include/pthread.h > index 27fd2cca52..f0068ebd73 100644 > --- a/lib/eal/windows/include/pthread.h > +++ b/lib/eal/windows/include/pthread.h Suggest move this part into a separate patch. > @@ -149,6 +149,11 @@ pthread_detach(__rte_unused pthread_t thread) > return 0; > } >=20 > +static inline void > +pthread_exit(__rte_unused void *__retval) { } > + > static inline int > pthread_join(__rte_unused pthread_t thread, > __rte_unused void **value_ptr) > -- > 2.25.1