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 D3753A0C57; Mon, 1 Nov 2021 13:45:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5CB2740E28; Mon, 1 Nov 2021 13:45:10 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 141CF40DF6 for ; Mon, 1 Nov 2021 13:45:07 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10154"; a="231268053" X-IronPort-AV: E=Sophos;i="5.87,199,1631602800"; d="scan'208";a="231268053" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Nov 2021 05:45:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,199,1631602800"; d="scan'208";a="448937777" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga006.jf.intel.com with ESMTP; 01 Nov 2021 05:45:01 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 1 Nov 2021 05:45:01 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Mon, 1 Nov 2021 05:45:00 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Mon, 1 Nov 2021 05:45:00 -0700 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (104.47.51.43) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Mon, 1 Nov 2021 05:45:00 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bz6SHWDI+gCm7ZHoZHoSPADCe1LnXuC6LhGrgmBEfDWaYiJ3MQzW0/b7tYIMneMjXo3JocTogBNFMr53ktxT+7leyJPSEuBFkxZxAo/0hevIw19MHiPO8BvOEY4ywOenR3jRFfpt+OIuijdg4rK6xZJ+4DrIKq1LGS3+GwAHTMGQN9mAb9r/pKe7BznWRyLkuSk0aXOfaacRA7if9FI4xd5aMZPUSNi19YnswnEBRTrWw+QUSFsBa74il8seDND4YCRQ/rTPxAEebApgu7CRchHPtaI4NF3W586Rz9217D8qh1cjPTAav4DD92jZkdYJuAKsDYmaSyvk6GwQHtE/Fw== 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=bmoW7UxX8kyjM+VHeM5+fsdX/HQMRxvZgubJAFurgkg=; b=X/qSakurxg4v1yywi0G410eluV1giqRjREP9I/z/xhNV1cpoDmpg1pDQKvng3Gcp9BpceFj0hBJwtJukRdv5LWWI9ahgHkKAsgaP2BGkzSSGHQ31RKYN6batEWe/sdGL4cbSOPiRUT+SDDERXdWeL+C9+Y5/Ue8aLbRfcZ5RGLZme7yQqK8EDNgiUkcp+xy7SdjLUFb1YCrzguBtgDnM4JBI4bfXNydmGdWPPD6H7u56oXrU1Hn2QV4pztn7N69hgj8tqN6KvurDHCaBeojglOn2qZDzcPjHSEuhzFK4khDpuzvQ9EUdfh/b6rELlYnu1MfS1c9J7KXa7Z+iOYetOQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bmoW7UxX8kyjM+VHeM5+fsdX/HQMRxvZgubJAFurgkg=; b=Z1eBOhSAovWCFsJ5q2V8Za9GX71xKo+qkOy1bQqIEABR9OMfAwJL5VrjbNLbODLowN4iIat+WPmnP5nW+K+cpOYZTxxJZ3sJm3sazMtmfwhhnwC8rUmlPEd4AwEHMrtpnziIWbteLplsCPvfVpNeoMHtk9Kr5sxsA6kslJS6Qto= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5047.namprd11.prod.outlook.com (2603:10b6:510:3c::18) by PH0PR11MB4983.namprd11.prod.outlook.com (2603:10b6:510:40::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14; Mon, 1 Nov 2021 12:44:58 +0000 Received: from PH0PR11MB5047.namprd11.prod.outlook.com ([fe80::f1a0:809a:3d2e:e13c]) by PH0PR11MB5047.namprd11.prod.outlook.com ([fe80::f1a0:809a:3d2e:e13c%9]) with mapi id 15.20.4649.019; Mon, 1 Nov 2021 12:44:58 +0000 To: Jerin Jacob , Feifei Wang CC: dpdk-dev , nd , Stephen Hemminger , David Marchand , Thomas Monjalon , =?UTF-8?Q?Mattias_R=c3=b6nnblom?= , "Ananyev, Konstantin" , Ruifeng Wang References: <20210902053253.3017858-1-feifei.wang2@arm.com> <20211029082021.945586-1-feifei.wang2@arm.com> <20211029082021.945586-6-feifei.wang2@arm.com> From: David Hunt Message-ID: <43f0aa2c-5bd1-b60c-9d26-95a4e686ed05@intel.com> Date: Mon, 1 Nov 2021 12:44:52 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB X-ClientProxiedBy: DB9PR02CA0015.eurprd02.prod.outlook.com (2603:10a6:10:1d9::20) To PH0PR11MB5047.namprd11.prod.outlook.com (2603:10b6:510:3c::18) MIME-Version: 1.0 Received: from [10.4.11.161] (95.45.23.115) by DB9PR02CA0015.eurprd02.prod.outlook.com (2603:10a6:10:1d9::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.14 via Frontend Transport; Mon, 1 Nov 2021 12:44:56 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 27fae8bb-6a2f-487f-ac87-08d99d356a00 X-MS-TrafficTypeDiagnostic: PH0PR11MB4983: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4DcfRoLsaR0u4BwCkUwGDaJhcJXZfeGpEQliQMPspl59xGmT68M2vQDr/uI5upAZq3pXHxkF7lVIcUE5ACrl3lP60Pc+GkEC/jhC0nET1jVKU82OITflEZbSJhiHGeaC7Wh7mG6mgoLAg0m12y2mNn9YxBMKuY8Ez/3+joMhy04vFubu3gFtw3T1SPjo3UtCTfCD4A5XRdAdNy0oOk+PEbBWm1WjnX4UWeU5ff7AvikYQzin2uZf4SsPFpufUFRnER4XKYaqHOfIDiYA4x2ikliCTt2DXVDa0DH/CpcVoIYLMNqEXD/aeTrTLKDcFiWud+VQ6v7AehkkEIz6GKytifS2cDO57Bn6ZBipglWLsIGzVa2i60wlqSa6uqVlgvJGkvRhPwaKVIrbzWXY+YEU9EpPs9js8XJjaxvPCZ0JBQrW9G8g6pkmOwKgi/fodRY0iMcIXgtLWfzX9vzaRNaV0bwyM4HYDvsdiBZ+8skS36ywjEecKJ37WSdbwfTAy237rW14YZ8amkWqBJG8w1Umk4sQu0XrK7G0MjxlhaFSagSuzDRAhuIbyEEXaOtbQSUvSnj/DNy6shnjPIxXHwDnkEiPZcAxX5DQEmzWtAuxe+y/r5UO/g3AKStynRVKmbpvXzfcEpWOHgxYj0WkNo/eNxIPTLxHJNGWhvs5VwY46QC+Isxm8i2ysqUodFRDiCab0P7HH01xfEig3BnB4xUSCD8+rY6iYz+e2qjvDYt6K18= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5047.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(2906002)(16576012)(83380400001)(2616005)(44832011)(8936002)(956004)(8676002)(54906003)(66946007)(110136005)(82960400001)(66476007)(66556008)(316002)(4326008)(26005)(86362001)(508600001)(53546011)(31686004)(6666004)(6486002)(31696002)(38100700002)(36756003)(186003)(5660300002)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?c0Jkb3czaVgxV3VTbUlVY0MwSEY3WFc0L3BmTkQ3K2w1bXdTZm9HRUpvQnhC?= =?utf-8?B?b1oxUFVVT1ZMVUFXL3FwR3A3a3ZkbUZXRUVPNmJrU1o3Rno5ZnNwWmtrYzdp?= =?utf-8?B?K1loQWRaU1QySHBVM0RKRlkrdkFObVVwcWlLUkp2VUE5L2puSEYrcU5oV2h5?= =?utf-8?B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3elNOeU04WVJrcTNCNVM2?= =?utf-8?B?YTMxN3B1QVR1UzlvZ0xyN2dyaUtERFYwTEJpdDdReFhhQ0pQZWtGQ3J4YXFJ?= =?utf-8?B?OTBWM1A4bUVKeW8xRjZaeWRnTVA0VG9pS0p4QXdJdkszM29JdjJJOFR1UkR1?= =?utf-8?B?Yk9KVll2dUVBRSsvRVFneVhEOEJLTVhqWjErOVFNUFg3WFIxMDl2NmVsUTlF?= =?utf-8?Q?MbxHbbc+gxxdVkPAoOlf2NA=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 27fae8bb-6a2f-487f-ac87-08d99d356a00 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5047.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2021 12:44:58.7927 (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: PE4Gu6BrYdbiB/NHKUK8JLZkBvbt5gHhY4WYpJvsqF9SQdU3YGJvweKfDVI9SZSbCjYDCw4ZB9A6v6zJHU79oQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4983 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v8 5/5] lib/distributor: use wait event scheme 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 Sender: "dev" On 29/10/2021 2:58 PM, Jerin Jacob wrote: > On Fri, Oct 29, 2021 at 1:50 PM Feifei Wang wrote: >> Instead of polling for bufptr64 to be updated, use >> wait event for this case. >> >> Signed-off-by: Feifei Wang >> Reviewed-by: Ruifeng Wang > > With the change in the subject as distributor: ... > Probably can be fixed in merge time. > > Acked-by: Jerin Jacob Acked-by David Hunt >> --- >> lib/distributor/rte_distributor_single.c | 10 ++++------ >> 1 file changed, 4 insertions(+), 6 deletions(-) >> >> diff --git a/lib/distributor/rte_distributor_single.c b/lib/distributor/rte_distributor_single.c >> index f4725b1d0b..d52b24a453 100644 >> --- a/lib/distributor/rte_distributor_single.c >> +++ b/lib/distributor/rte_distributor_single.c >> @@ -33,9 +33,8 @@ rte_distributor_request_pkt_single(struct rte_distributor_single *d, >> union rte_distributor_buffer_single *buf = &d->bufs[worker_id]; >> int64_t req = (((int64_t)(uintptr_t)oldpkt) << RTE_DISTRIB_FLAG_BITS) >> | RTE_DISTRIB_GET_BUF; >> - while (unlikely(__atomic_load_n(&buf->bufptr64, __ATOMIC_RELAXED) >> - & RTE_DISTRIB_FLAGS_MASK)) >> - rte_pause(); >> + rte_wait_event(&buf->bufptr64, RTE_DISTRIB_FLAGS_MASK, >> + !=, 0, __ATOMIC_RELAXED); >> >> /* Sync with distributor on GET_BUF flag. */ >> __atomic_store_n(&(buf->bufptr64), req, __ATOMIC_RELEASE); >> @@ -74,9 +73,8 @@ rte_distributor_return_pkt_single(struct rte_distributor_single *d, >> union rte_distributor_buffer_single *buf = &d->bufs[worker_id]; >> uint64_t req = (((int64_t)(uintptr_t)oldpkt) << RTE_DISTRIB_FLAG_BITS) >> | RTE_DISTRIB_RETURN_BUF; >> - while (unlikely(__atomic_load_n(&buf->bufptr64, __ATOMIC_RELAXED) >> - & RTE_DISTRIB_FLAGS_MASK)) >> - rte_pause(); >> + rte_wait_event(&buf->bufptr64, RTE_DISTRIB_FLAGS_MASK, >> + !=, 0, __ATOMIC_RELAXED); >> >> /* Sync with distributor on RETURN_BUF flag. */ >> __atomic_store_n(&(buf->bufptr64), req, __ATOMIC_RELEASE); >> -- >> 2.25.1 >>