Re: [lng-odp] [RFC, API-NEXT v2 1/1] comp:compression interface

2017-04-19 Thread Dmitry Eremin-Solenikov
On 19.04.2017 17:02, Verma, Shally wrote:
> 
> 
> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of Verma, 
> Shally
> Sent: 19 April 2017 19:30
> To: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>; Shally Verma 
> <shally.ve...@gmail.com>; lng-odp@lists.linaro.org
> Cc: Challa, Mahipal <mahipal.cha...@cavium.com>; Masood, Faisal 
> <faisal.mas...@cavium.com>; Narayana, Prasad Athreya 
> <prasadathreya.naray...@cavium.com>
> Subject: Re: [lng-odp] [RFC, API-NEXT v2 1/1] comp:compression interface
> 
> 
> 
> -Original Message-
> From: Dmitry Eremin-Solenikov [mailto:dmitry.ereminsoleni...@linaro.org]
> Sent: 19 April 2017 17:36
> To: Shally Verma <shally.ve...@gmail.com>; lng-odp@lists.linaro.org
> Cc: Challa, Mahipal <mahipal.cha...@cavium.com>; Masood, Faisal 
> <faisal.mas...@cavium.com>; Narayana, Prasad Athreya 
> <prasadathreya.naray...@cavium.com>; Verma, Shally <shally.ve...@cavium.com>
> Subject: Re: [lng-odp] [RFC, API-NEXT v2 1/1] comp:compression interface
> 
> On 19.04.2017 13:00, Shally Verma wrote:
>> An API set to add compression/decompression support in ODP interface.
>>
>> Signed-off-by: Shally Verma <sve...@cavium.com>
>> Signed-off-by: Mahipal Challa <mcha...@cavium.com>
>> ---
>>  include/odp/api/spec/comp.h | 748
>> 
>>  1 file changed, 748 insertions(+)
>>
>> diff --git a/include/odp/api/spec/comp.h b/include/odp/api/spec/comp.h 
>> new file mode 100644 index 000..65feacf
>> --- /dev/null
>> +++ b/include/odp/api/spec/comp.h
>> @@ -0,0 +1,748 @@
>> +/*
>> + */
>> +
>> +/**
>> + * @file
>> + *
>> + * ODP Compression
>> + */
>> +
>> +#ifndef ODP_API_COMP_H_
>> +#define ODP_API_COMP_H_
>> +#include 
>> +
>> +#ifdef __cplusplus
>> +extern "C" {
>> +#endif
>> +
>> +/** @defgroup odp_compression ODP COMP
>> + *  ODP Compression defines interface to compress/decompress and 
>> +authenticate
>> + *  data.
>> + *
>> + *  Compression here implicilty refer to both compression and decompression.
>> + *  Example, compression algo 'deflate' mean both 'deflate' and 'inflate'.
>> + *
>> + *  if opcode = ODP_COMP_COMPRESS, then it will Compress,
>> + *  if opcode = ODP_COMP_DECOMPRESS, then it will Decompress.
>> + *
>> + *  Current version of Interface allow Compression 
>> +ONLY,Authentication ONLY or
>> + *  both Compression + Auth ONLY sessions.
>> + *
>> + *  Macros, enums, types and operations to utilise compression.
>> + *  @{
>> + */
>> +
>> +/**
>> + * @def ODP_COMP_SESSION_INVALID
>> + * Invalid session handle
>> + */
>> +
>> +/**
>> + * @typedef odp_comp_session_t (platform dependent)
>> + * Comp API opaque session handle
>> + */
>> +
>> +/**
>> + * @typedef odp_comp_compl_t
>> +* Compression API completion event (platform dependent) */
>> +
>> +/**
>> + * Compression API operation mode
>> + */
>> +typedef enum {
>> +/** Synchronous, return results immediately */
>> +ODP_COMP_SYNC,
>> +/** Asynchronous, return results via queue event */
>> +ODP_COMP_ASYNC,
>> +} odp_comp_op_mode_t;
>> +
>> +/**
>> + * Comp API operation type.
>> + * Ignored for Authentication ONLY.
>> + *
>> + */
>> +typedef enum {
>> +/** Compress and/or Compute digest  */
>> +ODP_COMP_OP_COMPRESS,
>> +/** Decompress and/or Compute digest */
>> +ODP_COMP_OP_DECOMPRESS,
>> +} odp_comp_op_t;
>> +
>> +/**
>> + * Comp API authentication algorithm
>> + *
>> + */
>> +typedef enum {
>> +/** No authentication algorithm specified */
>> +ODP_COMP_AUTH_ALG_NULL,
>> +/** ODP_COMP_AUTH_ALG_SHA1*/
>> +ODP_COMP_AUTH_ALG_SHA1,
>> +/**  ODP_COMP_AUTH_ALG_SHA256*/
>> +ODP_COMP_AUTH_ALG_SHA256
>> +} odp_comp_auth_alg_t;
> 
> Why do you need special comp_auth_alg instead of just odp_auth_alg_t?
> Shally - To differentiate that these algorithm are specifically part of 
> compression interface as crypto also has them enumerated.
> Correction - Crypto doesn't enumerate them "as is" in current api-next as I 
> see it.

So, what is particularly 'compression' in them, which is not 'crypto'?

>
>> +/**
>> +* Comp API enumeration for preferred compression level/speed.
>> +*
>> +* trade-of

Re: [lng-odp] [RFC, API-NEXT v2 1/1] comp:compression interface

2017-04-19 Thread Verma, Shally


-Original Message-
From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of Verma, 
Shally
Sent: 19 April 2017 19:30
To: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>; Shally Verma 
<shally.ve...@gmail.com>; lng-odp@lists.linaro.org
Cc: Challa, Mahipal <mahipal.cha...@cavium.com>; Masood, Faisal 
<faisal.mas...@cavium.com>; Narayana, Prasad Athreya 
<prasadathreya.naray...@cavium.com>
Subject: Re: [lng-odp] [RFC, API-NEXT v2 1/1] comp:compression interface



-Original Message-
From: Dmitry Eremin-Solenikov [mailto:dmitry.ereminsoleni...@linaro.org]
Sent: 19 April 2017 17:36
To: Shally Verma <shally.ve...@gmail.com>; lng-odp@lists.linaro.org
Cc: Challa, Mahipal <mahipal.cha...@cavium.com>; Masood, Faisal 
<faisal.mas...@cavium.com>; Narayana, Prasad Athreya 
<prasadathreya.naray...@cavium.com>; Verma, Shally <shally.ve...@cavium.com>
Subject: Re: [lng-odp] [RFC, API-NEXT v2 1/1] comp:compression interface

On 19.04.2017 13:00, Shally Verma wrote:
> An API set to add compression/decompression support in ODP interface.
> 
> Signed-off-by: Shally Verma <sve...@cavium.com>
> Signed-off-by: Mahipal Challa <mcha...@cavium.com>
> ---
>  include/odp/api/spec/comp.h | 748
> 
>  1 file changed, 748 insertions(+)
> 
> diff --git a/include/odp/api/spec/comp.h b/include/odp/api/spec/comp.h 
> new file mode 100644 index 000..65feacf
> --- /dev/null
> +++ b/include/odp/api/spec/comp.h
> @@ -0,0 +1,748 @@
> +/*
> + */
> +
> +/**
> + * @file
> + *
> + * ODP Compression
> + */
> +
> +#ifndef ODP_API_COMP_H_
> +#define ODP_API_COMP_H_
> +#include 
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +/** @defgroup odp_compression ODP COMP
> + *  ODP Compression defines interface to compress/decompress and 
> +authenticate
> + *  data.
> + *
> + *  Compression here implicilty refer to both compression and decompression.
> + *  Example, compression algo 'deflate' mean both 'deflate' and 'inflate'.
> + *
> + *  if opcode = ODP_COMP_COMPRESS, then it will Compress,
> + *  if opcode = ODP_COMP_DECOMPRESS, then it will Decompress.
> + *
> + *  Current version of Interface allow Compression 
> +ONLY,Authentication ONLY or
> + *  both Compression + Auth ONLY sessions.
> + *
> + *  Macros, enums, types and operations to utilise compression.
> + *  @{
> + */
> +
> +/**
> + * @def ODP_COMP_SESSION_INVALID
> + * Invalid session handle
> + */
> +
> +/**
> + * @typedef odp_comp_session_t (platform dependent)
> + * Comp API opaque session handle
> + */
> +
> +/**
> + * @typedef odp_comp_compl_t
> +* Compression API completion event (platform dependent) */
> +
> +/**
> + * Compression API operation mode
> + */
> +typedef enum {
> + /** Synchronous, return results immediately */
> + ODP_COMP_SYNC,
> + /** Asynchronous, return results via queue event */
> + ODP_COMP_ASYNC,
> +} odp_comp_op_mode_t;
> +
> +/**
> + * Comp API operation type.
> + * Ignored for Authentication ONLY.
> + *
> + */
> +typedef enum {
> + /** Compress and/or Compute digest  */
> + ODP_COMP_OP_COMPRESS,
> + /** Decompress and/or Compute digest */
> + ODP_COMP_OP_DECOMPRESS,
> +} odp_comp_op_t;
> +
> +/**
> + * Comp API authentication algorithm
> + *
> + */
> +typedef enum {
> + /** No authentication algorithm specified */
> + ODP_COMP_AUTH_ALG_NULL,
> + /** ODP_COMP_AUTH_ALG_SHA1*/
> + ODP_COMP_AUTH_ALG_SHA1,
> + /**  ODP_COMP_AUTH_ALG_SHA256*/
> + ODP_COMP_AUTH_ALG_SHA256
> +} odp_comp_auth_alg_t;

Why do you need special comp_auth_alg instead of just odp_auth_alg_t?
Shally - To differentiate that these algorithm are specifically part of 
compression interface as crypto also has them enumerated.
Correction - Crypto doesn't enumerate them "as is" in current api-next as I see 
it.
> +
> +/**
> + * Comp API compression algorithm
> + *
> + */
> +typedef enum {
> + /** No algorithm specified.
> + * Means no compression, no output provided.
> + */
> + ODP_COMP_ALG_NULL,
> + /** DEFLATE -
> + * implicit Inflate in case of decode operation.
> + */
> + ODP_COMP_ALG_DEFLATE,
> + /** ZLIB-RFC1950 */
> + ODP_COMP_ALG_ZLIB,
> + /** LZS*/
> + ODP_COMP_ALG_LZS,
> +} odp_comp_alg_t;
> +
> +/**
> + * Comp API session creation return code
> + *
> + */
> +typedef enum {
> + /** Session created */
> + ODP_COMP_SES_CREATE_ERR_NONE,
> + /** Creation failed, no resources */
> + ODP_COMP_SES_CRE

Re: [lng-odp] [RFC, API-NEXT v2 1/1] comp:compression interface

2017-04-19 Thread Verma, Shally


-Original Message-
From: Dmitry Eremin-Solenikov [mailto:dmitry.ereminsoleni...@linaro.org] 
Sent: 19 April 2017 17:36
To: Shally Verma <shally.ve...@gmail.com>; lng-odp@lists.linaro.org
Cc: Challa, Mahipal <mahipal.cha...@cavium.com>; Masood, Faisal 
<faisal.mas...@cavium.com>; Narayana, Prasad Athreya 
<prasadathreya.naray...@cavium.com>; Verma, Shally <shally.ve...@cavium.com>
Subject: Re: [lng-odp] [RFC, API-NEXT v2 1/1] comp:compression interface

On 19.04.2017 13:00, Shally Verma wrote:
> An API set to add compression/decompression support in ODP interface.
> 
> Signed-off-by: Shally Verma <sve...@cavium.com>
> Signed-off-by: Mahipal Challa <mcha...@cavium.com>
> ---
>  include/odp/api/spec/comp.h | 748 
> 
>  1 file changed, 748 insertions(+)
> 
> diff --git a/include/odp/api/spec/comp.h b/include/odp/api/spec/comp.h 
> new file mode 100644 index 000..65feacf
> --- /dev/null
> +++ b/include/odp/api/spec/comp.h
> @@ -0,0 +1,748 @@
> +/*
> + */
> +
> +/**
> + * @file
> + *
> + * ODP Compression
> + */
> +
> +#ifndef ODP_API_COMP_H_
> +#define ODP_API_COMP_H_
> +#include 
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +/** @defgroup odp_compression ODP COMP
> + *  ODP Compression defines interface to compress/decompress and 
> +authenticate
> + *  data.
> + *
> + *  Compression here implicilty refer to both compression and decompression.
> + *  Example, compression algo 'deflate' mean both 'deflate' and 'inflate'.
> + *
> + *  if opcode = ODP_COMP_COMPRESS, then it will Compress,
> + *  if opcode = ODP_COMP_DECOMPRESS, then it will Decompress.
> + *
> + *  Current version of Interface allow Compression 
> +ONLY,Authentication ONLY or
> + *  both Compression + Auth ONLY sessions.
> + *
> + *  Macros, enums, types and operations to utilise compression.
> + *  @{
> + */
> +
> +/**
> + * @def ODP_COMP_SESSION_INVALID
> + * Invalid session handle
> + */
> +
> +/**
> + * @typedef odp_comp_session_t (platform dependent)
> + * Comp API opaque session handle
> + */
> +
> +/**
> + * @typedef odp_comp_compl_t
> +* Compression API completion event (platform dependent) */
> +
> +/**
> + * Compression API operation mode
> + */
> +typedef enum {
> + /** Synchronous, return results immediately */
> + ODP_COMP_SYNC,
> + /** Asynchronous, return results via queue event */
> + ODP_COMP_ASYNC,
> +} odp_comp_op_mode_t;
> +
> +/**
> + * Comp API operation type.
> + * Ignored for Authentication ONLY.
> + *
> + */
> +typedef enum {
> + /** Compress and/or Compute digest  */
> + ODP_COMP_OP_COMPRESS,
> + /** Decompress and/or Compute digest */
> + ODP_COMP_OP_DECOMPRESS,
> +} odp_comp_op_t;
> +
> +/**
> + * Comp API authentication algorithm
> + *
> + */
> +typedef enum {
> + /** No authentication algorithm specified */
> + ODP_COMP_AUTH_ALG_NULL,
> + /** ODP_COMP_AUTH_ALG_SHA1*/
> + ODP_COMP_AUTH_ALG_SHA1,
> + /**  ODP_COMP_AUTH_ALG_SHA256*/
> + ODP_COMP_AUTH_ALG_SHA256
> +} odp_comp_auth_alg_t;

Why do you need special comp_auth_alg instead of just odp_auth_alg_t?
Shally - To differentiate that these algorithm are specifically part of 
compression interface as crypto also has them enumerated.
> +
> +/**
> + * Comp API compression algorithm
> + *
> + */
> +typedef enum {
> + /** No algorithm specified.
> + * Means no compression, no output provided.
> + */
> + ODP_COMP_ALG_NULL,
> + /** DEFLATE -
> + * implicit Inflate in case of decode operation.
> + */
> + ODP_COMP_ALG_DEFLATE,
> + /** ZLIB-RFC1950 */
> + ODP_COMP_ALG_ZLIB,
> + /** LZS*/
> + ODP_COMP_ALG_LZS,
> +} odp_comp_alg_t;
> +
> +/**
> + * Comp API session creation return code
> + *
> + */
> +typedef enum {
> + /** Session created */
> + ODP_COMP_SES_CREATE_ERR_NONE,
> + /** Creation failed, no resources */
> + ODP_COMP_SES_CREATE_ERR_ENOMEM,
> + /** Creation failed, bad compression params */
> + ODP_COMP_SES_CREATE_ERR_INV_COMP,
> + /** Creation failed, bad auth params */
> + ODP_COMP_SES_CREATE_ERR_INV_AUTH,
> + /** Creation failed,requested configuration not supported*/
> + ODP_COMP_SES_CREATE_ERR_NOT_SUPPORTED
> +} odp_comp_ses_create_err_t;
> +
> +/**
> + * Comp API operation return codes
> + *
> + */
> +typedef enum {
> + /** Operation completed successfully*/
> + ODP_COMP_ERR_NONE,
> + /** Invalid user data pointers*/
> + ODP_COMP_ERR_DATA_PTR,
> + /**

Re: [lng-odp] [RFC, API-NEXT v2 1/1] comp:compression interface

2017-04-19 Thread Dmitry Eremin-Solenikov
On 19.04.2017 13:00, Shally Verma wrote:
> An API set to add compression/decompression support in ODP
> interface.
> 
> Signed-off-by: Shally Verma 
> Signed-off-by: Mahipal Challa 
> ---
>  include/odp/api/spec/comp.h | 748 
> 
>  1 file changed, 748 insertions(+)
> 
> diff --git a/include/odp/api/spec/comp.h b/include/odp/api/spec/comp.h
> new file mode 100644
> index 000..65feacf
> --- /dev/null
> +++ b/include/odp/api/spec/comp.h
> @@ -0,0 +1,748 @@
> +/*
> + */
> +
> +/**
> + * @file
> + *
> + * ODP Compression
> + */
> +
> +#ifndef ODP_API_COMP_H_
> +#define ODP_API_COMP_H_
> +#include 
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +/** @defgroup odp_compression ODP COMP
> + *  ODP Compression defines interface to compress/decompress and authenticate
> + *  data.
> + *
> + *  Compression here implicilty refer to both compression and decompression.
> + *  Example, compression algo 'deflate' mean both 'deflate' and 'inflate'.
> + *
> + *  if opcode = ODP_COMP_COMPRESS, then it will Compress,
> + *  if opcode = ODP_COMP_DECOMPRESS, then it will Decompress.
> + *
> + *  Current version of Interface allow Compression ONLY,Authentication ONLY 
> or
> + *  both Compression + Auth ONLY sessions.
> + *
> + *  Macros, enums, types and operations to utilise compression.
> + *  @{
> + */
> +
> +/**
> + * @def ODP_COMP_SESSION_INVALID
> + * Invalid session handle
> + */
> +
> +/**
> + * @typedef odp_comp_session_t (platform dependent)
> + * Comp API opaque session handle
> + */
> +
> +/**
> + * @typedef odp_comp_compl_t
> +* Compression API completion event (platform dependent)
> +*/
> +
> +/**
> + * Compression API operation mode
> + */
> +typedef enum {
> + /** Synchronous, return results immediately */
> + ODP_COMP_SYNC,
> + /** Asynchronous, return results via queue event */
> + ODP_COMP_ASYNC,
> +} odp_comp_op_mode_t;
> +
> +/**
> + * Comp API operation type.
> + * Ignored for Authentication ONLY.
> + *
> + */
> +typedef enum {
> + /** Compress and/or Compute digest  */
> + ODP_COMP_OP_COMPRESS,
> + /** Decompress and/or Compute digest */
> + ODP_COMP_OP_DECOMPRESS,
> +} odp_comp_op_t;
> +
> +/**
> + * Comp API authentication algorithm
> + *
> + */
> +typedef enum {
> + /** No authentication algorithm specified */
> + ODP_COMP_AUTH_ALG_NULL,
> + /** ODP_COMP_AUTH_ALG_SHA1*/
> + ODP_COMP_AUTH_ALG_SHA1,
> + /**  ODP_COMP_AUTH_ALG_SHA256*/
> + ODP_COMP_AUTH_ALG_SHA256
> +} odp_comp_auth_alg_t;

Why do you need special comp_auth_alg instead of just odp_auth_alg_t?

> +
> +/**
> + * Comp API compression algorithm
> + *
> + */
> +typedef enum {
> + /** No algorithm specified.
> + * Means no compression, no output provided.
> + */
> + ODP_COMP_ALG_NULL,
> + /** DEFLATE -
> + * implicit Inflate in case of decode operation.
> + */
> + ODP_COMP_ALG_DEFLATE,
> + /** ZLIB-RFC1950 */
> + ODP_COMP_ALG_ZLIB,
> + /** LZS*/
> + ODP_COMP_ALG_LZS,
> +} odp_comp_alg_t;
> +
> +/**
> + * Comp API session creation return code
> + *
> + */
> +typedef enum {
> + /** Session created */
> + ODP_COMP_SES_CREATE_ERR_NONE,
> + /** Creation failed, no resources */
> + ODP_COMP_SES_CREATE_ERR_ENOMEM,
> + /** Creation failed, bad compression params */
> + ODP_COMP_SES_CREATE_ERR_INV_COMP,
> + /** Creation failed, bad auth params */
> + ODP_COMP_SES_CREATE_ERR_INV_AUTH,
> + /** Creation failed,requested configuration not supported*/
> + ODP_COMP_SES_CREATE_ERR_NOT_SUPPORTED
> +} odp_comp_ses_create_err_t;
> +
> +/**
> + * Comp API operation return codes
> + *
> + */
> +typedef enum {
> + /** Operation completed successfully*/
> + ODP_COMP_ERR_NONE,
> + /** Invalid user data pointers*/
> + ODP_COMP_ERR_DATA_PTR,
> + /** Invalid input data size*/
> + ODP_COMP_ERR_DATA_SIZE,
> + /**  Compression and/or Auth Algo failure*/
> + ODP_COMP_ERR_ALGO_FAIL,
> + /** Error detected during DMA of data*/
> + ODP_COMP_ERR_DMA,
> + /** Operation paused due to insufficient output buffer
> + *
> + * This is not an error condition. On seeing this error, caller
> + * should call odp_comp_operation() again with valid output buffer
> + * with no-more input or altercation to other input
> + * operation parameters.
> + *
> + * for applications, considering this an error condition should destroy
> + * and re-create session to start afresh.
> + *
> + * Implementation should maintain context in this condition.
> + */
> + ODP_COMP_ERR_OUT_OF_SPACE,
> + /** Error if operation has been requested in an invalid state */
> + ODP_COMP_ERR_INV_STATE
> +} odp_comp_err_t;
> +
> +/**
> +* Comp API enumeration for preferred compression level/speed.
> +*
> +* trade-off between speed and compression ratio.
> +*
> +* Please note this enumeration