From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <yipeng1.wang@intel.com>
Received: from mga17.intel.com (mga17.intel.com [192.55.52.151])
 by dpdk.org (Postfix) with ESMTP id 1BA171B426
 for <dev@dpdk.org>; Wed,  3 Oct 2018 18:53:51 +0200 (CEST)
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga002.jf.intel.com ([10.7.209.21])
 by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 03 Oct 2018 09:53:51 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.54,336,1534834800"; d="scan'208";a="97119017"
Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202])
 by orsmga002.jf.intel.com with ESMTP; 03 Oct 2018 09:53:38 -0700
Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by
 fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS)
 id 14.3.319.2; Wed, 3 Oct 2018 09:53:34 -0700
Received: from fmsmsx151.amr.corp.intel.com ([169.254.7.87]) by
 fmsmsx118.amr.corp.intel.com ([169.254.1.230]) with mapi id 14.03.0319.002;
 Wed, 3 Oct 2018 09:53:34 -0700
From: "Wang, Yipeng1" <yipeng1.wang@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
 "honnappa.nagarahalli@arm.com" <honnappa.nagarahalli@arm.com>
CC: "Richardson, Bruce" <bruce.richardson@intel.com>, "Ananyev, Konstantin"
 <konstantin.ananyev@intel.com>, "dev@dpdk.org" <dev@dpdk.org>, "Gobriel,
 Sameh" <sameh.gobriel@intel.com>
Thread-Topic: [dpdk-dev] [PATCH v4 2/4] hash: add extendable bucket feature
Thread-Index: AQHUWyryts+AUDg3r0GYUiBdhOKjuKUNupHQ
Date: Wed, 3 Oct 2018 16:53:33 +0000
Message-ID: <D2C4A16CA39F7F4E8E384D204491D7A6614EB680@FMSMSX151.amr.corp.intel.com>
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: <20181003080811.7c1258bc@xeon-e3>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
dlp-product: dlpe-windows
dlp-version: 11.0.400.15
dlp-reaction: no-action
x-ctpclassification: CTP_NT
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2ZiYWEyN2ItZWVlNS00NmJjLWEyMTItODEyNWUzYjQxZjM3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoibTdDM0FNY3Q1UktFd2tDWnJPNitLQmRETlRLNFo3ZGhnbXF6a0xrZnRBWExWZ1h4Ym9pNmE2RXY1RDNjRXdWbyJ9
x-originating-ip: [10.1.200.107]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 03 Oct 2018 16:53:52 -0000

>-----Original Message-----
>From: Stephen Hemminger [mailto:stephen@networkplumber.org]
>On Fri, 28 Sep 2018 10:23:44 -0700
>Yipeng Wang <yipeng1.wang@intel.com> 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()?

Hmm.. As a second thought, maybe we don't need any pause/sleep here?

It is not a waiting loop and in multithreading case it is in the writer loc=
k so this thread
Should be the only thread operating this data structure.

What do you think?

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 by user.

Thanks
Yipeng