From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4EE5BA0566; Tue, 17 Mar 2020 18:27:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A2E501C0B7; Tue, 17 Mar 2020 18:27:56 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id C5A531C0B5 for ; Tue, 17 Mar 2020 18:27:54 +0100 (CET) IronPort-SDR: DTKGiSChpN822KFkl+PIF0ohm59O40SMx67zvAcVjs+DaqbWhA5oqzbfFPayEZTWZNp+j9tmNi GUJOX3jUXYXQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Mar 2020 10:27:53 -0700 IronPort-SDR: ojQwOHds69fJDsohUFyZHOO/i2QgZE1x+T+Ar516xms/V0GGpsgJRLy5iQ7dH+3HDH7NsToHOI aaEJOwtCkHzQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,565,1574150400"; d="scan'208";a="233567522" Received: from orsmsx105.amr.corp.intel.com ([10.22.225.132]) by orsmga007.jf.intel.com with ESMTP; 17 Mar 2020 10:27:53 -0700 Received: from orsmsx114.amr.corp.intel.com (10.22.240.10) by ORSMSX105.amr.corp.intel.com (10.22.225.132) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 17 Mar 2020 10:27:53 -0700 Received: from orsmsx104.amr.corp.intel.com ([169.254.4.140]) by ORSMSX114.amr.corp.intel.com ([169.254.8.205]) with mapi id 14.03.0439.000; Tue, 17 Mar 2020 10:27:52 -0700 From: "Wang, Yipeng1" To: "Medvedkin, Vladimir" , "dev@dpdk.org" CC: "Gobriel, Sameh" , "Richardson, Bruce" Thread-Topic: [PATCH 1/2] hash: add hash bulk lookup with hash signatures array Thread-Index: AQHV9hCDAVobkRJivESnNOf7IW4ZwahNEoVg Date: Tue, 17 Mar 2020 17:27:51 +0000 Message-ID: References: <1583757860-375294-1-git-send-email-vladimir.medvedkin@intel.com> In-Reply-To: <1583757860-375294-1-git-send-email-vladimir.medvedkin@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action 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 1/2] hash: add hash bulk lookup with hash signatures array 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Medvedkin, Vladimir > Sent: Monday, March 9, 2020 5:44 AM > To: dev@dpdk.org > Cc: Wang, Yipeng1 ; Gobriel, Sameh > ; Richardson, Bruce > > Subject: [PATCH 1/2] hash: add hash bulk lookup with hash signatures arra= y >=20 > Implement rte_hash_lookup_with_hash_bulk_data() - lookup function with > precomputed hash signatures. >=20 > Signed-off-by: Vladimir Medvedkin > --- > --- a/lib/librte_hash/rte_hash.h > +++ b/lib/librte_hash/rte_hash.h > @@ -528,6 +528,33 @@ rte_hash_lookup_bulk_data(const struct rte_hash > *h, const void **keys, > * Hash table to look in. > * @param keys > * A pointer to a list of keys to look for. > + * @param sig > + * A pointer to a list of precomputed hash values for keys. > + * @param num_keys > + * How many keys are in the keys list (less than > RTE_HASH_LOOKUP_BULK_MAX). > + * @param hit_mask > + * Output containing a bitmask with all successful lookups. > + * @param data > + * Output containing array of data returned from all the successful lo= okups. > + * @return > + * -EINVAL if there's an error, otherwise number of successful lookups= . > + */ > +__rte_experimental > +int > +rte_hash_lookup_with_hash_bulk_data(const struct rte_hash *h, > + const void **keys, hash_sig_t *prim_hash, [Wang, Yipeng] hash_sig_t *sig > + uint32_t num_keys, uint64_t *hit_mask, void *data[]); > + > +/** > + * Find multiple keys in the hash table. [Wang, Yipeng] ...with precomputed hash value array. > + * This operation is multi-thread safe with regarding to other lookup th= reads. > + * Read-write concurrency can be enabled by setting flag during > + * table creation. > + * [Wang, Yipeng] Hi, Vladimir, thanks for the patch! Besides the minor comments above, my major concern is the code duplication = here. It is after all hundred's lines of code that in future if we want to extend= features, we need to modify both function blocks. Have you tried to just do if-else and reuse the current code block, and mea= sure the performance? If that causes performance difference, then we may justify adding the dupli= cation, but we still Need to optimize the software pipelining accordingly.