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 6FE56A0545; Thu, 11 Aug 2022 04:33:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AEEEF40694; Thu, 11 Aug 2022 04:33:26 +0200 (CEST) Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2043.outbound.protection.outlook.com [40.107.102.43]) by mails.dpdk.org (Postfix) with ESMTP id DE0154068E for ; Thu, 11 Aug 2022 04:33:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aV7HB8Bw4gFY9v4Ah+OlwOl4y6v9hDyf47vf2NlH2MsURpJjr3/99C1zKlnMvMP4MbYM3V/6noOOc/264QNJ9wpat/MAUuqtY/i1rzRhUOSh6Uis73bD584Tu8q5sbVg8oLrSmJ5T91SIav5RXc783eMa2Ob7Tzz69+DGK0/vmv+11lR/7HzkLgt6oc9ccFGdprbFhZnzDhohLMXbf6xcVaxdXpQNI12DcSJYAPwFdrK05NfY+Vc2fdu4mFjJYORSsqUvRisQDchbx2n6RMnvFfiZQsSXn6HewD3W6NM81VB/zmT1X00aYuOVbmPH9JrLCVHSFJcKdLqQqY9OFBfAA== 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=xbWlF2BOFmU3HXQ7bd2r/EcU5uxIkbBFSpSvxqlCOtU=; b=g/dX7X5pINL1ZZftg/PWlMpScafd3qLRBzVsOA77GN4AAbyE1dYk9FopkDgt/f5lEiNE3NDV2zT+kQdIB7d5fsF/GlisaiorCDAKCfe2DZahs6xu4DYAjNwoCNMRZr8R1yhCwnJ8S3kTlBhkPtTdzsTGHehGDlD12x5/ujM/pASLoRMU0+JD33ItV/4mN6d+d81d9Xr1gyU/hO/1YnDkrdJRZgmnl3SNZ+7uSwW0CrrgOwOOoFmEXJP8D/gnqozW1ZKGipMXHGpexBsIhnlu6OVG0BYB8DEKTriOepAvk3uCfKOqc7s73+/rc9sxAPbX05a11m4X154zgtTENo+03A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xbWlF2BOFmU3HXQ7bd2r/EcU5uxIkbBFSpSvxqlCOtU=; b=tfNKGxIqC1BqasO1IbYKQ6Xk7ag6x7KuMCEMjhqXHhuY4ox+VQJ22n4ALmoMcDstgGzL5pjwJTPyzZSR2/6A+597GOQZYknZgq8B3pnc+hWqvjfO1JKCx2iRKq979EYA1yYmKiFGSO0emj8j6BJ3w7Ih1348YuVQA49y6PvENKrDtVr7wm4yYnps5ai7YU6+Z9ePJcQSVH/dh6UFDGWVmroEHrjlXbbMi5v/Qdb+AE0wfKZcxuKJtioYL2ffWvjC4gSWirDsHiOCl25D8Dvz35CjLhXCn+NFOEVgZygK48xncaZYevER55f2h8v+ZJd7o9MC8epYlJTRFvAJq113Fg== Received: from CO6PR12MB5396.namprd12.prod.outlook.com (2603:10b6:303:139::8) by MN0PR12MB6031.namprd12.prod.outlook.com (2603:10b6:208:3cd::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.20; Thu, 11 Aug 2022 02:33:23 +0000 Received: from CO6PR12MB5396.namprd12.prod.outlook.com ([fe80::718a:265e:d776:e7e1]) by CO6PR12MB5396.namprd12.prod.outlook.com ([fe80::718a:265e:d776:e7e1%9]) with mapi id 15.20.5525.011; Thu, 11 Aug 2022 02:33:23 +0000 From: Suanming Mou To: Leyi Rong , "yipeng1.wang@intel.com" , "zaoxingliu@gmail.com" , "sameh.gobriel@intel.com" CC: "dev@dpdk.org" Subject: RE: [PATCH 2/2] test/member: add functional and perf tests for sketch Thread-Topic: [PATCH 2/2] test/member: add functional and perf tests for sketch Thread-Index: AQHYrI0zKxKzQyafFkKgYCWtiYFZAa2o+nSw Date: Thu, 11 Aug 2022 02:33:23 +0000 Message-ID: References: <20220810074518.1695013-1-leyi.rong@intel.com> <20220810074518.1695013-3-leyi.rong@intel.com> In-Reply-To: <20220810074518.1695013-3-leyi.rong@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1a23dc18-522c-4e83-9051-08da7b41dcb1 x-ms-traffictypediagnostic: MN0PR12MB6031:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gBamUMKuFw3suTmueY8wso4fcOKGIoc0mVMuxXdjv7z9jL9KhFLfFITme/Iq9dZqhXF+g6Au6wOglRGmrxT3joniM1tb7nJCDzNyFE4wgvPSPfdHFf+tWmSEOak1UPLXWtDBdN/u29/MYPbSJ2Wzkg/Y7PTqn1OQqod7TTDfwDpz/zkQ2PdHldmR7hTj9j4d+GeXv0Wa3V2ByzTzVDY/7osowcKuqo77wXFRLAGpxBea45tSHHe1viw7AMk57ZFzJ0hvIhp/PyVhYqHEUDZ+WRvGUzGdVidFeZH0JkGCUXSc/2S+liTpR0cSiuFUhaqWi5+NYOYQGm6UVLMLeGaO+T6CYHmvNN4ogSah/skXumK70kGjKdnnj6nauIZB4zqV28OakHlJRXFc+EE+/J6TpYNI9cWVSbtXBqtmRwWFBWE4j+rDO0MCRZ96i1eKB8t9SVPizU1YlSy0AoZXf9+f9/+ddkVGUr94ZVI4EB0SZl+GInVMPz38OM3qf40p84g/i8JDdBys+yeQIRkYbu+49SGx7td3p8dbDjygqKacKbMRupWWj7axyG9WVZfLm+vBeCDIIj1kbwPoADTbMShjGqSvgjtXQfi8bbqP5XFKxxX1ucAJo8jfjchQTC/rR2xLtiJElcINtdAvJ8NpdcSodn6oKhsnnhh9Goyg2LCEDMlnI3l0gVQcpboN2n1YJiHDc5new7EXbOwJzWK5VerVqVSD1hz9t/wD9heP1TIfcaUw5YsxFVrczHJ5BQR+lYR/LAtH4ApupC/uyXvcGmCU69TFrQPoqfP6J7dO4Pju6JI0TCmR54gUjQl9n6exKva2 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR12MB5396.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(136003)(396003)(366004)(346002)(39860400002)(376002)(4326008)(83380400001)(6506007)(7696005)(66446008)(64756008)(53546011)(41300700001)(186003)(66556008)(66946007)(66476007)(33656002)(9686003)(316002)(55016003)(76116006)(8676002)(26005)(110136005)(86362001)(122000001)(2906002)(38100700002)(8936002)(38070700005)(478600001)(71200400001)(52536014)(5660300002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?1tjmsby+2spTaOCTEDj1tRUbE4xuQBJB2fG6nZybYxjSNKrZi7OyJriR2gBf?= =?us-ascii?Q?XKPRunLB3iY6TdIBxEZN4yyGrnDrMS6vVlLxhIOUTiHwj8XQwt9GqpTJ0Ghw?= =?us-ascii?Q?19INaMs5GDnyqUPhEOwT52fEm64K0Epz1A/USVNDRb+mSgJvBvYgctgso1mk?= =?us-ascii?Q?EAj9I9l/IA9yYcjG44IGrxcakcvLPnCH9OHvSy9SqM1BdfxhxPIDdGON1+Wr?= =?us-ascii?Q?FhtbAC0zSFM1v9lS4IrSmItaWHjZSs4p8zJOiyHUa5m3KCzzXVDO8ry0b3vE?= =?us-ascii?Q?fnf2Gihi9oh2YgRBzzmmygqh/SQ23UeprkQ9/mhmA4jKikh1IU0TkxyD2gxo?= =?us-ascii?Q?/bwAb16+xlsOanBtzYyBJA/IgdyINhJ6VEoWXKofOQjj2QIF94dZSsOAUtaH?= =?us-ascii?Q?q05gZbCag1CDVZDWAi5pWOQm9k7YFpvz8KNCDt5HhDRuVT/78Si4DOwV33Za?= =?us-ascii?Q?kQE+ExWgvUuDL/oDHPpPRPPa20m9mvHgrHZACL+BPp6Vd5vGZGn4gKbVccCI?= =?us-ascii?Q?wXSEGcB3iC3Ssm803vyjluC5+nutTcWbyhk70ZjQS171F373LQlMxzh/7cMT?= =?us-ascii?Q?f8lVIeCqL2+/qGEmGFP8wO4i18/h+nv6EygYY8tmRrAxl2+DK20HxsMK8nY5?= =?us-ascii?Q?TG0RVw4hTcBZPu4FZqObhldSxIdhbz5W/hePBSr0kko7IgBdYf6RyMCZixzf?= =?us-ascii?Q?PRqPSEOEQveQ+XVxgmn5gD1+zCFSkJvx6cH2IiNN2xUynCFFnUEGxB0vRlsl?= =?us-ascii?Q?FGvrKn0BNU/tgVjvos05q0mBi+zfnGZYW6nnoiYJOuhTASPtpTYk6sTA5zZs?= =?us-ascii?Q?kE9LDdJ6uTEu5lGxltnM3GlBuaL9cIfjbQqL8H7F/MawOYcA1kHiVAUiCbzW?= =?us-ascii?Q?3Ui0MASk+sHS1rKNiNqlNeSQsWTuFdc/E/SwGMU38oMQffv04K02FbK//0+Y?= =?us-ascii?Q?4+/TjH4GVv76/bM6tdsfII6LjYBQJy2cSC3pM7+bG+F90VWpgix/xN6uMsqy?= =?us-ascii?Q?/pjJuA6+QCxIQO41XWqdXxmAkWFfUCTF8V0XmbRAQ44UTuUHm9aaE6qBeoE2?= =?us-ascii?Q?FbEa+zydBBfj+NHdlsENeZXLROmY0mNeAfBoEG8Ntv7XJ4HpJCzn8GiHM3n5?= =?us-ascii?Q?xpVYo3AWA9dNe1R8fQ12wY83fTnqthRGNb3hRG5ETS56lcDTJumEs4L/V0qn?= =?us-ascii?Q?JkcK4WkkvThgrNVoIaus1j8htk/Pyhs7kZQrUtqHzqFxlaaLnNpyWepONUzT?= =?us-ascii?Q?7OYV6NcwF2xkFScIoalBFMsSXDlPVmJkIwth1v8M5MjSOEB32Bu/CMtDmtEq?= =?us-ascii?Q?nqG2pE8HkxSG+00JZRySd99QYCsKUuhd7LFY9Wn8cfg3MnU6IXTRbaMabtzW?= =?us-ascii?Q?QQlwOZJkc9uMnOflmywicErgID18Fwmo/QRNhYIG8cTND8DKSf1FxNBp3RWI?= =?us-ascii?Q?PTcsigwtsZLd/FvxOghG2YBMGrANLjXBSZWzMt3ucxukcnDk+Pj5cTC8d+gv?= =?us-ascii?Q?YQb17zvuQK0My31RwlmX9cmR9QbLqg/0tLWsXgJrrBK4Vw400E7RX52YxyPS?= =?us-ascii?Q?W79OSJdSk2TxDa97lW0N2Ek9Um3Awu6HigkBAj1o?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO6PR12MB5396.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a23dc18-522c-4e83-9051-08da7b41dcb1 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Aug 2022 02:33:23.1424 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vUKTXSpWa12xqQFoZouVspg2oNzF2jGlPfz2L6uGm5OQh++Yle+i+/qfDl+ucgQ2qTbQm8mvnNbqR/JyCEtQkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6031 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 Hi, > -----Original Message----- > From: Leyi Rong > Sent: Wednesday, August 10, 2022 3:45 PM > To: yipeng1.wang@intel.com; zaoxingliu@gmail.com; sameh.gobriel@intel.com > Cc: dev@dpdk.org; Leyi Rong > Subject: [PATCH 2/2] test/member: add functional and perf tests for sketc= h >=20 > This patch adds functional and performance tests for sketch mode of > membership library. >=20 > Signed-off-by: Yipeng Wang > Signed-off-by: Leyi Rong > --- > app/test/test_member.c | 258 ++++++++++++++++++++++++++++++++++++ > app/test/test_member_perf.c | 153 ++++++++++++++++++++- > 2 files changed, 407 insertions(+), 4 deletions(-) >=20 > diff --git a/app/test/test_member.c b/app/test/test_member.c index > 26a712439f..abe59bb9f8 100644 > --- a/app/test/test_member.c > +++ b/app/test/test_member.c > @@ -4,6 +4,7 @@ >=20 > /* This test is for membership library's simple feature test */ >=20 > +#include > #include "test.h" >=20 > #include > @@ -28,6 +29,7 @@ test_member(void) > struct rte_member_setsum *setsum_ht; > struct rte_member_setsum *setsum_cache; struct rte_member_setsum > *setsum_vbf; > +struct rte_member_setsum *setsum_sketch; >=20 > /* 5-tuple key type */ > struct flow_key { > @@ -108,6 +110,21 @@ static struct rte_member_parameters params =3D { > .socket_id =3D 0 /* NUMA Socket ID for > memory. */ > }; >=20 > +/* for sketch definitions */ > +#define TOP_K 10 > +#define HH_PKT_SIZE 16 > +#define SKETCH_ERROR_RATE 0.05 > +#define SKETCH_SAMPLE_RATE 0.001 > +#define PRINT_OUT_COUNT 20 > + > +#define SKETCH_LARGEST_KEY_SIZE 1000000 #define SKETCH_TOTAL_KEY 500 > +#define NUM_OF_KEY(key) {\ > + (unsigned int)ceil(SKETCH_LARGEST_KEY_SIZE / (key + 1)) \ } > + > +void *heavy_hitters[TOP_K]; > + > /* > * Sequence of operations for find existing setsummary > * > @@ -684,6 +701,243 @@ perform_free(void) > rte_member_free(setsum_vbf); > } >=20 > +static void > +print_out_sketch_results(uint64_t *count_result, member_set_t *heavy_set= , > + uint32_t print_num, bool count_byte) { > + uint32_t i; > + > + for (i =3D 0; i < print_num; i++) { > + if (count_byte) > + printf("key %2u, count %8lu, real count %8u, " > + "heavy_set %u, deviation rate [%.04f]\n", > + i, count_result[i], > + (unsigned int)ceil(SKETCH_LARGEST_KEY_SIZE / > (i + 1)) * > + HH_PKT_SIZE, > + heavy_set[i], > + fabs((float)count_result[i] - > (float)NUM_OF_KEY(i) * HH_PKT_SIZE) / > + ((float)NUM_OF_KEY(i) * HH_PKT_SIZE)); > + else > + printf("key %2u, count %8lu, real count %8u, " > + "heavy_set %u, deviation rate [%.04f]\n", > + i, count_result[i], > + (unsigned int)ceil(SKETCH_LARGEST_KEY_SIZE / > (i + 1)), > + heavy_set[i], > + fabs((float)count_result[i] - > (float)NUM_OF_KEY(i)) / > + (float)NUM_OF_KEY(i)); > + } > +} > + > +static int > +sketch_test(uint32_t *keys, uint32_t total_pkt, int count_byte, int > +reset_test) { > + uint32_t i; > + uint64_t result_count[SKETCH_TOTAL_KEY]; > + member_set_t heavy_set[SKETCH_TOTAL_KEY]; > + uint64_t count[TOP_K]; > + int ret; > + int hh_cnt; > + > + setsum_sketch =3D rte_member_create(¶ms); > + if (setsum_sketch =3D=3D NULL) { > + printf("Creation of setsums fail\n"); > + return -1; > + } > + > + for (i =3D 0; i < total_pkt; i++) { > + if (count_byte) > + ret =3D rte_member_add_byte_count(setsum_sketch, > &keys[i], HH_PKT_SIZE); > + else > + ret =3D rte_member_add(setsum_sketch, &keys[i], 1); > + > + if (ret < 0) { > + printf("rte_member_add Failed! Error [%d]\n", ret); I'm afraid rte_member_free(setsum_sketch) is missing here. Same code below with "return -1;" should be checked. > + > + return -1; > + } > + } > + > + for (i =3D 0; i < SKETCH_TOTAL_KEY; i++) { > + uint32_t tmp_key =3D i; > + > + rte_member_query_count(setsum_sketch, (void *)&tmp_key, > &result_count[i]); > + rte_member_lookup(setsum_sketch, (void *)&tmp_key, > &heavy_set[i]); > + } > + > + print_out_sketch_results(result_count, heavy_set, PRINT_OUT_COUNT, > +count_byte); > + > + hh_cnt =3D rte_member_report_heavyhitter(setsum_sketch, heavy_hitters, > count); > + if (hh_cnt < 0) { > + printf("sketch report heavy hitter error!"); > + > + return -1; > + } > + > + printf("Report heavy hitters:"); > + for (i =3D 0; i < (unsigned int)hh_cnt; i++) { > + printf("%u: %lu\t", > + *((uint32_t *)heavy_hitters[i]), count[i]); > + } > + printf("\n"); > + > + if (reset_test) { > + printf("\nEntering Sketch Reset Test Process!\n"); > + rte_member_reset(setsum_sketch); > + > + /* after reset, check some key's count */ > + for (i =3D 0; i < SKETCH_TOTAL_KEY; i++) { > + uint32_t tmp_key =3D i; > + > + rte_member_query_count(setsum_sketch, (void > *)&tmp_key, &result_count[i]); > + rte_member_lookup(setsum_sketch, (void *)&tmp_key, > &heavy_set[i]); > + } > + > + print_out_sketch_results(result_count, heavy_set, > PRINT_OUT_COUNT, > +count_byte); > + > + printf("\nReinsert keys after Sketch Reset!\n"); > + for (i =3D 0; i < total_pkt; i++) { > + if (count_byte) > + ret =3D rte_member_add_byte_count > + (setsum_sketch, &keys[i], > HH_PKT_SIZE); > + else > + ret =3D rte_member_add(setsum_sketch, &keys[i], > 1); > + > + if (ret < 0) { > + printf("rte_member_add Failed! Error [%d]\n", > ret); > + > + return -1; > + } > + } > + > + for (i =3D 0; i < SKETCH_TOTAL_KEY; i++) { > + uint32_t tmp_key =3D i; > + > + rte_member_query_count(setsum_sketch, (void > *)&tmp_key, &result_count[i]); > + rte_member_lookup(setsum_sketch, (void *)&tmp_key, > &heavy_set[i]); > + } > + > + print_out_sketch_results(result_count, heavy_set, > PRINT_OUT_COUNT, > +count_byte); > + > + hh_cnt =3D rte_member_report_heavyhitter(setsum_sketch, > heavy_hitters, count); > + if (hh_cnt < 0) { > + printf("sketch report heavy hitter error!"); > + > + return -1; > + } > + printf("Report heavy hitters:"); > + for (i =3D 0; i < (unsigned int)hh_cnt; i++) { > + printf("%u: %lu\t", > + *((uint32_t *)heavy_hitters[i]), count[i]); > + } > + printf("\n"); > + > + printf("\nDelete some keys!\n"); > + uint32_t tmp_key =3D 0; > + > + rte_member_delete(setsum_sketch, (void *)&tmp_key, 0); > + tmp_key =3D 1; > + rte_member_delete(setsum_sketch, (void *)&tmp_key, 0); > + > + for (i =3D 0; i < SKETCH_TOTAL_KEY; i++) { > + uint32_t tmp_key =3D i; > + > + rte_member_query_count(setsum_sketch, (void > *)&tmp_key, &result_count[i]); > + rte_member_lookup(setsum_sketch, (void *)&tmp_key, > &heavy_set[i]); > + } > + > + print_out_sketch_results(result_count, heavy_set, > PRINT_OUT_COUNT, > +count_byte); > + > + hh_cnt =3D rte_member_report_heavyhitter(setsum_sketch, > heavy_hitters, count); > + if (hh_cnt < 0) { > + printf("sketch report heavy hitter error!"); > + > + return -1; > + } > + printf("Report heavy hitters:"); > + for (i =3D 0; i < (unsigned int)hh_cnt; i++) { > + printf("%u: %lu\t", > + *((uint32_t *)heavy_hitters[i]), count[i]); > + } > + printf("\n"); > + } > + > + rte_member_free(setsum_sketch); > + return 0; > +} > + > +static int > +test_member_sketch(void) > +{ > + unsigned int i, j, index; > + uint32_t total_pkt =3D 0; > + uint32_t *keys; > + int count_byte =3D 0; > + > + for (i =3D 0; i < SKETCH_TOTAL_KEY; i++) > + total_pkt +=3D ceil(SKETCH_LARGEST_KEY_SIZE / (i + 1)); > + > + printf("\nTotal key count [%u] in Sketch Autotest\n", total_pkt); > + > + keys =3D rte_zmalloc(NULL, sizeof(uint32_t) * total_pkt, 0); > + > + if (keys =3D=3D NULL) { > + printf("RTE_ZMALLOC failed\n"); > + return -1; > + } > + > + index =3D 0; > + for (i =3D 0; i < SKETCH_TOTAL_KEY; i++) { > + for (j =3D 0; j < ceil(SKETCH_LARGEST_KEY_SIZE / (i + 1)); j++) > + keys[index++] =3D i; > + } > + > + /* shuffle the keys */ > + for (i =3D index - 1; i > 0; i--) { > + uint32_t swap_idx =3D rte_rand() % i; > + uint32_t tmp_key =3D keys[i]; > + > + keys[i] =3D keys[swap_idx]; > + keys[swap_idx] =3D tmp_key; > + } > + > + params.key_len =3D 4; > + params.name =3D "test_member_sketch"; > + params.type =3D RTE_MEMBER_TYPE_SKETCH; > + params.error_rate =3D SKETCH_ERROR_RATE; > + params.sample_rate =3D SKETCH_SAMPLE_RATE; > + params.extra_flag =3D 0; > + params.top_k =3D TOP_K; > + params.prim_hash_seed =3D rte_rdtsc(); > + int reset_test =3D 0; > + > + printf("Default sketching params: Error Rate: [%f]\tSample Rate: > [%f]\tTopK: [%d]\n", > + SKETCH_ERROR_RATE, SKETCH_SAMPLE_RATE, TOP_K); > + > + printf("\n[Sketch with Fixed Sampling Rate Mode]\n"); > + if (sketch_test(keys, total_pkt, count_byte, reset_test) < 0) Same here, will keys memory allocated by rte_zmalloc be freed in other plac= e? > + return -1; > + > + params.extra_flag |=3D RTE_MEMBER_SKETCH_ALWAYS_BOUNDED; > + printf("\n[Sketch with Always Bounded Mode]\n"); > + if (sketch_test(keys, total_pkt, count_byte, reset_test) < 0) > + return -1; > + > + count_byte =3D 1; > + params.extra_flag |=3D RTE_MEMBER_SKETCH_COUNT_BYTE; > + printf("\n[Sketch with Packet Size Mode]\n"); > + if (sketch_test(keys, total_pkt, count_byte, reset_test) < 0) > + return -1; > + > + count_byte =3D 0; > + params.extra_flag =3D 0; snip