From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20068.outbound.protection.outlook.com [40.107.2.68]) by dpdk.org (Postfix) with ESMTP id ADD2C1B39E for ; Wed, 3 Oct 2018 19:59:23 +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=ocR4Yz9yjc4P4z5caK5ufJEkNAvr80SXAm5FtKisUaA=; b=A88kk96+H+v4/o+k2t+zYR+QBPPLnBuPnuBcoBYQhSttpQ2AnDwHh3vtiIB1P5j4lsZOaUVn5qOTnpJ7ldJTXp4R3TEhN2Fy6Q3eUEt+NdQkI6UUQC446JgPdcPpKy9NbRtDAtzktck1L1C2E/Yp2TWxlg11kLMZ+vkRDaouxa8= Received: from AM6PR08MB3672.eurprd08.prod.outlook.com (20.177.115.29) by AM6PR08MB3238.eurprd08.prod.outlook.com (52.135.164.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.21; Wed, 3 Oct 2018 17:59:22 +0000 Received: from AM6PR08MB3672.eurprd08.prod.outlook.com ([fe80::f423:e46a:a03c:e928]) by AM6PR08MB3672.eurprd08.prod.outlook.com ([fe80::f423:e46a:a03c:e928%2]) with mapi id 15.20.1185.026; Wed, 3 Oct 2018 17:59:22 +0000 From: Honnappa Nagarahalli To: "Wang, Yipeng1" , Stephen Hemminger CC: "Richardson, Bruce" , "Ananyev, Konstantin" , "dev@dpdk.org" , "Gobriel, Sameh" , nd Thread-Topic: [dpdk-dev] [PATCH v4 2/4] hash: add extendable bucket feature Thread-Index: AQHUW0LQKEGj4Nrz2EuU9OqDhdaG5A== Date: Wed, 3 Oct 2018 17:59:22 +0000 Message-ID: References: <1537993618-92630-1-git-send-email-yipeng1.wang@intel.com> <1538155426-145177-1-git-send-email-yipeng1.wang@intel.com> <1538155426-145177-3-git-send-email-yipeng1.wang@intel.com> <20181003080811.7c1258bc@xeon-e3> In-Reply-To: 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; AM6PR08MB3238; 6:Cjm1mPqsqTE6HSYmwXUm9hr2uhModUDEpHJbyQ0I0BSzNZCye1A9G4NHcTCDlmhfIMgk2ZBTlrkM0FhZtMwRZ5LcBwwOwPHE01rTtBGF3UgFkJu5ab6nkYn66dstpUALqMSkUtho/9nXgyYEXxdQuDFHfQA5pAn4sbTKDYHRa479Qeh+B1YAjCEkgaIdzrKe7pYiq2Y2IHI4wRvIHj4gV0a0v0uq14rfDyl1FvkHU1x2CDchM1T7x860bEri+L0LZ9LKTIG6uEq9ZSYcEfaKa4l8ZWLyt3HGASeNppG9q4QaO0/FjqgftYrN1HPepB4JbLZH1IF1EzNzf7809l0vsHl5sSFCo6ctnMAZbI6MPF2PLXHlNkbmna7rIc4KqBtoY7g5BLPtxyFK26UIMVqCjGerea3sPz/6FLVXNiXJ0lno6QUSIKzIZrISBCjDdEVrgh+/dKQsZzEFb2UGFIFssw==; 5:vzRWpXl1IIp7PeDuQNEvZGPlZbqhsNQQf+iMl4vTx0mDbYxFY3tQFrepUAeyE4jiKF/08IG1clu1II1Qz1yEyVYaTh6BUrV+uWVTV4AbpQTuqGpyX1mfhkLTKkOiTiM+bx3q+59o0N1/cgdH1PKBdbqaGjZAcdQ35BbRrw7kA7w=; 7:me1YoDfsQNmFDKThUxFg/A2iGORKY4yhuMlArWfyv0RxpIuSm/4Pk4hp155LOlejdLASRsmOsdqIl9WN3U/xyUMsG8OmfhQhrOo29ADG2clML1nJ5dFCmrG6DiirxqkL3gxNGpti5W8X01jFcJsEXVww9v2AHLKZxnyxBSUbdrGrrnZH5tMyQ7o+kVWEcXx4UtwqDdTBupixncOVDVswmaDwV+Hzj+dX5rOoc5AB7FqR/IYYY/OiirzcH+sBqs7H x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 885c7328-2cd4-4322-288b-08d62959f2da x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM6PR08MB3238; x-ms-traffictypediagnostic: AM6PR08MB3238: nodisclaimer: True 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)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(201708071742011)(7699051); SRVR:AM6PR08MB3238; BCL:0; PCL:0; RULEID:; SRVR:AM6PR08MB3238; x-forefront-prvs: 0814A2C7A3 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39860400002)(396003)(136003)(346002)(13464003)(189003)(199004)(5250100002)(68736007)(14444005)(256004)(25786009)(33656002)(97736004)(66066001)(2900100001)(7736002)(305945005)(74316002)(99286004)(476003)(486006)(446003)(11346002)(86362001)(26005)(81156014)(81166006)(8676002)(8936002)(186003)(102836004)(7696005)(6506007)(6436002)(53936002)(9686003)(71200400001)(71190400001)(54906003)(105586002)(110136005)(76176011)(106356001)(55016002)(93886005)(316002)(4326008)(2906002)(14454004)(72206003)(478600001)(229853002)(6246003)(6116002)(5660300001)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR08MB3238; 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: 8OaDgEw2ywaHSr01MRkRg0Os813ydq7juvK59LCgU2m+wHgWDX91x8M79ALW5ZvLfSsnB4jv+Ar3Ot/slheHcAmHRhdhljSFOw3/vjDeJ+lXsS2LeREgM7gtUmdGvxGbDjtdNviKFlDmoDrsJcJS9Il3U10T0en2sLKzqs10FCaxJmrv0vn6EQXuAQZCJebe01t+x2v0dyTkWSUIboEZp6fau/5oxfGGd76hUm/R1P3Y+VAu/yI6uDLmXU70jT0qHeE4ErQb4VqIbtQpNF6m0KrzG/o9CB39Du7jpOkZLJHOSl4E50fTwJnb7fzJg0LUURpKcjzvde9nO2VOqqzqFHyY0EjWMl871u94uzFNwxM= 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: 885c7328-2cd4-4322-288b-08d62959f2da X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2018 17:59:22.2090 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3238 Subject: Re: [dpdk-dev] [PATCH v4 2/4] hash: add extendable bucket feature 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: Wed, 03 Oct 2018 17:59:23 -0000 >=20 > >-----Original Message----- > >From: Stephen Hemminger [mailto:stephen@networkplumber.org] > >On Fri, 28 Sep 2018 10:23:44 -0700 > >Yipeng Wang wrote: > > > >> + /* clear free extendable bucket ring and memory */ > >> + if (h->ext_table_support) { > >> + memset(h->buckets_ext, 0, h->num_buckets * > >> + sizeof(struct > rte_hash_bucket)); > >> + while (rte_ring_dequeue(h->free_ext_bkts, &ptr) =3D=3D 0) > >> + rte_pause(); > > > >Pause is much to short. Maybe nanosleep or sched_yield()? >=20 > Hmm.. As a second thought, maybe we don't need any pause/sleep here? >=20 > It is not a waiting loop and in multithreading case it is in the writer l= ock so > this thread Should be the only thread operating this data structure. >=20 > What do you think? Yes, this is a single thread use case. This is resetting the ring. >=20 > BTW Honnappa, in the lock free implementation, is hash_reset protected? > We should indicate in the API doc which API is supposed to be protected b= y > user. I do not understand the use case for hash_reset API. Why not call hash_free= and hash_create? But, lock free implementation does not handle hash_reset. I will document i= t in the next version. >=20 > Thanks > Yipeng