Re: [lng-odp] Suspected SPAM - [API-NEXT PATCH v2 1/3] api: system_info: add function for fetching all supported huge page sizes

2017-07-05 Thread Savolainen, Petri (Nokia - FI/Espoo)
Reviewed-by: Petri Savolainen 

> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of
> Matias Elo
> Sent: Wednesday, July 05, 2017 5:23 PM
> To: lng-odp@lists.linaro.org
> Subject: Suspected SPAM - [lng-odp] [API-NEXT PATCH v2 1/3] api:
> system_info: add function for fetching all supported huge page sizes
> 
> A system may simultaneously support multiple huge page sizes. Add a new
> API
> function odp_sys_huge_page_size_all() which returns all supported page
> sizes. odp_sys_huge_page_size() stays unmodified to maintain backward
> compatibility.
> 
> Signed-off-by: Matias Elo 
> ---
> V2:
> - Changed return value and 'num' param from unsigned to int (Maxim)
> 
> 
>  include/odp/api/spec/system_info.h | 19 +++
>  1 file changed, 19 insertions(+)


Re: [lng-odp] [PATCH 7/7] linux-gen: dpdk: enable zero-copy operation

2017-07-05 Thread Honnappa Nagarahalli
On 3 July 2017 at 07:01, Matias Elo  wrote:
> Implements experimental zero-copy mode for DPDK pktio. This can be enabled
> with additional '--enable-dpdk-zero-copy' configure flag.
>
> This feature has been put behind an extra configure flag as it doesn't
> entirely adhere to the DPDK API and may behave unexpectedly with untested
> DPDK NIC drivers. Zero-copy operation has been tested with pcap, ixgbe, and
> i40e drivers.
>

Can you elaborate more on this? Which parts do not adhere to DPDK APIs?

> Signed-off-by: Matias Elo 
> ---
>  .../linux-generic/include/odp_buffer_internal.h|   2 +-
>  .../linux-generic/include/odp_packet_internal.h|  13 +
>  platform/linux-generic/include/odp_pool_internal.h |   4 +
>  platform/linux-generic/m4/odp_dpdk.m4  |  14 +-
>  platform/linux-generic/odp_pool.c  |   2 +
>  platform/linux-generic/pktio/dpdk.c| 676 
> -
>  6 files changed, 562 insertions(+), 149 deletions(-)
>
> diff --git a/platform/linux-generic/include/odp_buffer_internal.h 
> b/platform/linux-generic/include/odp_buffer_internal.h
> index 076abe9..78ea527 100644
> --- a/platform/linux-generic/include/odp_buffer_internal.h
> +++ b/platform/linux-generic/include/odp_buffer_internal.h
> @@ -109,7 +109,7 @@ struct odp_buffer_hdr_t {
>
> /* Data or next header */
> uint8_t data[0];
> -};
> +} ODP_ALIGNED_CACHE;
>
>  ODP_STATIC_ASSERT(CONFIG_PACKET_MAX_SEGS < 256,
>   "CONFIG_PACKET_MAX_SEGS_TOO_LARGE");
> diff --git a/platform/linux-generic/include/odp_packet_internal.h 
> b/platform/linux-generic/include/odp_packet_internal.h
> index 11f2fdc..78569b6 100644
> --- a/platform/linux-generic/include/odp_packet_internal.h
> +++ b/platform/linux-generic/include/odp_packet_internal.h
> @@ -92,6 +92,12 @@ typedef struct {
> uint32_t l4_offset; /**< offset to L4 hdr (TCP, UDP, SCTP, also ICMP) 
> */
>  } packet_parser_t;
>
> +/* Packet extra data length */
> +#define PKT_EXTRA_LEN 128
> +
> +/* Packet extra data types */
> +#define PKT_EXTRA_TYPE_DPDK 1
> +
>  /**
>   * Internal Packet header
>   *
> @@ -131,6 +137,13 @@ typedef struct {
> /* Result for crypto */
> odp_crypto_generic_op_result_t op_result;
>
> +#ifdef ODP_PKTIO_DPDK
> +   /* Type of extra data */
> +   uint8_t extra_type;
> +   /* Extra space for packet descriptors. E.g. DPDK mbuf  */
> +   uint8_t extra[PKT_EXTRA_LEN] ODP_ALIGNED_CACHE;
> +#endif
> +
> /* Packet data storage */
> uint8_t data[0];
>  } odp_packet_hdr_t;
> diff --git a/platform/linux-generic/include/odp_pool_internal.h 
> b/platform/linux-generic/include/odp_pool_internal.h
> index ebb779d..acea079 100644
> --- a/platform/linux-generic/include/odp_pool_internal.h
> +++ b/platform/linux-generic/include/odp_pool_internal.h
> @@ -68,6 +68,10 @@ typedef struct pool_t {
> uint8_t *base_addr;
> uint8_t *uarea_base_addr;
>
> +   /* Used by DPDK zero-copy pktio */
> +   void*ext_desc;
> +   uint16_t ext_ref_count;
> +
> pool_cache_t local_cache[ODP_THREAD_COUNT_MAX];
>
> odp_shm_tring_shm;
> diff --git a/platform/linux-generic/m4/odp_dpdk.m4 
> b/platform/linux-generic/m4/odp_dpdk.m4
> index 58d1472..edcc4c8 100644
> --- a/platform/linux-generic/m4/odp_dpdk.m4
> +++ b/platform/linux-generic/m4/odp_dpdk.m4
> @@ -9,6 +9,16 @@ AC_HELP_STRING([--with-dpdk-path=DIR   path to dpdk build 
> directory]),
>  pktio_dpdk_support=yes],[])
>
>  ##
> +# Enable zero-copy DPDK pktio
> +##
> +zero_copy=0
> +AC_ARG_ENABLE([dpdk-zero-copy],
> +[  --enable-dpdk-zero-copy  enable experimental zero-copy DPDK pktio 
> mode],
> +[if test x$enableval = xyes; then
> +zero_copy=1
> +fi])
> +
> +##
>  # Save and set temporary compilation flags
>  ##
>  OLD_CPPFLAGS=$CPPFLAGS
> @@ -38,9 +48,9 @@ then
>  done
>  DPDK_PMD+=--no-whole-archive
>
> -ODP_CFLAGS="$ODP_CFLAGS -DODP_PKTIO_DPDK"
> +ODP_CFLAGS="$ODP_CFLAGS -DODP_PKTIO_DPDK -DODP_DPDK_ZERO_COPY=$zero_copy"
>  AM_LDFLAGS="$AM_LDFLAGS -L$DPDK_PATH/lib -Wl,$DPDK_PMD"
> -LIBS="$LIBS -ldpdk -ldl -lpcap"
> +LIBS="$LIBS -ldpdk -ldl -lpcap -lm"
>  else
>  pktio_dpdk_support=no
>  fi
> diff --git a/platform/linux-generic/odp_pool.c 
> b/platform/linux-generic/odp_pool.c
> index 5360b94..8a27c8a 100644
> --- a/platform/linux-generic/odp_pool.c
> +++ b/platform/linux-generic/odp_pool.c
> @@ -395,6 +395,8 @@ static odp_pool_t pool_create(const char *name, 
> odp_pool_param_t *params,
> pool->uarea_size = uarea_size;
> pool->shm_size   = num * block_size;
> pool->ua

[lng-odp] [Linaro/odp] 15c974: linux-gen: fix out-of-tree build

2017-07-05 Thread GitHub
  Branch: refs/heads/api-next
  Home:   https://github.com/Linaro/odp
  Commit: 15c97427d01c81dc9f4d0aafe9b0a99cdb2d1fc6
  
https://github.com/Linaro/odp/commit/15c97427d01c81dc9f4d0aafe9b0a99cdb2d1fc6
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-07-06 (Thu, 06 Jul 2017)

  Changed paths:
M platform/Makefile.inc

  Log Message:
  ---
  linux-gen: fix out-of-tree build

Drop include/odp/api/spec/deprecated.h from headers list incorrectly
added by merge a5ef33a6f2575cd011cb05c3fb1b06d1c017f879.

Signed-off-by: Dmitry Eremin-Solenikov 
Signed-off-by: Maxim Uvarov 




[lng-odp] [Linaro/odp] 0c15c4: linux-gen: fix compilation with OpenSSL 1.1.y

2017-07-05 Thread GitHub
  Branch: refs/heads/monarch_lts
  Home:   https://github.com/Linaro/odp
  Commit: 0c15c40db40834f1df217191c4b6a06303ab0872
  
https://github.com/Linaro/odp/commit/0c15c40db40834f1df217191c4b6a06303ab0872
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-07-06 (Thu, 06 Jul 2017)

  Changed paths:
M platform/linux-generic/include/odp_crypto_internal.h

  Log Message:
  ---
  linux-gen: fix compilation with OpenSSL 1.1.y

Signed-off-by: Dmitry Eremin-Solenikov 
Reviewed-by: Bill Fischofer 




Re: [lng-odp] [API-NEXT PATCH v2 1/3] api: system_info: add function for fetching all supported huge page sizes

2017-07-05 Thread Bill Fischofer
On Wed, Jul 5, 2017 at 9:23 AM, Matias Elo  wrote:
> A system may simultaneously support multiple huge page sizes. Add a new API
> function odp_sys_huge_page_size_all() which returns all supported page
> sizes. odp_sys_huge_page_size() stays unmodified to maintain backward
> compatibility.
>
> Signed-off-by: Matias Elo 

For the v2 series:
Reviewed-and-tested-by: Bill Fischofer 

> ---
> V2:
> - Changed return value and 'num' param from unsigned to int (Maxim)
>
>
>  include/odp/api/spec/system_info.h | 19 +++
>  1 file changed, 19 insertions(+)
>
> diff --git a/include/odp/api/spec/system_info.h 
> b/include/odp/api/spec/system_info.h
> index ca4dcdc..140db7b 100644
> --- a/include/odp/api/spec/system_info.h
> +++ b/include/odp/api/spec/system_info.h
> @@ -27,10 +27,29 @@ extern "C" {
>   * Default system huge page size in bytes
>   *
>   * @return Default huge page size in bytes
> + * @retval 0 on no huge pages
>   */
>  uint64_t odp_sys_huge_page_size(void);
>
>  /**
> + * System huge page sizes in bytes
> + *
> + * Returns the number of huge page sizes supported by the system. Outputs up 
> to
> + * 'num' sizes when the 'size' array pointer is not NULL. If return value is
> + * larger than 'num', there are more supported sizes than the function was
> + * allowed to output. If return value (N) is less than 'num', only sizes
> + * [0 ... N-1] have been written. Returned values are ordered from smallest 
> to
> + * largest.
> + *
> + * @param[out] size Points to an array of huge page sizes for output
> + * @param  num  Maximum number of huge page sizes to output
> + *
> + * @return Number of supported huge page sizes
> + * @retval <0 on failure
> + */
> +int odp_sys_huge_page_size_all(uint64_t size[], int num);
> +
> +/**
>   * Page size in bytes
>   *
>   * @return Page size in bytes
> --
> 2.7.4
>


[lng-odp] [API-NEXT PATCH v2 3/3] validation: system_info: add test for odp_sys_huge_page_size_all()

2017-07-05 Thread Matias Elo
Signed-off-by: Matias Elo 
---
 test/common_plat/validation/api/system/system.c | 21 +
 test/common_plat/validation/api/system/system.h |  1 +
 2 files changed, 22 insertions(+)

diff --git a/test/common_plat/validation/api/system/system.c 
b/test/common_plat/validation/api/system/system.c
index 5b7ca01..4dfac55 100644
--- a/test/common_plat/validation/api/system/system.c
+++ b/test/common_plat/validation/api/system/system.c
@@ -13,6 +13,7 @@
 
 #define DIFF_TRY_NUM   160
 #define RES_TRY_NUM10
+#define PAGESZ_NUM 10
 
 void system_test_odp_version_numbers(void)
 {
@@ -214,6 +215,25 @@ void system_test_odp_sys_huge_page_size(void)
CU_ASSERT(0 < page);
 }
 
+void system_test_odp_sys_huge_page_size_all(void)
+{
+   uint64_t pagesz_tbs[PAGESZ_NUM];
+   uint64_t prev_pagesz = 0;
+   int num;
+   int i;
+
+   num = odp_sys_huge_page_size_all(NULL, 0);
+   CU_ASSERT(num >= 0);
+
+   num = odp_sys_huge_page_size_all(pagesz_tbs, PAGESZ_NUM);
+   CU_ASSERT(num >= 0);
+   for (i = 0; i < num && i < PAGESZ_NUM; i++) {
+   CU_ASSERT(pagesz_tbs[i] > 0);
+   CU_ASSERT(pagesz_tbs[i] > prev_pagesz);
+   prev_pagesz = pagesz_tbs[i];
+   }
+}
+
 int system_check_odp_cpu_hz(void)
 {
if (odp_cpu_hz() == 0) {
@@ -316,6 +336,7 @@ odp_testinfo_t system_suite[] = {
ODP_TEST_INFO(system_test_odp_cpu_model_str_id),
ODP_TEST_INFO(system_test_odp_sys_page_size),
ODP_TEST_INFO(system_test_odp_sys_huge_page_size),
+   ODP_TEST_INFO(system_test_odp_sys_huge_page_size_all),
ODP_TEST_INFO_CONDITIONAL(system_test_odp_cpu_hz,
  system_check_odp_cpu_hz),
ODP_TEST_INFO_CONDITIONAL(system_test_odp_cpu_hz_id,
diff --git a/test/common_plat/validation/api/system/system.h 
b/test/common_plat/validation/api/system/system.h
index c33729b..0ea72dc 100644
--- a/test/common_plat/validation/api/system/system.h
+++ b/test/common_plat/validation/api/system/system.h
@@ -20,6 +20,7 @@ void system_test_odp_cpu_model_str(void);
 void system_test_odp_cpu_model_str_id(void);
 void system_test_odp_sys_page_size(void);
 void system_test_odp_sys_huge_page_size(void);
+void system_test_odp_sys_huge_page_size_all(void);
 int system_check_odp_cpu_hz(void);
 void system_test_odp_cpu_hz(void);
 int system_check_odp_cpu_hz_id(void);
-- 
2.7.4



[lng-odp] [API-NEXT PATCH v2 2/3] linux-gen: system_info: implement odp_sys_huge_page_size_all()

2017-07-05 Thread Matias Elo
Directory /sys/kernel/mm/hugepages contains subdirectories for all huge
page sizes supported by the running kernel. Loop through the contents of
this directory to find the supported huge page sizes.

Signed-off-by: Matias Elo 
---
 platform/linux-generic/odp_system_info.c | 36 
 1 file changed, 36 insertions(+)

diff --git a/platform/linux-generic/odp_system_info.c 
b/platform/linux-generic/odp_system_info.c
index 40ffca0..0495fb0 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -379,6 +379,42 @@ uint64_t odp_sys_huge_page_size(void)
return odp_global_data.hugepage_info.default_huge_page_size;
 }
 
+static int pagesz_compare(const void *pagesz1, const void *pagesz2)
+{
+   return (*(const uint64_t *)pagesz1 - *(const uint64_t *)pagesz2);
+}
+
+int odp_sys_huge_page_size_all(uint64_t size[], int num)
+{
+   DIR *dir;
+   struct dirent *entry;
+   int pagesz_num = 0;
+   int saved = 0;
+
+   /* See: kernel.org: hugetlbpage.txt */
+   dir = opendir("/sys/kernel/mm/hugepages");
+   if (!dir) {
+   ODP_ERR("Failed to open huge page directory\n");
+   return -1;
+   }
+
+   while ((entry = readdir(dir)) != NULL) {
+   unsigned long sz;
+
+   if (sscanf(entry->d_name, "hugepages-%8lukB", &sz) == 1) {
+   if (size != NULL && saved < num)
+   size[saved++] = sz * 1024;
+   pagesz_num++;
+   }
+   }
+   closedir(dir);
+
+   if (size != NULL && saved > 1)
+   qsort(size, saved, sizeof(uint64_t), pagesz_compare);
+
+   return pagesz_num;
+}
+
 uint64_t odp_sys_page_size(void)
 {
return odp_global_data.system_info.page_size;
-- 
2.7.4



[lng-odp] [API-NEXT PATCH v2 1/3] api: system_info: add function for fetching all supported huge page sizes

2017-07-05 Thread Matias Elo
A system may simultaneously support multiple huge page sizes. Add a new API
function odp_sys_huge_page_size_all() which returns all supported page
sizes. odp_sys_huge_page_size() stays unmodified to maintain backward
compatibility.

Signed-off-by: Matias Elo 
---
V2:
- Changed return value and 'num' param from unsigned to int (Maxim)


 include/odp/api/spec/system_info.h | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/include/odp/api/spec/system_info.h 
b/include/odp/api/spec/system_info.h
index ca4dcdc..140db7b 100644
--- a/include/odp/api/spec/system_info.h
+++ b/include/odp/api/spec/system_info.h
@@ -27,10 +27,29 @@ extern "C" {
  * Default system huge page size in bytes
  *
  * @return Default huge page size in bytes
+ * @retval 0 on no huge pages
  */
 uint64_t odp_sys_huge_page_size(void);
 
 /**
+ * System huge page sizes in bytes
+ *
+ * Returns the number of huge page sizes supported by the system. Outputs up to
+ * 'num' sizes when the 'size' array pointer is not NULL. If return value is
+ * larger than 'num', there are more supported sizes than the function was
+ * allowed to output. If return value (N) is less than 'num', only sizes
+ * [0 ... N-1] have been written. Returned values are ordered from smallest to
+ * largest.
+ *
+ * @param[out] size Points to an array of huge page sizes for output
+ * @param  num  Maximum number of huge page sizes to output
+ *
+ * @return Number of supported huge page sizes
+ * @retval <0 on failure
+ */
+int odp_sys_huge_page_size_all(uint64_t size[], int num);
+
+/**
  * Page size in bytes
  *
  * @return Page size in bytes
-- 
2.7.4



[lng-odp] [PATCH API-NEXT v8 10/10] example: ipsec: rewrite using Crypto packet API

2017-07-05 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 64 (lumag:crypto-packet)
 ** https://github.com/Linaro/odp/pull/64
 ** Patch: https://github.com/Linaro/odp/pull/64.patch
 ** Base sha: 00a21c6dce65a30c8250db59a42a43c658e8ca1b
 ** Merge commit sha: ac9b299a7f3bee72dd9343bbfaa826217d243ea6
 **/
 example/ipsec/odp_ipsec.c   | 118 
 example/ipsec/odp_ipsec_cache.c |  17 +-
 example/ipsec/odp_ipsec_cache.h |   7 ++-
 example/ipsec/odp_ipsec_misc.h  |   2 +-
 4 files changed, 91 insertions(+), 53 deletions(-)

diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
index c618cc46..5df8f154 100644
--- a/example/ipsec/odp_ipsec.c
+++ b/example/ipsec/odp_ipsec.c
@@ -144,7 +144,7 @@ typedef struct {
uint32_t dst_ip; /**< SA dest IP address */
 
/* Output only */
-   odp_crypto_op_param_t params;   /**< Parameters for crypto call */
+   odp_crypto_packet_op_param_t params; /**< Parameters for crypto call */
uint32_t *ah_seq;   /**< AH sequence number location */
uint32_t *esp_seq;  /**< ESP sequence number location */
uint16_t *tun_hdr_id;   /**< Tunnel header ID > */
@@ -393,7 +393,9 @@ void ipsec_init_post(crypto_api_mode_e api_mode)
 auth_sa,
 tun,
 api_mode,
-entry->input)) {
+entry->input,
+completionq,
+out_pool)) {
EXAMPLE_ERR("Error: IPSec cache entry failed.\n"
);
exit(EXIT_FAILURE);
@@ -627,19 +629,18 @@ pkt_disposition_e do_route_fwd_db(odp_packet_t pkt, 
pkt_ctx_t *ctx)
  * @return PKT_CONTINUE if done else PKT_POSTED
  */
 static
-pkt_disposition_e do_ipsec_in_classify(odp_packet_t pkt,
+pkt_disposition_e do_ipsec_in_classify(odp_packet_t *pkt,
   pkt_ctx_t *ctx,
-  odp_bool_t *skip,
-  odp_crypto_op_result_t *result)
+  odp_bool_t *skip)
 {
-   uint8_t *buf = odp_packet_data(pkt);
-   odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
+   uint8_t *buf = odp_packet_data(*pkt);
+   odph_ipv4hdr_t *ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(*pkt, NULL);
int hdr_len;
odph_ahhdr_t *ah = NULL;
odph_esphdr_t *esp = NULL;
ipsec_cache_entry_t *entry;
-   odp_crypto_op_param_t params;
-   odp_bool_t posted = 0;
+   odp_crypto_packet_op_param_t params;
+   odp_packet_t out_pkt;
 
/* Default to skip IPsec */
*skip = TRUE;
@@ -661,8 +662,7 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t pkt,
/* Initialize parameters block */
memset(¶ms, 0, sizeof(params));
params.session = entry->state.session;
-   params.pkt = pkt;
-   params.out_pkt = entry->in_place ? pkt : ODP_PACKET_INVALID;
+   out_pkt = entry->in_place ? *pkt : ODP_PACKET_INVALID;
 
/*Save everything to context */
ctx->ipsec.ip_tos = ip->tos;
@@ -697,12 +697,17 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t pkt,
/* Issue crypto request */
*skip = FALSE;
ctx->state = PKT_STATE_IPSEC_IN_FINISH;
-   if (odp_crypto_operation(¶ms,
-&posted,
-result)) {
-   abort();
+   if (entry->async) {
+   if (odp_crypto_packet_op_enq(pkt, &out_pkt, ¶ms, 1))
+   abort();
+   return PKT_POSTED;
}
-   return (posted) ? PKT_POSTED : PKT_CONTINUE;
+
+   if (odp_crypto_packet_op(pkt, &out_pkt, ¶ms, 1))
+   abort();
+   *pkt = out_pkt;
+
+   return PKT_CONTINUE;
 }
 
 /**
@@ -715,18 +720,20 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t pkt,
  */
 static
 pkt_disposition_e do_ipsec_in_finish(odp_packet_t pkt,
-pkt_ctx_t *ctx,
-odp_crypto_op_result_t *result)
+pkt_ctx_t *ctx)
 {
odph_ipv4hdr_t *ip;
+   odp_crypto_packet_result_t result;
int hdr_len = ctx->ipsec.hdr_len;
int trl_len = 0;
 
+   odp_crypto_packet_result(&result, pkt);
+
/* Check crypto result */
-   if (!result->ok) {
-   if (!is_crypto_op_status_ok(&result->cipher_status))
+   if (!result.ok) {
+   if (!is_crypto_op_status_ok(&result.cipher_status))
retu

[lng-odp] [PATCH API-NEXT v8 9/10] test: rewrite odp_crypto using Crypto packet API

2017-07-05 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 64 (lumag:crypto-packet)
 ** https://github.com/Linaro/odp/pull/64
 ** Patch: https://github.com/Linaro/odp/pull/64.patch
 ** Base sha: 00a21c6dce65a30c8250db59a42a43c658e8ca1b
 ** Merge commit sha: ac9b299a7f3bee72dd9343bbfaa826217d243ea6
 **/
 test/common_plat/performance/odp_crypto.c | 169 ++
 1 file changed, 104 insertions(+), 65 deletions(-)

diff --git a/test/common_plat/performance/odp_crypto.c 
b/test/common_plat/performance/odp_crypto.c
index bc29a888..a129ec98 100644
--- a/test/common_plat/performance/odp_crypto.c
+++ b/test/common_plat/performance/odp_crypto.c
@@ -443,9 +443,10 @@ create_session_from_config(odp_crypto_session_t *session,
return -1;
}
params.compl_queue = out_queue;
-
+   params.packet_op_mode = ODP_CRYPTO_ASYNC;
} else {
params.compl_queue = ODP_QUEUE_INVALID;
+   params.packet_op_mode   = ODP_CRYPTO_SYNC;
}
if (odp_crypto_session_create(¶ms, session,
  &ses_create_rc)) {
@@ -456,6 +457,24 @@ create_session_from_config(odp_crypto_session_t *session,
return 0;
 }
 
+static odp_packet_t
+make_packet(odp_pool_t pkt_pool, unsigned int payload_length)
+{
+   odp_packet_t pkt;
+
+   pkt = odp_packet_alloc(pkt_pool, payload_length);
+   if (pkt == ODP_PACKET_INVALID) {
+   app_err("failed to allocate buffer\n");
+   return pkt;
+   }
+
+   void *mem = odp_packet_data(pkt);
+
+   memset(mem, 1, payload_length);
+
+   return pkt;
+}
+
 /**
  * Run measurement iterations for given config and payload size.
  * Result of run returned in 'result' out parameter.
@@ -467,15 +486,13 @@ run_measure_one(crypto_args_t *cargs,
unsigned int payload_length,
crypto_run_result_t *result)
 {
-   odp_crypto_op_param_t params;
+   odp_crypto_packet_op_param_t params;
 
odp_pool_t pkt_pool;
odp_queue_t out_queue;
-   odp_packet_t pkt;
+   odp_packet_t pkt = ODP_PACKET_INVALID;
int rc = 0;
 
-   odp_bool_t posted = 0;
-
pkt_pool = odp_pool_lookup("packet_pool");
if (pkt_pool == ODP_POOL_INVALID) {
app_err("pkt_pool not found\n");
@@ -490,16 +507,12 @@ run_measure_one(crypto_args_t *cargs,
}
}
 
-   pkt = odp_packet_alloc(pkt_pool, payload_length);
-   if (pkt == ODP_PACKET_INVALID) {
-   app_err("failed to allocate buffer\n");
-   return -1;
+   if (cargs->reuse_packet) {
+   pkt = make_packet(pkt_pool, payload_length);
+   if (ODP_PACKET_INVALID == pkt)
+   return -1;
}
 
-   void *mem = odp_packet_data(pkt);
-
-   memset(mem, 1, payload_length);
-
time_record_t start, end;
int packets_sent = 0;
int packets_received = 0;
@@ -515,77 +528,102 @@ run_measure_one(crypto_args_t *cargs,
params.auth_range.length = payload_length;
params.hash_result_offset = payload_length;
 
-   if (cargs->reuse_packet) {
-   params.pkt = pkt;
-   params.out_pkt = cargs->in_place ? pkt :
-ODP_PACKET_INVALID;
-   }
-
fill_time_record(&start);
 
while ((packets_sent < cargs->iteration_count) ||
   (packets_received <  cargs->iteration_count)) {
void *mem;
-   odp_crypto_op_result_t result;
 
if ((packets_sent < cargs->iteration_count) &&
(packets_sent - packets_received <
 cargs->in_flight)) {
+   odp_packet_t out_pkt;
+
if (!cargs->reuse_packet) {
-   /*
-* For in place test we use just one
-* statically allocated buffer.
-* For now in place test we have to
-* allocate and initialize packet
-* every time.
-* Note we leaked one packet here.
-*/
-   odp_packet_t newpkt;
-
-   newpkt = odp_packet_alloc(pkt_pool,
- payload_length);
-   if (newpkt == ODP_PACKET_INVALID) {
-   app_err("failed to allocate buffer\n");
+   pkt = make_packet(pkt_pool, payload_length);
+   if (ODP_PACKET_INVALID == pkt)
return -1;
-   }
-   mem = odp_packet_data

[lng-odp] [PATCH API-NEXT v8 6/10] api: crypto: add crypto packet operation interface

2017-07-05 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Input and output of crypto operations are packets. API is more flexible
for application and API pipelining when output is packet with additional
metadata. Application or API pipeline stages which do not care about
crypto results may work on basic packet metadata.

Crypto result event type changes from ODP_EVENT_CRYPTO_COMPL to
ODP_EVENT_PACKET. Event subtype (ODP_EVENT_PACKET_CRYPTO) can be
used to identify packets with crypto metadata.

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 64 (lumag:crypto-packet)
 ** https://github.com/Linaro/odp/pull/64
 ** Patch: https://github.com/Linaro/odp/pull/64.patch
 ** Base sha: 00a21c6dce65a30c8250db59a42a43c658e8ca1b
 ** Merge commit sha: ac9b299a7f3bee72dd9343bbfaa826217d243ea6
 **/
 example/ipsec/odp_ipsec.c  |   8 +-
 example/ipsec/odp_ipsec_misc.h |   4 +-
 include/odp/api/spec/crypto.h  | 176 +++--
 include/odp/arch/default/api/abi/event.h   |   3 +-
 .../include/odp/api/plat/event_types.h |   3 +-
 5 files changed, 176 insertions(+), 18 deletions(-)

diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
index 1ed03585..c618cc46 100644
--- a/example/ipsec/odp_ipsec.c
+++ b/example/ipsec/odp_ipsec.c
@@ -724,9 +724,9 @@ pkt_disposition_e do_ipsec_in_finish(odp_packet_t pkt,
 
/* Check crypto result */
if (!result->ok) {
-   if (!is_crypto_compl_status_ok(&result->cipher_status))
+   if (!is_crypto_op_status_ok(&result->cipher_status))
return PKT_DROP;
-   if (!is_crypto_compl_status_ok(&result->auth_status))
+   if (!is_crypto_op_status_ok(&result->auth_status))
return PKT_DROP;
}
ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
@@ -1011,9 +1011,9 @@ pkt_disposition_e do_ipsec_out_finish(odp_packet_t pkt,
 
/* Check crypto result */
if (!result->ok) {
-   if (!is_crypto_compl_status_ok(&result->cipher_status))
+   if (!is_crypto_op_status_ok(&result->cipher_status))
return PKT_DROP;
-   if (!is_crypto_compl_status_ok(&result->auth_status))
+   if (!is_crypto_op_status_ok(&result->auth_status))
return PKT_DROP;
}
ip = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
diff --git a/example/ipsec/odp_ipsec_misc.h b/example/ipsec/odp_ipsec_misc.h
index 45cb022e..20ebe9fc 100644
--- a/example/ipsec/odp_ipsec_misc.h
+++ b/example/ipsec/odp_ipsec_misc.h
@@ -321,12 +321,12 @@ void ipv4_adjust_len(odph_ipv4hdr_t *ip, int adj)
 /**
  * Verify crypto operation completed successfully
  *
- * @param status  Pointer to cryto completion structure
+ * @param status  Pointer to crypto op status structure
  *
  * @return TRUE if all OK else FALSE
  */
 static inline
-odp_bool_t is_crypto_compl_status_ok(odp_crypto_compl_status_t *status)
+odp_bool_t is_crypto_op_status_ok(odp_crypto_op_status_t *status)
 {
if (status->alg_err != ODP_CRYPTO_ALG_ERR_NONE)
return FALSE;
diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h
index 454855ea..27b12c89 100644
--- a/include/odp/api/spec/crypto.h
+++ b/include/odp/api/spec/crypto.h
@@ -16,6 +16,7 @@
 #include 
 
 #include 
+#include 
 
 #ifdef __cplusplus
 extern "C" {
@@ -276,6 +277,9 @@ typedef struct odp_crypto_session_param_t {
 * data in non-posted mode */
odp_crypto_op_mode_t ODP_DEPRECATE(pref_mode);
 
+   /** Operation mode when using packet interface: sync or async */
+   odp_crypto_op_mode_t packet_op_mode;
+
/** Cipher algorithm
 *
 *  Use odp_crypto_capability() for supported algorithms.
@@ -311,16 +315,15 @@ typedef struct odp_crypto_session_param_t {
 
/** Async mode completion event queue
 *
-*  When odp_crypto_operation() is asynchronous, the completion queue is
-*  used to return the completion status of the operation to the
-*  application.
+*  The completion queue is used to return odp_crypto_packet_op_enq()
+*  results to the application.
 */
odp_queue_t compl_queue;
 
/** Output pool
 *
 *  When the output packet is not specified during the call to
-*  odp_crypto_operation(), the output packet will be allocated
+*  crypto operation, the output packet will be allocated
 *  from this pool.
 */
odp_pool_t output_pool;
@@ -400,6 +403,44 @@ typedef struct odp_crypto_op_param_t {
 typedef odp_crypto_op_param_t ODP_DEPRECATE(odp_crypto_op_params_t);
 
 /**
+ * Crypto packet API per packet operation parameters
+ */
+typedef struct odp_crypto_packet_op_param_t {
+   /** Session handle from creation */
+   odp_crypto_session_t session;
+
+   /** Override session IV p

[lng-odp] [PATCH API-NEXT v8 7/10] linux-gen: crypto: provide packet API implementation

2017-07-05 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Provide implementation for new crypto API using packets as first grade
objects. Reimplement odp_crypto_operation using new functions.

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 64 (lumag:crypto-packet)
 ** https://github.com/Linaro/odp/pull/64
 ** Patch: https://github.com/Linaro/odp/pull/64.patch
 ** Base sha: 00a21c6dce65a30c8250db59a42a43c658e8ca1b
 ** Merge commit sha: ac9b299a7f3bee72dd9343bbfaa826217d243ea6
 **/
 .../linux-generic/include/odp_crypto_internal.h|   3 +-
 .../linux-generic/include/odp_packet_internal.h|   3 +
 platform/linux-generic/odp_crypto.c| 329 +++--
 3 files changed, 245 insertions(+), 90 deletions(-)

diff --git a/platform/linux-generic/include/odp_crypto_internal.h 
b/platform/linux-generic/include/odp_crypto_internal.h
index 52b94d07..12d1720b 100644
--- a/platform/linux-generic/include/odp_crypto_internal.h
+++ b/platform/linux-generic/include/odp_crypto_internal.h
@@ -23,7 +23,8 @@ typedef struct odp_crypto_generic_session 
odp_crypto_generic_session_t;
  * Algorithm handler function prototype
  */
 typedef
-odp_crypto_alg_err_t (*crypto_func_t)(odp_crypto_op_param_t *param,
+odp_crypto_alg_err_t (*crypto_func_t)(odp_packet_t pkt,
+ const odp_crypto_packet_op_param_t *param,
  odp_crypto_generic_session_t *session);
 
 /**
diff --git a/platform/linux-generic/include/odp_packet_internal.h 
b/platform/linux-generic/include/odp_packet_internal.h
index 9f28fc05..a90ec477 100644
--- a/platform/linux-generic/include/odp_packet_internal.h
+++ b/platform/linux-generic/include/odp_packet_internal.h
@@ -128,6 +128,9 @@ typedef struct {
/* Classifier destination queue */
odp_queue_t dst_queue;
 
+   /* Result for crypto packet op */
+   odp_crypto_packet_result_t crypto_op_result;
+
/* Packet data storage */
uint8_t data[0];
 } odp_packet_hdr_t;
diff --git a/platform/linux-generic/odp_crypto.c 
b/platform/linux-generic/odp_crypto.c
index 075bb02b..792c2eca 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -113,7 +113,8 @@ void free_session(odp_crypto_generic_session_t *session)
 }
 
 static odp_crypto_alg_err_t
-null_crypto_routine(odp_crypto_op_param_t *param ODP_UNUSED,
+null_crypto_routine(odp_packet_t pkt ODP_UNUSED,
+   const odp_crypto_packet_op_param_t *param ODP_UNUSED,
odp_crypto_generic_session_t *session ODP_UNUSED)
 {
return ODP_CRYPTO_ALG_ERR_NONE;
@@ -121,11 +122,11 @@ null_crypto_routine(odp_crypto_op_param_t *param 
ODP_UNUSED,
 
 static
 void packet_hmac_calculate(HMAC_CTX *ctx,
-  odp_crypto_op_param_t *param,
+  odp_packet_t pkt,
+  const odp_crypto_packet_op_param_t *param,
   odp_crypto_generic_session_t *session,
   uint8_t *hash)
 {
-   odp_packet_t pkt = param->out_pkt;
uint32_t offset = param->auth_range.offset;
uint32_t len   = param->auth_range.length;
 
@@ -152,7 +153,8 @@ void packet_hmac_calculate(HMAC_CTX *ctx,
 
 #if OPENSSL_VERSION_NUMBER < 0x1010L
 static
-void packet_hmac(odp_crypto_op_param_t *param,
+void packet_hmac(odp_packet_t pkt,
+const odp_crypto_packet_op_param_t *param,
 odp_crypto_generic_session_t *session,
 uint8_t *hash)
 {
@@ -160,12 +162,13 @@ void packet_hmac(odp_crypto_op_param_t *param,
 
/* Hash it */
HMAC_CTX_init(&ctx);
-   packet_hmac_calculate(&ctx, param, session, hash);
+   packet_hmac_calculate(&ctx, pkt, param, session, hash);
HMAC_CTX_cleanup(&ctx);
 }
 #else
 static
-void packet_hmac(odp_crypto_op_param_t *param,
+void packet_hmac(odp_packet_t pkt,
+const odp_crypto_packet_op_param_t *param,
 odp_crypto_generic_session_t *session,
 uint8_t *hash)
 {
@@ -173,22 +176,23 @@ void packet_hmac(odp_crypto_op_param_t *param,
 
/* Hash it */
ctx = HMAC_CTX_new();
-   packet_hmac_calculate(ctx, param, session, hash);
+   packet_hmac_calculate(ctx, pkt, param, session, hash);
HMAC_CTX_free(ctx);
 }
 #endif
 
 static
-odp_crypto_alg_err_t auth_gen(odp_crypto_op_param_t *param,
+odp_crypto_alg_err_t auth_gen(odp_packet_t pkt,
+ const odp_crypto_packet_op_param_t *param,
  odp_crypto_generic_session_t *session)
 {
uint8_t  hash[EVP_MAX_MD_SIZE];
 
/* Hash it */
-   packet_hmac(param, session, hash);
+   packet_hmac(pkt, param, session, hash);
 
/* Copy to the output location */
-   odp_packet_copy_from_mem(param->out_pkt,
+   odp_packet_copy_from_mem(pkt,
 param->hash_result_offset,
 

[lng-odp] [PATCH API-NEXT v8 8/10] validation: crypto: tests for Crypto packet API

2017-07-05 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 64 (lumag:crypto-packet)
 ** https://github.com/Linaro/odp/pull/64
 ** Patch: https://github.com/Linaro/odp/pull/64.patch
 ** Base sha: 00a21c6dce65a30c8250db59a42a43c658e8ca1b
 ** Merge commit sha: ac9b299a7f3bee72dd9343bbfaa826217d243ea6
 **/
 test/common_plat/validation/api/crypto/crypto.c|   8 +-
 .../validation/api/crypto/odp_crypto_test_inp.c| 309 +
 .../validation/api/crypto/odp_crypto_test_inp.h|   6 +-
 3 files changed, 271 insertions(+), 52 deletions(-)

diff --git a/test/common_plat/validation/api/crypto/crypto.c 
b/test/common_plat/validation/api/crypto/crypto.c
index fde95ab7..8a6c20ec 100644
--- a/test/common_plat/validation/api/crypto/crypto.c
+++ b/test/common_plat/validation/api/crypto/crypto.c
@@ -13,8 +13,12 @@
 #define PKT_POOL_LEN  (1 * 1024)
 
 odp_suiteinfo_t crypto_suites[] = {
-   {ODP_CRYPTO_SYNC_INP, crypto_suite_sync_init, crypto_suite_term,
-crypto_suite},
+   {ODP_CRYPTO_SYNC_INP, crypto_suite_sync_init,
+crypto_suite_term, crypto_suite},
+   {ODP_CRYPTO_PACKET_SYNC_INP, crypto_suite_packet_sync_init,
+crypto_suite_term, crypto_suite},
+   {ODP_CRYPTO_PACKET_ASYNC_INP, crypto_suite_packet_async_init,
+crypto_suite_term, crypto_suite},
ODP_SUITE_INFO_NULL,
 };
 
diff --git a/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c 
b/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c
index d42ecb68..d5549493 100644
--- a/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c
+++ b/test/common_plat/validation/api/crypto/odp_crypto_test_inp.c
@@ -14,6 +14,8 @@
 #define MAX_ALG_CAPA 32
 
 struct suite_context_s {
+   odp_bool_t packet;
+   odp_crypto_op_mode_t packet_op_mode;
odp_pool_t pool;
odp_queue_t queue;
 };
@@ -58,6 +60,217 @@ static const char *cipher_alg_name(odp_cipher_alg_t cipher)
}
 }
 
+static int alg_op(odp_packet_t pkt,
+ odp_bool_t *ok,
+ odp_crypto_session_t session,
+ uint8_t *op_iv_ptr,
+ odp_packet_data_range_t *cipher_range,
+ odp_packet_data_range_t *auth_range,
+ uint8_t *aad,
+ uint32_t aad_len,
+ unsigned int plaintext_len)
+{
+   int data_off = 0, rc;
+   odp_crypto_op_result_t result;
+   odp_crypto_op_param_t op_params;
+   odp_bool_t posted;
+   odp_event_subtype_t subtype;
+
+   /* Prepare input/output params */
+   memset(&op_params, 0, sizeof(op_params));
+   op_params.session = session;
+   op_params.pkt = pkt;
+   op_params.out_pkt = pkt;
+
+   if (cipher_range) {
+   op_params.cipher_range = *cipher_range;
+   data_off = cipher_range->offset;
+   } else {
+   op_params.cipher_range.offset = data_off;
+   op_params.cipher_range.length = plaintext_len;
+   }
+   if (auth_range) {
+   op_params.auth_range = *auth_range;
+   } else {
+   op_params.auth_range.offset = data_off;
+   op_params.auth_range.length = plaintext_len;
+   }
+   if (op_iv_ptr)
+   op_params.override_iv_ptr = op_iv_ptr;
+
+   op_params.aad.ptr = aad;
+   op_params.aad.length = aad_len;
+
+   op_params.hash_result_offset = plaintext_len;
+
+   rc = odp_crypto_operation(&op_params, &posted, &result);
+   if (rc < 0) {
+   CU_FAIL("Failed odp_crypto_operation()");
+   return rc;
+   }
+
+   CU_ASSERT(posted == 0);
+   CU_ASSERT(result.pkt == pkt);
+   CU_ASSERT(ODP_EVENT_PACKET ==
+ odp_event_type(odp_packet_to_event(result.pkt)));
+   CU_ASSERT(ODP_EVENT_PACKET_BASIC ==
+ odp_event_subtype(odp_packet_to_event(result.pkt)));
+   CU_ASSERT(ODP_EVENT_PACKET ==
+ odp_event_types(odp_packet_to_event(result.pkt), &subtype));
+   CU_ASSERT(ODP_EVENT_PACKET_BASIC == subtype);
+
+   *ok = result.ok;
+
+   return 0;
+}
+
+static int alg_packet_op(odp_packet_t pkt,
+odp_bool_t *ok,
+odp_crypto_session_t session,
+uint8_t *op_iv_ptr,
+odp_packet_data_range_t *cipher_range,
+odp_packet_data_range_t *auth_range,
+uint8_t *aad,
+uint32_t aad_len,
+unsigned int plaintext_len)
+{
+   int data_off = 0, rc;
+   odp_crypto_packet_result_t result;
+   odp_crypto_packet_op_param_t op_params;
+   odp_event_subtype_t subtype;
+   odp_packet_t out_pkt = pkt;
+
+   /* Prepare input/output params */
+   memset(&op_params, 0, sizeof(op_params));
+   op_params.session = session;
+
+   if (cipher_range) {
+   op_p

[lng-odp] [PATCH API-NEXT v8 4/10] linux-gen: fix ODP_HANDLE_T expansion with c++ if type is compound

2017-07-05 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Currently expansion of ODP_HANDLE_T defined in strong_types.h would
result in concatenating undercrore with 'type'. If type defined using
macro, this can result in underscore being concatenated with macro name,
resulting in further errors. Use two-stage ODP_HANDLE_T expansion in C++
case so that macro params are expanded first, before being concatenated
with underscore.

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 64 (lumag:crypto-packet)
 ** https://github.com/Linaro/odp/pull/64
 ** Patch: https://github.com/Linaro/odp/pull/64.patch
 ** Base sha: 00a21c6dce65a30c8250db59a42a43c658e8ca1b
 ** Merge commit sha: ac9b299a7f3bee72dd9343bbfaa826217d243ea6
 **/
 platform/linux-generic/include/odp/api/plat/strong_types.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/platform/linux-generic/include/odp/api/plat/strong_types.h 
b/platform/linux-generic/include/odp/api/plat/strong_types.h
index a53d7635..2e3070f8 100644
--- a/platform/linux-generic/include/odp/api/plat/strong_types.h
+++ b/platform/linux-generic/include/odp/api/plat/strong_types.h
@@ -17,7 +17,9 @@
 
 /** Use strong typing for ODP types */
 #ifdef __cplusplus
-#define ODP_HANDLE_T(type) struct _##type { uint8_t unused_dummy_var; } *type
+/* Allow type to be expanded before concatenation with underscore */
+#define _ODP_HANDLE_T(type) struct _##type { uint8_t unused_dummy_var; } *type
+#define ODP_HANDLE_T(type) _ODP_HANDLE_T(type)
 #else
 #define odp_handle_t struct { uint8_t unused_dummy_var; } *
 /** C/C++ helper macro for strong typing */



[lng-odp] [PATCH API-NEXT v8 5/10] api: crypto: deprecate ASYNC mode and odp_crypto_compl_t

2017-07-05 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Setting pref_mode to ASYNC now results in SYNC behaviour, so let's
deprecate all ASYNC-related crypto items: pref_mode, odp_crypto_compl_t
and related functions.

Passing context through param/result is also deprecated, as
odp_crypto_operation now works only in sync mode, thus there is no need
to pass additional data around it.

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 64 (lumag:crypto-packet)
 ** https://github.com/Linaro/odp/pull/64
 ** Patch: https://github.com/Linaro/odp/pull/64.patch
 ** Base sha: 00a21c6dce65a30c8250db59a42a43c658e8ca1b
 ** Merge commit sha: ac9b299a7f3bee72dd9343bbfaa826217d243ea6
 **/
 example/ipsec/odp_ipsec.c  | 14 +---
 example/ipsec/odp_ipsec_cache.c| 15 ++--
 example/ipsec/odp_ipsec_cache.h|  6 +---
 include/odp/api/spec/crypto.h  | 31 ++--
 include/odp/arch/default/api/abi/crypto.h  |  4 ++-
 include/odp/arch/default/api/abi/event.h   |  4 ++-
 .../include/odp/api/plat/crypto_types.h|  3 +-
 .../include/odp/api/plat/event_types.h |  3 +-
 platform/linux-generic/odp_crypto.c| 14 +---
 platform/linux-generic/odp_event.c |  2 ++
 test/common_plat/performance/odp_crypto.c  | 42 +-
 test/common_plat/validation/api/crypto/crypto.c|  2 --
 .../validation/api/crypto/odp_crypto_test_inp.c| 40 +
 .../validation/api/crypto/odp_crypto_test_inp.h|  2 --
 14 files changed, 49 insertions(+), 133 deletions(-)

diff --git a/example/ipsec/odp_ipsec.c b/example/ipsec/odp_ipsec.c
index 9ed3aa20..1ed03585 100644
--- a/example/ipsec/odp_ipsec.c
+++ b/example/ipsec/odp_ipsec.c
@@ -393,9 +393,7 @@ void ipsec_init_post(crypto_api_mode_e api_mode)
 auth_sa,
 tun,
 api_mode,
-entry->input,
-completionq,
-out_pool)) {
+entry->input)) {
EXAMPLE_ERR("Error: IPSec cache entry failed.\n"
);
exit(EXIT_FAILURE);
@@ -662,7 +660,6 @@ pkt_disposition_e do_ipsec_in_classify(odp_packet_t pkt,
 
/* Initialize parameters block */
memset(¶ms, 0, sizeof(params));
-   params.ctx = ctx;
params.session = entry->state.session;
params.pkt = pkt;
params.out_pkt = entry->in_place ? pkt : ODP_PACKET_INVALID;
@@ -843,7 +840,6 @@ pkt_disposition_e do_ipsec_out_classify(odp_packet_t pkt,
/* Initialize parameters block */
memset(¶ms, 0, sizeof(params));
params.session = entry->state.session;
-   params.ctx = ctx;
params.pkt = pkt;
params.out_pkt = entry->in_place ? pkt : ODP_PACKET_INVALID;
 
@@ -1085,14 +1081,6 @@ int pktio_thread(void *arg EXAMPLE_UNUSED)
}
ctx->state = PKT_STATE_INPUT_VERIFY;
}
-   } else if (ODP_EVENT_CRYPTO_COMPL == odp_event_type(ev)) {
-   odp_crypto_compl_t compl;
-
-   compl = odp_crypto_compl_from_event(ev);
-   odp_crypto_compl_result(compl, &result);
-   odp_crypto_compl_free(compl);
-   pkt = result.pkt;
-   ctx = result.ctx;
} else {
abort();
}
diff --git a/example/ipsec/odp_ipsec_cache.c b/example/ipsec/odp_ipsec_cache.c
index dba0ea0a..e4150336 100644
--- a/example/ipsec/odp_ipsec_cache.c
+++ b/example/ipsec/odp_ipsec_cache.c
@@ -40,9 +40,7 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa,
 sa_db_entry_t *auth_sa,
 tun_db_entry_t *tun,
 crypto_api_mode_e api_mode,
-odp_bool_t in,
-odp_queue_t completionq,
-odp_pool_t out_pool)
+odp_bool_t in)
 {
odp_crypto_session_param_t params;
ipsec_cache_entry_t *entry;
@@ -65,15 +63,8 @@ int create_ipsec_cache_entry(sa_db_entry_t *cipher_sa,
/* Setup parameters and call crypto library to create session */
params.op = (in) ? ODP_CRYPTO_OP_DECODE : ODP_CRYPTO_OP_ENCODE;
params.auth_cipher_text = TRUE;
-   if (CRYPTO_API_SYNC == api_mode) {
-   params.pref_mode   = ODP_CRYPTO_SYNC;
-   params.compl_queue = ODP_QUEUE_INVALID;
-   params.output_pool = ODP_P

[lng-odp] [PATCH API-NEXT v8 3/10] api: crypto: drop async mode support

2017-07-05 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Current Crypto API provides a way to set the 'preferred' mode of
operation, without actually telling if the operation will proceed in
sync or async mode. In preparation of reworking crypto API declare that
all operations always end up processed in sync mode (posted == FALSE).

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 64 (lumag:crypto-packet)
 ** https://github.com/Linaro/odp/pull/64
 ** Patch: https://github.com/Linaro/odp/pull/64.patch
 ** Base sha: 00a21c6dce65a30c8250db59a42a43c658e8ca1b
 ** Merge commit sha: ac9b299a7f3bee72dd9343bbfaa826217d243ea6
 **/
 include/odp/api/spec/crypto.h  | 10 ++--
 .../linux-generic/include/odp_crypto_internal.h|  8 ---
 .../linux-generic/include/odp_packet_internal.h|  4 --
 platform/linux-generic/odp_crypto.c| 61 +-
 platform/linux-generic/odp_packet.c|  1 -
 5 files changed, 16 insertions(+), 68 deletions(-)

diff --git a/include/odp/api/spec/crypto.h b/include/odp/api/spec/crypto.h
index 470cba05..01b15d6b 100644
--- a/include/odp/api/spec/crypto.h
+++ b/include/odp/api/spec/crypto.h
@@ -640,14 +640,12 @@ void odp_crypto_compl_free(odp_crypto_compl_t 
completion_event);
  * Crypto per packet operation
  *
  * Performs the cryptographic operations specified during session creation
- * on the packet.  If the operation is performed synchronously, "posted"
- * will return FALSE and the result of the operation is immediately available.
- * If "posted" returns TRUE the result will be delivered via the completion
- * queue specified when the session was created.
+ * on the packet. The operation is performed synchronously, the result of the
+ * operation is immediately available.
  *
  * @param param Operation parameters
- * @param postedPointer to return posted, TRUE for async operation
- * @param resultResults of operation (when posted returns FALSE)
+ * @param postedAlways returns FALSE
+ * @param resultResults of operation
  *
  * @retval 0 on success
  * @retval <0 on failure
diff --git a/platform/linux-generic/include/odp_crypto_internal.h 
b/platform/linux-generic/include/odp_crypto_internal.h
index c3b70b23..52b94d07 100644
--- a/platform/linux-generic/include/odp_crypto_internal.h
+++ b/platform/linux-generic/include/odp_crypto_internal.h
@@ -56,14 +56,6 @@ struct odp_crypto_generic_session {
 };
 
 /**
- * Per packet operation result
- */
-typedef struct odp_crypto_generic_op_result {
-   uint32_t magic;
-   odp_crypto_op_result_t result;
-} odp_crypto_generic_op_result_t;
-
-/**
  * Per session creation operation result
  */
 typedef struct odp_crypto_generic_session_result {
diff --git a/platform/linux-generic/include/odp_packet_internal.h 
b/platform/linux-generic/include/odp_packet_internal.h
index cdd139bb..9f28fc05 100644
--- a/platform/linux-generic/include/odp_packet_internal.h
+++ b/platform/linux-generic/include/odp_packet_internal.h
@@ -128,9 +128,6 @@ typedef struct {
/* Classifier destination queue */
odp_queue_t dst_queue;
 
-   /* Result for crypto */
-   odp_crypto_generic_op_result_t op_result;
-
/* Packet data storage */
uint8_t data[0];
 } odp_packet_hdr_t;
@@ -171,7 +168,6 @@ static inline void 
copy_packet_cls_metadata(odp_packet_hdr_t *src_hdr,
dst_hdr->dst_queue = src_hdr->dst_queue;
dst_hdr->flow_hash = src_hdr->flow_hash;
dst_hdr->timestamp = src_hdr->timestamp;
-   dst_hdr->op_result = src_hdr->op_result;
 }
 
 static inline void pull_tail(odp_packet_hdr_t *pkt_hdr, uint32_t len)
diff --git a/platform/linux-generic/odp_crypto.c 
b/platform/linux-generic/odp_crypto.c
index 0e2adad1..b23b5b6b 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -88,14 +88,6 @@ struct odp_crypto_global_s {
 static odp_crypto_global_t *global;
 
 static
-odp_crypto_generic_op_result_t *get_op_result_from_event(odp_event_t ev)
-{
-   odp_packet_hdr_t *hdr = odp_packet_hdr(odp_packet_from_event(ev));
-
-   return &hdr->op_result;
-}
-
-static
 odp_crypto_generic_session_t *alloc_session(void)
 {
odp_crypto_generic_session_t *session = NULL;
@@ -903,37 +895,14 @@ odp_crypto_operation(odp_crypto_op_param_t *param,
(rc_cipher == ODP_CRYPTO_ALG_ERR_NONE) &&
(rc_auth == ODP_CRYPTO_ALG_ERR_NONE);
 
-   /* If specified during creation post event to completion queue */
-   if (ODP_QUEUE_INVALID != session->p.compl_queue) {
-   odp_event_t completion_event;
-   odp_crypto_generic_op_result_t *op_result;
-   odp_buffer_t buf;
-
-   /* Linux generic will always use packet for completion event */
-   completion_event = odp_packet_to_event(param->out_pkt);
-   buf = odp_buffer_from_event(completion_event);
-   _odp_b

[lng-odp] [PATCH API-NEXT v8 2/10] validation: test correctness of events subtype implementation

2017-07-05 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 64 (lumag:crypto-packet)
 ** https://github.com/Linaro/odp/pull/64
 ** Patch: https://github.com/Linaro/odp/pull/64.patch
 ** Base sha: 00a21c6dce65a30c8250db59a42a43c658e8ca1b
 ** Merge commit sha: ac9b299a7f3bee72dd9343bbfaa826217d243ea6
 **/
 test/common_plat/validation/api/buffer/buffer.c| 50 --
 .../validation/api/crypto/odp_crypto_test_inp.c| 14 ++
 test/common_plat/validation/api/packet/packet.c| 21 -
 test/common_plat/validation/api/timer/timer.c  | 32 --
 4 files changed, 99 insertions(+), 18 deletions(-)

diff --git a/test/common_plat/validation/api/buffer/buffer.c 
b/test/common_plat/validation/api/buffer/buffer.c
index 7c723d4f..66d00ab7 100644
--- a/test/common_plat/validation/api/buffer/buffer.c
+++ b/test/common_plat/validation/api/buffer/buffer.c
@@ -48,7 +48,8 @@ void buffer_test_pool_alloc(void)
odp_buffer_t buffer[num];
odp_event_t ev;
int index;
-   char wrong_type = 0, wrong_size = 0, wrong_align = 0;
+   odp_bool_t wrong_type = false, wrong_subtype = false;
+   odp_bool_t wrong_size = false, wrong_align = false;
odp_pool_param_t params;
 
odp_pool_param_init(¶ms);
@@ -63,6 +64,7 @@ void buffer_test_pool_alloc(void)
/* Try to allocate num items from the pool */
for (index = 0; index < num; index++) {
uintptr_t addr;
+   odp_event_subtype_t subtype;
 
buffer[index] = odp_buffer_alloc(pool);
 
@@ -71,14 +73,20 @@ void buffer_test_pool_alloc(void)
 
ev = odp_buffer_to_event(buffer[index]);
if (odp_event_type(ev) != ODP_EVENT_BUFFER)
-   wrong_type = 1;
+   wrong_type = true;
+   if (odp_event_subtype(ev) != ODP_EVENT_NO_SUBTYPE)
+   wrong_subtype = true;
+   if (odp_event_types(ev, &subtype) != ODP_EVENT_BUFFER)
+   wrong_type = true;
+   if (subtype != ODP_EVENT_NO_SUBTYPE)
+   wrong_subtype = true;
if (odp_buffer_size(buffer[index]) < BUF_SIZE)
-   wrong_size = 1;
+   wrong_size = true;
 
addr = (uintptr_t)odp_buffer_addr(buffer[index]);
 
if ((addr % BUF_ALIGN) != 0)
-   wrong_align = 1;
+   wrong_align = true;
 
if (wrong_type || wrong_size || wrong_align)
odp_buffer_print(buffer[index]);
@@ -90,9 +98,10 @@ void buffer_test_pool_alloc(void)
index--;
 
/* Check that the pool had correct buffers */
-   CU_ASSERT(wrong_type == 0);
-   CU_ASSERT(wrong_size == 0);
-   CU_ASSERT(wrong_align == 0);
+   CU_ASSERT(!wrong_type);
+   CU_ASSERT(!wrong_subtype);
+   CU_ASSERT(!wrong_size);
+   CU_ASSERT(!wrong_align);
 
for (; index >= 0; index--)
odp_buffer_free(buffer[index]);
@@ -123,7 +132,8 @@ void buffer_test_pool_alloc_multi(void)
odp_buffer_t buffer[num + 1];
odp_event_t ev;
int index;
-   char wrong_type = 0, wrong_size = 0, wrong_align = 0;
+   odp_bool_t wrong_type = false, wrong_subtype = false;
+   odp_bool_t wrong_size = false, wrong_align = false;
odp_pool_param_t params;
 
odp_pool_param_init(¶ms);
@@ -140,20 +150,27 @@ void buffer_test_pool_alloc_multi(void)
 
for (index = 0; index < num; index++) {
uintptr_t addr;
+   odp_event_subtype_t subtype;
 
if (buffer[index] == ODP_BUFFER_INVALID)
break;
 
ev = odp_buffer_to_event(buffer[index]);
if (odp_event_type(ev) != ODP_EVENT_BUFFER)
-   wrong_type = 1;
+   wrong_type = true;
+   if (odp_event_subtype(ev) != ODP_EVENT_NO_SUBTYPE)
+   wrong_subtype = true;
+   if (odp_event_types(ev, &subtype) != ODP_EVENT_BUFFER)
+   wrong_type = true;
+   if (subtype != ODP_EVENT_NO_SUBTYPE)
+   wrong_subtype = true;
if (odp_buffer_size(buffer[index]) < BUF_SIZE)
-   wrong_size = 1;
+   wrong_size = true;
 
addr = (uintptr_t)odp_buffer_addr(buffer[index]);
 
if ((addr % BUF_ALIGN) != 0)
-   wrong_align = 1;
+   wrong_align = true;
 
if (wrong_type || wrong_size || wrong_align)
odp_buffer_print(buffer[index]);
@@ -163,9 +180,10 @@ void buffer_test_pool_alloc_multi(void)
CU_ASSERT(index == num);
 
/* Check that the pool had correct buffers */
-   CU_ASSERT(wrong_type == 0);
-   CU_ASSERT(wrong_siz

[lng-odp] [PATCH API-NEXT v8 1/10] linux-generic: events subtype implementation

2017-07-05 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 64 (lumag:crypto-packet)
 ** https://github.com/Linaro/odp/pull/64
 ** Patch: https://github.com/Linaro/odp/pull/64.patch
 ** Base sha: 00a21c6dce65a30c8250db59a42a43c658e8ca1b
 ** Merge commit sha: ac9b299a7f3bee72dd9343bbfaa826217d243ea6
 **/
 platform/linux-generic/include/odp_buffer_inlines.h  |  2 ++
 platform/linux-generic/include/odp_buffer_internal.h |  3 +++
 platform/linux-generic/odp_crypto.c  | 15 +--
 platform/linux-generic/odp_event.c   | 15 +++
 platform/linux-generic/odp_packet.c  |  1 +
 platform/linux-generic/odp_pool.c| 11 +++
 6 files changed, 41 insertions(+), 6 deletions(-)

diff --git a/platform/linux-generic/include/odp_buffer_inlines.h 
b/platform/linux-generic/include/odp_buffer_inlines.h
index cf817d90..4c0e7339 100644
--- a/platform/linux-generic/include/odp_buffer_inlines.h
+++ b/platform/linux-generic/include/odp_buffer_inlines.h
@@ -21,6 +21,8 @@ extern "C" {
 
 odp_event_type_t _odp_buffer_event_type(odp_buffer_t buf);
 void _odp_buffer_event_type_set(odp_buffer_t buf, int ev);
+odp_event_subtype_t _odp_buffer_event_subtype(odp_buffer_t buf);
+void _odp_buffer_event_subtype_set(odp_buffer_t buf, int ev);
 int odp_buffer_snprint(char *str, uint32_t n, odp_buffer_t buf);
 
 static inline odp_buffer_t odp_hdr_to_buf(odp_buffer_hdr_t *hdr)
diff --git a/platform/linux-generic/include/odp_buffer_internal.h 
b/platform/linux-generic/include/odp_buffer_internal.h
index 076abe96..dadf285e 100644
--- a/platform/linux-generic/include/odp_buffer_internal.h
+++ b/platform/linux-generic/include/odp_buffer_internal.h
@@ -96,6 +96,9 @@ struct odp_buffer_hdr_t {
/* Event type. Maybe different than pool type (crypto compl event) */
int8_tevent_type;
 
+   /* Event subtype. Should be ODP_EVENT_NO_SUBTYPE except packets. */
+   int8_tevent_subtype;
+
/* Burst table */
struct odp_buffer_hdr_t *burst[BUFFER_BURST_SIZE];
 
diff --git a/platform/linux-generic/odp_crypto.c 
b/platform/linux-generic/odp_crypto.c
index 68fc5658..0e2adad1 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -907,12 +907,13 @@ odp_crypto_operation(odp_crypto_op_param_t *param,
if (ODP_QUEUE_INVALID != session->p.compl_queue) {
odp_event_t completion_event;
odp_crypto_generic_op_result_t *op_result;
+   odp_buffer_t buf;
 
/* Linux generic will always use packet for completion event */
completion_event = odp_packet_to_event(param->out_pkt);
-   _odp_buffer_event_type_set(
-   odp_buffer_from_event(completion_event),
-   ODP_EVENT_CRYPTO_COMPL);
+   buf = odp_buffer_from_event(completion_event);
+   _odp_buffer_event_type_set(buf, ODP_EVENT_CRYPTO_COMPL);
+   _odp_buffer_event_subtype_set(buf, ODP_EVENT_NO_SUBTYPE);
/* Asynchronous, build result (no HW so no errors) and send it*/
op_result = get_op_result_from_event(completion_event);
op_result->magic = OP_RESULT_MAGIC;
@@ -1106,9 +1107,11 @@ odp_crypto_compl_result(odp_crypto_compl_t 
completion_event,
 void
 odp_crypto_compl_free(odp_crypto_compl_t completion_event)
 {
-   _odp_buffer_event_type_set(
-   odp_buffer_from_event((odp_event_t)completion_event),
-   ODP_EVENT_PACKET);
+   odp_buffer_t buf =
+   odp_buffer_from_event((odp_event_t)completion_event);
+
+   _odp_buffer_event_type_set(buf, ODP_EVENT_PACKET);
+   _odp_buffer_event_subtype_set(buf, ODP_EVENT_PACKET_BASIC);
 }
 
 void odp_crypto_session_param_init(odp_crypto_session_param_t *param)
diff --git a/platform/linux-generic/odp_event.c 
b/platform/linux-generic/odp_event.c
index d71f4464..23b410d8 100644
--- a/platform/linux-generic/odp_event.c
+++ b/platform/linux-generic/odp_event.c
@@ -19,6 +19,21 @@ odp_event_type_t odp_event_type(odp_event_t event)
return _odp_buffer_event_type(odp_buffer_from_event(event));
 }
 
+odp_event_subtype_t odp_event_subtype(odp_event_t event)
+{
+   return _odp_buffer_event_subtype(odp_buffer_from_event(event));
+}
+
+odp_event_type_t odp_event_types(odp_event_t event,
+odp_event_subtype_t *subtype)
+{
+   odp_buffer_t buf = odp_buffer_from_event(event);
+
+   *subtype = _odp_buffer_event_subtype(buf);
+
+   return _odp_buffer_event_type(buf);
+}
+
 void odp_event_free(odp_event_t event)
 {
switch (odp_event_type(event)) {
diff --git a/platform/linux-generic/odp_packet.c 
b/platform/linux-generic/odp_packet.c
index eb66af2d..3789feca 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -268,6 +268,7 @@ static

[lng-odp] [PATCH API-NEXT v8 0/10] Crypto API rework

2017-07-05 Thread Github ODP bot
Provide crypto API using packets to pass results. This PR also contains changes 
from [PATCH API-NEXT v3 0/2] event subtype implementation.

github
/** Email created from pull request 64 (lumag:crypto-packet)
 ** https://github.com/Linaro/odp/pull/64
 ** Patch: https://github.com/Linaro/odp/pull/64.patch
 ** Base sha: 00a21c6dce65a30c8250db59a42a43c658e8ca1b
 ** Merge commit sha: ac9b299a7f3bee72dd9343bbfaa826217d243ea6
 **/
/github

checkpatch.pl
total: 0 errors, 0 warnings, 0 checks, 98 lines checked


to_send-p-000.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 270 lines checked


to_send-p-001.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 143 lines checked


to_send-p-002.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 10 lines checked


to_send-p-003.patch has no obvious style problems and is ready for submission.
CHECK: No space is necessary after a cast
#180: FILE: include/odp/api/spec/crypto.h:627:
+ODP_DEPRECATE(odp_crypto_compl_t) ODP_DEPRECATE(odp_crypto_compl_from_event)(

CHECK: No space is necessary after a cast
#191: FILE: include/odp/api/spec/crypto.h:638:
+ ODP_DEPRECATE(odp_crypto_compl_t) completion_event);

CHECK: No space is necessary after a cast
#200: FILE: include/odp/api/spec/crypto.h:646:
+  ODP_DEPRECATE(odp_crypto_compl_t) completion_event);

CHECK: No space is necessary after a cast
#211: FILE: include/odp/api/spec/crypto.h:673:
+  ODP_DEPRECATE(odp_crypto_compl_t) completion_event,

CHECK: No space is necessary after a cast
#222: FILE: include/odp/api/spec/crypto.h:701:
+  ODP_DEPRECATE(odp_crypto_compl_t) hdl);

total: 0 errors, 0 warnings, 5 checks, 419 lines checked


to_send-p-004.patch has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 0 checks, 301 lines checked


to_send-p-005.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 513 lines checked


to_send-p-006.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 399 lines checked


to_send-p-007.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 236 lines checked


to_send-p-008.patch has no obvious style problems and is ready for submission.
total: 0 errors, 0 warnings, 0 checks, 301 lines checked


to_send-p-009.patch has no obvious style problems and is ready for submission.
/checkpatch.pl


[lng-odp] [Linaro/odp] 05a9cf: doc: add IMAGES_DIR instead of specifying full pat...

2017-07-05 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/Linaro/odp
  Commit: 05a9cff266565a8c7d24eb29d6128f2ad70bbccb
  
https://github.com/Linaro/odp/commit/05a9cff266565a8c7d24eb29d6128f2ad70bbccb
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-07-05 (Wed, 05 Jul 2017)

  Changed paths:
M doc/Makefile.inc
M doc/process-guide/Makefile.am
M doc/users-guide/Makefile.am

  Log Message:
  ---
  doc: add IMAGES_DIR instead of specifying full path to images

Signed-off-by: Dmitry Eremin-Solenikov 
Reviewed-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 


  Commit: 0893a0d99b3b718369d77eacd88db3b7aedc8332
  
https://github.com/Linaro/odp/commit/0893a0d99b3b718369d77eacd88db3b7aedc8332
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-07-05 (Wed, 05 Jul 2017)

  Changed paths:
M doc/Makefile.am
M doc/Makefile.inc
M doc/implementers-guide/Makefile.am
M doc/process-guide/Makefile.am
M doc/users-guide/Makefile.am

  Log Message:
  ---
  doc: fix documentation building

Set VPATH to just $(srcdir) so that make can locate adoc files itself.
Drop long paths starting from $(top_srcdir), which are unnecessary now.
Properly declare SUFFIXES used in documentation building (so that
automake can pass that to make to enable proper rules substitution).

Signed-off-by: Dmitry Eremin-Solenikov 
Reviewed-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 


  Commit: e33884ef62a274c187c30f4bebb34d8a48190cfa
  
https://github.com/Linaro/odp/commit/e33884ef62a274c187c30f4bebb34d8a48190cfa
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-07-05 (Wed, 05 Jul 2017)

  Changed paths:
M doc/implementers-guide/Makefile.am
M doc/process-guide/Makefile.am
M doc/users-guide/Makefile.am

  Log Message:
  ---
  doc: use CLEANFILES instead of handcoding clean rules

Signed-off-by: Dmitry Eremin-Solenikov 
Reviewed-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 


  Commit: fbd17f06236c14c05fb2d577b9027f96cec94a87
  
https://github.com/Linaro/odp/commit/fbd17f06236c14c05fb2d577b9027f96cec94a87
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-07-05 (Wed, 05 Jul 2017)

  Changed paths:
M doc/users-guide/users-guide.adoc

  Log Message:
  ---
  doc: fix user-guide.doc permissions

Signed-off-by: Dmitry Eremin-Solenikov 
Reviewed-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 


  Commit: df2cf17f3cdd3313c9982aacc7adcddfd20ea29a
  
https://github.com/Linaro/odp/commit/df2cf17f3cdd3313c9982aacc7adcddfd20ea29a
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-07-05 (Wed, 05 Jul 2017)

  Changed paths:
M doc/users-guide/users-guide-pktio.adoc
M doc/users-guide/users-guide-tm.adoc

  Log Message:
  ---
  doc: drop images full paths, we have imagesdir properly set

Signed-off-by: Dmitry Eremin-Solenikov 
Reviewed-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 


  Commit: 6096ae389fe221d366d1a7ba8a7169c836a820de
  
https://github.com/Linaro/odp/commit/6096ae389fe221d366d1a7ba8a7169c836a820de
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-07-05 (Wed, 05 Jul 2017)

  Changed paths:
M doc/users-guide/Makefile.am

  Log Message:
  ---
  doc: include sources of generated images into distribution

Signed-off-by: Dmitry Eremin-Solenikov 
Reviewed-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 


  Commit: 61e4b959b31854f83695cbbdd2e2fa0389fa4da6
  
https://github.com/Linaro/odp/commit/61e4b959b31854f83695cbbdd2e2fa0389fa4da6
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-07-05 (Wed, 05 Jul 2017)

  Changed paths:
M Makefile.am

  Log Message:
  ---
  build: enable user guides during distcheck

Signed-off-by: Dmitry Eremin-Solenikov 
Reviewed-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 


  Commit: 96b36df87f23bf32ab218321f1fc35703f092eb4
  
https://github.com/Linaro/odp/commit/96b36df87f23bf32ab218321f1fc35703f092eb4
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-07-05 (Wed, 05 Jul 2017)

  Changed paths:
M .travis.yml

  Log Message:
  ---
  travis: pass proper path to make distcheck

On Travis CI gems are installed into user home directory. If make
distcheck is run under sudo, PATH will be reset and configure won't be
able to find asciidoctor. So let's pass full user's path  to make
distcheck.

Signed-off-by: Dmitry Eremin-Solenikov 
Reviewed-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 


Compare: https://github.com/Linaro/odp/compare/ceeab69f3af6...96b36df87f23


Re: [lng-odp] [API-NEXT PATCH] api: system_info: add function for fetching all supported huge page sizes

2017-07-05 Thread Elo, Matias (Nokia - FI/Espoo)

> On 5 Jul 2017, at 10:09, Maxim Uvarov  wrote:
> 
> Matias,
> 
> I would change it from unsigned. That allows to reuse on variable for all 
> return code.
> 
> int ret;
> 
> re t=  odp_init_global()
> if (ret) ..
> ret = odp_packet()...
> if (ret)
> ret = odp_sys_huge_page_size_all()  <- here in your case we will need 
> additional cast to unsigned 
> if (ret) ...
> return ret;
> 

OK, I'll change the return value and 'num' param to int in V2.

-Matias




Re: [lng-odp] [API-NEXT PATCH] api: system_info: add function for fetching all supported huge page sizes

2017-07-05 Thread Maxim Uvarov
Matias,

I would change it from unsigned. That allows to reuse on variable for all
return code.

int ret;

re t=  odp_init_global()
if (ret) ..
ret = odp_packet()...
if (ret)
ret = odp_sys_huge_page_size_all()  <- here in your case we will need
additional cast to unsigned
if (ret) ...
return ret;

On 3 July 2017 at 15:59, Elo, Matias (Nokia - FI/Espoo) <
matias@nokia.com> wrote:

>
> > On 3 Jul 2017, at 15:54, Bill Fischofer 
> wrote:
> >
> > On Mon, Jul 3, 2017 at 7:40 AM, Elo, Matias (Nokia - FI/Espoo)
> >  wrote:
> >> Ping.
> >
> > Is the rest of the patch (implementation, validation test updates, doc
> > updates) in preparation? The API changes have already been reviewed by
> > both Petri and me.
> >
>
>
> Maxim had previously some issues with the API change, but if everything is
> now OK I can
> do the actual implementation.
>
> -Matias
>
>


Re: [lng-odp] [PATCH CLOUD-DEV v1] [RFC 1/2] odp: add modular framework

2017-07-05 Thread Maxim Uvarov
yes, we can not use GPL code in ODP it has to be pure BSD license. Please
be very careful about back ports from any other not BSD projects.

Maxim.

On 5 July 2017 at 07:28, Honnappa Nagarahalli <
honnappa.nagaraha...@linaro.org> wrote:

> Hi Yi,
> scalable scheduler added a lock-less (for ARM, spin lock for x86)
> linked list in odp_llqueue.h. Lock-less implementation can be more
> helpful in the place of reader-writer lock. You might want to look at
> that.
>
> Thanks,
> Honnappa
>
> On 3 July 2017 at 03:55, Yi He  wrote:
> > Yes, Dmitry and community
> >
> > The modular framework minimizes dependencies to linked-list and rwlock
> > facilities only, and by reusing Linux kernel list.h and alias rwlock APIs
> > to ODP rwlock implementation, it really makes the framework so concise
> > (only one source module.c).
> >
> > I'd like to ask how do we typically solve this kind of license problem
> (GPL
> > vs 3-clause BSD license)? Or I can find a BSD list.h to use.
> >
> > Thanks and Best Regards, Yi
> >
> >
> > On 3 July 2017 at 16:24, Dmitry Eremin-Solenikov <
> > dmitry.ereminsoleni...@linaro.org> wrote:
> >
> >> On 03.07.2017 11:00, Github ODP bot wrote:
> >> > From: Yi He 
> >> >
> >> > Add modular programming framework to support runtime selectable
> >> > implementations for variant software subsystems.
> >> >
> >> > Signed-off-by: Yi He 
> >> > ---
> >> > /** Email created from pull request 65 (heyi-linaro:modular-
> framework)
> >> >  ** https://github.com/Linaro/odp/pull/65
> >> >  ** Patch: https://github.com/Linaro/odp/pull/65.patch
> >> >  ** Base sha: 1ba26aa5650c05718c177842178de6d0f70b7fc1
> >> >  ** Merge commit sha: f0f96a26d22e16b9299777cd413dfd6ae89a024e
> >> >  **/
> >> >  modular-framework/list.h   | 620
> >> +
> >> >  modular-framework/module.c | 158 ++
> >> >  modular-framework/module.h | 205 +++
> >> >  modular-framework/rwlock.h |  88 +++
> >> >  platform/linux-generic/Makefile.am |  11 +
> >> >  .../include/odp/api/plat/atomic_types.h|   2 +
> >> >  .../include/odp/api/plat/rwlock_types.h|   2 +
> >> >  7 files changed, 1086 insertions(+)
> >> >  create mode 100644 modular-framework/list.h
> >> >  create mode 100644 modular-framework/module.c
> >> >  create mode 100644 modular-framework/module.h
> >> >  create mode 100644 modular-framework/rwlock.h
> >> >
> >> > diff --git a/modular-framework/list.h b/modular-framework/list.h
> >> > new file mode 100644
> >> > index ..366d9f38
> >> > --- /dev/null
> >> > +++ b/modular-framework/list.h
> >> > @@ -0,0 +1,620 @@
> >> > +#ifndef _LINUX_LIST_H
> >> > +#define _LINUX_LIST_H
> >>
> >> This file is licensed under GPL, while the rest of ODP is licensed under
> >> 3-clause BSD license.
> >>
> >> > +
> >> > +#include 
> >> > +
> >> > +#if defined(__STDC__)
> >> > +#define typeof __typeof__
> >> > +#endif
> >>
> >>
> >> --
> >> With best wishes
> >> Dmitry
> >>
>