From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AF855A04DB; Thu, 15 Oct 2020 04:19:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC73C1DB47; Thu, 15 Oct 2020 04:19:00 +0200 (CEST) Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by dpdk.org (Postfix) with ESMTP id C78121C2A5 for ; Thu, 15 Oct 2020 04:18:58 +0200 (CEST) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Wed, 14 Oct 2020 19:17:27 -0700 Received: from HQMAIL101.nvidia.com (172.20.187.10) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 15 Oct 2020 02:18:48 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.174) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Thu, 15 Oct 2020 02:18:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j2HtE6MQDjpdKwGvNOv4gLr73P4G1XYhYmUBS8DPHIdLqOiqz+9Ceo8qt6+/Vca9UTlhKglda/zYzi7uSoSXF3vZze9IgaI4mYaHHw7WthxMdMTO9693NhdnGN1KTNG3yP+DpaFy4XjZCxKFTda7i7/3/y6sni+JO90rNjVOdLWihA0/71W95dnVDL+umJUYcu+sJqQvNzL2P9KoelAE53xHl1XM/fESyPAv6Us1bvJlVB37IQ9e3wuiVPtx9FPyJqn4SJFATwhRp72VRglusNqU1mFyWxbv8kxXn/0fOxUp6LwjSN0HXGYxuKZgNuTwSaKVBkYdSiv2RmsvoiAV8w== 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-SenderADCheck; bh=QNbKy3ye5t9Hq7gn39LoeRND+DAfJRaw6bQJum3vV+o=; b=QZUWyX8F8egW4Q3X2qyYy7E6bIbrkv6e7AYbC0qUoUYqQCkP+CHXlUvN0xtA0bKXM5+dEP8hdFTvll/RTt+rLv4dA0XgapZgKieHRXyLbDOmTvV2bg5N8+M8GL37vPIjJ9/om2yYswWowK6LoBE+DLYJSdA7alg+b/gtta8jbWCdnYhGvBBfY3gJ2BukF376h0qLNc4ruKVyCjBqKjibjFi36UdPrBBRlROKiJnqCI6BUYK8go9YMDkLx1yVeUkx55F3YX5LsKDGibyHbIrh7j8nMpFEXkAn7hyoevXbY6hu300H/ujINPvjEbHp5sKf63XYJ/2Z/VMh/tV8qZHaiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from MWHPR12MB1743.namprd12.prod.outlook.com (2603:10b6:300:113::8) by MW2PR12MB2395.namprd12.prod.outlook.com (2603:10b6:907:3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.24; Thu, 15 Oct 2020 02:18:46 +0000 Received: from MWHPR12MB1743.namprd12.prod.outlook.com ([fe80::59df:5b11:7957:cfc]) by MWHPR12MB1743.namprd12.prod.outlook.com ([fe80::59df:5b11:7957:cfc%6]) with mapi id 15.20.3477.020; Thu, 15 Oct 2020 02:18:46 +0000 From: Suanming Mou To: Narcisa Ana Maria Vasile CC: Dmitry Kozlyuk , Dmitry Malloy , Pallavi Kadam , "dev@dpdk.org" , NBU-Contact-Thomas Monjalon , Tal Shnaiderman , Ophir Munk Thread-Topic: [PATCH v4 1/2] eal/windows: add pthread mutex lock Thread-Index: AQHWopkgzxoYZoA6JEWfM1uKftCC+qmX7VXw Date: Thu, 15 Oct 2020 02:18:46 +0000 Message-ID: References: <1601194817-208834-1-git-send-email-suanmingm@nvidia.com> <1602206243-157603-1-git-send-email-suanmingm@nvidia.com> <1602206243-157603-2-git-send-email-suanmingm@nvidia.com> <20201015021545.GA26401@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> In-Reply-To: <20201015021545.GA26401@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: linux.microsoft.com; dkim=none (message not signed) header.d=none;linux.microsoft.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [60.176.163.235] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0ec495ef-24c1-442a-b318-08d870b0a5a1 x-ms-traffictypediagnostic: MW2PR12MB2395: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: uUAQv6eTaIQLYL0KNgkNjRbWUXGchOkt4SIkq3nX05pDzobzYL5WRTWkVb0zHhXh9Zx36bU/KOhMZUFhT9ridtB5Gw8orxAzT8GonoHu8LDuCCcoR3LXI+JHCSPw2Xms5bj2BkYrOCA+y3gadrguMwogtx+Bk2eVPPHshU5RBTcun/WiSIYjUaK81fu3rTy5KfG4vnUm4fvXXJ18RlzvdcNXt6/0o7RfwYFq09JVT1MEQXV8gl/OTYHecmt2eX7jwhF+XT2a/lRyxNerVBR7drHJekV+wcvT616krod5mNX2QZ8vWiWECL+FV7vzCZAkv2K4R9WpreCjZH9rShYbJ/lF5dcK0Wbi6Gmbe9eLbR+xF6qWB5tYn81B5zs6rAseZ83OXL1WUbgK3EQq/Qplgw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR12MB1743.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(346002)(136003)(396003)(366004)(39860400002)(53546011)(83080400001)(6506007)(83380400001)(966005)(55016002)(186003)(86362001)(478600001)(45080400002)(26005)(8676002)(107886003)(8936002)(4326008)(2906002)(316002)(7696005)(33656002)(6916009)(66476007)(76116006)(64756008)(54906003)(66556008)(5660300002)(66946007)(9686003)(66446008)(71200400001)(52536014); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: pSfFE4ISLtNUgAUh8T++oOPBUqg1S6y8OX9CSJTSml69tMxS8hZZSSl4WPTQOlIuhptqDYW0p5KGfEiph4ZerRg6i84ZIWP5Jpcxavjj0wiBGMFaBnW5ciSMXaBKx+jAfVp2q7Ltm5T1BlW3o6mxXvtYJ09D4tAu7HcjjleKxig6RKs8GfCLm4RdwXtlQLsScRJwew4DieYD+i/HA21mafEXjbSXlISWdmcTvp6mOs3FNa703WwtikU9LNvJqqisREpwHISuXuR4WOmaDfZDqUMas2Xq5LDzfcYUt5NJblrHVMuj1Vr3/D0Cz64enmqOsVIG1V4XtwhV0MiAsZxZxFW8Dp0FXCLLFYoeHcsL4jQCXxmRWQ3AkvTpKpOwkWBKrApICFopXILo2iMAaYgCVDCSSbo74VV+sUTlyi3OUOzZhkCFgYlxIwVwPIPTUnhWtAwuKfxtBVc8Zy1swp5gIGe5c5zhZmZWhRazsz+DherznQI9J2pID4W6UwDU6AkszS+2gbseoUf1Mm89kiyloe0JM4oVOmKxzmD4QWNfWpKvaR5HdRKCRDM+F9ohE7hXX8TFd8vpfPziHbaM8Wk4ZixWkU9aA4PQArHtdqopiR2UPwSkDCrYaPZeGllzDxJB8e/n4379HcvY/LvatjPG4Q== 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: MWHPR12MB1743.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ec495ef-24c1-442a-b318-08d870b0a5a1 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2020 02:18:46.6308 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 90Bf6wfbCJChcentPzY9yRbYQXGl0y8k+0nSi59s58CV8vX0Pshtkw24csvI75zSZCZ/jDDgZEkBTf0Hd6aO9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR12MB2395 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1602728247; bh=QNbKy3ye5t9Hq7gn39LoeRND+DAfJRaw6bQJum3vV+o=; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To: CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References: In-Reply-To:Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-ld-processed: x-ms-exchange-transport-forked:x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers:x-ms-exchange-senderadcheck: x-microsoft-antispam:x-microsoft-antispam-message-info: x-forefront-antispam-report:x-ms-exchange-antispam-messagedata: Content-Type:Content-Transfer-Encoding:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=bKxuU0lSK+RMJkLH6ZouKr6SoPGSJAC8rqTGBHdUC8/OKwfE6MmPHZXguGtctr8/o 0d18MrBjc80iUThFJyjNJLlw7olN2zfBj0NSWD5e4p96H006WN3v5GX69//gDZKn2A +FjzxaW1ZygFol0hnDr2ZkhO0s1OC9u+Os+lyLfg6rJNU07KxfQVYVmcreza5qrPd7 ytq0rm814Axlw/1MLT0LaLv1HkJFoYxCgpQY7b2kHBrRyNFLLQi0PcqYzEUcXuSpYK 3WJFi4IKWVxJAqltpeFRa5Gw78PAymsZQ/VnQOrNe2yjACdMcogRu/mhogS8CQVpJY b/5eoWcmpM/Hw== Subject: Re: [dpdk-dev] [PATCH v4 1/2] eal/windows: add pthread mutex lock X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Narcisa Ana Maria Vasile > Sent: Thursday, October 15, 2020 10:16 AM > To: Suanming Mou > Cc: Dmitry Kozlyuk ; Dmitry Malloy > ; Pallavi Kadam ; > dev@dpdk.org > Subject: Re: [PATCH v4 1/2] eal/windows: add pthread mutex lock >=20 > On Fri, Oct 09, 2020 at 09:17:22AM +0800, Suanming Mou wrote: > > Add pthread mutex lock as it is needed for the thread safe rte_flow > > functions. > > > > Signed-off-by: Suanming Mou > > Acked-by: Dmitry Kozlyuk > > --- > > > > v4: > > - Add PTHREAD_MUTEX_INITIALIZER macro. > > > > v3: > > - No updates. > > > > v2: > > - Using critical section for windows pthread mutex. > > > > --- > > > > lib/librte_eal/windows/include/pthread.h | 35 > > ++++++++++++++++++++++++++++++++ > > 1 file changed, 35 insertions(+) > > > > diff --git a/lib/librte_eal/windows/include/pthread.h > > b/lib/librte_eal/windows/include/pthread.h > > index 99013dc..c62251f 100644 > > --- a/lib/librte_eal/windows/include/pthread.h > > +++ b/lib/librte_eal/windows/include/pthread.h > > @@ -28,6 +28,12 @@ > > /* defining pthread_attr_t type on Windows since there is no in > > Microsoft libc*/ typedef void *pthread_attr_t; > > > > +typedef void *pthread_mutexattr_t; > > + > > +typedef CRITICAL_SECTION pthread_mutex_t; > > + > > +#define PTHREAD_MUTEX_INITIALIZER {(void *)-1, -1, 0, 0, 0, 0} > > + >=20 > Regarding the question on the static initializer, adding the guidance fro= m > DmitryM: > "If you choose to do the static initializer, you will be relying on imple= mentation > specifics, (which may have not changed ever, or may not ever change, or m= ay > change in the next release). > This would be a hack (although potentially long term)." Yes, thanks. So we have removed that hack in the latest v5. https://patches.dpdk.org/patch/80814/ >=20 > Otherwise, > Acked-by: Narcisa Vasile