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 4BFBFA00C5; Mon, 6 Jul 2020 17:32:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 404B61DAB5; Mon, 6 Jul 2020 17:32:29 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2045.outbound.protection.outlook.com [40.107.21.45]) by dpdk.org (Postfix) with ESMTP id B7FB61DAA5 for ; Mon, 6 Jul 2020 17:32:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VXXVR4EHaPBD+f+9lGGVOsNkmU3OhL1CoLyuL238PRM=; b=5zm7rL1l6ozODwIsjL+MN9RH7bSNlzZPFdQqWJ+xxJJ1R8Y+bbeb9VfoFsJ2K1Bs06B0wZ0suIQ+KFAyDdp00/2jdXXjOI4Vr6dC1QFtKyPHY0p9UfnOV/gglu+rwH2pkDiiBF8et/V1PMvt6mrEMJQH6hyzdeToV18zjf/uSxE= Received: from AM6P194CA0066.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:84::43) by HE1PR08MB2891.eurprd08.prod.outlook.com (2603:10a6:7:2b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.29; Mon, 6 Jul 2020 15:32:25 +0000 Received: from VE1EUR03FT062.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:84:cafe::7b) by AM6P194CA0066.outlook.office365.com (2603:10a6:209:84::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.23 via Frontend Transport; Mon, 6 Jul 2020 15:32:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT062.mail.protection.outlook.com (10.152.18.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.24 via Frontend Transport; Mon, 6 Jul 2020 15:32:24 +0000 Received: ("Tessian outbound b8ad5ab47c8c:v62"); Mon, 06 Jul 2020 15:32:24 +0000 X-CR-MTA-TID: 64aa7808 Received: from f8ac670023f1.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F9B61477-D1CB-44C5-B0EB-4B280D10BA73.1; Mon, 06 Jul 2020 15:32:19 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f8ac670023f1.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 06 Jul 2020 15:32:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fEf3eJ8o3bxlH/5I3Zi3Fowoe5lvwUR4qtK8RyWPWi7MIvZ00G//gLKl/5SLYKEu3mgjgqMHUbKOfa8wwdoYZZHU8NxPFoFE3/GfgK9E/wVR4yAghIQtcxISJH6DF1pShBlgGiL5Mi655mQmEG+C4WInoPxb5VwZs2ng2J26uWSVTzzYJW/52XGDVoCMHNdxlXdYZnbo6zUYxiGXN7aI3mwIRl79GQeLoO1sS7u0GpU9Ccp1HpqvMl/zfIs6dfCbaph+t5JBcHRvqMWjnjShunkUe5eKaIKygD21DerPIjK4DBp4ywRHwCjNhpznpFilE+L/GnlUijVzc3uOrbkoNQ== 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=VXXVR4EHaPBD+f+9lGGVOsNkmU3OhL1CoLyuL238PRM=; b=S03sj5Xms+IPQEiHJYYO/47bcvYbaYDkKPc4FMkH1GUplq44scV6Fgq0LXB+mLXCVIPok5XLJldXYIAfKPYDO6T4+/QKDyVQKIlNh+4pxSMMHkk5WgKjCC0i6KO3XL58+s8utL6sEbOA9L5bsxu3ILugJgbvAQsblOvJQ7e1d4hqI4VVmL8yameTI3pDWh8aIc25jjI+hnNuDK7ey481yoYE61WNPRmMuEK+SXKMYYlR+BDHcJ1jT17JN80uHvA7oTzln97dMIPH15DcxQ8cc1zjTTbLHRF8pzlhBEhy4+8qgYR3J2Irc7IXU6tQZGL4EuF9we6VJ0TzXQkgWwtkvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VXXVR4EHaPBD+f+9lGGVOsNkmU3OhL1CoLyuL238PRM=; b=5zm7rL1l6ozODwIsjL+MN9RH7bSNlzZPFdQqWJ+xxJJ1R8Y+bbeb9VfoFsJ2K1Bs06B0wZ0suIQ+KFAyDdp00/2jdXXjOI4Vr6dC1QFtKyPHY0p9UfnOV/gglu+rwH2pkDiiBF8et/V1PMvt6mrEMJQH6hyzdeToV18zjf/uSxE= Received: from VE1PR08MB4640.eurprd08.prod.outlook.com (2603:10a6:802:b2::11) by VI1PR08MB4191.eurprd08.prod.outlook.com (2603:10a6:803:e6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.20; Mon, 6 Jul 2020 15:32:16 +0000 Received: from VE1PR08MB4640.eurprd08.prod.outlook.com ([fe80::c2e:9ccb:a690:6863]) by VE1PR08MB4640.eurprd08.prod.outlook.com ([fe80::c2e:9ccb:a690:6863%6]) with mapi id 15.20.3153.029; Mon, 6 Jul 2020 15:32:16 +0000 From: Phil Yang To: "thomas@monjalon.net" CC: "erik.g.carrillo@intel.com" , "dev@dpdk.org" , "jerinj@marvell.com" , Honnappa Nagarahalli , "drc@linux.vnet.ibm.com" , Ruifeng Wang , Dharmik Thakkar , nd , "david.marchand@redhat.com" , "mdr@ashroe.eu" , Neil Horman , Dodji Seketeli Thread-Topic: [dpdk-dev] [PATCH v2 4/4] eventdev: relax smp barriers with c11 atomics Thread-Index: AQHWU3zy2PosA8/VkE2gNKFCboplgqj6pXnA Date: Mon, 6 Jul 2020 15:32:16 +0000 Message-ID: References: <1591960798-24024-1-git-send-email-phil.yang@arm.com> <1593667604-12029-1-git-send-email-phil.yang@arm.com> <1593667604-12029-4-git-send-email-phil.yang@arm.com> <3726677.YG9GXOvrMZ@thomas> In-Reply-To: <3726677.YG9GXOvrMZ@thomas> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: bda5bb12-471f-44c3-8b00-413b6c20c0c8.0 x-checkrecipientchecked: true Authentication-Results-Original: monjalon.net; dkim=none (message not signed) header.d=none; monjalon.net; dmarc=none action=none header.from=arm.com; x-originating-ip: [180.162.1.103] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e15ca6aa-e96d-40e6-2a87-08d821c1c872 x-ms-traffictypediagnostic: VI1PR08MB4191:|HE1PR08MB2891: x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:3044;OLM:3044; x-forefront-prvs: 04569283F9 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: vuGeMTmobnxWk8ntj2gyJT2OFmMI6AKqRRjFxlWdIVtF+rxUsHubku7IkQGhXgnFzNqAk3A74F5kjQeUOuI6xfEHGcPr3hGIx/MaZa6p/K4rySx1G1BTxM5NE8AKK6QBqtQXa/S/h5Fg+SN9tWzoBTGirDUf43YGKKLtQbjnlI5BfiEDd22bdThOvzcp1GsUo9icpfCsOBM18CBt5szZ4AFe+2MEbeYtgTK9svVYHxOIEnmJ/9+NbU/5KzJzFR+0WpJZYC/0XZZ5wVEpUKa6dRUFvjTS62ObIw8WzmdrQTL6IclprDB2JUG9kH1MkZko21RWcScjrW0vzAWN2IcyIVkyKo6pAJklD6qvirwJva8hHd++6Bvnys6PyzoaFo3OyH6JmPX4DtHb5A0tnlRWCQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR08MB4640.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(376002)(346002)(136003)(39860400002)(366004)(396003)(33656002)(5660300002)(6916009)(2906002)(8936002)(71200400001)(52536014)(54906003)(8676002)(316002)(9686003)(86362001)(66446008)(66476007)(64756008)(26005)(66556008)(4326008)(478600001)(55016002)(7696005)(83380400001)(53546011)(6506007)(66946007)(186003)(76116006)(966005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: VAjLHsnC/f2s1WP73vbAEo8XnDVjd+iL62dse/E6cnM4viuviVRzqfDEBGiv6YdVjBNzHDPRZbdpCbMy45Eur+/Yx6K8Bpj2aN8bxtPEm096Lgf6ljqjVkkH0JwQBSTqnxwUlV19C/kWchN9AOiBhzAsQQBrklJsji7JPCyM4sqFdbhhI68zKqobXs7+uEr92Hj9yYHWkD98rq7V6RiK4j+qWpS8PdmzETBBzml430aj72o6RefOiCBRQOHIHZOaqmHz80Xbnx+9P8gAcojy2oCruZ0a8grFXi27cd0MQXSgyJil3AH3bFQzIbgse7sRHR9A7dLU6nLdi+CeoAaPe9E10lIkuGeZy5CfEdwHDFfARrOdyIQrQ5Ci2+I18742ldQbggkkqF0MR01LKuYHyfknD6EVrPBUQPswTEtQtmBvdn/HbVwGEhY/12V03Xkep1pTftWovcNEgERaBBQk1tTbRUDW7ZB2ErsiREjEvpE= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB4191 Original-Authentication-Results: monjalon.net; dkim=none (message not signed) header.d=none; monjalon.net; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT062.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFTY:; SFS:(4636009)(136003)(346002)(376002)(39860400002)(396003)(46966005)(8676002)(36906005)(53546011)(6506007)(336012)(7696005)(8936002)(5660300002)(86362001)(26005)(2906002)(52536014)(186003)(33656002)(107886003)(316002)(54906003)(83380400001)(82310400002)(82740400003)(81166007)(9686003)(356005)(47076004)(966005)(6862004)(478600001)(70206006)(55016002)(70586007)(4326008); DIR:OUT; SFP:1101; X-MS-Office365-Filtering-Correlation-Id-Prvs: 7f24b233-99fe-49bf-ae58-08d821c1c34e X-Forefront-PRVS: 04569283F9 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q0B3Z95ag7MIJeWP2RgaHXCFT6EcS9BxNREruT33xkW86caCBobDCYQJJ60ajUYEj+Wz0k5hyiAVou8mpDfMP18gUq8ku8lMMlBRmnCTknRyHG+J+Y24OaD5AHCPqanNdFiZ5lDxRXEr/Qiv7oK5R2gtkmXqnh5wgjEdraB8hzPm5mSMCvtUdNTdVDouO21X8MOyQKnen8hECoi6u3mpqslL6RPGZYnrcuREIdhrJdhTrHamom1ZV6tPqeLeyaFfmmrS9sUtQqzJR60FE6HZ9sMa4Mxq05vBMgI9IRtVunxcBIzHzqlMKhH7RGmKFknNR9UbZSi/HpUSdj0fgFKJNT5ZuIJPwl794HAtysvvkOLNUB+agLEWyem3W6NXZ5xVOS+EE/QoLlpzUeHqmTlKV1i2AEnT8yk3lCDwe2d5rrFrkLRbmwct9FwoeJXFB1M7JGNpkhbCsOa9oKlzj49N/mSMaX+AQRFmC4qM2RUCsu8= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2020 15:32:24.6845 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e15ca6aa-e96d-40e6-2a87-08d821c1c872 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB2891 Subject: Re: [dpdk-dev] [PATCH v2 4/4] eventdev: relax smp barriers with c11 atomics 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: Thomas Monjalon > Sent: Monday, July 6, 2020 6:04 PM > To: Phil Yang > Cc: erik.g.carrillo@intel.com; dev@dpdk.org; jerinj@marvell.com; Honnappa > Nagarahalli ; drc@linux.vnet.ibm.com; > Ruifeng Wang ; Dharmik Thakkar > ; nd ; > david.marchand@redhat.com; mdr@ashroe.eu; Neil Horman > ; Dodji Seketeli > Subject: Re: [dpdk-dev] [PATCH v2 4/4] eventdev: relax smp barriers with = c11 > atomics >=20 > 02/07/2020 07:26, Phil Yang: > > The implementation-specific opaque data is shared between arm and > cancel > > operations. The state flag acts as a guard variable to make sure the > > update of opaque data is synchronized. This patch uses c11 atomics with > > explicit one way memory barrier instead of full barriers rte_smp_w/rmb(= ) > > to synchronize the opaque data between timer arm and cancel threads. >=20 > I think we should write C11 (uppercase). Agreed.=20 I will change it in the next version. >=20 > Please, in your explanations, try to be more specific. > Naming fields may help to make things clear. OK. Thanks. >=20 > [...] > > --- a/lib/librte_eventdev/rte_event_timer_adapter.h > > +++ b/lib/librte_eventdev/rte_event_timer_adapter.h > > @@ -467,7 +467,7 @@ struct rte_event_timer { > > * - op: RTE_EVENT_OP_NEW > > * - event_type: RTE_EVENT_TYPE_TIMER > > */ > > - volatile enum rte_event_timer_state state; > > + enum rte_event_timer_state state; > > /**< State of the event timer. */ >=20 > Why do you remove the volatile keyword? > It is not explained in the commit log. By using the C11 atomic operations, it will generate the same instructions = for non-volatile and volatile version. Please check the sample code here: https://gcc.godbolt.org/z/8x5rWs >=20 > This change is triggering a warning in the ABI check: > http://mails.dpdk.org/archives/test-report/2020-July/140440.html > Moving from volatile to non-volatile is probably not an issue. > I expect the code generated for the volatile case to work the same > in non-volatile case. Do you confirm? They generate the same instructions, so either way will work. Do I need to revert it to the volatile version? Thanks, Phil >=20 > In any case, we need an explanation and an ABI check exception. >=20