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 5D9A8A04DD; Thu, 22 Oct 2020 00:35:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AD47B9AFF; Thu, 22 Oct 2020 00:34:59 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2040.outbound.protection.outlook.com [40.107.21.40]) by dpdk.org (Postfix) with ESMTP id 511019AFE for ; Thu, 22 Oct 2020 00:34:57 +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=mz2SAUuVTcgQOoolPd3wkGczWUED1TzDSmoMUtJiIs4=; b=5XZoPqqsgAsmBlvUkbnJUf+6EiOmckTxuMfqxj8jdgAxX2IKTVOJGKCYqzYqnAgA/uHpz1c5CQ2SesR7GYeXllHZRK3Tt/+gEwjQeXd4gAzkQsYtm7UJOevNnyI4OtuEy+3iEW+k+XMbJ6NZQwRJysPqv0AztnrfhTaEg0BM8nI= Received: from MR2P264CA0114.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500:33::30) by AM0PR08MB3764.eurprd08.prod.outlook.com (2603:10a6:208:ff::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21; Wed, 21 Oct 2020 22:34:55 +0000 Received: from VE1EUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:500:33:cafe::80) by MR2P264CA0114.outlook.office365.com (2603:10a6:500:33::30) 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 22:34:55 +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 VE1EUR03FT040.mail.protection.outlook.com (10.152.18.210) 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 22:34:54 +0000 Received: ("Tessian outbound c579d876a324:v64"); Wed, 21 Oct 2020 22:34:54 +0000 X-CR-MTA-TID: 64aa7808 Received: from 4a8ab2252f34.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 86793B9E-1075-4E0A-8E68-5C74A234EB52.1; Wed, 21 Oct 2020 22:34:49 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 4a8ab2252f34.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 21 Oct 2020 22:34:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JvDuwRswvjnyKJEVRSAiaXk0ZsQsoAc84wRZpe3epq8OamqRmIsyf0/GIFpdA2YEHElLT1WyRiYdViuYXXiOsB7KJPddjnXDm4xC10SXTc5CoyLpWmeYihkx29Ck/WXQ9gmZyJDV7EZe/tLPcXVZiC2RmYE3/R5cn0lqF7pF60pmFxE39o8/8ssvDxS8woZocs+IoekObO2i7KUHj1TQywi3U5STc7xbHrf44s11NjTvL6qeT5g6Mok/T+u7eienpx4NhxAW6TVrVpzGGfEx55MDDGfMqmqxLdgr1PiE0UmQldmlnL4KSMijEVHPqBNqECTYiwH+Upd0L1a72uVQzw== 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=mz2SAUuVTcgQOoolPd3wkGczWUED1TzDSmoMUtJiIs4=; b=LkcfWiLwMfBMeiPK4UXeoHYGxrq0pj3aIdpVpV+WJltlHbTWVQUy2I7h+7iBhvrTgVXSl9mm1h7av5wawmwoZYdanjaYwfzf8SS1SzIQnQP5GmhxW8YJS9HTkrMHxIhu3JOpLNJ0WUIzt8lLpyhLFS1w1f+nGzZd5jp9yPxLY/B1PEiMWNeLhj45qmgZ0xhTVgansvXuV8lc3bVVCKUJ+67S9AZH512HAhL4KZiJ8ceC/aq54Ajc4oyVeU6R8vNLxMRjES6Bn6x3qToSQ1lSTIlU60gWUQIlBmS5tMbYJYSXnKY8dt9YY32CeG5e0xQUaaET7Pt/gEYklqlAtcV3Ag== 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=mz2SAUuVTcgQOoolPd3wkGczWUED1TzDSmoMUtJiIs4=; b=5XZoPqqsgAsmBlvUkbnJUf+6EiOmckTxuMfqxj8jdgAxX2IKTVOJGKCYqzYqnAgA/uHpz1c5CQ2SesR7GYeXllHZRK3Tt/+gEwjQeXd4gAzkQsYtm7UJOevNnyI4OtuEy+3iEW+k+XMbJ6NZQwRJysPqv0AztnrfhTaEg0BM8nI= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DBAPR08MB5685.eurprd08.prod.outlook.com (2603:10a6:10:1ad::20) 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 22:34:48 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::7814:9c1:781f:475d]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::7814:9c1:781f:475d%4]) with mapi id 15.20.3499.018; Wed, 21 Oct 2020 22:34:48 +0000 From: Honnappa Nagarahalli To: "Wang, Yipeng1" , Dharmik Thakkar , "Gobriel, Sameh" , "Richardson, Bruce" CC: "dev@dpdk.org" , nd , Honnappa Nagarahalli , nd Thread-Topic: [dpdk-dev] [PATCH v5 4/4] test/hash: add tests for integrated RCU QSBR Thread-Index: AQHWpvwDeRiWkk5SjEiGzdRYuwNzdKmhY+wggAFAl1A= Date: Wed, 21 Oct 2020 22:34:48 +0000 Message-ID: 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: x-ts-tracking-id: 3A8ABB48D362D14C903A5CBB432A6570.0 x-checkrecipientchecked: true 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: [107.77.220.172] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 051bed32-e447-4d57-e8c8-08d87611886e x-ms-traffictypediagnostic: DBAPR08MB5685:|AM0PR08MB3764: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: OZlPnFPXFDapBmAmWFl3Oqfwzil3n17JK83xWuLpxSb4iGVLU2oG+qTxhSYqsVcmOTB+KPnxMcLkqJdxZmyYSWE1m3cwarqyn/03+d2ruhCIqgASNJ9n0lFXvwHjcnLUcSyWxJ8E5ItZJucX9j36Za1L7WVUU/CglW4oc87Gdh5iFcdGwxZc9lJd5dwdETxsbWCUiCrQUetzu+zZPg1jXI9qC0j9Ub4Wz1ZYVc5AG8DA4eFWSRNe3ouujkohnBr+J1+ntFOUFN9y81FkkX9vzAaoXnRuDYiBNmfKECiNRwBJXQBTiBhm7MZ1icSYYjGA+lZLLSSTVrOuJBcmSzDS5Q4DiEVbrcudQJosJ7I+G+i9yurz92GyOmOrASIPAKxK/p0muGWOIxufvddB6yR2yA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(346002)(366004)(376002)(39860400002)(396003)(33656002)(8936002)(4326008)(478600001)(86362001)(6506007)(26005)(7696005)(2906002)(9686003)(966005)(186003)(64756008)(55016002)(83380400001)(316002)(54906003)(110136005)(71200400001)(5660300002)(66946007)(76116006)(52536014)(66476007)(66446008)(66556008); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: ny7IRhvmHgraQ2+Jdsf8suG/vO6jDqx6ki/VHVkMlwy3o8AqSqnGygSoAZsVPNbBaoZaT8w76ioOmnyh6bC8hbslreaZyoisgq1lZfvGUa5mNdJSgv3u+POqih/BPaXnDM4z4RjSjUf6KB/qOzcSzJlTYeNU265YYH8VM8e7XEKvyO6OY5BGyQB8tMFGMbmMoAXv//YQZ2SEEd7EvaINsQfupRoN5cjZKtHd5EckEDpx8pZXRgV3OeTXE+wyJNH9OEZgflhXTz2YtN1kwMcSAbVAs/LnY/RBEppR/+QQwdW6PhjhEpGvfsskBQKfDeNzVdKCFP6MwFtx4XmcLt4PrrscvdDLwp+B+Ma2QVqEH3LBCzpj/zsX5xquoELoeaT1hYApii0IiblNOMYYbDgGNVkHV6fD0VXOs8aUsaU3Gcvj50izDoiU+864RQcEkRABWU/LxnSTxSAoCmKdKdhGX98wirouyIOuA07CmoSBVm44Z6YfEnYZ6ljmKap1vZx0uQc/mvWJ4nrfMvQbDlGkwnbgraG9gDcCItc+AB9T2CXAEtS7qFBInlHM8Dd6J86j9iTBaie/mfJ8q5qIiYbT3ocyULaIztRRoUqVxBEY6qJg7ooi/UYnqLMk6vVD+XOltjfhJ2rtUJdLKGByE4WMjg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5685 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: VE1EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: c60f6fc7-b045-495b-37fc-08d8761184aa X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9nHY+LSfSCkBEfxm8mqbv6+e+gZlZZxBc1r1QEcOI9jV9NcpS3Qi75NIFu/y/KCPVUmStTESDAV/Fh6gurFypWe6/gOTAdHIpFO5NnIgkfRgyAaG4DM0g5eKM1eRU3FvQCcQGpXrl1Y+IpN9nVzMa5o5Rvu9xu2pTl/OH8hs7iLtgCl3fxc1A/D/bQqnPY38MabySXaTs6v+idYFKPVRiFdhigWedfEnhR6yFuRzGi3VjN8zzEEhn1MMUdBgAvst2PK0irIJFHS/VNOgfgMMcO92PWgONHooR+n4xmsauBJJehIs/mQiFYtFt0lSiffltuMZkaMQptqdN7klKBYcxwCvpfxGqmchcKWh5NfKYSDEZNoACOBOimvWn3wy7a47uVeaGFte96WW+NCSANzWPZ1q8u/4mQRm7bXrIukaf7ucEI0nzebIQApL0iGRke7917/DKu0uynJblkIIHnr/OxUzS5iEx9PrQqJL7QM/w7mFVjteMMYmIZeKNlVhg39g 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)(136003)(39860400002)(346002)(396003)(376002)(46966005)(8936002)(70206006)(186003)(7696005)(70586007)(82310400003)(4326008)(5660300002)(966005)(6506007)(83380400001)(52536014)(2906002)(478600001)(47076004)(81166007)(33656002)(356005)(82740400003)(36906005)(336012)(26005)(86362001)(55016002)(316002)(54906003)(110136005)(9686003)(2690400003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2020 22:34:54.7267 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 051bed32-e447-4d57-e8c8-08d87611886e 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: VE1EUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3764 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" > > > > Add functional and performance tests for the integrated RCU QSBR. > > > > 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(-) > > > > 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) > > > > -#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) > > > > +#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; > > } > > > > +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. The functionality required for resource reclamation is split into various p= arts [1]. The functionality of creating the RCU variable, initializing it e= tc is left to the application. The application has better knowledge of the = data plane threads, which ones are using the (hash) library etc. Hence it i= s better to keep this in the application. [1] http://doc.dpdk.org/guides/prog_guide/rcu_lib.html#resource-reclamation= -framework-for-dpdk >=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? >=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? >=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; > > +} > <...>