From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id CB1C32B91 for ; Wed, 23 Aug 2017 04:58:56 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP; 22 Aug 2017 19:58:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,415,1498546800"; d="scan'208";a="1209209279" Received: from orsmsx104.amr.corp.intel.com ([10.22.225.131]) by fmsmga002.fm.intel.com with ESMTP; 22 Aug 2017 19:58:53 -0700 Received: from orsmsx157.amr.corp.intel.com (10.22.240.23) by ORSMSX104.amr.corp.intel.com (10.22.225.131) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 22 Aug 2017 19:58:52 -0700 Received: from orsmsx105.amr.corp.intel.com ([169.254.2.21]) by ORSMSX157.amr.corp.intel.com ([169.254.9.80]) with mapi id 14.03.0319.002; Tue, 22 Aug 2017 19:58:52 -0700 From: "Wang, Yipeng1" To: Stephen Hemminger CC: "vincent.jardin@6wind.com" , "Richardson, Bruce" , "Ananyev, Konstantin" , "thomas@monjalon.net" , "dev@dpdk.org" , "Tai, Charlie" , "Gobriel, Sameh" , "Wang, Ren" Thread-Topic: [PATCH 0/7] Add Membership Library Thread-Index: AQHTGtyDxboSVWJa6UulRCgR990jnKKQNk0AgAEGZfA= Date: Wed, 23 Aug 2017 02:58:51 +0000 Message-ID: References: <1503361193-36699-1-git-send-email-yipeng1.wang@intel.com> <20170821210132.5dd74b10@xeon-e3> In-Reply-To: <20170821210132.5dd74b10@xeon-e3> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNThjNzcwZmYtMzFlYy00ZTdmLThiYjktNDc0MjU0N2M1ZDA5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImFibkx4ZDhmN29WV0diZndoblwvMjRxUCtFeVhXTmNSQ3FkK3JXWmlWYUVJPSJ9 x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 0/7] Add Membership Library 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, 23 Aug 2017 02:58:57 -0000 Hi Stephen, Thanks for the comments. We will remove the needless return initialization = in next version. For the unified API concern, we think the current implementation has two be= nefits: 1. It is easier to extend the library with new types of filters without adding a lot of top level APIs every time= . 2. When users switch between different types in their application, they do not need to switch between function cal= ls. They can reuse same code for different types.=20 However, we agree with you that a switch case in the library affects the pe= rformance. We did a quick test and here is the results (cycles/operation): lookup lookup_bulk(16 batch) lookup_multi = lookup_multi_bulk switch_case 50 36 = 57 45 direct call 47 35 = 54 45 There will be 3 cycle difference for non-bulk version lookup. I guess if us= ers usually use bulk version, it maybe not a big concern, but single key lookup indeed slower. If you think the benefi= t we mentioned does not outweigh the performance slowdown, we would like to make the change. We also considered using function pointers to get rid of switch case, but i= t will be unfriendly to the multi-process usages.=20 Please comments. Thanks Yipeng > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Monday, August 21, 2017 9:02 PM > To: Wang, Yipeng1 > Cc: vincent.jardin@6wind.com; Richardson, Bruce > ; Ananyev, Konstantin > ; thomas@monjalon.net; dev@dpdk.org; Tai, > Charlie ; Gobriel, Sameh = ; > Wang, Ren > Subject: Re: [PATCH 0/7] Add Membership Library >=20 > On Mon, 21 Aug 2017 17:19:46 -0700 > Yipeng Wang wrote: >=20 > > This patch set implements two types of set-summaries, i.e., hash-table > > based set-summary (HTSS) and Vector Bloom Filter (vBF). HTSS supports > > both the non-cache and cache modes. The non-cache mode can incur a > > small chance of false-positives which is the case when the set-summary > > indicates a key belongs to a given set while actually it is not. The > > cache mode can also have false-negatives in addition to > > false-positives. False-negatives means the case when the set-summary > > indicates a key does not belong to a given set while actually it does. > > This happens because cache mode allows new key to evict existing keys. = vBF > only has false-positives similar to the non-cache HTSS. > > However, one can set the false-positive rate arbitrarily. HTSS's > > false-positive rate is determined by the hash-table size and the signat= ure size. >=20 > I don't think it makes sense to merge two different types of tables in = one API. > Especially in DPDK where every cycle counts. You are taking an extra bran= ch on > each lookup. The user of this API is likely to know exactly what type of = objects > and look are desired.