[lng-odp] [PATCH] example:generator : Fix data race condition

2015-10-01 Thread ion.grigore
From: Grigore Ion 

The counters.seq counter is used to check if the configured number of
packets was processed. There is a race condition between the counter
incrementation time and its value testing time. If code is running on
multiple CPUs it is possible the application send more packets than
expected (with number of CPUs - 1). A separate counter must be used
for the processed packets.

Signed-off-by: Grigore Ion 
---
 example/generator/odp_generator.c |   20 +++-
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/example/generator/odp_generator.c 
b/example/generator/odp_generator.c
index e281b27..34df8b3 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -66,6 +66,7 @@ static struct {
odp_atomic_u64_t ip;/**< ip packets */
odp_atomic_u64_t udp;   /**< udp packets */
odp_atomic_u64_t icmp;  /**< icmp packets */
+   odp_atomic_u64_t cnt;   /**< sent packets*/
 } counters;
 
 /** * Thread specific arguments
@@ -395,6 +396,12 @@ static void *gen_send_thread(void *arg)
for (;;) {
int err;
 
+   if (args->appl.number != -1 &&
+   odp_atomic_fetch_add_u64(, 1) >=
+   (unsigned int)args->appl.number) {
+   break;
+   }
+
if (args->appl.mode == APPL_MODE_UDP)
pkt = pack_udp_pkt(thr_args->pool);
else if (args->appl.mode == APPL_MODE_PING)
@@ -426,11 +433,6 @@ static void *gen_send_thread(void *arg)
   thr_args->tmo_ev);
 
}
-   if (args->appl.number != -1 &&
-   odp_atomic_load_u64()
-   >= (unsigned int)args->appl.number) {
-   break;
-   }
}
 
/* receive number of reply pks until timeout */
@@ -450,11 +452,10 @@ static void *gen_send_thread(void *arg)
 
/* print info */
if (args->appl.mode == APPL_MODE_UDP) {
-   printf("  [%02i] total send: %ju\n",
-  thr, odp_atomic_load_u64());
+   printf("  [%02i] total send: %d\n", thr, args->appl.number);
} else if (args->appl.mode == APPL_MODE_PING) {
-   printf("  [%02i] total send: %ju total receive: %ju\n",
-  thr, odp_atomic_load_u64(),
+   printf("  [%02i] total send: %d total receive: %ju\n",
+  thr, args->appl.number,
   odp_atomic_load_u64());
}
return arg;
@@ -610,6 +611,7 @@ int main(int argc, char *argv[])
odp_atomic_init_u64(, 0);
odp_atomic_init_u64(, 0);
odp_atomic_init_u64(, 0);
+   odp_atomic_init_u64(, 0);
 
/* Reserve memory for args from shared mem */
shm = odp_shm_reserve("shm_args", sizeof(args_t),
-- 
1.7.3.4

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1834] New: Untested internal API verify_pmr_dmac

2015-10-01 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1834

Bug ID: 1834
   Summary: Untested internal API verify_pmr_dmac
   Product: OpenDataPlane - linux- generic reference
   Version: 1.3
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Classification
  Assignee: bala.manoha...@linaro.org
  Reporter: mike.hol...@linaro.org
CC: lng-odp@lists.linaro.org

Validation tests should exercise this branch

http://docs.opendataplane.org/master/linux-generic-lcov-html/linux-generic/include/odp_classification_inlines.h.func-sort-c.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] example:generator : Fix data race condition

2015-10-01 Thread Maxim Uvarov

ping.

On 09/22/15 17:19, ion.grig...@freescale.com wrote:

From: Grigore Ion 

The counters.seq counter is used to check if the configured number of
packets was processed. There is a race condition between the counter
incrementation time and its value testing time. If code is running on
multiple CPUs it is possible the application send more packets than
expected (with number of CPUs - 1). A separate counter must be used
for the processed packets.

Signed-off-by: Grigore Ion 
---
  example/generator/odp_generator.c |   21 -
  1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/example/generator/odp_generator.c 
b/example/generator/odp_generator.c
index e281b27..2dc1801 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -66,6 +66,7 @@ static struct {
odp_atomic_u64_t ip;/**< ip packets */
odp_atomic_u64_t udp;   /**< udp packets */
odp_atomic_u64_t icmp;  /**< icmp packets */
+   odp_atomic_u64_t cnt;   /**< sent packets*/
  } counters;
  
  /** * Thread specific arguments

@@ -228,6 +229,7 @@ static odp_packet_t pack_udp_pkt(odp_pool_t pool)
   ODPH_IPV4HDR_LEN);
ip->proto = ODPH_IPPROTO_UDP;
seq = odp_atomic_fetch_add_u64(, 1) % 0x;
+
ip->id = odp_cpu_to_be_16(seq);
ip->chksum = 0;
odph_ipv4_csum_update(pkt);
@@ -395,6 +397,12 @@ static void *gen_send_thread(void *arg)
for (;;) {
int err;
  
+		if (args->appl.number != -1 &&

+   odp_atomic_fetch_add_u64(, 1) >=
+   (unsigned int)args->appl.number) {
+   break;
+   }
+
if (args->appl.mode == APPL_MODE_UDP)
pkt = pack_udp_pkt(thr_args->pool);
else if (args->appl.mode == APPL_MODE_PING)
@@ -426,11 +434,6 @@ static void *gen_send_thread(void *arg)
   thr_args->tmo_ev);
  
  		}

-   if (args->appl.number != -1 &&
-   odp_atomic_load_u64()
-   >= (unsigned int)args->appl.number) {
-   break;
-   }
}
  
  	/* receive number of reply pks until timeout */

@@ -450,11 +453,10 @@ static void *gen_send_thread(void *arg)
  
  	/* print info */

if (args->appl.mode == APPL_MODE_UDP) {
-   printf("  [%02i] total send: %ju\n",
-  thr, odp_atomic_load_u64());
+   printf("  [%02i] total send: %d\n", thr, args->appl.number);
} else if (args->appl.mode == APPL_MODE_PING) {
-   printf("  [%02i] total send: %ju total receive: %ju\n",
-  thr, odp_atomic_load_u64(),
+   printf("  [%02i] total send: %d total receive: %ju\n",
+  thr, args->appl.number,
   odp_atomic_load_u64());
}
return arg;
@@ -610,6 +612,7 @@ int main(int argc, char *argv[])
odp_atomic_init_u64(, 0);
odp_atomic_init_u64(, 0);
odp_atomic_init_u64(, 0);
+   odp_atomic_init_u64(, 0);
  
  	/* Reserve memory for args from shared mem */

shm = odp_shm_reserve("shm_args", sizeof(args_t),


___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1824] Untested internal code: reorder_enq & reorder_deq

2015-10-01 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1824

Bill Fischofer  changed:

   What|Removed |Added

 CC||bill.fischo...@linaro.org

--- Comment #1 from Bill Fischofer  ---
These routines are quite thoroughly exercised by the l2fwd example running in
schedule mode, especially when run with a large PCAP file using Stuart's code. 
This was covered in the resolution of Bug
https://bugs.linaro.org/show_bug.cgi?id=1803

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1826] New: Untested internal APIs verify_pmr_eth_type_0

2015-10-01 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1826

Bug ID: 1826
   Summary: Untested internal APIs verify_pmr_eth_type_0
   Product: OpenDataPlane - linux- generic reference
   Version: 1.3
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Classification
  Assignee: bala.manoha...@linaro.org
  Reporter: mike.hol...@linaro.org
CC: lng-odp@lists.linaro.org

Validation tests should exercise this branch

http://docs.opendataplane.org/master/linux-generic-lcov-html/linux-generic/include/odp_classification_inlines.h.func-sort-c.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1827] New: Untested internal API verify_pmr_eth_type_x

2015-10-01 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1827

Bug ID: 1827
   Summary: Untested internal API verify_pmr_eth_type_x
   Product: OpenDataPlane - linux- generic reference
   Version: 1.3
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Classification
  Assignee: bala.manoha...@linaro.org
  Reporter: mike.hol...@linaro.org
CC: lng-odp@lists.linaro.org

Validation tests should exercise this branch

http://docs.opendataplane.org/master/linux-generic-lcov-html/linux-generic/include/odp_classification_inlines.h.func-sort-c.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] example:generator : Fix data race condition

2015-10-01 Thread Ion Grigore
Pong.

-Original Message-
From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of Maxim 
Uvarov
Sent: Thursday, October 01, 2015 1:37 PM
To: lng-odp@lists.linaro.org
Subject: Re: [lng-odp] [PATCH] example:generator : Fix data race condition

ping.

On 09/22/15 17:19, ion.grig...@freescale.com wrote:
> From: Grigore Ion 
>
> The counters.seq counter is used to check if the configured number of 
> packets was processed. There is a race condition between the counter 
> incrementation time and its value testing time. If code is running on 
> multiple CPUs it is possible the application send more packets than 
> expected (with number of CPUs - 1). A separate counter must be used 
> for the processed packets.
>
> Signed-off-by: Grigore Ion 
> ---
>   example/generator/odp_generator.c |   21 -
>   1 files changed, 12 insertions(+), 9 deletions(-)
>
> diff --git a/example/generator/odp_generator.c 
> b/example/generator/odp_generator.c
> index e281b27..2dc1801 100644
> --- a/example/generator/odp_generator.c
> +++ b/example/generator/odp_generator.c
> @@ -66,6 +66,7 @@ static struct {
>   odp_atomic_u64_t ip;/**< ip packets */
>   odp_atomic_u64_t udp;   /**< udp packets */
>   odp_atomic_u64_t icmp;  /**< icmp packets */
> + odp_atomic_u64_t cnt;   /**< sent packets*/
>   } counters;
>   
>   /** * Thread specific arguments
> @@ -228,6 +229,7 @@ static odp_packet_t pack_udp_pkt(odp_pool_t pool)
>  ODPH_IPV4HDR_LEN);
>   ip->proto = ODPH_IPPROTO_UDP;
>   seq = odp_atomic_fetch_add_u64(, 1) % 0x;
> +
>   ip->id = odp_cpu_to_be_16(seq);
>   ip->chksum = 0;
>   odph_ipv4_csum_update(pkt);
> @@ -395,6 +397,12 @@ static void *gen_send_thread(void *arg)
>   for (;;) {
>   int err;
>   
> + if (args->appl.number != -1 &&
> + odp_atomic_fetch_add_u64(, 1) >=
> + (unsigned int)args->appl.number) {
> + break;
> + }
> +
>   if (args->appl.mode == APPL_MODE_UDP)
>   pkt = pack_udp_pkt(thr_args->pool);
>   else if (args->appl.mode == APPL_MODE_PING) @@ -426,11 +434,6 
> @@ 
> static void *gen_send_thread(void *arg)
>  thr_args->tmo_ev);
>   
>   }
> - if (args->appl.number != -1 &&
> - odp_atomic_load_u64()
> - >= (unsigned int)args->appl.number) {
> - break;
> - }
>   }
>   
>   /* receive number of reply pks until timeout */ @@ -450,11 +453,10 
> @@ static void *gen_send_thread(void *arg)
>   
>   /* print info */
>   if (args->appl.mode == APPL_MODE_UDP) {
> - printf("  [%02i] total send: %ju\n",
> -thr, odp_atomic_load_u64());
> + printf("  [%02i] total send: %d\n", thr, args->appl.number);
>   } else if (args->appl.mode == APPL_MODE_PING) {
> - printf("  [%02i] total send: %ju total receive: %ju\n",
> -thr, odp_atomic_load_u64(),
> + printf("  [%02i] total send: %d total receive: %ju\n",
> +thr, args->appl.number,
>  odp_atomic_load_u64());
>   }
>   return arg;
> @@ -610,6 +612,7 @@ int main(int argc, char *argv[])
>   odp_atomic_init_u64(, 0);
>   odp_atomic_init_u64(, 0);
>   odp_atomic_init_u64(, 0);
> + odp_atomic_init_u64(, 0);
>   
>   /* Reserve memory for args from shared mem */
>   shm = odp_shm_reserve("shm_args", sizeof(args_t),

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1829] New: Untested internal API verify_pmr_ipsec_spi

2015-10-01 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1829

Bug ID: 1829
   Summary: Untested internal API verify_pmr_ipsec_spi
   Product: OpenDataPlane - linux- generic reference
   Version: 1.3
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Classification
  Assignee: bala.manoha...@linaro.org
  Reporter: mike.hol...@linaro.org
CC: lng-odp@lists.linaro.org

Validation tests should exercise this branch

http://docs.opendataplane.org/master/linux-generic-lcov-html/linux-generic/include/odp_classification_inlines.h.func-sort-c.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1830] New: Untested internal API verify_pmr_ipv4_daddr

2015-10-01 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1830

Bug ID: 1830
   Summary: Untested internal API verify_pmr_ipv4_daddr
   Product: OpenDataPlane - linux- generic reference
   Version: 1.3
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Classification
  Assignee: bala.manoha...@linaro.org
  Reporter: mike.hol...@linaro.org
CC: lng-odp@lists.linaro.org

Validation tests should exercise this branch

http://docs.opendataplane.org/master/linux-generic-lcov-html/linux-generic/include/odp_classification_inlines.h.func-sort-c.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] example:generator : Fix data race condition

2015-10-01 Thread Ola Liljedahl
I think Maxim expects you to send an updated patch with the following
change reversed:

seq = odp_atomic_fetch_add_u64(, 1) % 0x;
+
ip->id = odp_cpu_to_be_16(seq);

Unfortunately Maxim only responded to the ODP list and not to you directly.
Perhaps you are not on the list?

-- Ola


On 1 October 2015 at 13:04, Ion Grigore  wrote:

> Pong.
>
> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of
> Maxim Uvarov
> Sent: Thursday, October 01, 2015 1:37 PM
> To: lng-odp@lists.linaro.org
> Subject: Re: [lng-odp] [PATCH] example:generator : Fix data race condition
>
> ping.
>
> On 09/22/15 17:19, ion.grig...@freescale.com wrote:
> > From: Grigore Ion 
> >
> > The counters.seq counter is used to check if the configured number of
> > packets was processed. There is a race condition between the counter
> > incrementation time and its value testing time. If code is running on
> > multiple CPUs it is possible the application send more packets than
> > expected (with number of CPUs - 1). A separate counter must be used
> > for the processed packets.
> >
> > Signed-off-by: Grigore Ion 
> > ---
> >   example/generator/odp_generator.c |   21 -
> >   1 files changed, 12 insertions(+), 9 deletions(-)
> >
> > diff --git a/example/generator/odp_generator.c
> > b/example/generator/odp_generator.c
> > index e281b27..2dc1801 100644
> > --- a/example/generator/odp_generator.c
> > +++ b/example/generator/odp_generator.c
> > @@ -66,6 +66,7 @@ static struct {
> >   odp_atomic_u64_t ip;/**< ip packets */
> >   odp_atomic_u64_t udp;   /**< udp packets */
> >   odp_atomic_u64_t icmp;  /**< icmp packets */
> > + odp_atomic_u64_t cnt;   /**< sent packets*/
> >   } counters;
> >
> >   /** * Thread specific arguments
> > @@ -228,6 +229,7 @@ static odp_packet_t pack_udp_pkt(odp_pool_t pool)
> >  ODPH_IPV4HDR_LEN);
> >   ip->proto = ODPH_IPPROTO_UDP;
> >   seq = odp_atomic_fetch_add_u64(, 1) % 0x;
> > +
> >   ip->id = odp_cpu_to_be_16(seq);
> >   ip->chksum = 0;
> >   odph_ipv4_csum_update(pkt);
> > @@ -395,6 +397,12 @@ static void *gen_send_thread(void *arg)
> >   for (;;) {
> >   int err;
> >
> > + if (args->appl.number != -1 &&
> > + odp_atomic_fetch_add_u64(, 1) >=
> > + (unsigned int)args->appl.number) {
> > + break;
> > + }
> > +
> >   if (args->appl.mode == APPL_MODE_UDP)
> >   pkt = pack_udp_pkt(thr_args->pool);
> >   else if (args->appl.mode == APPL_MODE_PING) @@ -426,11
> +434,6 @@
> > static void *gen_send_thread(void *arg)
> >  thr_args->tmo_ev);
> >
> >   }
> > - if (args->appl.number != -1 &&
> > - odp_atomic_load_u64()
> > - >= (unsigned int)args->appl.number) {
> > - break;
> > - }
> >   }
> >
> >   /* receive number of reply pks until timeout */ @@ -450,11 +453,10
> > @@ static void *gen_send_thread(void *arg)
> >
> >   /* print info */
> >   if (args->appl.mode == APPL_MODE_UDP) {
> > - printf("  [%02i] total send: %ju\n",
> > -thr, odp_atomic_load_u64());
> > + printf("  [%02i] total send: %d\n", thr,
> args->appl.number);
> >   } else if (args->appl.mode == APPL_MODE_PING) {
> > - printf("  [%02i] total send: %ju total receive: %ju\n",
> > -thr, odp_atomic_load_u64(),
> > + printf("  [%02i] total send: %d total receive: %ju\n",
> > +thr, args->appl.number,
> >  odp_atomic_load_u64());
> >   }
> >   return arg;
> > @@ -610,6 +612,7 @@ int main(int argc, char *argv[])
> >   odp_atomic_init_u64(, 0);
> >   odp_atomic_init_u64(, 0);
> >   odp_atomic_init_u64(, 0);
> > + odp_atomic_init_u64(, 0);
> >
> >   /* Reserve memory for args from shared mem */
> >   shm = odp_shm_reserve("shm_args", sizeof(args_t),
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT/PATCH] validation: classification: Queue parameter init calls

2015-10-01 Thread Maxim Uvarov

Merged,
Thanks!

(looks like it's the most tested one liner we had before ;)

On 09/30/15 20:53, Anders Roxell wrote:

On 2015-09-30 11:43, Mike Holmes wrote:

On 30 September 2015 at 06:24, Bill Fischofer 
wrote:



On Wed, Sep 30, 2015 at 2:24 AM, Balasubramanian Manoharan <
bala.manoha...@linaro.org> wrote:


Add missing odp_queue_param_init()
Fixes: https://bugs.linaro.org/show_bug.cgi?id=1823

Signed-off-by: Balasubramanian Manoharan 


Reviewed-by: Bill Fischofer 


Reviewed-and-tested-by: Mike Holmes 

Reviewed-and-tested-by: Anders Roxell 


Fixes Bug 1823





---
  test/validation/classification/odp_classification_basic.c | 1 +
  test/validation/classification/odp_classification_tests.c | 1 +
  2 files changed, 2 insertions(+)

diff --git a/test/validation/classification/odp_classification_basic.c
b/test/validation/classification/odp_classification_basic.c
index d60eafd..c063b88 100644
--- a/test/validation/classification/odp_classification_basic.c
+++ b/test/validation/classification/odp_classification_basic.c
@@ -76,6 +76,7 @@ void classification_test_cos_set_queue(void)
 cos_queue = odp_cos_create(cosname);
 CU_ASSERT_FATAL(cos_queue != ODP_COS_INVALID);

+   odp_queue_param_init();
 qparam.sched.prio = ODP_SCHED_PRIO_HIGHEST;
 qparam.sched.sync = ODP_SCHED_SYNC_NONE;
 qparam.sched.group = ODP_SCHED_GROUP_ALL;
diff --git a/test/validation/classification/odp_classification_tests.c
b/test/validation/classification/odp_classification_tests.c
index 69a71b1..0fb624d 100644
--- a/test/validation/classification/odp_classification_tests.c
+++ b/test/validation/classification/odp_classification_tests.c
@@ -408,6 +408,7 @@ void configure_cls_pmr_chain(void)
 cos_list[CLS_PMR_CHAIN_DST] = odp_cos_create(cosname);
 CU_ASSERT_FATAL(cos_list[CLS_PMR_CHAIN_DST] != ODP_COS_INVALID);

+   odp_queue_param_init();
 qparam.sched.prio = ODP_SCHED_PRIO_NORMAL;
 qparam.sched.sync = ODP_SCHED_SYNC_NONE;
 qparam.sched.group = ODP_SCHED_GROUP_ALL;
--
1.9.1

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp



___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp




--
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org  *│ *Open source software for ARM SoCs
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp




___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH] helper : Fix UDP checksum computation

2015-10-01 Thread ion.grigore
From: Grigore Ion 

This patch fixes the following problems:
- checksum computation for LE platforms
- checksum is computed in the CPU endianness. The returned result
must be converted to the BE ordering when it is used to update the
UDP checksum in a packet.
- checksum computation for packets having the UDP length not a
multiple of 2.

Signed-off-by: Grigore Ion 
---
 helper/include/odp/helper/udp.h |   55 --
 1 files changed, 23 insertions(+), 32 deletions(-)

diff --git a/helper/include/odp/helper/udp.h b/helper/include/odp/helper/udp.h
index 06c439b..f56b310 100644
--- a/helper/include/odp/helper/udp.h
+++ b/helper/include/odp/helper/udp.h
@@ -4,7 +4,6 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-
 /**
  * @file
  *
@@ -22,7 +21,6 @@ extern "C" {
 #include 
 #include 
 
-
 /** @addtogroup odph_header ODPH HEADER
  *  @{
  */
@@ -44,46 +42,39 @@ typedef struct ODP_PACKED {
  * This function uses odp packet to calc checksum
  *
  * @param pkt  calculate chksum for pkt
- * @return  checksum value
+ * @return  checksum value in CPU endianness
  */
 static inline uint16_t odph_ipv4_udp_chksum(odp_packet_t pkt)
 {
-   uint32_t sum = 0;
-   odph_udphdr_t *udph;
-   odph_ipv4hdr_t *iph;
-   uint16_t udplen;
-   uint8_t *buf;
-
-   if (!odp_packet_l3_offset(pkt))
-   return 0;
+   odph_ipv4hdr_t  *iph;
+   odph_udphdr_t   *udph;
+   uint32_tsum;
+   uint16_tudplen, *buf;
 
-   if (!odp_packet_l4_offset(pkt))
+   if (!odp_packet_l3_offset(pkt) || !odp_packet_l3_offset(pkt))
return 0;
-
iph = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
udph = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL);
-   udplen = odp_be_to_cpu_16(udph->length);
-
-   /* 32-bit sum of all 16-bit words covered by UDP chksum */
+   /* 32-bit sum of UDP pseudo-header */
sum = (iph->src_addr & 0x) + (iph->src_addr >> 16) +
- (iph->dst_addr & 0x) + (iph->dst_addr >> 16) +
- (uint16_t)iph->proto + udplen;
-   for (buf = (uint8_t *)udph; udplen > 1; udplen -= 2) {
-   sum += ((*buf << 8) + *(buf + 1));
-   buf += 2;
-   }
-
-   /* Fold sum to 16 bits: add carrier to result */
-   while (sum >> 16)
-   sum = (sum & 0x) + (sum >> 16);
-
+   (iph->dst_addr & 0x) + (iph->dst_addr >> 16) +
+   odp_be_to_cpu_16(iph->proto) + udph->length;
+   udplen = odp_be_to_cpu_16(udph->length);
+   buf = (uint16_t *)((void *)udph);
+   /* 32-bit sum of UDP header (checksum field cleared) and UDP data */
+   for ( ; udplen > 1; udplen -= 2)
+   sum += *buf++;
+   /* Length is not a multiple of 2 bytes */
+   if (udplen)
+   sum += odp_be_to_cpu_16(*((uint8_t *)buf) << 8);
+   /* Fold sum to 16 bits */
+   sum = (sum & 0x) + (sum >> 16);
+   /* Add carrier (0/1) to result */
+   sum += (sum >> 16);
/* 1's complement */
sum = ~sum;
-
-   /* set computation result */
-   sum = (sum == 0x0) ? 0x : sum;
-
-   return sum;
+   /* Set computation result */
+   return (sum == 0x0) ? 0x : odp_be_to_cpu_16(sum);
 }
 
 /** @internal Compile time assert */
-- 
1.7.3.4

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1828] New: Untested internal API verify_pmr_ip_proto

2015-10-01 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1828

Bug ID: 1828
   Summary: Untested internal API  verify_pmr_ip_proto
   Product: OpenDataPlane - linux- generic reference
   Version: 1.3
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Classification
  Assignee: bala.manoha...@linaro.org
  Reporter: mike.hol...@linaro.org
CC: lng-odp@lists.linaro.org

Validation tests should exercise this branch

http://docs.opendataplane.org/master/linux-generic-lcov-html/linux-generic/include/odp_classification_inlines.h.func-sort-c.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] example:generator : Fix data race condition

2015-10-01 Thread Ion Grigore
Hi

I superseded the old patch and I resent a new one with the “empty line” removed.

Thanks,
Grig


From: Ola Liljedahl [mailto:ola.liljed...@linaro.org]
Sent: Thursday, October 01, 2015 4:05 PM
To: Grigore Ion-B17953 
Cc: Maxim Uvarov ; lng-odp@lists.linaro.org
Subject: Re: [lng-odp] [PATCH] example:generator : Fix data race condition

I think Maxim expects you to send an updated patch with the following change 
reversed:

seq = odp_atomic_fetch_add_u64(, 1) % 0x;
+
ip->id = odp_cpu_to_be_16(seq);

Unfortunately Maxim only responded to the ODP list and not to you directly. 
Perhaps you are not on the list?

-- Ola


On 1 October 2015 at 13:04, Ion Grigore 
> wrote:
Pong.

-Original Message-
From: lng-odp 
[mailto:lng-odp-boun...@lists.linaro.org]
 On Behalf Of Maxim Uvarov
Sent: Thursday, October 01, 2015 1:37 PM
To: lng-odp@lists.linaro.org
Subject: Re: [lng-odp] [PATCH] example:generator : Fix data race condition

ping.

On 09/22/15 17:19, ion.grig...@freescale.com 
wrote:
> From: Grigore Ion 
> >
>
> The counters.seq counter is used to check if the configured number of
> packets was processed. There is a race condition between the counter
> incrementation time and its value testing time. If code is running on
> multiple CPUs it is possible the application send more packets than
> expected (with number of CPUs - 1). A separate counter must be used
> for the processed packets.
>
> Signed-off-by: Grigore Ion 
> >
> ---
>   example/generator/odp_generator.c |   21 -
>   1 files changed, 12 insertions(+), 9 deletions(-)
>
> diff --git a/example/generator/odp_generator.c
> b/example/generator/odp_generator.c
> index e281b27..2dc1801 100644
> --- a/example/generator/odp_generator.c
> +++ b/example/generator/odp_generator.c
> @@ -66,6 +66,7 @@ static struct {
>   odp_atomic_u64_t ip;/**< ip packets */
>   odp_atomic_u64_t udp;   /**< udp packets */
>   odp_atomic_u64_t icmp;  /**< icmp packets */
> + odp_atomic_u64_t cnt;   /**< sent packets*/
>   } counters;
>
>   /** * Thread specific arguments
> @@ -228,6 +229,7 @@ static odp_packet_t pack_udp_pkt(odp_pool_t pool)
>  ODPH_IPV4HDR_LEN);
>   ip->proto = ODPH_IPPROTO_UDP;
>   seq = odp_atomic_fetch_add_u64(, 1) % 0x;
> +
>   ip->id = odp_cpu_to_be_16(seq);
>   ip->chksum = 0;
>   odph_ipv4_csum_update(pkt);
> @@ -395,6 +397,12 @@ static void *gen_send_thread(void *arg)
>   for (;;) {
>   int err;
>
> + if (args->appl.number != -1 &&
> + odp_atomic_fetch_add_u64(, 1) >=
> + (unsigned int)args->appl.number) {
> + break;
> + }
> +
>   if (args->appl.mode == APPL_MODE_UDP)
>   pkt = pack_udp_pkt(thr_args->pool);
>   else if (args->appl.mode == APPL_MODE_PING) @@ -426,11 +434,6 @@
> static void *gen_send_thread(void *arg)
>  thr_args->tmo_ev);
>
>   }
> - if (args->appl.number != -1 &&
> - odp_atomic_load_u64()
> - >= (unsigned int)args->appl.number) {
> - break;
> - }
>   }
>
>   /* receive number of reply pks until timeout */ @@ -450,11 +453,10
> @@ static void *gen_send_thread(void *arg)
>
>   /* print info */
>   if (args->appl.mode == APPL_MODE_UDP) {
> - printf("  [%02i] total send: %ju\n",
> -thr, odp_atomic_load_u64());
> + printf("  [%02i] total send: %d\n", thr, args->appl.number);
>   } else if (args->appl.mode == APPL_MODE_PING) {
> - printf("  [%02i] total send: %ju total receive: %ju\n",
> -thr, odp_atomic_load_u64(),
> + printf("  [%02i] total send: %d total receive: %ju\n",
> +thr, args->appl.number,
>  odp_atomic_load_u64());
>   }
>   return arg;
> @@ -610,6 +612,7 @@ int main(int argc, char *argv[])
>   odp_atomic_init_u64(, 0);
>   odp_atomic_init_u64(, 0);
>   odp_atomic_init_u64(, 0);
> + odp_atomic_init_u64(, 0);
>
>   /* Reserve memory for args from shared mem */
>   shm = odp_shm_reserve("shm_args", sizeof(args_t),

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp
___
lng-odp mailing list
lng-odp@lists.linaro.org

[lng-odp] [Bug 1833] New: Untested internal API verify_pmr_ld_vni

2015-10-01 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1833

Bug ID: 1833
   Summary: Untested internal API verify_pmr_ld_vni
   Product: OpenDataPlane - linux- generic reference
   Version: 1.3
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Classification
  Assignee: bala.manoha...@linaro.org
  Reporter: mike.hol...@linaro.org
CC: lng-odp@lists.linaro.org

Validation tests should exercise this branch

http://docs.opendataplane.org/master/linux-generic-lcov-html/linux-generic/include/odp_classification_inlines.h.func-sort-c.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1832] New: Untested internal API verify_pmr_ipv6_saddr

2015-10-01 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1832

Bug ID: 1832
   Summary: Untested internal API verify_pmr_ipv6_saddr
   Product: OpenDataPlane - linux- generic reference
   Version: 1.3
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Classification
  Assignee: bala.manoha...@linaro.org
  Reporter: mike.hol...@linaro.org
CC: lng-odp@lists.linaro.org

Validation tests should exercise this branch

http://docs.opendataplane.org/master/linux-generic-lcov-html/linux-generic/include/odp_classification_inlines.h.func-sort-c.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1831] New: Untested internal API verify_pmr_ipv6_daddr

2015-10-01 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1831

Bug ID: 1831
   Summary: Untested internal API verify_pmr_ipv6_daddr
   Product: OpenDataPlane - linux- generic reference
   Version: 1.3
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Classification
  Assignee: bala.manoha...@linaro.org
  Reporter: mike.hol...@linaro.org
CC: lng-odp@lists.linaro.org

Validation tests should exercise this branch

http://docs.opendataplane.org/master/linux-generic-lcov-html/linux-generic/include/odp_classification_inlines.h.func-sort-c.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXTv2 2/7] api: packet: add functions to alloc/free multiple packets at once

2015-10-01 Thread Bill Fischofer
I agree if we're going to support multi calls then these are a reasonable
addition.  We'll also need an odp_tm_enq_multi() variant as well if we
don't have one already.

On Wed, Sep 30, 2015 at 6:08 AM, Savolainen, Petri (Nokia - FI/Espoo) <
petri.savolai...@nokia.com> wrote:

>
> Application may very well need to create multiple packets, fill those and
> send into different destinations ...
>
> packet_alloc_multi(pkt[], 2);
>
> fill_packet(pkt[0], "192.168.0.1");
> fill_packet(pkt[1], "192.168.0.2");
>
> tm_enq_multi(dest, pkt, 2);
>
>
> ... or free multiple packets after reassembly ...
>
> deq_multi(pkt[], 3);
>
> new_pkt = reassemble(pkt[], 3);
>
> packet_free_multi(pkt, 3);
>
> tm_enq(dest, new_pkt);
>
>
> ... or drop everything ...
>
>
> num = schedule_multi(pkt[], 10);
>
> packet_free_multi(pkt[], num);
>
>
> True, in the common case application would not allocate and store packets
> (like above - it does not store, just works in bursts). Some application
> could also store packets for later use, and it's OK - e.g.  packet input
> and output pools may be different.
>
>
> -Petri
>
>
> > -Original Message-
> > From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT
> > Bala Manoharan
> > Sent: Wednesday, September 30, 2015 8:41 AM
> > To: Nicolas Morey-Chaisemartin
> > Cc: LNG ODP Mailman List
> > Subject: Re: [lng-odp] [API-NEXTv2 2/7] api: packet: add functions to
> > alloc/free multiple packets at once
> >
> > Hi,
> >
> > I am not sure whether we need this call for alloc multiple packets at
> once.
> > The reason being in a high speed data plane system the packets which
> > are allocated and not processed will result in holding up of pool
> > space which will result in dropping of the incoming packets if the
> > pool space is depleted.
> >
> > So it will always be advisable to allocated the packets as soon as the
> > core is ready to process them rather than allocating an array of
> > packets in a single call and then processing them in a serial manner.
> > Maybe it would be better if you can define the use-case and advantages
> > of allocating the packets in a single API and then we can decide if
> > this API is needed.
> >
> > Regards,
> > Bala
> >
> > On 29 September 2015 at 22:34, Nicolas Morey-Chaisemartin
> >  wrote:
> > >
> > >
> > > On 09/29/2015 04:34 PM, Bill Fischofer wrote:
> > >
> > >
> > >
> > > On Tue, Sep 29, 2015 at 9:15 AM, Nicolas Morey-Chaisemartin
> > >  wrote:
> > >>
> > >> Signed-off-by: Nicolas Morey-Chaisemartin 
> > >> ---
> > >>  include/odp/api/packet.h | 28 
> > >>  1 file changed, 28 insertions(+)
> > >>
> > >> diff --git a/include/odp/api/packet.h b/include/odp/api/packet.h
> > >> index 5d46b7b..c220329 100644
> > >> --- a/include/odp/api/packet.h
> > >> +++ b/include/odp/api/packet.h
> > >> @@ -77,6 +77,23 @@ extern "C" {
> > >>  odp_packet_t odp_packet_alloc(odp_pool_t pool, uint32_t len);
> > >>
> > >>  /**
> > >> + * Allocate packets from a buffer pool
> > >> + *
> > >> + * @see odp_packet_alloc
> > >> + *
> > >> + * @param pool  Pool handle
> > >> + * @param len   Packet data length
> > >> + * @param pkt   Array of packet handles for output
> > >> + * @param num   Maximum number of packet to allocate
> > >> + *
> > >> + * @return Number of packet actually allocated (0 ... num)
> > >> + * @retval <0 on failure
> > >> + *
> > >> + */
> > >> +int odp_packet_alloc_multi(odp_pool_t pool, uint32_t len,
> > >> +  odp_packet_t pkt[], int num);
> > >
> > >
> > >
> > > 3rd parameter is an output array, so should be *odp_packet_t pkt[]
> > > Should 2nd parameter also be an array or is it sufficient to restrict
> > this
> > > to allocating all pkts of the same length?
> > >
> > >
> > > I am not sure there is a way to efficiently alloc multiple packets with
> > > different sizes at once. And making sure all len are the same will
> reduce
> > > the benefits of having a simple multi alloc.
> > > If someone has a use case where a multiple len multi alloc is useful,
> we
> > can
> > > either tweak this call or add another one.
> > >
> > > Nicolas
> > >
> > > ___
> > > lng-odp mailing list
> > > lng-odp@lists.linaro.org
> > > https://lists.linaro.org/mailman/listinfo/lng-odp
> > >
> > ___
> > lng-odp mailing list
> > lng-odp@lists.linaro.org
> > https://lists.linaro.org/mailman/listinfo/lng-odp
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] helper : Fix UDP checksum computation

2015-10-01 Thread Bill Fischofer
On Thu, Oct 1, 2015 at 8:45 AM,  wrote:

> From: Grigore Ion 
>
> This patch fixes the following problems:
> - checksum computation for LE platforms
> - checksum is computed in the CPU endianness. The returned result
> must be converted to the BE ordering when it is used to update the
> UDP checksum in a packet.
> - checksum computation for packets having the UDP length not a
> multiple of 2.
>
> Signed-off-by: Grigore Ion 
> ---
>  helper/include/odp/helper/udp.h |   55
> --
>  1 files changed, 23 insertions(+), 32 deletions(-)
>
> diff --git a/helper/include/odp/helper/udp.h
> b/helper/include/odp/helper/udp.h
> index 06c439b..5d6154f 100644
> --- a/helper/include/odp/helper/udp.h
> +++ b/helper/include/odp/helper/udp.h
> @@ -4,7 +4,6 @@
>   * SPDX-License-Identifier: BSD-3-Clause
>   */
>
> -
>  /**
>   * @file
>   *
> @@ -22,7 +21,6 @@ extern "C" {
>  #include 
>  #include 
>
> -
>  /** @addtogroup odph_header ODPH HEADER
>   *  @{
>   */
> @@ -44,46 +42,39 @@ typedef struct ODP_PACKED {
>   * This function uses odp packet to calc checksum
>   *
>   * @param pkt  calculate chksum for pkt
> - * @return  checksum value
> + * @return  checksum value in CPU endianness
>   */
>  static inline uint16_t odph_ipv4_udp_chksum(odp_packet_t pkt)
>  {
> -   uint32_t sum = 0;
> -   odph_udphdr_t *udph;
> -   odph_ipv4hdr_t *iph;
> -   uint16_t udplen;
> -   uint8_t *buf;
> -
> -   if (!odp_packet_l3_offset(pkt))
> -   return 0;
> +   odph_ipv4hdr_t  *iph;
> +   odph_udphdr_t   *udph;
> +   uint32_tsum;
> +   uint16_tudplen, *buf;
>
> -   if (!odp_packet_l4_offset(pkt))
> +   if (!odp_packet_l3_offset(pkt) || !odp_packet_l4_offset(pkt))
>

Both this code and the base code are incorrect.
 odp_packet_l(2/3/4)_offset() return ODP_PACKET_OFFSET_INVALID if the
packet contains no corresponding offset and that value may or may not be
zero.  Correct test is:

if (odp_packet_l4_offset(pkt) != ODP_PACKET_OFFSET_INVALID) ...

There's no need to check the L3 offset since if the packet has a recognized
L4 offset then it's guaranteed to have a valid L3 offset as well.


> return 0;
> -
> iph = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
> udph = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL);
> -   udplen = odp_be_to_cpu_16(udph->length);
> -
> -   /* 32-bit sum of all 16-bit words covered by UDP chksum */
> +   /* 32-bit sum of UDP pseudo-header */
> sum = (iph->src_addr & 0x) + (iph->src_addr >> 16) +
> - (iph->dst_addr & 0x) + (iph->dst_addr >> 16) +
> - (uint16_t)iph->proto + udplen;
> -   for (buf = (uint8_t *)udph; udplen > 1; udplen -= 2) {
> -   sum += ((*buf << 8) + *(buf + 1));
> -   buf += 2;
> -   }
> -
> -   /* Fold sum to 16 bits: add carrier to result */
> -   while (sum >> 16)
> -   sum = (sum & 0x) + (sum >> 16);
> -
> +   (iph->dst_addr & 0x) + (iph->dst_addr >> 16) +
> +   odp_be_to_cpu_16(iph->proto) + udph->length;
> +   udplen = odp_be_to_cpu_16(udph->length);
> +   buf = (uint16_t *)((void *)udph);
> +   /* 32-bit sum of UDP header (checksum field cleared) and UDP data
> */
> +   for ( ; udplen > 1; udplen -= 2)
> +   sum += *buf++;
> +   /* Length is not a multiple of 2 bytes */
> +   if (udplen)
> +   sum += odp_be_to_cpu_16(*((uint8_t *)buf) << 8);
> +   /* Fold sum to 16 bits */
> +   sum = (sum & 0x) + (sum >> 16);
> +   /* Add carrier (0/1) to result */
> +   sum += (sum >> 16);
> /* 1's complement */
> sum = ~sum;
> -
> -   /* set computation result */
> -   sum = (sum == 0x0) ? 0x : sum;
> -
> -   return sum;
> +   /* Set computation result */
> +   return (sum == 0x0) ? 0x : odp_be_to_cpu_16(sum);
>  }
>
>  /** @internal Compile time assert */
> --
> 1.7.3.4
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT/PATCH] validation: classification: Queue parameter init calls

2015-10-01 Thread Mike Holmes
On 1 October 2015 at 06:36, Maxim Uvarov  wrote:

> Merged,
> Thanks!
>
> (looks like it's the most tested one liner we had before ;)\


That is because the fault got into the repo and broke the build for two
weeks.

Fixed now
https://ci.linaro.org/view/odp-ci/job/odp-publish/GIT_BRANCH=api-next,build_type=lcov,label=docker-utopic,platform_type=generic/


>
>
> On 09/30/15 20:53, Anders Roxell wrote:
>
>> On 2015-09-30 11:43, Mike Holmes wrote:
>>
>>> On 30 September 2015 at 06:24, Bill Fischofer >> >
>>> wrote:
>>>
>>>
 On Wed, Sep 30, 2015 at 2:24 AM, Balasubramanian Manoharan <
 bala.manoha...@linaro.org> wrote:

 Add missing odp_queue_param_init()
> Fixes: https://bugs.linaro.org/show_bug.cgi?id=1823
>
> Signed-off-by: Balasubramanian Manoharan 
>
> Reviewed-by: Bill Fischofer 

 Reviewed-and-tested-by: Mike Holmes 
>>>
>> Reviewed-and-tested-by: Anders Roxell 
>>
>> Fixes Bug 1823
>>>
>>>
>>>
 ---
>   test/validation/classification/odp_classification_basic.c | 1 +
>   test/validation/classification/odp_classification_tests.c | 1 +
>   2 files changed, 2 insertions(+)
>
> diff --git a/test/validation/classification/odp_classification_basic.c
> b/test/validation/classification/odp_classification_basic.c
> index d60eafd..c063b88 100644
> --- a/test/validation/classification/odp_classification_basic.c
> +++ b/test/validation/classification/odp_classification_basic.c
> @@ -76,6 +76,7 @@ void classification_test_cos_set_queue(void)
>  cos_queue = odp_cos_create(cosname);
>  CU_ASSERT_FATAL(cos_queue != ODP_COS_INVALID);
>
> +   odp_queue_param_init();
>  qparam.sched.prio = ODP_SCHED_PRIO_HIGHEST;
>  qparam.sched.sync = ODP_SCHED_SYNC_NONE;
>  qparam.sched.group = ODP_SCHED_GROUP_ALL;
> diff --git a/test/validation/classification/odp_classification_tests.c
> b/test/validation/classification/odp_classification_tests.c
> index 69a71b1..0fb624d 100644
> --- a/test/validation/classification/odp_classification_tests.c
> +++ b/test/validation/classification/odp_classification_tests.c
> @@ -408,6 +408,7 @@ void configure_cls_pmr_chain(void)
>  cos_list[CLS_PMR_CHAIN_DST] = odp_cos_create(cosname);
>  CU_ASSERT_FATAL(cos_list[CLS_PMR_CHAIN_DST] !=
> ODP_COS_INVALID);
>
> +   odp_queue_param_init();
>  qparam.sched.prio = ODP_SCHED_PRIO_NORMAL;
>  qparam.sched.sync = ODP_SCHED_SYNC_NONE;
>  qparam.sched.group = ODP_SCHED_GROUP_ALL;
> --
> 1.9.1
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
 ___
 lng-odp mailing list
 lng-odp@lists.linaro.org
 https://lists.linaro.org/mailman/listinfo/lng-odp



>>> --
>>> Mike Holmes
>>> Technical Manager - Linaro Networking Group
>>> Linaro.org  *│ *Open source software for ARM
>>> SoCs
>>> ___
>>> lng-odp mailing list
>>> lng-odp@lists.linaro.org
>>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>>
>>
>>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>



-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org  *│ *Open source software for ARM SoCs
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH] helper : Fix UDP checksum computation

2015-10-01 Thread ion.grigore
From: Grigore Ion 

This patch fixes the following problems:
- checksum computation for LE platforms
- checksum is computed in the CPU endianness. The returned result
must be converted to the BE ordering when it is used to update the
UDP checksum in a packet.
- checksum computation for packets having the UDP length not a
multiple of 2.

Signed-off-by: Grigore Ion 
---
 helper/include/odp/helper/udp.h |   55 --
 1 files changed, 23 insertions(+), 32 deletions(-)

diff --git a/helper/include/odp/helper/udp.h b/helper/include/odp/helper/udp.h
index 06c439b..5d6154f 100644
--- a/helper/include/odp/helper/udp.h
+++ b/helper/include/odp/helper/udp.h
@@ -4,7 +4,6 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-
 /**
  * @file
  *
@@ -22,7 +21,6 @@ extern "C" {
 #include 
 #include 
 
-
 /** @addtogroup odph_header ODPH HEADER
  *  @{
  */
@@ -44,46 +42,39 @@ typedef struct ODP_PACKED {
  * This function uses odp packet to calc checksum
  *
  * @param pkt  calculate chksum for pkt
- * @return  checksum value
+ * @return  checksum value in CPU endianness
  */
 static inline uint16_t odph_ipv4_udp_chksum(odp_packet_t pkt)
 {
-   uint32_t sum = 0;
-   odph_udphdr_t *udph;
-   odph_ipv4hdr_t *iph;
-   uint16_t udplen;
-   uint8_t *buf;
-
-   if (!odp_packet_l3_offset(pkt))
-   return 0;
+   odph_ipv4hdr_t  *iph;
+   odph_udphdr_t   *udph;
+   uint32_tsum;
+   uint16_tudplen, *buf;
 
-   if (!odp_packet_l4_offset(pkt))
+   if (!odp_packet_l3_offset(pkt) || !odp_packet_l4_offset(pkt))
return 0;
-
iph = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
udph = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL);
-   udplen = odp_be_to_cpu_16(udph->length);
-
-   /* 32-bit sum of all 16-bit words covered by UDP chksum */
+   /* 32-bit sum of UDP pseudo-header */
sum = (iph->src_addr & 0x) + (iph->src_addr >> 16) +
- (iph->dst_addr & 0x) + (iph->dst_addr >> 16) +
- (uint16_t)iph->proto + udplen;
-   for (buf = (uint8_t *)udph; udplen > 1; udplen -= 2) {
-   sum += ((*buf << 8) + *(buf + 1));
-   buf += 2;
-   }
-
-   /* Fold sum to 16 bits: add carrier to result */
-   while (sum >> 16)
-   sum = (sum & 0x) + (sum >> 16);
-
+   (iph->dst_addr & 0x) + (iph->dst_addr >> 16) +
+   odp_be_to_cpu_16(iph->proto) + udph->length;
+   udplen = odp_be_to_cpu_16(udph->length);
+   buf = (uint16_t *)((void *)udph);
+   /* 32-bit sum of UDP header (checksum field cleared) and UDP data */
+   for ( ; udplen > 1; udplen -= 2)
+   sum += *buf++;
+   /* Length is not a multiple of 2 bytes */
+   if (udplen)
+   sum += odp_be_to_cpu_16(*((uint8_t *)buf) << 8);
+   /* Fold sum to 16 bits */
+   sum = (sum & 0x) + (sum >> 16);
+   /* Add carrier (0/1) to result */
+   sum += (sum >> 16);
/* 1's complement */
sum = ~sum;
-
-   /* set computation result */
-   sum = (sum == 0x0) ? 0x : sum;
-
-   return sum;
+   /* Set computation result */
+   return (sum == 0x0) ? 0x : odp_be_to_cpu_16(sum);
 }
 
 /** @internal Compile time assert */
-- 
1.7.3.4

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] helper : Fix UDP checksum computation

2015-10-01 Thread Ion Grigore
Hi,

Now all variables are declared on top of block.
The patch passed checkpatch verification.

I superseded the old patch.

Thanks,
Grig

-Original Message-
From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of Maxim 
Uvarov
Sent: Wednesday, September 23, 2015 8:34 PM
To: lng-odp@lists.linaro.org
Subject: Re: [lng-odp] [PATCH] helper : Fix UDP checksum computation



On 09/21/15 08:45, ion.grig...@freescale.com wrote:
> From: Grigore Ion 
>
> This patch fixes the following problems:
> - checksum computation for LE platforms
> - checksum is computed in the CPU endianess. The returned result must 
> be converted to the BE ordering when it is used to update the UDP checksum in 
> a packet.
> - checksum computation for packets having the UDP length not a multiple of 2.
>
> Signed-off-by: Grigore Ion 
> ---
>   helper/include/odp/helper/udp.h |   54 
> ++-
>   1 files changed, 25 insertions(+), 29 deletions(-)
>
> diff --git a/helper/include/odp/helper/udp.h 
> b/helper/include/odp/helper/udp.h index 06c439b..74fad3c 100644
> --- a/helper/include/odp/helper/udp.h
> +++ b/helper/include/odp/helper/udp.h
> @@ -22,7 +22,6 @@ extern "C" {
>   #include 
>   #include 
>   
> -
>   /** @addtogroup odph_header ODPH HEADER
>*  @{
>*/
> @@ -44,46 +43,43 @@ typedef struct ODP_PACKED {
>* This function uses odp packet to calc checksum
>*
>* @param pkt  calculate chksum for pkt
> - * @return  checksum value
> + * @return  checksum value in CPU endianess
>*/
>   static inline uint16_t odph_ipv4_udp_chksum(odp_packet_t pkt)
>   {
> - uint32_t sum = 0;
> - odph_udphdr_t *udph;
> - odph_ipv4hdr_t *iph;
> - uint16_t udplen;
> - uint8_t *buf;
> -
> - if (!odp_packet_l3_offset(pkt))
> + if (!odp_packet_l3_offset(pkt) || !odp_packet_l3_offset(pkt))
that looks strange :)
>   return 0;
>   
> - if (!odp_packet_l4_offset(pkt))
> - return 0;
> + odph_ipv4hdr_t *iph = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
> + odph_udphdr_t *udph = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL);
iph and udph should be defined on top of the block. Interesting if checkpatch 
did not said about that.
The same for all other variables. So just not delete them from top and run 
./script/checkpatch.pl before sending.

Thanks,
Maxim.

> +
> + /* 32-bit sum of UDP pseudo-header */
> + uint32_t sum = (iph->src_addr & 0x) + (iph->src_addr >> 16) +
> + (iph->dst_addr & 0x) + (iph->dst_addr >> 16) +
> + odp_be_to_cpu_16(iph->proto) + udph->length;
>   
> - iph = (odph_ipv4hdr_t *)odp_packet_l3_ptr(pkt, NULL);
> - udph = (odph_udphdr_t *)odp_packet_l4_ptr(pkt, NULL);
> - udplen = odp_be_to_cpu_16(udph->length);
> + uint16_t udplen = odp_be_to_cpu_16(udph->length);
> + uint16_t *buf = (uint16_t *)((void *)udph);
>   
> - /* 32-bit sum of all 16-bit words covered by UDP chksum */
> - sum = (iph->src_addr & 0x) + (iph->src_addr >> 16) +
> -   (iph->dst_addr & 0x) + (iph->dst_addr >> 16) +
> -   (uint16_t)iph->proto + udplen;
> - for (buf = (uint8_t *)udph; udplen > 1; udplen -= 2) {
> - sum += ((*buf << 8) + *(buf + 1));
> - buf += 2;
> - }
> + /* 32-bit sum of UDP header (checksum field cleared) and UDP data */
> + for ( ; udplen > 1; udplen -= 2)
> + sum += *buf++;
>   
> - /* Fold sum to 16 bits: add carrier to result */
> - while (sum >> 16)
> - sum = (sum & 0x) + (sum >> 16);
> + /* Length is not a multiple of 2 bytes */
> + if (udplen)
> + sum += odp_be_to_cpu_16(*((uint8_t *)buf) << 8);
> +
> + /* Fold sum to 16 bits */
> + sum = (sum & 0x) + (sum >> 16);
> +
> + /* Add carrier (0/1) to result */
> + sum += (sum >> 16);
>   
>   /* 1's complement */
>   sum = ~sum;
>   
> - /* set computation result */
> - sum = (sum == 0x0) ? 0x : sum;
> -
> - return sum;
> + /* Set computation result */
> + return (sum == 0x0) ? 0x : odp_be_to_cpu_16(sum);
>   }
>   
>   /** @internal Compile time assert */

___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] linux-generic: packet: use packet metadata copy function on packet realloc

2015-10-01 Thread Bill Fischofer
odp_packet_copy() can copy between pools, which may have different sized
user areas, hence the size checks.

The user ptr is vestigial and probably should be deprecated at some point.

On Mon, Sep 14, 2015 at 4:34 AM, Nicolas Morey-Chaisemartin <
nmo...@kalray.eu> wrote:

>
>
> On 09/14/2015 11:14 AM, Nicolas Morey-Chaisemartin wrote:
> > Remove duplicated code and use  preexisting metadata copy function
> >
> > Signed-off-by: Nicolas Morey-Chaisemartin 
> > ---
> >  platform/linux-generic/odp_packet.c | 34
> ++
> >  1 file changed, 2 insertions(+), 32 deletions(-)
> >
> > diff --git a/platform/linux-generic/odp_packet.c
> b/platform/linux-generic/odp_packet.c
> > index 5581cc4..3d36b34 100644
> > --- a/platform/linux-generic/odp_packet.c
> > +++ b/platform/linux-generic/odp_packet.c
> > @@ -427,22 +427,7 @@ odp_packet_t odp_packet_add_data(odp_packet_t pkt,
> uint32_t offset,
> >   odp_packet_free(newpkt);
> >   newpkt = ODP_PACKET_INVALID;
> >   } else {
> > - odp_packet_hdr_t *new_hdr = odp_packet_hdr(newpkt);
> > - new_hdr->input = pkt_hdr->input;
> > - new_hdr->buf_hdr.buf_u64 =
> pkt_hdr->buf_hdr.buf_u64;
> > - if (new_hdr->buf_hdr.uarea_addr != NULL &&
> > - pkt_hdr->buf_hdr.uarea_addr != NULL)
> > - memcpy(new_hdr->buf_hdr.uarea_addr,
> > -pkt_hdr->buf_hdr.uarea_addr,
> > -new_hdr->buf_hdr.uarea_size <=
> > -pkt_hdr->buf_hdr.uarea_size ?
> > -new_hdr->buf_hdr.uarea_size :
> > -pkt_hdr->buf_hdr.uarea_size);
>
> BTW, why do we need to compute the min uarea_size ?
> The allocated packet comes from the same pool as the old one (in the 2
> cases I removed, not the md_copy function),
> so it should have the same uarea_size, shouldn't it?
>
> And on a side note, do we really need both user ptr and user area? If the
> user really wants a user_ptr, he could just set user_are_size to
> sizeof(void*) and store it there?
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1823] Segfault in API-NEXT ../../../test/validation/classification/classification_main

2015-10-01 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1823

Mike Holmes  changed:

   What|Removed |Added

 Status|IN_PROGRESS |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Mike Holmes  ---
commit 577b4a6

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1786] CID 143679: odp_classifier.c CHECKED_RETURN

2015-10-01 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1786

Mike Holmes  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCHv2 0/4] linux-generic: add pktio pcap type

2015-10-01 Thread Maxim Uvarov

Hi Stuart,

looks like bug with inq fixed. Are going to send updated version?

Thank you,
Maxim.

On 09/10/15 14:24, Stuart Haslam wrote:

On Mon, Sep 07, 2015 at 10:55:21AM +0100, Stuart Haslam wrote:

On Fri, Sep 04, 2015 at 02:50:47PM -0500, Bill Fischofer wrote:

On Fri, Sep 4, 2015 at 8:20 AM, Stuart Haslam 
wrote:


This is pretty handy for testing, for example to test classifier rules
using packets from a pcap;

odp_classifier -ipcap:in=test.pcap -p -m 0 
"ODP_PMR_SIP_ADDR:192.168.111.2::queue1"
-t 5

Use the l2fwd app send packets from a pcap out over a real interface;

odp_l2fwd -ipcap:in=test.pcap:loops=10,eth0 -t 5

Check that l2fwd doesn't reorder packets;

odp_l2fwd -m 0 -i pcap:in=test.pcap,pcap:out=test_out.pcap
editcap -v -D 0 test.pcap /dev/null | awk '{print $7}' > test.txt
editcap -v -D 0 test_out.pcap /dev/null | awk '{print $7}' > test_out.txt
diff -q test.txt test_out.txt

(oops, it does when using > 2 workers)


Stuart: Is this with the just-released ODP v1.3 using ordered queues?
Preventing this is what ordered queues are designed to do.


In this case I was running it in "direct" mode, so it's calling
odp_pktio_recv()/_send() directly. Ordering is therefore the
responsibility of the application but it's doing nothing to maintain
order while calling recv/send on the same interface from multiple
threads. I'll raise a bug against the app for that.

It does have a mode in which packets are received via the scheduler,
I'll give that a try. It's using ATOMIC at the minute so it should work,

So that works.

I did have to change the pcap recv function to handle packet allocation
failures without dropping packets though, so I'll send a v2 series. With
a single atomic inq and multiple workers the pktio's default inq quickly
fills up until the pool is exhausted. Normally dropping packets would be
a reasonable way to deal with this overload, but it doesn't make sense
when the source is a pcap file.


it would be interesting to covert to an ORDERED queue

ORDERED PKTIN queues don't seem to work at all;

#3  0x7f77da83ab8e in pktin_enqueue (qentry=, buf_hdr=, sustain=) at odp_packet_io.c:536
#4  0x7f77da84085a in release_order (origin_qe=0x7f77dae0d000, order=, pool=0x0, enq_called=) at odp_queue.c:912
#5  0x7f77da841375 in odp_schedule_release_context () at odp_schedule.c:411
#6  0x7f77da841565 in schedule (max_deq=4, max_num=1, 
out_ev=0x7f77d671dcb8, out_queue=0x0) at odp_schedule.c:453

I just replaced ODP_SCHED_SYNC_ATOMIC with ODP_SCHED_SYNC_ORDERED in
odp_l2fwd.c, then ran it with "-m 1".



___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1752] timer test: Number of timeouts delivered/received too late: 0

2015-10-01 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1752

--- Comment #4 from Mike Holmes  ---
Maxim to confirm this is reproducible

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1456] odp_syncronizers: data race

2015-10-01 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1456

Mike Holmes  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |WONTFIX

-- 
You are receiving this mail because:
You are the assignee for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1457] odp_timer: data race

2015-10-01 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1457

Mike Holmes  changed:

   What|Removed |Added

 Resolution|--- |WONTFIX
 Status|UNCONFIRMED |RESOLVED

-- 
You are receiving this mail because:
You are on the CC list for the bug.___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT/PATCH v3] validation: classification: added additional suite to test individual PMRs

2015-10-01 Thread Bala Manoharan
On 30 September 2015 at 21:34, Mike Holmes  wrote:
>
>
> On 24 September 2015 at 10:43, Balasubramanian Manoharan
>  wrote:
>>
>> Additional test suite is added to classification validation suite to test
>> individual PMRs. This suite will test the defined PMRs by configuring
>> pktio separately for every test case.
>>
>> Fixes:
>> https://bugs.linaro.org/show_bug.cgi?id=1542
>> https://bugs.linaro.org/show_bug.cgi?id=1544
>> https://bugs.linaro.org/show_bug.cgi?id=1545
>> https://bugs.linaro.org/show_bug.cgi?id=1546
>>
>> Signed-off-by: Balasubramanian Manoharan 
>
>
> This does cover the listed bugs, but there are still a lot of untested
> related APIs in that header file
>
> Function Name Hit count verify_pmr_dmac 0 verify_pmr_eth_type_0 0
> verify_pmr_eth_type_x 0 verify_pmr_ipsec_spi 0 verify_pmr_ipv4_daddr 0
> verify_pmr_ipv6_daddr 0 verify_pmr_ipv6_saddr 0 verify_pmr_ld_vni 0
> verify_pmr_packet_len 0 verify_pmr_vlan_id_0 0 verify_pmr_vlan_id_x

Once the test suite module is added onto the repo it supports modular
addition of individual test cases and these missing APIs can be added
as individual patches.

Regards,
Bala
>
>
>>
>> ---
>> v3: Incorporates review comments from Ivan
>>
>>  helper/include/odp/helper/tcp.h|   1 +
>>  test/validation/classification/Makefile.am |   2 +
>>  test/validation/classification/classification.c|   5 +
>>  .../classification/odp_classification_common.c | 267 ++
>>  .../classification/odp_classification_test_pmr.c   | 569
>> +
>>  .../classification/odp_classification_tests.c  | 265 ++
>>  .../classification/odp_classification_testsuites.h |  15 +-
>>  7 files changed, 909 insertions(+), 215 deletions(-)
>>  create mode 100644
>> test/validation/classification/odp_classification_common.c
>>  create mode 100644
>> test/validation/classification/odp_classification_test_pmr.c
>>
>> diff --git a/helper/include/odp/helper/tcp.h
>> b/helper/include/odp/helper/tcp.h
>> index defe422..42f0cbe 100644
>> --- a/helper/include/odp/helper/tcp.h
>> +++ b/helper/include/odp/helper/tcp.h
>> @@ -26,6 +26,7 @@ extern "C" {
>>   *  @{
>>   */
>>
>> +#define ODPH_TCPHDR_LEN 20 /**< Min length of TCP header (no options) */
>>
>>  /** TCP header */
>>  typedef struct ODP_PACKED {
>> diff --git a/test/validation/classification/Makefile.am
>> b/test/validation/classification/Makefile.am
>> index 5881665..4235309 100644
>> --- a/test/validation/classification/Makefile.am
>> +++ b/test/validation/classification/Makefile.am
>> @@ -3,6 +3,8 @@ include ../Makefile.inc
>>  noinst_LTLIBRARIES = libtestclassification.la
>>  libtestclassification_la_SOURCES = odp_classification_basic.c \
>>odp_classification_tests.c \
>> +  odp_classification_test_pmr.c \
>> +  odp_classification_common.c \
>>classification.c
>>
>>  bin_PROGRAMS = classification_main$(EXEEXT)
>> diff --git a/test/validation/classification/classification.c
>> b/test/validation/classification/classification.c
>> index d0fef93..6641893 100644
>> --- a/test/validation/classification/classification.c
>> +++ b/test/validation/classification/classification.c
>> @@ -13,6 +13,11 @@ CU_SuiteInfo classification_suites[] = {
>> { .pName = "classification basic",
>> .pTests = classification_suite_basic,
>> },
>> +   { .pName = "classification pmr tests",
>> +   .pTests = classification_suite_pmr,
>> +   .pInitFunc = classification_suite_pmr_init,
>> +   .pCleanupFunc = classification_suite_pmr_term,
>> +   },
>> { .pName = "classification tests",
>> .pTests = classification_suite,
>> .pInitFunc = classification_suite_init,
>> diff --git a/test/validation/classification/odp_classification_common.c
>> b/test/validation/classification/odp_classification_common.c
>> new file mode 100644
>> index 000..9b05ad6
>> --- /dev/null
>> +++ b/test/validation/classification/odp_classification_common.c
>> @@ -0,0 +1,267 @@
>> +/* Copyright (c) 2015, Linaro Limited
>> + * All rights reserved.
>> + *
>> + * SPDX-License-Identifier:BSD-3-Clause
>> + */
>> +
>> +#include "odp_classification_testsuites.h"
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +
>> +#define SHM_PKT_NUM_BUFS32
>> +#define SHM_PKT_BUF_SIZE1024
>> +
>> +#define CLS_DEFAULT_SADDR  "10.0.0.1/32"
>> +#define CLS_DEFAULT_DADDR  "10.0.0.100/32"
>> +#define CLS_DEFAULT_SPORT  1024
>> +#define CLS_DEFAULT_DPORT  2048
>> +
>> +#define CLS_TEST_SPORT 4096
>> +#define CLS_TEST_DPORT 8192
>> +#define CLS_TEST_DADDR "10.0.0.5/32"
>> +
>> +/* Test Packet values */
>> +#define DATA_MAGIC