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 3C0C2A034D for ; Fri, 21 Jan 2022 09:03:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2465D42737; Fri, 21 Jan 2022 09:03:03 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 9F32F40042; Fri, 21 Jan 2022 09:03:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642752181; x=1674288181; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=tdPKuXTBDDAMvIRvIwz8Nu/ZA0QY3KmTFoMCvWKM1LY=; b=Wvqp80JH7HxXXdAC4gcZFIMTehuF70tdw4fnQts/9zx9+qkTHpybix7e nJkU9NiOt7YZUPP3Qctx8K3aATMaP5B1BF38Zy8ghgMh+DJ8ygCqGPmGU FYYmS2gUscr0jCcUhIcF3JihTRvYPc3BwBkQI2ndCx3AEZF0dvEAJBybf oxjU2+QIqbH0f2m/0oFuKwB+EmobDavFTY39BzhInNq2wJWvHY3d42jHX WkQ5UUaO9oyAJ5KPm2uHD0sqVQX0+8CRs7bwBIPEKK/0LaWQlO+rxYsvG cHJvjKtlrrV+4xjhfUrytNA9NCl9txTrbXfU9+bBy+KHJM99y2B/72DqF Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10233"; a="331945180" X-IronPort-AV: E=Sophos;i="5.88,304,1635231600"; d="scan'208";a="331945180" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jan 2022 00:02:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,304,1635231600"; d="scan'208";a="561782530" Received: from fmsmsx605.amr.corp.intel.com ([10.18.126.85]) by orsmga001.jf.intel.com with ESMTP; 21 Jan 2022 00:02:59 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 21 Jan 2022 00:02:58 -0800 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 21 Jan 2022 00:02:58 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Fri, 21 Jan 2022 00:02:58 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.109) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Fri, 21 Jan 2022 00:02:58 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VUp4yyUw/90n+5FFVG7vVn8iimWkYeBBFYGPvrd8QQqHcTpjvaM1lghTaX9NqxhpAxSDxYIFtO8nm4tkoMR5Bptcm5gvz17gE4j/IR3VAqPe9mkJjSHVx1pdWZkj1vJE4+RfhMF61LJ1YM11+VyBUjDiDhNuVDuOOMJQmMqUjrBsCDoxleCSfPeUjWRKZe2T4gECUGwKuEYmrbV6kJjgBhjF0v6+3hsmP3ZMAUzradQPDEaJK5Uq5NXFyu1S22DWNF41vDItxjZtJ8PQ+mgPz2KQNVgG3LERoy4FGb1V2Ld0eB2Wn9nvd6l6JstHfgD8isXh+rweLYSrflgFB0GiTQ== 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=SyCy/PeApNoY2BLh4dex+7S+Hu2fXvRQl61m6gbDgCU=; b=CTdQNkfr4pEIPvEfHO4k0tDL7D1uBoAdBEw+4YtKStLu5ePua2FervkLISHkPlnhhs8ymY7NPy2augwyIkkLZ8twXExcO+oJE9z1yU4u++4r7q8kZdxeoBkr2LC+1PMinnW8qmUF+0hSKdC7Tms1efd4do2ML3lYq5n6MQKRcYy5hqXH2lAVwpAbb1Juc03jej+SUrKkRj0PgylOnLq6k+GFhOoQudsG6PBv6nUO6UGxi+tLT8UOwPgKzw8c5ydSTp4XL/UvL92ULhZeUxxaKwEfPvOJjvwcsJEjNiRPShxvGZfkyWUOdCj8BsGX07rslNTNnd44tf6vKLXDmKGXkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by SJ0PR11MB5771.namprd11.prod.outlook.com (2603:10b6:a03:424::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Fri, 21 Jan 2022 08:02:55 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::c8ff:c95c:e601:eee3]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::c8ff:c95c:e601:eee3%5]) with mapi id 15.20.4909.008; Fri, 21 Jan 2022 08:02:55 +0000 From: "Zhang, Tianfei" To: Stephen Hemminger , "Huang, Wei" CC: "dev@dpdk.org" , "Xu, Rosen" , "Zhang, Qi Z" , "stable@dpdk.org" , "Yigit, Ferruh" Subject: RE: [PATCH v3] raw/ifpga: fix pthread cannot join Thread-Topic: [PATCH v3] raw/ifpga: fix pthread cannot join Thread-Index: AQHYDcMor155wc72T06zi3AETYn6EqxsDlGAgAEOYIA= Date: Fri, 21 Jan 2022 08:02:54 +0000 Message-ID: References: <20220120023535.6747-1-wei.huang@intel.com> <20220120055814.7244-1-wei.huang@intel.com> <20220120074643.10aa0926@hermes.local> In-Reply-To: <20220120074643.10aa0926@hermes.local> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.200.16 dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 84fee098-bdc0-4d5d-1552-08d9dcb46e41 x-ms-traffictypediagnostic: SJ0PR11MB5771:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ChxzyfK8+qVb0PPU5FiJ6SgzOOoZp9lmmRJtwtCzDI/jtzppFzIFumCpQDRxMQ6ABZycpcV+U4wfh0OFQ2650aUxThyZQTrnjpylBx4dqBztDmDySmUwh1bu6A2WV4LjqooZubq+K4QbKkLkLlwGH6kJeGQxtmBMw7J+sdDSq2rCvUX93tAnJFXrgx8VBsQR5r1jPHrpECdxVxpWKv4buGzTln2LA6be3d8fyyqD2QAixlu7HP5m67ImgaNDbh3Xe6FuVXIPNL2o4Z5otjRvuwnTLXooWEogOSx1UfCwwUv9XanauYL/IfBhgl6g7MTAs30O+cFaYm+fkc8vuMl/4H2nfvcrBl/I8k5gfAMNsesNsW9sJZHMkrK2HPNp+6J9GGFrqpB6il0ZHUhK2KS1c+JILkfIgc1++BasdgZM/H32VigSqnH1KBbf/1GDJygSU9iFiIPrR3wtZ9y2J79AJP2q9G1qGgUshSpZDXxZcDFjlLlyOsApF1Zrsbqt6hPmWCO5ZnvQyA3XsVnCfBMS82QhAdBqJTiXyPFBUv7oX9Hu28/y5KiYBjHa+vXwHJx3dEwzFMdWYpqbcf/rhHteEX9uihrO/hU9BGniETaWX0NTGj1wA4POGC/YiAIxMgh28xU3n4onkhTtmHQ1Fki3wy3cQcG8B1uZfTtVVwB9PGpSMJTFh43KZEc6su2Tfi4ISlzWJ3BfmqpXuA0uLrI9M9hJQDtgqTrh/dLO3OpOXqE= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN9PR11MB5483.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(186003)(53546011)(122000001)(33656002)(26005)(107886003)(38100700002)(9686003)(8676002)(64756008)(4326008)(54906003)(6636002)(83380400001)(66476007)(76116006)(6506007)(66446008)(52536014)(66556008)(508600001)(71200400001)(82960400001)(86362001)(316002)(8936002)(7696005)(5660300002)(110136005)(38070700005)(55016003)(66946007)(2906002)(21314003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?SQv75DrOepvr+CmJvpiiDX7ZCBmhmiEQs4g5Qa8uEUzgzvzB1mB7k/nXfua8?= =?us-ascii?Q?VlK/NEF1uGcMG+DXXt5Y/k4XhwYsKioC+xxzlITuCEX/h8ZyxL2XuDqw62F3?= =?us-ascii?Q?tUv0hJORe6IBy33AP3eKO+0xpv/zfzt6sGAGBd4oveDsSUDw3SZqWueVPa/W?= =?us-ascii?Q?evvN2BtdtD/GQlgCPsj4FD+bPhHQ0OTpHdKO5PiV446HdKsnL5a+2u25CEe2?= =?us-ascii?Q?i35PmtBypPEY6iKNQpvFxo+FcVFwoStMbGT7Acc7+E4cMACeRbieyB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RsAEoGiClMySIme3o25OC95wTC7t7D2PhqAB13?= =?us-ascii?Q?b8yFDRKgZC8IC/YRy1V0J/EnPXZeYNvoYRw3VgPaX6VGwkLNag+S9+MoEPzS?= =?us-ascii?Q?LAYre7FyaHitDq9qradymaVv5EY+flMOIrp2QofnxC3CTQQal6Xs27An3kr8?= =?us-ascii?Q?6RCmnRLlLIw/La2zWBIhXpv1P9KYtPGpPi27nkTweYVJOE1CzCXpUwMsto5c?= =?us-ascii?Q?KNVBCnia+Dr00JmUwf8779bGWNaR2o+CAVOd0E3zmWEB1tJY/yMumDIgbO/D?= =?us-ascii?Q?Z3KEui1cpzCafAJ0rs2QaJSzKJPEJJPt/yZ0eNhHcFckiD1WYYPaWyr55HyA?= =?us-ascii?Q?B0JCcVpog+cM8d38f3XLo2JqQULNS51NsAxXlxiY+LQ2+B3Fog7rG9yGlHA+?= =?us-ascii?Q?eg4CPuF8C76ErXcBrqqwtIuPGHb20p9uvbwqefvIMtRma+xuneUiJRQCX1N4?= =?us-ascii?Q?GQ=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: BN9PR11MB5483.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84fee098-bdc0-4d5d-1552-08d9dcb46e41 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2022 08:02:55.0211 (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: A+tuNAxBn2RF7ibENvtiAe973gEm/pssnguK1aAox0jd5nboRJDHJ2EywU/J14qzigocPcJn0kl0NobSGxi0uA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB5771 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: Stephen Hemminger > Sent: Thursday, January 20, 2022 11:47 PM > To: Huang, Wei > Cc: dev@dpdk.org; Xu, Rosen ; Zhang, Qi Z > ; stable@dpdk.org; Zhang, Tianfei > ; Yigit, Ferruh > Subject: Re: [PATCH v3] raw/ifpga: fix pthread cannot join >=20 > On Thu, 20 Jan 2022 00:58:14 -0500 > Wei Huang wrote: >=20 > > diff --git a/drivers/raw/ifpga/ifpga_rawdev.c > > b/drivers/raw/ifpga/ifpga_rawdev.c > > index 8d9db58..2bc569b 100644 > > --- a/drivers/raw/ifpga/ifpga_rawdev.c > > +++ b/drivers/raw/ifpga/ifpga_rawdev.c > > @@ -497,7 +497,7 @@ static int set_surprise_link_check_aer( > > int gsd_enable, ret; > > #define MS 1000 > > > > - while (1) { > > + while (ifpga_monitor_start) { >=20 > This will work on x86 CPU but not on CPU's with weak memory ordering like > ARM. >=20 > You need to use atomic_builtin when accessing a flag shared between threa= ds > that is not being protected by a lock. We submitted a v5 patch for your suggestion, but got a " coding style issue= s" which said that:=20 Warning in drivers/raw/ifpga/ifpga_rawdev.c: Using rte_atomicNN_xxx We look at the devtools/checkpatches.sh script, it mentioned that rte_atomi= c APIs are forbidden. ifpga_monitor_start just a flags to enable and disable the threads not shar= e with threads. When the driver init it will start the thread,=20 when the driver remove it want to stop the thread. I don't think it will ha= s a concurrency issue on this scenario.