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 54E6CA04DD; Wed, 21 Oct 2020 06:56:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CA598AC85; Wed, 21 Oct 2020 06:55:59 +0200 (CEST) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50087.outbound.protection.outlook.com [40.107.5.87]) by dpdk.org (Postfix) with ESMTP id 91168AC79 for ; Wed, 21 Oct 2020 06:55:56 +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=HVGsAnLXWc0C9rgG4aivKgqwGYGYfCTZ8Zy68GeIb/c=; b=ssl69xqiaCmp4pZuxtmnerSSupC7MSH7oK405FIfAgeRX1lwBoFRZDZPwd+qZEvFvG3vbn1savKI8H9H9kqr1ilD085KlhENTQfIuX4HlJaEpR7zmEDRJwnVuwu9Q2rK9v/5Xdy8EP5mphURl7p7pa8rtsAwJ9JbT4IjpcycgH4= Received: from DB6P18901CA0015.EURP189.PROD.OUTLOOK.COM (2603:10a6:4:16::25) by DB7PR08MB3737.eurprd08.prod.outlook.com (2603:10a6:10:33::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Wed, 21 Oct 2020 04:55:54 +0000 Received: from DB5EUR03FT020.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:16:cafe::3a) by DB6P18901CA0015.outlook.office365.com (2603:10a6:4:16::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Wed, 21 Oct 2020 04:55:54 +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=pass 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 DB5EUR03FT020.mail.protection.outlook.com (10.152.20.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18 via Frontend Transport; Wed, 21 Oct 2020 04:55:54 +0000 Received: ("Tessian outbound 68da730eaaba:v64"); Wed, 21 Oct 2020 04:55:54 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 87b4dc31d1ad1a1d X-CR-MTA-TID: 64aa7808 Received: from f5669a4822ec.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id CF6D945F-8560-454C-99F9-E4790A202C37.1; Wed, 21 Oct 2020 04:55:48 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f5669a4822ec.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 21 Oct 2020 04:55:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cWK41AMzcyWvlfu3nwC9jFeet3Mb/O2pycvFALxfseSWUmURUbjeAEuaMiMUXcshk8xUHFj15auyubQdWKknJ8bD06d15ii7j6EslgsE+EUNOmd8j+QrrS/vODy6mBhjV1ssMDu5ROyqwpcHw+wGWOEeCyP7SnZZnt96DZG44AJkV+/Ml2q5HqV71+DXJaPQEL0pprOnpz5lvw03I9ShXcu92bXfCdBjrk1jqfDW2HFQrnM8LU+tRcZI0Eux6HuVeUoYCmBlo8orW8YtMpnp8jCchyrHyQ8j8ytFNLRE/HupUd/ISBkItQPCUkE6WDdJ/tiLgIGpdj0XAQSGAqPBwA== 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=HVGsAnLXWc0C9rgG4aivKgqwGYGYfCTZ8Zy68GeIb/c=; b=h2ulXkgxcdGCgkwabF4WjWfEYuMpf/EzyOT5z42mzFaKRIjT8Fm0g4pucDiGoyGjZDYfr3ibJolAWtyvfOFDHM/nxrgEEy1qCCh/BZ+rjyex3MrFJill/qSxXRWuIzbSly9VjYoQMKbOyj30q9/sqThRpocUs7XgZmPsrwAZpFhnqPxYxFnEQ5mwSUtufpS5yvyOAxgc/cF8agtUeuBkSf3wnoJGpoHkylMNMhloD/ZDFuAZ0TESq/4BK5wlVLoxRacWgcyhf7k5wXj2/JEq46wEzt8kTgy8/VIrke5SerSUSsqDJ8x6IGKMuBLe0afu/8Yto62UnbelXUqjUw44IQ== 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=HVGsAnLXWc0C9rgG4aivKgqwGYGYfCTZ8Zy68GeIb/c=; b=ssl69xqiaCmp4pZuxtmnerSSupC7MSH7oK405FIfAgeRX1lwBoFRZDZPwd+qZEvFvG3vbn1savKI8H9H9kqr1ilD085KlhENTQfIuX4HlJaEpR7zmEDRJwnVuwu9Q2rK9v/5Xdy8EP5mphURl7p7pa8rtsAwJ9JbT4IjpcycgH4= Received: from VI1PR08MB4622.eurprd08.prod.outlook.com (2603:10a6:803:bc::17) by VE1PR08MB4926.eurprd08.prod.outlook.com (2603:10a6:802:a9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.24; Wed, 21 Oct 2020 04:55:46 +0000 Received: from VI1PR08MB4622.eurprd08.prod.outlook.com ([fe80::e9cc:b2a4:eb77:980b]) by VI1PR08MB4622.eurprd08.prod.outlook.com ([fe80::e9cc:b2a4:eb77:980b%7]) with mapi id 15.20.3477.028; Wed, 21 Oct 2020 04:55:46 +0000 From: Dharmik Thakkar To: "Wang, Yipeng1" CC: "Gobriel, Sameh" , "Richardson, Bruce" , "dev@dpdk.org" , nd Thread-Topic: [PATCH v5 4/4] test/hash: add tests for integrated RCU QSBR Thread-Index: AQHWpvv2KhFeBZhELUCpjfJ3ZAZo5qmhbbCAgAARNoA= Date: Wed, 21 Oct 2020 04:55:46 +0000 Message-ID: <4AED7E2F-30CC-4753-8DC7-04422DE8D58D@arm.com> References: <20201019163519.28180-1-dharmik.thakkar@arm.com> <20201020161301.7458-1-dharmik.thakkar@arm.com> <20201020161301.7458-5-dharmik.thakkar@arm.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Authentication-Results-Original: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [72.182.82.154] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3062ce70-d52a-4cce-b7d6-08d8757d976e x-ms-traffictypediagnostic: VE1PR08MB4926:|DB7PR08MB3737: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:8273;OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: may58nFC0QVdrA4UV9ZkK0bGZp00nnhDbH/B1k07jzWYAZMeshTfEGexpNY4TS+ADNk1CZCAdtA08VoPyqXSV5/W+rjP3y6qCbGdhaJu5cgaaGAsWMWbs2XId7B/IexjrEHEPh2w9mLdYUewPDKrnMO7bqPyKLDllvHj3rxEpwU3As1DGNTDm3/xqd1diuvj/NYjAJm9aANyZT720X98tU3X6cA0SeWBCHS/9wd4btxZTZURILmqcpod1sUfTSNN319k3elnEptRU2EEiQHtJ4mt6mdV4B63dlM1u3DQiCAw6lKLkAzau0vcWKSRMvuJ5SpggYtotnZvmoCUd0T3AQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB4622.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(396003)(346002)(39860400002)(366004)(376002)(8676002)(36756003)(64756008)(6512007)(4326008)(186003)(6916009)(8936002)(6486002)(26005)(2616005)(478600001)(6506007)(33656002)(5660300002)(76116006)(86362001)(53546011)(66476007)(2906002)(91956017)(66946007)(316002)(66556008)(66446008)(54906003)(71200400001)(83380400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: A9PRdSqA9Xh5WrS9ERzT2fHfelIzn7+O5hekeL8QF3gZdO6vqIGFemTo8+F1p9uGF9yIxcRS+kfY1jPXGb2BkU9JvDil9ztf/i8HqIFd2x3qaCCe1b5Q0wcDW0wEG9bMBSJpgTRpoKPyVVanjCCrDJYBX2O2G/DWaxFAV5Txcf0r38Oi3zxNVBde6EB2o8fvlpzSyhWeOmDjp7jD+j4CnPiwclTp8LIVFdwtOTrvn0yB37ZvbjYKDcLET9cym1I4HXrhba13bda4QMA6XRwlYNucP2NF1P0iCeoRa0Yap+jagjnPE1lTc9B6ADEpg+FoDlvrsl+S29ezjYkx98aqidyt5XDxONtDPk4JG6Fz1s9XRnn9WYm6PONNQ7fwwffWAvCPuS/+bXcSxLXpsqXDd4SKjqi74mU+VArypTzKh70oVR6uC/zyIJ2Xhmu5HVGw2Vt4lI8TOYIbou/su7h+dkjq+SlhKqzzxjlvbdjvLbC/kV5KzPZn6AcgML86DD71El2UbeLBpJlaPj0EC6OMD8Ue6uAB8BAMyu1VhFsJsYCCeleu11dv00+PFHZj7tCEB/hbphpOaBJPdWNSQiTPFQzFlJRaHjDLO6BdIPWcZgr1wmz1Z+REKpECvTc5Vk834GeD5pMFGUFf9iHwjRa0wg== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4926 Original-Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: e0d4b48d-d114-462c-c6bd-08d8757d929f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vZMopg1rgU5hckXdnvgD8EpUIWhsKUFpDsJ9W4IPT0PRRHVvVrBG9eSav1NSf5l4MdJgNn8YzGUhzdH8m/VCel8f5fM0PJmpOI9lilUHKXDpBPPRSiAbS0UhdatNLQHbqPkt2f7zJTj9SsTX8dvyaybJpKTk1Efj0dzAMRaQ6grUxuKSYhT/lk7WOGwVlnJZ+VX7TgUXAIamOU4G3v0hoMj6Avo+4jJ1P8Ig/q4Y8k9BXk2IvzLRfGqnIG7tN2bSek8AckT3FdSwi0Ah4U4HLa4uwA7xDCfBRYnZQV1YvgRi2ZM2ya3GNg8RCo+zOJMYPsd1YXaoPqNd5xbqV6XYk+NugdRCNtY9C65PdQ2Ab1BZtAQT1NFqFXVmED0ANVwDQpd0O5suG306U3swTxRkbA== 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; SFS:(4636009)(376002)(39860400002)(136003)(346002)(396003)(46966005)(6506007)(53546011)(54906003)(26005)(2906002)(6486002)(336012)(86362001)(33656002)(8936002)(8676002)(186003)(6512007)(36756003)(316002)(2616005)(4326008)(478600001)(6862004)(70206006)(70586007)(5660300002)(81166007)(356005)(47076004)(83380400001)(82740400003)(82310400003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2020 04:55:54.4827 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3062ce70-d52a-4cce-b7d6-08d8757d976e 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: DB5EUR03FT020.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3737 Subject: Re: [dpdk-dev] [PATCH v5 4/4] test/hash: add tests for integrated RCU QSBR 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" > On Oct 20, 2020, at 10:54 PM, Wang, Yipeng1 wrot= e: >=20 >> -----Original Message----- >> From: Dharmik Thakkar >> Sent: Tuesday, October 20, 2020 9:13 AM >> To: Wang, Yipeng1 ; Gobriel, Sameh >> ; Richardson, Bruce >> Cc: dev@dpdk.org; nd@arm.com; Dharmik Thakkar >> >> Subject: [PATCH v5 4/4] test/hash: add tests for integrated RCU QSBR >>=20 >> Add functional and performance tests for the integrated RCU QSBR. >>=20 >> Suggested-by: Honnappa Nagarahalli >> Signed-off-by: Dharmik Thakkar >> Reviewed-by: Ruifeng Wang >> --- >> app/test/test_hash.c | 390 ++++++++++++++++++++++++- >> app/test/test_hash_readwrite_lf_perf.c | 170 ++++++++++- >> 2 files changed, 556 insertions(+), 4 deletions(-) >>=20 >> diff --git a/app/test/test_hash.c b/app/test/test_hash.c index >> 990a1815f893..22b47b3e7728 100644 >> --- a/app/test/test_hash.c >> +++ b/app/test/test_hash.c >> @@ -52,7 +52,7 @@ static uint32_t hashtest_key_lens[] =3D {0, 2, 4, 5, 6= , 7, 8, 10, >> 11, 15, 16, 21, >> } \ >> } while(0) >>=20 >> -#define RETURN_IF_ERROR_FBK(cond, str, ...) do { >> \ >> +#define RETURN_IF_ERROR_FBK(cond, str, ...) do { \ >> if (cond) { \ >> printf("ERROR line %d: " str "\n", __LINE__, ##__VA_ARGS__); >> \ >> if (handle) rte_fbk_hash_free(handle); \ >> @@ -60,6 +60,20 @@ static uint32_t hashtest_key_lens[] =3D {0, 2, 4, 5, = 6, 7, 8, >> 10, 11, 15, 16, 21, >> } \ >> } while(0) >>=20 >> +#define RETURN_IF_ERROR_RCU_QSBR(cond, str, ...) do { >> \ >> + if (cond) { \ >> + printf("ERROR line %d: " str "\n", __LINE__, ##__VA_ARGS__); >> \ >> + if (rcu_cfg.mode =3D=3D RTE_HASH_QSBR_MODE_SYNC) { >> \ >> + writer_done =3D 1; \ >> + /* Wait until reader exited. */ \ >> + rte_eal_mp_wait_lcore(); \ >> + } \ >> + if (g_handle) rte_hash_free(g_handle); \ >> + if (g_qsv) rte_free(g_qsv); \ >> + return -1; \ >> + } \ >> +} while(0) >> + >> /* 5-tuple key type */ >> struct flow_key { >> uint32_t ip_src; >> @@ -1801,6 +1815,365 @@ test_hash_add_delete_jhash_3word(void) >> return ret; >> } >>=20 >> +static struct rte_hash *g_handle; >> +static struct rte_rcu_qsbr *g_qsv; >> +static volatile uint8_t writer_done; >> +struct flow_key g_rand_keys[9]; >> +/* >> + * rte_hash_rcu_qsbr_add positive and negative tests. >> + * - Add RCU QSBR variable to Hash >> + * - Add another RCU QSBR variable to Hash >> + * - Check returns >> + */ >> +static int >> +test_hash_rcu_qsbr_add(void) >> +{ >> + size_t sz; >> + struct rte_rcu_qsbr *qsv2 =3D NULL; >> + int32_t status; >> + struct rte_hash_rcu_config rcu_cfg =3D {0}; >> + >> + struct rte_hash_parameters params; >> + >> + printf("\n# Running RCU QSBR add tests\n"); >> + memcpy(¶ms, &ut_params, sizeof(params)); >> + params.name =3D "test_hash_rcu_qsbr_add"; >> + params.extra_flag =3D RTE_HASH_EXTRA_FLAGS_RW_CONCURRENCY_LF >> | >> + >> RTE_HASH_EXTRA_FLAGS_MULTI_WRITER_ADD; >> + g_handle =3D rte_hash_create(¶ms); >> + RETURN_IF_ERROR_RCU_QSBR(g_handle =3D=3D NULL, "Hash creation >> failed"); >> + >> + /* Create RCU QSBR variable */ >> + sz =3D rte_rcu_qsbr_get_memsize(RTE_MAX_LCORE); >> + g_qsv =3D (struct rte_rcu_qsbr *)rte_zmalloc_socket(NULL, sz, >> + RTE_CACHE_LINE_SIZE, >> SOCKET_ID_ANY); >> + RETURN_IF_ERROR_RCU_QSBR(g_qsv =3D=3D NULL, >> + "RCU QSBR variable creation failed"); >> + >> + status =3D rte_rcu_qsbr_init(g_qsv, RTE_MAX_LCORE); > [Wang, Yipeng] It reminds me that could we hide this function in the rte_= cuckoo_hash.c as well? > I saw most of the rcu related functions are hidden in the hash implementa= tion, it would be less confusing if we hide this one as well. Yes, I think this can be hidden within rte_hash_reset() and rte_hash_rcu_qs= br_add() >=20 >> + RETURN_IF_ERROR_RCU_QSBR(status !=3D 0, >> + "RCU QSBR variable initialization failed"); >> + >> + rcu_cfg.v =3D g_qsv; >> + /* Invalid QSBR mode */ >> + rcu_cfg.mode =3D 2; > [Wang, Yipeng] Any other way rather than hardcode 2 here? Maybe just a la= rge number like 0xff? Yes, I can use 0xxff >=20 >> + status =3D rte_hash_rcu_qsbr_add(g_handle, &rcu_cfg); >> + RETURN_IF_ERROR_RCU_QSBR(status =3D=3D 0, "Invalid QSBR mode test >> +failed"); >> + >> + rcu_cfg.mode =3D RTE_HASH_QSBR_MODE_DQ; > [Wang, Yipeng] This reminds me that if there is an explanation on the dif= ference of the two modes for users to easy to choose? It is available within rte_hash.h > =20 >=20 >> + /* Attach RCU QSBR to hash table */ >> + status =3D rte_hash_rcu_qsbr_add(g_handle, &rcu_cfg); >> + RETURN_IF_ERROR_RCU_QSBR(status !=3D 0, >> + "Attach RCU QSBR to hash table failed"); >> + >> + /* Create and attach another RCU QSBR to hash table */ >> + qsv2 =3D (struct rte_rcu_qsbr *)rte_zmalloc_socket(NULL, sz, >> + RTE_CACHE_LINE_SIZE, >> SOCKET_ID_ANY); >> + RETURN_IF_ERROR_RCU_QSBR(qsv2 =3D=3D NULL, >> + "RCU QSBR variable creation failed"); >> + >> + rcu_cfg.v =3D qsv2; >> + rcu_cfg.mode =3D RTE_HASH_QSBR_MODE_SYNC; >> + status =3D rte_hash_rcu_qsbr_add(g_handle, &rcu_cfg); >> + rte_free(qsv2); >> + RETURN_IF_ERROR_RCU_QSBR(status =3D=3D 0, >> + "Attach RCU QSBR to hash table succeeded where >> failure" >> + " is expected"); >> + >> + rte_hash_free(g_handle); >> + rte_free(g_qsv); >> + >> + return 0; >> +} > <...>