[lng-odp] [PATCH v5 1/3] validation: packet: increase test pool size

2017-03-31 Thread Matias Elo
Previously packet_test_concatsplit() could fail on some pool
implementations as the pool ran out of buffers. Increase default pools size
and use capability to make sure the value is valid.

Signed-off-by: Matias Elo 
---
 test/common_plat/validation/api/packet/packet.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/test/common_plat/validation/api/packet/packet.c 
b/test/common_plat/validation/api/packet/packet.c
index 669122a..1997139 100644
--- a/test/common_plat/validation/api/packet/packet.c
+++ b/test/common_plat/validation/api/packet/packet.c
@@ -13,6 +13,8 @@
 #define PACKET_BUF_LEN ODP_CONFIG_PACKET_SEG_LEN_MIN
 /* Reserve some tailroom for tests */
 #define PACKET_TAILROOM_RESERVE  4
+/* Number of packets in the test packet pool */
+#define PACKET_POOL_NUM 300
 
 static odp_pool_t packet_pool, packet_pool_no_uarea, packet_pool_double_uarea;
 static uint32_t packet_len;
@@ -109,6 +111,7 @@ int packet_suite_init(void)
uint32_t udat_size;
uint8_t data = 0;
uint32_t i;
+   uint32_t num = PACKET_POOL_NUM;
 
if (odp_pool_capability(&capa) < 0) {
printf("pool_capability failed\n");
@@ -130,13 +133,15 @@ int packet_suite_init(void)
segmented_packet_len = capa.pkt.min_seg_len *
   capa.pkt.max_segs_per_pkt;
}
+   if (capa.pkt.max_num != 0 && capa.pkt.max_num < num)
+   num = capa.pkt.max_num;
 
odp_pool_param_init(¶ms);
 
params.type   = ODP_POOL_PACKET;
params.pkt.seg_len= capa.pkt.min_seg_len;
params.pkt.len= capa.pkt.min_seg_len;
-   params.pkt.num= 100;
+   params.pkt.num= num;
params.pkt.uarea_size = sizeof(struct udata_struct);
 
packet_pool = odp_pool_create("packet_pool", ¶ms);
-- 
2.7.4



Re: [lng-odp] [PATCH v5 1/3] validation: packet: increase test pool size

2017-04-06 Thread Krishna Garapati
for this patch series,

Reviewed-by: Balakrishna Garapati 

/Krishna

On 31 March 2017 at 14:18, Matias Elo  wrote:

> Previously packet_test_concatsplit() could fail on some pool
> implementations as the pool ran out of buffers. Increase default pools size
> and use capability to make sure the value is valid.
>
> Signed-off-by: Matias Elo 
> ---
>  test/common_plat/validation/api/packet/packet.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/test/common_plat/validation/api/packet/packet.c
> b/test/common_plat/validation/api/packet/packet.c
> index 669122a..1997139 100644
> --- a/test/common_plat/validation/api/packet/packet.c
> +++ b/test/common_plat/validation/api/packet/packet.c
> @@ -13,6 +13,8 @@
>  #define PACKET_BUF_LEN ODP_CONFIG_PACKET_SEG_LEN_MIN
>  /* Reserve some tailroom for tests */
>  #define PACKET_TAILROOM_RESERVE  4
> +/* Number of packets in the test packet pool */
> +#define PACKET_POOL_NUM 300
>
>  static odp_pool_t packet_pool, packet_pool_no_uarea,
> packet_pool_double_uarea;
>  static uint32_t packet_len;
> @@ -109,6 +111,7 @@ int packet_suite_init(void)
> uint32_t udat_size;
> uint8_t data = 0;
> uint32_t i;
> +   uint32_t num = PACKET_POOL_NUM;
>
> if (odp_pool_capability(&capa) < 0) {
> printf("pool_capability failed\n");
> @@ -130,13 +133,15 @@ int packet_suite_init(void)
> segmented_packet_len = capa.pkt.min_seg_len *
>capa.pkt.max_segs_per_pkt;
> }
> +   if (capa.pkt.max_num != 0 && capa.pkt.max_num < num)
> +   num = capa.pkt.max_num;
>
> odp_pool_param_init(¶ms);
>
> params.type   = ODP_POOL_PACKET;
> params.pkt.seg_len= capa.pkt.min_seg_len;
> params.pkt.len= capa.pkt.min_seg_len;
> -   params.pkt.num= 100;
> +   params.pkt.num= num;
> params.pkt.uarea_size = sizeof(struct udata_struct);
>
> packet_pool = odp_pool_create("packet_pool", ¶ms);
> --
> 2.7.4
>
>


Re: [lng-odp] [PATCH v5 1/3] validation: packet: increase test pool size

2017-04-13 Thread Elo, Matias (Nokia - FI/Espoo)
Ping.


> On 6 Apr 2017, at 14:41, Krishna Garapati  
> wrote:
> 
> for this patch series,
> 
> Reviewed-by: Balakrishna Garapati 
> 
> /Krishna
> 
> On 31 March 2017 at 14:18, Matias Elo  wrote:
> Previously packet_test_concatsplit() could fail on some pool
> implementations as the pool ran out of buffers. Increase default pools size
> and use capability to make sure the value is valid.
> 
> Signed-off-by: Matias Elo 
> ---
>  test/common_plat/validation/api/packet/packet.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/test/common_plat/validation/api/packet/packet.c 
> b/test/common_plat/validation/api/packet/packet.c
> index 669122a..1997139 100644
> --- a/test/common_plat/validation/api/packet/packet.c
> +++ b/test/common_plat/validation/api/packet/packet.c
> @@ -13,6 +13,8 @@
>  #define PACKET_BUF_LEN ODP_CONFIG_PACKET_SEG_LEN_MIN
>  /* Reserve some tailroom for tests */
>  #define PACKET_TAILROOM_RESERVE  4
> +/* Number of packets in the test packet pool */
> +#define PACKET_POOL_NUM 300
> 
>  static odp_pool_t packet_pool, packet_pool_no_uarea, 
> packet_pool_double_uarea;
>  static uint32_t packet_len;
> @@ -109,6 +111,7 @@ int packet_suite_init(void)
> uint32_t udat_size;
> uint8_t data = 0;
> uint32_t i;
> +   uint32_t num = PACKET_POOL_NUM;
> 
> if (odp_pool_capability(&capa) < 0) {
> printf("pool_capability failed\n");
> @@ -130,13 +133,15 @@ int packet_suite_init(void)
> segmented_packet_len = capa.pkt.min_seg_len *
>capa.pkt.max_segs_per_pkt;
> }
> +   if (capa.pkt.max_num != 0 && capa.pkt.max_num < num)
> +   num = capa.pkt.max_num;
> 
> odp_pool_param_init(¶ms);
> 
> params.type   = ODP_POOL_PACKET;
> params.pkt.seg_len= capa.pkt.min_seg_len;
> params.pkt.len= capa.pkt.min_seg_len;
> -   params.pkt.num= 100;
> +   params.pkt.num= num;
> params.pkt.uarea_size = sizeof(struct udata_struct);
> 
> packet_pool = odp_pool_create("packet_pool", ¶ms);
> --
> 2.7.4
> 
>