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 22801A04DD; Wed, 21 Oct 2020 05:54:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 40A29AC79; Wed, 21 Oct 2020 05:54:29 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id B62F8AC79 for ; Wed, 21 Oct 2020 05:54:27 +0200 (CEST) IronPort-SDR: +6R/bBUFyjY8c+8zDE6y5PY9+WOWDf1DTdnL7l8bINw/hbtb3Vv1wffyMDUr6nT0iz9/kSHDdG VwPwbUorfr6w== X-IronPort-AV: E=McAfee;i="6000,8403,9780"; a="252007855" X-IronPort-AV: E=Sophos;i="5.77,400,1596524400"; d="scan'208";a="252007855" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2020 20:54:25 -0700 IronPort-SDR: 2meHOmNrDzIMI6QfSSGnZpklgIzyWeaHZG7oyNQLiu1NNuLpWx7iPyJWXi7+NhckwEMeJXE+2A YlJ27v0ZE2sg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,400,1596524400"; d="scan'208";a="358757281" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by FMSMGA003.fm.intel.com with ESMTP; 20 Oct 2020 20:54:25 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 20 Oct 2020 20:54:25 -0700 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 20 Oct 2020 20:54:24 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 20 Oct 2020 20:54:24 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.173) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 20 Oct 2020 20:54:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gimFVnr3lKSGFBCj9D7uNx+t30yPNEJaEktU1I3VxTw3hbBzUjI1sB3YI52WGa2/Q6iRi40BqNKOu/zAlcIAcjYzZaz7Q7ycQH0IitYs6k8av+XhYGdwp5eZjxK8TdGGIqpATp1EBySTzLIEbU55TNZ6R47PyqI/AkBzpnqJDboMYbxFIqMrkG6tMyd0A1at2xs039Zm0jZgv06WgM9k+WZn3H+RFvj4jMBZ4G63kEGO8ShVItp4KPleWHG/wAnIRwL8vSLAzI03qXWrCr80RP9KjielPppA0Cm6pi3odLncFLe8IwQzbqfrP0AAovlPDjtVCc9BfQvylLSJapfb0g== 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=dkICPV2st83WJ0dSbSEbuWVrlpEEXJuGaK8beGda/8c=; b=eygIQ10UqlieBUVWwxAJ2a2KnR13HaDh9t44BdSS+sggOXl1+0t+t4Grbvp9bQ6DbkGbA2yYJdo1UlxWJt3paSfUYPRIwDarYRgqmZpv93gKl2cJclU1NlxnzIBZDCa1nfXVfZY0NCOU8QZoWlhXlq77efjc48wrtPKn5WZWbsvLyPvrPMvyXOxy6abSYAa4yBBumrm5wJQi1LdmKbKLW1PjyMZRijhwTX33by+h2s5BOOonU0amS5y+mnxkVwZep/aZuwhFQssFkDyulHiH5IrGfqLmcMGhKASRsBC6lgOWcAds7MMFlPpZmTnlgFk3PiN1CuwqzLef8SbQEGDwGg== 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=dkICPV2st83WJ0dSbSEbuWVrlpEEXJuGaK8beGda/8c=; b=TPUXWFSPxllnRntI2P/ySQOdISbv8VbVxT9yrtx+I3Ik7TF1Pp6UGh7S4g0P0lAO5tq/bTK6aJ1D+ea8MStfZiyjSFzuWqPt1YEq45Oi06jeS/Mh8gQDw/pybfFYkJcZ8DOwOMrCKkK0OmMiUpQaWBXDlMKRx330l+94vqB3rKA= Received: from BYAPR11MB3494.namprd11.prod.outlook.com (2603:10b6:a03:86::15) by SJ0PR11MB4781.namprd11.prod.outlook.com (2603:10b6:a03:2d8::14) 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 03:54:10 +0000 Received: from BYAPR11MB3494.namprd11.prod.outlook.com ([fe80::5886:71de:a26f:8060]) by BYAPR11MB3494.namprd11.prod.outlook.com ([fe80::5886:71de:a26f:8060%4]) with mapi id 15.20.3477.028; Wed, 21 Oct 2020 03:54:10 +0000 From: "Wang, Yipeng1" To: Dharmik Thakkar , "Gobriel, Sameh" , "Richardson, Bruce" CC: "dev@dpdk.org" , "nd@arm.com" Thread-Topic: [PATCH v5 4/4] test/hash: add tests for integrated RCU QSBR Thread-Index: AQHWpvwDeRiWkk5SjEiGzdRYuwNzdKmhY+wg Date: Wed, 21 Oct 2020 03:54:09 +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: <20201020161301.7458-5-dharmik.thakkar@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.5.1.3 dlp-product: dlpe-windows authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [108.161.24.24] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a6a59a3d-8c39-40d8-727a-08d87574f776 x-ms-traffictypediagnostic: SJ0PR11MB4781: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NDYxghywM7jgpb4FuDwV71ycIVDk2se7jZ4OCjUMj28Qpl2OW7EFXdFTFIDFnNNz6YtpnjAR7nIK+UGFGnr71l2d6wQbbvlGXnRh/r61+AHY3v8yDXkfsIWBONn/Uynov11vSkZGCErlMdHn2miEHeEASS43eDm9Rc49tlbzHmYQT3RgbW1KJFbVZ0Ax0WH3HF+QfLNNbFrFk9RHS4xN56SU9rRVMBP7PZlwe+oo3Tv8dWPmfRlo1xqSolEFEt2rlQFtfyoHi34xvR1b/+0/2jbnWkcYk13zVXRdUi9lYtN6aJ0GMgIp25sX4zQCQ0dIfRdWjrVX311slfLDq4jHJg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3494.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(366004)(39860400002)(136003)(376002)(4326008)(2906002)(53546011)(66556008)(7696005)(64756008)(55016002)(66446008)(66946007)(86362001)(66476007)(6506007)(76116006)(5660300002)(110136005)(6636002)(9686003)(54906003)(316002)(83380400001)(478600001)(26005)(8676002)(52536014)(71200400001)(33656002)(8936002)(186003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: OLzkslKSFhB6v19+UyvFP2I8AR/nZAKeiyQ/iaSXhhATE2jP+f7ZsDjPKdcrm1dE4brcNRuoFvmbJ7AJEDQrVYAtDKWhbz9i+SUJ7Qg6pZI2Ay8A2Ht7oziwBbtXVtUYSgZTXQvhmnex0SEq/2dmsdMMcso7uI7g0aCCD1CEV6XUrPMf5m5hbc05wg61k32sT2H6ewKiKHbH99+e+lupfsIulmEpu2cGm8M7jtsGX0ZKLm1THZRp6LYWBy2siCNLmMR5oB7IYScPNVrGWvecFLX+x5GDcR8B5y41YTB9jA0L52xl5RN07CgBuOJ83MYhEAYPDapxVKnI6+hkOykHDr5JHbZCcagwtnhSsMvi7pzHIjhHcBl8udJzdkifzjmmo9e0zhD4K84emsTcDhM6oc5sGLbS0yP3fzZNJj05ihaPoBNEbYjcRMEfK3oCNsxnD9n/DAWhWnzLRfxSuTv6CscIwFtN3GfZMre00HoBLnfVoWVkDrqvkqfhaWg8/YMLotH4skgflebSBRNqCsGN3/p6I39p9H9KYgMZuyrcJfezoLUo4+wUQulc3niwWGDayN/gLcDGlnSQFP0SQR5x8/WeFGNSu44RPob/QqkEbktUADVFUJx9uSr/OPtej0x2tAXGFI7YbdMhlTJ6fYCZlg== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3494.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a6a59a3d-8c39-40d8-727a-08d87574f776 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Oct 2020 03:54:10.0426 (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: XNWN389MH0VeH2xy/bdEnlS+9nQj8sHTX9Dlo3m0uHFJ32PUY5U14fbT3S+j2feua1AIh3lLebBK7ZU5pv+ZSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4781 X-OriginatorOrg: intel.com 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" > -----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_cu= ckoo_hash.c as well? I saw most of the rcu related functions are hidden in the hash implementati= on, it would be less confusing if we hide this one as well. > + 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 larg= e number like 0xff? > + 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 diffe= rence 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; > +} <...>