From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0069.outbound.protection.outlook.com [104.47.0.69]) by dpdk.org (Postfix) with ESMTP id 6BE615F16 for ; Fri, 26 Oct 2018 07:03:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0MuIxY/gGH/N6pcmcGICqdWKI0uLmK0v5Qzx2uWo+rs=; b=fijkNr1aOFwO5sjSZpUqBGt/o4f7OBizaMgFVsGtL/MR2Y3jQTb+yUMCbV5KBYx5lnu/tirhEQcaprpSAJwi2dFpDttjjR8YRFgewfNQSOlITkry88hvo1EttJGA74gKrNnWR9Ac4rg0lexrHTQv+gEkfQ44jzNJ1eyH0WWy6Tk= Received: from AM6PR08MB3672.eurprd08.prod.outlook.com (20.177.115.29) by AM6PR08MB3557.eurprd08.prod.outlook.com (20.177.114.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.19; Fri, 26 Oct 2018 05:03:57 +0000 Received: from AM6PR08MB3672.eurprd08.prod.outlook.com ([fe80::c1a0:51bf:cd33:2b27]) by AM6PR08MB3672.eurprd08.prod.outlook.com ([fe80::c1a0:51bf:cd33:2b27%5]) with mapi id 15.20.1250.032; Fri, 26 Oct 2018 05:03:56 +0000 From: Honnappa Nagarahalli To: Yipeng Wang , "bruce.richardson@intel.com" CC: "stephen@networkplumber.org" , "dev@dpdk.org" , "sameh.gobriel@intel.com" Thread-Topic: [PATCH v3 3/6] test/hash: test more corner cases in unit test Thread-Index: AQHUbNHwPMKiJ1OYXE20a10yVaSabqUw+K/Q Date: Fri, 26 Oct 2018 05:03:56 +0000 Message-ID: References: <1540404570-102126-1-git-send-email-yipeng1.wang@intel.com> <1540494678-64299-1-git-send-email-yipeng1.wang@intel.com> <1540494678-64299-4-git-send-email-yipeng1.wang@intel.com> In-Reply-To: <1540494678-64299-4-git-send-email-yipeng1.wang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Honnappa.Nagarahalli@arm.com; x-originating-ip: [217.140.111.135] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM6PR08MB3557; 6:Z7PSLqhRQb2j8eRi1QmVfkNSm13thz8tjV8Ldw/+EOcVhe+gOzaRxRSVEz0O2Ub903TOx7fjaj9OFjtUnpQdi0NXJz9eQ3fXj5ypKAI1ri5yED28rZMrTurkh1AuyBUnWcAQjaQ7QVbNd6D6b5L5th5oMYCRS7D0MPk/jYzvPnKADRMh5A65NNytgbNnsez3FXHpkbJFWlVeaFqm/7edsXLr9Ft4LF9u0BB6vRDWhz+9NHNUWab5ts+8clzvzDI2sg2n9JqdzNmFg3UFNXK8T6XXuCY77U6HgAGlSYJc+wPpO67GmeNJUqz20N89Bh60S/6pA/F31HF2BokeBfLBADPsulC7/6OuwVMeMYnbxpcqrRl12jz/Illsh9UVKF8cozNGp3NPem1LdQ6DV+5uPC82lq4YsQvKZYbWmZcyG1Kya9sTgV0KfmtiOTmkWVM8QR+W1K4Dh/Ehs3O9yH3L7w==; 5:KS0YBHhtnMXRcDeC8bollEGLbNyZ+Hi9T+ZVx9QpTwcNd6IELFDFuJHkCiFLGii6xYBexFivYCpRdSyY8xqpGO43qP4NbUVoveFCdN4TnV/Cn8CifdQGLzURxQc8AmWwqyy8EC5nDMIzRnAOI1YAIAzA0oObOx7ED2/bcRoT7P0=; 7:+4linPkrTje2IA1VA5whg2pD4eEErTtNPrcm2RWWsypWkOIOPaaUzOdYgaym8EWHaCa3GzFzojdbI6bzZalFkGiFdBCIjB9OnkZEkzz5VIcpzzORmFOK40eNQexq3VM5NLPKKwmpiPgylYeeh6T+Hg== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 105d19c6-5c44-4fb2-fd04-08d63b006f17 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM6PR08MB3557; x-ms-traffictypediagnostic: AM6PR08MB3557: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231355)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:AM6PR08MB3557; BCL:0; PCL:0; RULEID:; SRVR:AM6PR08MB3557; x-forefront-prvs: 083751FCA6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(376002)(346002)(136003)(39860400002)(189003)(199004)(40434004)(97736004)(5024004)(14444005)(5250100002)(110136005)(9686003)(33656002)(256004)(7696005)(8676002)(446003)(6436002)(81156014)(81166006)(66066001)(54906003)(11346002)(26005)(74316002)(71190400001)(476003)(6506007)(55016002)(25786009)(14454004)(4326008)(186003)(72206003)(76176011)(2501003)(102836004)(229853002)(68736007)(2906002)(6246003)(5660300001)(71200400001)(316002)(86362001)(486006)(2900100001)(105586002)(478600001)(3846002)(6116002)(7736002)(53936002)(305945005)(8936002)(99286004)(106356001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR08MB3557; H:AM6PR08MB3672.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 4FXmwUPMShANkCilCkrMk8uiqFJrcQw+ceRxap7P2O/kdqn9xfmxYuZx1Y1OKX0alhC7HT5dGI9ujXjXXZyVaaqGiuoGOVBXr2Mp3cCmTFomTXOZbFKjgE7ivuR25aAVBBSmgvcpEalKpD0nIvHyE5NgYR+tmtf1QNPeNfR1UBZXr5KIr9M4enVfa5U4O20jjiIu/bQfHzOEMSKpikq8iwVD0KQI38h604t/Y8AZtv3vJTBVzmza09/lBDpSzsqocyzP9lU0aIqicve5b1eOr0tK/zHgDGa+StGZM6Pt1VPeLQOn97sKdaIszoPvENIFWRysxIPbf2QC0aZ3m32MZd9P5MLlAqVkDuKVup7J76w= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 105d19c6-5c44-4fb2-fd04-08d63b006f17 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Oct 2018 05:03:56.7823 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3557 Subject: Re: [dpdk-dev] [PATCH v3 3/6] test/hash: test more corner cases in unit test 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: , X-List-Received-Date: Fri, 26 Oct 2018 05:03:59 -0000 > > This commit improves the readwrite unit test to cover more corner cases a= nd > reduces the testing time by reducing the total key count. > > Signed-off-by: Yipeng Wang > Acked-by: Bruce Richardson > --- > test/test/test_hash_readwrite.c | 31 +++++++++++++++++++++++++------ > 1 file changed, 25 insertions(+), 6 deletions(-) > > diff --git a/test/test/test_hash_readwrite.c b/test/test/test_hash_readwr= ite.c > index a8fadd0..a45c669 100644 > --- a/test/test/test_hash_readwrite.c > +++ b/test/test/test_hash_readwrite.c > @@ -18,8 +18,8 @@ > > #define RTE_RWTEST_FAIL 0 > > -#define TOTAL_ENTRY (16*1024*1024) > -#define TOTAL_INSERT (15*1024*1024) > +#define TOTAL_ENTRY (5*1024*1024) > +#define TOTAL_INSERT (4.5*1024*1024) > > #define NUM_TEST 3 > unsigned int core_cnt[NUM_TEST] =3D {2, 4, 8}; @@ -59,8 +59,10 @@ > test_hash_readwrite_worker(__attribute__((unused)) void *arg) > uint64_t i, offset; > uint32_t lcore_id =3D rte_lcore_id(); > uint64_t begin, cycles; > -int ret; > +int *ret; > > +ret =3D rte_malloc(NULL, sizeof(int) * > +tbl_rw_test_param.num_insert, 0); This memory needs to be freed at the end of this function > for (i =3D 0; i < rte_lcore_count(); i++) { > if (slave_core_ids[i] =3D=3D lcore_id) > break; > @@ -79,13 +81,30 @@ test_hash_readwrite_worker(__attribute__((unused)) > void *arg) > tbl_rw_test_param.keys + i) > 0) > break; > > -ret =3D rte_hash_add_key(tbl_rw_test_param.h, > +ret[i - offset] =3D rte_hash_add_key(tbl_rw_test_param.h, > tbl_rw_test_param.keys + i); > -if (ret < 0) > +if (ret[i - offset] < 0) > +break; > + > +/* lookup a random key */ > +uint32_t rand =3D rte_rand() % (i + 1 - offset); > + > +if (rte_hash_lookup(tbl_rw_test_param.h, > +tbl_rw_test_param.keys + rand) !=3D ret[rand]) > +break; > + > + > +if (rte_hash_del_key(tbl_rw_test_param.h, > +tbl_rw_test_param.keys + rand) !=3D ret[rand]) > +break; > + > +ret[rand] =3D rte_hash_add_key(tbl_rw_test_param.h, > +tbl_rw_test_param.keys + rand); > +if (ret[rand] < 0) > break; > > if (rte_hash_lookup(tbl_rw_test_param.h, > -tbl_rw_test_param.keys + i) !=3D ret) > +tbl_rw_test_param.keys + rand) !=3D ret[rand]) > break; > } > > -- > 2.7.4 IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.