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 4534A5F34 for ; Fri, 16 Mar 2018 15:21:15 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Mar 2018 07:21:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,316,1517904000"; d="scan'208";a="208822648" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by orsmga005.jf.intel.com with ESMTP; 16 Mar 2018 07:21:12 -0700 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.176]) by IRSMSX152.ger.corp.intel.com ([169.254.6.128]) with mapi id 14.03.0319.002; Fri, 16 Mar 2018 14:21:12 +0000 From: "Trahe, Fiona" To: "Verma, Shally" CC: "Athreya, Narayana Prasad" , "Challa, Mahipal" , "Gupta, Ashish" , "dev@dpdk.org" , "ahmed.mansour@nxp.com" , "De Lara Guarch, Pablo" , "Jain, Deepak K" , "Trahe, Fiona" Thread-Topic: [RFC v4 1/1] lib/compressdev: Adding hash support Thread-Index: AQHTm0z2d1qAEvD+okqrqh1FeH/w06POlQdwgAQSqgCAAIJUsA== Date: Fri, 16 Mar 2018 14:21:11 +0000 Message-ID: <348A99DA5F5B7549AA880327E580B4358935AD72@IRSMSX101.ger.corp.intel.com> References: <1517483232-28756-1-git-send-email-shally.verma@caviumnetworks.com> <348A99DA5F5B7549AA880327E580B4358934AD24@IRSMSX101.ger.corp.intel.com> In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNjYyY2MzYmQtOGRkYS00N2MzLTllYjEtZTEyNTU2MGE4ZWU1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6InB4bFhweTRpTCt5MXpuekZ6N0lnZjhvVjNEaEQycVM4d1B4OWVXOStBYkU9In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [RFC v4 1/1] lib/compressdev: Adding hash support 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, 16 Mar 2018 14:21:16 -0000 Hi Shally, //snip//; > >> + /**< window size range in bytes */ > >> + int support_dict; > >> + /** Indicate algo support for dictionary load */ > >[Fiona] I need more info on this - What else is needed on the API to sup= port it? > [Shally] We will need to add an API, say, rte_comp_set_dictionary() to lo= ad pre-set dictionary. > If a particular algorithm implementation supports dictionary load, then a= pp can call this API before starting compression. [Fiona] ok. so maybe submit in a patch separate to hash on github. With any needed APIs. =20 >=20 > > > >> + struct rte_comp_hash_algo_capability *hash_capa; > >> + /** pointer to an array of hash capability struct */ > >[Fiona] Does the hash capability depend on the compression algorithm? > >I'd have thought it's completely independent as it's computed > >on the uncompressed data? > >I suppose the same can be said of checksum. >=20 > [Shally] Ok. I miss to set background here. > Though practically hash can be performed standalone on data but we are pr= oposing it as a feature that can > be performed along with compression and so > is the assumption for crc/adler. Thus , we proposed it as part of compres= sion algo capability. Ex. > Implementation may support Deflate+sha1 but not lzs+sha1. > Do you want to propose hash/checksum as standalone capability on compress= ion API? shouldn't > standalone hash a part of crypto spec? similar is question > for checksum because app can use processor optimized crc/adler library fu= nc, if required. So, I see > standalone hash/checksums as duplicated feature on compression. >=20 > I will issue next patch on github, once we this requirement is resolved. [Fiona] No, I wasn't suggesting as standalone op - just that I thought it a= device had the capability to do hash it could probably do it regardless of which algo is used.=20 But if you think there's a case where a device has deflate+hash capability = and not lzs+sha1 then the hash capability can be per-algo. Based on above can it just be add= ed to the=20 existing feature-flags bitmask? Probably no need for the separate hash and = algo capability structs you were proposing since all capabilities are per-algo. >=20 > >This all seems a bit awkward. > >Would something like this be better: > > > >enum rte_comp_capability_type { > > RTE_COMP_CAPA_TYPE_ALGO, > > RTE_COMP_CAPA_TYPE_CHKSUM, > > RTE_COMP_CAPA_TYPE_HASH > >} > > > >struct rte_comp_algo_capability { > > enum rte_comp_algorithm algo; > > /** Compression Algorithm */ > > uint64_t comp_feature_flags; > > /**< bitmap of flags for compression service features supported with th= is algo */ > > struct rte_comp_param_range window_size; > > /**< window size range in bytes supported with this algo */ > > /* int support_dict; */ > > /** Indicate algo support for dictionary load */ > >}; > > > >struct rte_compressdev_capabilities { > >{ > > rte_comp_capability_type capa_type; > > union { > > struct rte_comp_algo_capability algo_capa, > > int checksum_capa, /* bitmask of supported checksums */ > > int hash_capa, /* bitmask of supported hashes - this could be a str= uct if more data needed */ > > } > >}; > > > >> > >> /** Structure used to capture a capability of a comp device */ > >> struct rte_compressdev_capabilities { > >> - /* TODO */ > >> enum rte_comp_algorithm algo; > >> + /** Compression Algorithm */ > >> + struct rte_comp_algo_capability alg_capa; > >> + /**< Compression algo capabilities */ > >> uint64_t comp_feature_flags; > >> - /**< bitmap of flags for compression service features*/ > >> - struct rte_comp_param_range window_size; > >> - /**< window size range in bytes */ > >> + /**< bitmap of flags for compression service features */ > >> }; > >> + //snip