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 12EBBA32A2 for ; Thu, 24 Oct 2019 17:53:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A53FE1EB5C; Thu, 24 Oct 2019 17:53:30 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80078.outbound.protection.outlook.com [40.107.8.78]) by dpdk.org (Postfix) with ESMTP id 837CD1EB53 for ; Thu, 24 Oct 2019 17:53:29 +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=gPWDvyOEiS179GMhAmq3VNRnWmZpoTccw68KZsTU3ek=; b=M5gEn+kezwnygNkaFnOn4zh5LdWcinwsZsEhmpMEH6281i6Zov3KGoJIqcGsNw2O/72gxfgYF1NXeV9WBeY8uzQ6noHKVUm+VX5ev2p6ZWylJxB4NkfbQwdrcJaKwFTehgIuueao0+27z2KLcWxWO67fOjh/C747rv+ok2FE4PI= Received: from VI1PR08CA0248.eurprd08.prod.outlook.com (2603:10a6:803:dc::21) by AM5PR0802MB2578.eurprd08.prod.outlook.com (2603:10a6:203:9e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.16; Thu, 24 Oct 2019 15:53:28 +0000 Received: from AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::201) by VI1PR08CA0248.outlook.office365.com (2603:10a6:803:dc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.20 via Frontend Transport; Thu, 24 Oct 2019 15:53:28 +0000 Authentication-Results: spf=fail (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=none action=none header.from=arm.com; Received-SPF: Fail (protection.outlook.com: domain of arm.com does not designate 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 AM5EUR03FT042.mail.protection.outlook.com (10.152.17.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.20 via Frontend Transport; Thu, 24 Oct 2019 15:53:28 +0000 Received: ("Tessian outbound 081de437afc7:v33"); Thu, 24 Oct 2019 15:53:28 +0000 X-CR-MTA-TID: 64aa7808 Received: from a58bf0917132.1 (cr-mta-lb-1.cr-mta-net [104.47.2.53]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4B2B03FC-6AA6-43B2-ACCE-93D0C4613650.1; Thu, 24 Oct 2019 15:53:23 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01lp2053.outbound.protection.outlook.com [104.47.2.53]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a58bf0917132.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384); Thu, 24 Oct 2019 15:53:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jSXGdKR7my2iuN/FVOMm/S3qz7oF2VU2Nblt0IggE6EhIoNpe2oFMYto3AuG0RhCwU+FZ1Y/HGTMBQ7ViTSMpzX4pAdUK13biQgwp46fyziOk9bsAveEZWh21piy1rCqHLHU2W1TmjBc3avddf9yEtBXsP5tpW5YehFCprqYQYSv6bRzTrIMd0cpwGyVL429fmCOdq+GeG48+bjJJ0QBB5gneV+2Wrb+Dt/H5uhLD1seXEUozD/G532wlGhHGiC1mUjKdZg+be0YDBUBxWjhRqrNWwENePdAgmKGBgHh7nFxyOluPagRoFtqTy7XHIs2mEy5jLv9K+u5YYcj9H1QIA== 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=gPWDvyOEiS179GMhAmq3VNRnWmZpoTccw68KZsTU3ek=; b=cgTGZp8Lj7eqif6oHXXVosEGJhRAmkKDI01PlMn0HjZkogloM2CTbNZKhaL+l7og7D9g920muIq6pOj6PWRwIkE+puKkd4VioGFTrQlfbIBxVoVQ86bgCrfxyBm9SAGqCHZtHlJB452IeoqS9gupov/oH0YlcfggVi6hLgEIVXDKawUPaIhtVIsR+g3U4XV2elHkdU7B106DFDTheSPx/jpTLKXfdyR8snqvfomliWTF1iv9LIgp/Lr2ef7fj9ueHUPdeTcb+7HzftJ/9Qk7+h+9VNVoZB4+2jkWqClarkdTrVRvGsZh6tLz6wFqg06ySpPg/v1VBart2Af1lwFEOQ== 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=gPWDvyOEiS179GMhAmq3VNRnWmZpoTccw68KZsTU3ek=; b=M5gEn+kezwnygNkaFnOn4zh5LdWcinwsZsEhmpMEH6281i6Zov3KGoJIqcGsNw2O/72gxfgYF1NXeV9WBeY8uzQ6noHKVUm+VX5ev2p6ZWylJxB4NkfbQwdrcJaKwFTehgIuueao0+27z2KLcWxWO67fOjh/C747rv+ok2FE4PI= Received: from AM0PR08MB5363.eurprd08.prod.outlook.com (52.132.214.213) by AM0PR08MB3473.eurprd08.prod.outlook.com (20.177.109.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.20; Thu, 24 Oct 2019 15:53:21 +0000 Received: from AM0PR08MB5363.eurprd08.prod.outlook.com ([fe80::b483:301f:e382:a94d]) by AM0PR08MB5363.eurprd08.prod.outlook.com ([fe80::b483:301f:e382:a94d%6]) with mapi id 15.20.2387.021; Thu, 24 Oct 2019 15:53:21 +0000 From: "Gavin Hu (Arm Technology China)" To: "pbhagavatula@marvell.com" , "jerinj@marvell.com" CC: "dev@dpdk.org" , nd Thread-Topic: [dpdk-dev] [PATCH] event/octeontx2: use wfe while waiting for head Thread-Index: AQHViby5JmiY9ClsQ02w7Dx6nQWH86dp7+FQ Date: Thu, 24 Oct 2019 15:53:21 +0000 Message-ID: References: <20191023161244.3284-1-pbhagavatula@marvell.com> In-Reply-To: <20191023161244.3284-1-pbhagavatula@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: b83d092f-1baa-4b6d-b4c6-fcb43083c6ad.0 x-checkrecipientchecked: true Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Gavin.Hu@arm.com; x-originating-ip: [113.29.88.7] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: f5e319f9-3df2-4f07-604f-08d7589a4fac X-MS-TrafficTypeDiagnostic: AM0PR08MB3473:|AM5PR0802MB2578: X-MS-Exchange-PUrlCount: 1 x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:5236;OLM:5236; x-forefront-prvs: 0200DDA8BE X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(136003)(376002)(366004)(39860400002)(396003)(346002)(13464003)(189003)(199004)(55016002)(8676002)(3846002)(11346002)(25786009)(6306002)(110136005)(53546011)(316002)(256004)(52536014)(6436002)(229853002)(54906003)(14444005)(4326008)(966005)(6246003)(33656002)(7696005)(71200400001)(45080400002)(71190400001)(478600001)(5660300002)(2501003)(6506007)(76176011)(55236004)(99286004)(2906002)(102836004)(14454004)(26005)(6116002)(9686003)(86362001)(66946007)(486006)(74316002)(446003)(66066001)(7736002)(8936002)(66446008)(64756008)(66476007)(476003)(305945005)(81156014)(81166006)(66556008)(186003)(76116006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR08MB3473; H:AM0PR08MB5363.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: jCxl4w5CG+z9ml7mBfPNM3a6krbgcNmP48I3Z+i5zGzqZg0cTPbTiVRnh5jATttYV//HV25D05wQeyKGV8W52kjqY5Kj3uazuMtiJ7yIu7pUY1zmWr7VKtD9lXvaUaoy3StIOlCDn/DXBeM+Am8iy1rOMc6TaTVI5aQFwF694eJtB2rJFgVxNERWukH3MoHp5VCjuqcCHVu8bSOxuoYopjfyOlM9l74M4g7OmMqDkNEUXGK4IIxrt+K9K9hRBjiN7X05npD1V8zTnxky34dWJ1AFQjbt/0zIWNlWHLbKyx+I68AOkDbk3/oFBBKEKcKfCYPCHQP8gjtQhVYeGeXZBhxqrHvKCorqcMhHAvRo/1abzmuwVZ7u6bZDgZFYKlVC9iMBavjA31GRPpAMYmLu3hHjoyK97gF20/i5r0PoENXTzmdZ1Y7qY/Vrc97V0hm7 x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3473 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Gavin.Hu@arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT042.eop-EUR03.prod.protection.outlook.com X-Forefront-Antispam-Report: CIP:63.35.35.123; IPV:CAL; SCL:-1; CTRY:IE; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(346002)(396003)(39860400002)(376002)(1110001)(339900001)(13464003)(199004)(189003)(52536014)(45080400002)(26826003)(478600001)(46406003)(14444005)(8936002)(8746002)(53546011)(76176011)(25786009)(6506007)(2501003)(2906002)(102836004)(229853002)(105606002)(316002)(6246003)(4326008)(76130400001)(36906005)(50466002)(54906003)(97756001)(70206006)(5660300002)(86362001)(70586007)(22756006)(9686003)(99286004)(55016002)(476003)(3846002)(7696005)(446003)(6306002)(305945005)(74316002)(110136005)(81156014)(81166006)(126002)(6116002)(33656002)(11346002)(8676002)(336012)(486006)(26005)(186003)(966005)(356004)(7736002)(47776003)(14454004)(66066001)(23726003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2578; H:64aa7808-outbound-1.mta.getcheckrecipient.com; FPR:; SPF:Fail; LANG:en; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; A:1; MX:1; X-MS-Office365-Filtering-Correlation-Id-Prvs: ac2bbeeb-bc46-4130-7796-08d7589a4bda NoDisclaimer: True X-Forefront-PRVS: 0200DDA8BE X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KiQx9v2QZMxYqIUrdoxqlPGN4yw42+LzMNpo5ExkO5gcET/nacCS/cHMvDMOIohD/TbRMUJPTw8PKQ5mAbtiMgKuniVPb1D2ZWaQhtRcHdLR1n5VZG4dVcLBv4qe3Mpw31Hk8S2/zTZl7+a+OwdrueqGvvla2qhZ12pH/+FRInPNU36tTxy0A0l0gj1JCQ64KS0+tTzCU8j5xbOX9NUihv/D/TpNDqwdTMuQKO0bul1Ft5IdVvD8+1rBfFEPTYf5ga1NmfOZlL+OmlMLcBeF7eE1EnA8XmQfQQqtBvMXrtY+JjG5VOpGpDTYzgH4W0H/1V/Ra5XjhWvH+33sUQ7+IvgPXy1+3B/bJ2FYI0mQK9bGdzTq3yYqXgomrGXn5p1OOJvp6em2GSckrBwCye4/UYHd8EEVE318PBQ/cCj5gxVm1HBVY/+q0Q/cHmuUyKdQ X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2019 15:53:28.0548 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f5e319f9-3df2-4f07-604f-08d7589a4fac 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2578 Subject: Re: [dpdk-dev] [PATCH] event/octeontx2: use wfe while waiting for head 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" Hi Pavan, > -----Original Message----- > From: pbhagavatula@marvell.com > Sent: Thursday, October 24, 2019 12:13 AM > To: Gavin Hu (Arm Technology China) ; > jerinj@marvell.com; Pavan Nikhilesh > Cc: dev@dpdk.org > Subject: [dpdk-dev] [PATCH] event/octeontx2: use wfe while waiting for > head >=20 > From: Pavan Nikhilesh >=20 > Use wfe to save power while waiting for tag to become head. >=20 > SSO signals EVENTI to allow cores to exit from wfe when they > are waiting for specific operations in which one of them is > setting HEAD bit in GWS_TAG. >=20 > Signed-off-by: Pavan Nikhilesh > --- > drivers/event/octeontx2/otx2_worker.h | 30 ++++++++++++++++++++++++-- > - > 1 file changed, 27 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/event/octeontx2/otx2_worker.h > b/drivers/event/octeontx2/otx2_worker.h > index 4e971f27c..7a55caca5 100644 > --- a/drivers/event/octeontx2/otx2_worker.h > +++ b/drivers/event/octeontx2/otx2_worker.h > @@ -226,10 +226,34 @@ otx2_ssogws_swtag_wait(struct otx2_ssogws *ws) > } >=20 > static __rte_always_inline void > -otx2_ssogws_head_wait(struct otx2_ssogws *ws, const uint8_t wait_flag) > +otx2_ssogws_head_wait(struct otx2_ssogws *ws) > { > - while (wait_flag && !(otx2_read64(ws->tag_op) & BIT_ULL(35))) > +#ifdef RTE_ARCH_ARM64 > + uint64_t tag; > + > + asm volatile ( > + " ldr %[tag], [%[tag_op]] \n" "ldxr" should be used, exclusive-load is required to "monitor" the location= , then a write to the location will cause clear of the exclusive monitor, t= hus a wake up event is generated implicitly. You can find more explanation is here: http://inbox.dpdk.org/dev/AM0PR08MB5363F9D1BA158B66B803EA068F6B0@AM0PR08MB5= 363.eurprd08.prod.outlook.com/=20 /Gavin > + " tbnz %[tag], 35, done%=3D \n" > + " sevl \n" > + "rty%=3D: wfe \n" > + " ldr %[tag], [%[tag_op]] \n" > + " tbz %[tag], 35, rty%=3D \n" > + "done%=3D: \n" > + : [tag] "=3D&r" (tag) > + : [tag_op] "r" (ws->tag_op) > + ); > +#else > + /* Wait for the HEAD to be set */ > + while (!(otx2_read64(ws->tag_op) & BIT_ULL(35))) > ; > +#endif > +} > + > +static __rte_always_inline void > +otx2_ssogws_order(struct otx2_ssogws *ws, const uint8_t wait_flag) > +{ > + if (wait_flag) > + otx2_ssogws_head_wait(ws); >=20 > rte_cio_wmb(); What ordering does this barrier try to keep? If there is a write then wait= for kind of response, should this barrier move before otx2_ssogws_head_wa= it? /Gavin > } > @@ -258,7 +282,7 @@ otx2_ssogws_event_tx(struct otx2_ssogws *ws, > struct rte_event ev[], >=20 > /* Perform header writes before barrier for TSO */ > otx2_nix_xmit_prepare_tso(m, flags); > - otx2_ssogws_head_wait(ws, !ev->sched_type); > + otx2_ssogws_order(ws, !ev->sched_type); > otx2_ssogws_prepare_pkt(txq, m, cmd, flags); >=20 > if (flags & NIX_TX_MULTI_SEG_F) { > -- > 2.17.1