[lng-odp] [PATCHv1] example: ODP Classifier example

2015-03-20 Thread bala . manoharan
From: Balasubramanian Manoharan 

ODP Classifier example

This programs gets pmr rules as command-line parameter and configures the 
classification engine
in the system.

This initial version supports the following
* ODP_PMR_SIP_ADDR pmr term
* PMR term MATCH and RANGE type
* Multiple PMR rule can be set on a single pktio interface with different 
queues associated to each PMR rule
* Automatically configures a default queue and provides statistics for the same
* Prints statistics interms of the number of packets dispatched to each queue

Signed-off-by: Balasubramanian Manoharan 
---
 configure.ac|   1 +
 example/Makefile.am |   2 +-
 example/classifier/Makefile.am  |  10 +
 example/classifier/odp_classifier.c | 759 
 4 files changed, 771 insertions(+), 1 deletion(-)
 create mode 100644 example/classifier/Makefile.am
 create mode 100644 example/classifier/odp_classifier.c

diff --git a/configure.ac b/configure.ac
index 57054c5..51e4834 100644
--- a/configure.ac
+++ b/configure.ac
@@ -255,6 +255,7 @@ AC_CONFIG_FILES([Makefile
 example/l2fwd/Makefile
 example/packet/Makefile
 example/timer/Makefile
+example/classifier/Makefile
 pkgconfig/libodp.pc
 platform/Makefile
 platform/linux-generic/Makefile
diff --git a/example/Makefile.am b/example/Makefile.am
index 3021571..aa09a8e 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -1 +1 @@
-SUBDIRS = generator ipsec l2fwd packet timer
+SUBDIRS = generator ipsec l2fwd packet timer classifier
diff --git a/example/classifier/Makefile.am b/example/classifier/Makefile.am
new file mode 100644
index 000..938f094
--- /dev/null
+++ b/example/classifier/Makefile.am
@@ -0,0 +1,10 @@
+include $(top_srcdir)/example/Makefile.inc
+
+bin_PROGRAMS = odp_classifier
+odp_classifier_LDFLAGS = $(AM_LDFLAGS) -static
+odp_classifier_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/example
+
+noinst_HEADERS = \
+ $(top_srcdir)/example/example_debug.h
+
+dist_odp_classifier_SOURCES = odp_classifier.c
diff --git a/example/classifier/odp_classifier.c 
b/example/classifier/odp_classifier.c
new file mode 100644
index 000..8b34e7d
--- /dev/null
+++ b/example/classifier/odp_classifier.c
@@ -0,0 +1,759 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** @def MAX_WORKERS
+ * @brief Maximum number of worker threads
+ */
+#define MAX_WORKERS32
+
+/** @def SHM_PKT_POOL_SIZE
+ * @brief Size of the shared memory block
+ */
+#define SHM_PKT_POOL_SIZE  (512*2048)
+
+/** @def SHM_PKT_POOL_BUF_SIZE
+ * @brief Buffer size of the packet pool buffer
+ */
+#define SHM_PKT_POOL_BUF_SIZE  1856
+
+/** @def MAX_PMR_COUNT
+ * @brief Maximum number of Classification Policy
+ */
+#define MAX_PMR_COUNT  8
+
+/** @def DISPLAY_STRING_LEN
+ * @brief Length of string used to display term value
+ */
+#define DISPLAY_STRING_LEN 32
+
+/** Get rid of path in filename - only for unix-type paths using '/' */
+#define NO_PATH(file_name) (strrchr((file_name), '/') ? \
+   strrchr((file_name), '/') + 1 : (file_name))
+
+typedef struct {
+   odp_queue_t queue;  /**< Associated queue handle */
+   odp_cos_t cos;  /**< Associated cos handle */
+   odp_pmr_t pmr;  /**< Associated pmr handle */
+   odp_atomic_u64_t packet_count;  /**< count of received packets */
+   odp_pmr_term_e term;/**< odp pmr term value */
+   char queuename[ODP_QUEUE_NAME_LEN]; /**< queue name */
+   odp_pmr_match_type_e match_type;/**< pmr match type */
+   int val_sz; /**< size of the pmr term */
+   union {
+   struct {
+   uint32_t val;   /**< pmr term value */
+   uint32_t mask;  /**< pmr term mask */
+   } match;
+   struct  {
+   uint32_t val1;  /**< pmr term start range */
+   uint32_t val2;  /**< pmr term end range */
+   } range;
+   };
+   char value1[DISPLAY_STRING_LEN];/**< Display string1 */
+   char value2[DISPLAY_STRING_LEN];/**< Display string2 */
+} global_statistics;
+
+static global_statistics stats[MAX_PMR_COUNT];
+static int policy_count;
+static int queue_count;
+static int appl_mode;
+static odp_atomic_u64_t total_packets;
+
+enum packet_mode {
+   APPL_MODE_DROP, /**< Packet is dropped */
+   APPL_MODE_REPLY /**< Packet is sent back */
+};
+
+/**
+ * Parsed command line application arguments
+ */
+typedef struct {
+   int cpu_count;  /**< Number of CPUs to use */
+   char *if_name;  /**< pointer to interface name

Re: [lng-odp] [PATCHv1] example: ODP Classifier example

2015-03-20 Thread Bala Manoharan
This example has dependency with the following bug fix:
https://patches.linaro.org/46130/

Regards,
Bala

On 20 March 2015 at 12:37,   wrote:
> From: Balasubramanian Manoharan 
>
> ODP Classifier example
>
> This programs gets pmr rules as command-line parameter and configures the 
> classification engine
> in the system.
>
> This initial version supports the following
> * ODP_PMR_SIP_ADDR pmr term
> * PMR term MATCH and RANGE type
> * Multiple PMR rule can be set on a single pktio interface with different 
> queues associated to each PMR rule
> * Automatically configures a default queue and provides statistics for the 
> same
> * Prints statistics interms of the number of packets dispatched to each queue
>
> Signed-off-by: Balasubramanian Manoharan 
> ---
>  configure.ac|   1 +
>  example/Makefile.am |   2 +-
>  example/classifier/Makefile.am  |  10 +
>  example/classifier/odp_classifier.c | 759 
> 
>  4 files changed, 771 insertions(+), 1 deletion(-)
>  create mode 100644 example/classifier/Makefile.am
>  create mode 100644 example/classifier/odp_classifier.c
>
> diff --git a/configure.ac b/configure.ac
> index 57054c5..51e4834 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -255,6 +255,7 @@ AC_CONFIG_FILES([Makefile
>  example/l2fwd/Makefile
>  example/packet/Makefile
>  example/timer/Makefile
> +example/classifier/Makefile
>  pkgconfig/libodp.pc
>  platform/Makefile
>  platform/linux-generic/Makefile
> diff --git a/example/Makefile.am b/example/Makefile.am
> index 3021571..aa09a8e 100644
> --- a/example/Makefile.am
> +++ b/example/Makefile.am
> @@ -1 +1 @@
> -SUBDIRS = generator ipsec l2fwd packet timer
> +SUBDIRS = generator ipsec l2fwd packet timer classifier
> diff --git a/example/classifier/Makefile.am b/example/classifier/Makefile.am
> new file mode 100644
> index 000..938f094
> --- /dev/null
> +++ b/example/classifier/Makefile.am
> @@ -0,0 +1,10 @@
> +include $(top_srcdir)/example/Makefile.inc
> +
> +bin_PROGRAMS = odp_classifier
> +odp_classifier_LDFLAGS = $(AM_LDFLAGS) -static
> +odp_classifier_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/example
> +
> +noinst_HEADERS = \
> + $(top_srcdir)/example/example_debug.h
> +
> +dist_odp_classifier_SOURCES = odp_classifier.c
> diff --git a/example/classifier/odp_classifier.c 
> b/example/classifier/odp_classifier.c
> new file mode 100644
> index 000..8b34e7d
> --- /dev/null
> +++ b/example/classifier/odp_classifier.c
> @@ -0,0 +1,759 @@
> +/* Copyright (c) 2015, Linaro Limited
> + * All rights reserved.
> + *
> + * SPDX-License-Identifier: BSD-3-Clause
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/** @def MAX_WORKERS
> + * @brief Maximum number of worker threads
> + */
> +#define MAX_WORKERS32
> +
> +/** @def SHM_PKT_POOL_SIZE
> + * @brief Size of the shared memory block
> + */
> +#define SHM_PKT_POOL_SIZE  (512*2048)
> +
> +/** @def SHM_PKT_POOL_BUF_SIZE
> + * @brief Buffer size of the packet pool buffer
> + */
> +#define SHM_PKT_POOL_BUF_SIZE  1856
> +
> +/** @def MAX_PMR_COUNT
> + * @brief Maximum number of Classification Policy
> + */
> +#define MAX_PMR_COUNT  8
> +
> +/** @def DISPLAY_STRING_LEN
> + * @brief Length of string used to display term value
> + */
> +#define DISPLAY_STRING_LEN 32
> +
> +/** Get rid of path in filename - only for unix-type paths using '/' */
> +#define NO_PATH(file_name) (strrchr((file_name), '/') ? \
> +   strrchr((file_name), '/') + 1 : (file_name))
> +
> +typedef struct {
> +   odp_queue_t queue;  /**< Associated queue handle */
> +   odp_cos_t cos;  /**< Associated cos handle */
> +   odp_pmr_t pmr;  /**< Associated pmr handle */
> +   odp_atomic_u64_t packet_count;  /**< count of received packets */
> +   odp_pmr_term_e term;/**< odp pmr term value */
> +   char queuename[ODP_QUEUE_NAME_LEN]; /**< queue name */
> +   odp_pmr_match_type_e match_type;/**< pmr match type */
> +   int val_sz; /**< size of the pmr term */
> +   union {
> +   struct {
> +   uint32_t val;   /**< pmr term value */
> +   uint32_t mask;  /**< pmr term mask */
> +   } match;
> +   struct  {
> +   uint32_t val1;  /**< pmr term start range */
> +   uint32_t val2;  /**< pmr term end range */
> +   } range;
> +   };
> +   char value1[DISPLAY_STRING_LEN];/**< Display string1 */
> +   char value2[DISPLAY_STRING_LEN];/**< Display string2 */
> +} global_statistics;
> +
> +static global_statistics stats[MAX_PMR_COUNT];
> +static int policy_count;
> +stat

Re: [lng-odp] [PATCHv2 1/3] validation: pktio: add support for VPATH builds

2015-03-20 Thread Maxim Uvarov

Merged,
Maxim.

On 03/19/15 17:46, Mike Holmes wrote:



On 19 March 2015 at 09:29, Maxim Uvarov > wrote:


Looks like that is good to go. Mike, Anders ok?

Maxim.


On 03/17/15 13:31, Stuart Haslam wrote:

Running "make check" in a VPATH build fails as the
odp_pktio_run script
incorrectly assumes that the odp_pktio binary is in the same
directory.
Resolve this by passing the path to the test binary to the
script via
the TESTS_ENVIRONMENT variable.

Signed-off-by: Stuart Haslam mailto:stuart.has...@linaro.org>>


For the serise
Tested-by: Mike Holmes >


---
  test/validation/Makefile.am   | 4 +++-
  test/validation/odp_pktio_run | 2 +-
  2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/test/validation/Makefile.am
b/test/validation/Makefile.am
index 0833181..e695e07 100644
--- a/test/validation/Makefile.am
+++ b/test/validation/Makefile.am
@@ -3,7 +3,7 @@ include $(top_srcdir)/test/Makefile.inc
  AM_CFLAGS += -I$(srcdir)/common
  AM_LDFLAGS += -static
  -TESTS_ENVIRONMENT = ODP_PLATFORM=${with_platform}
+TESTS_ENVIRONMENT = ODP_PLATFORM=${with_platform}
TEST_DIR=${builddir}
EXECUTABLES = odp_buffer \
  odp_classification \
@@ -31,6 +31,8 @@ if test_vald
  TESTS = $(EXECUTABLES) $(TESTSCRIPTS)
  endif
  +dist_bin_SCRIPTS = odp_pktio_run
+
  bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
ODP_CU_COMMON=common/odp_cunit_common.c
diff --git a/test/validation/odp_pktio_run
b/test/validation/odp_pktio_run
index 6177caa..856dfac 100755
--- a/test/validation/odp_pktio_run
+++ b/test/validation/odp_pktio_run
@@ -27,7 +27,7 @@
  # (repeat running test multiple times..)
  # odp_pktio_run cleanup
  #
-TEST_DIR=$(dirname $0)
+TEST_DIR="${TEST_DIR:-$(dirname $0)}"
  IF0=pktio-p0
  IF1=pktio-p1





--
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org ***│ *Open source software for ARM SoCs




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


[lng-odp] [PATCHv5 1/3] validation: schedule: free queues and pool

2015-03-20 Thread Ciprian Barbu
With the implementation of termination APIs it is now necessarry to cleanup all
allocated resources, queues and pool in this case.
Fixes https://bugs.linaro.org/show_bug.cgi?id=1284

Signed-off-by: Ciprian Barbu 
---
v5:
- add return -1 in termination routine
v4:
- check return code of destroy_queues
 test/validation/odp_schedule.c | 61 --
 1 file changed, 59 insertions(+), 2 deletions(-)

diff --git a/test/validation/odp_schedule.c b/test/validation/odp_schedule.c
index a9369c5..efc7c8b 100644
--- a/test/validation/odp_schedule.c
+++ b/test/validation/odp_schedule.c
@@ -624,7 +624,63 @@ static int schd_suite_init(void)
return 0;
 }
 
-struct CU_TestInfo test_odp_schedule[] = {
+static int destroy_queue(const char *name)
+{
+   odp_queue_t q;
+
+   q = odp_queue_lookup(name);
+
+   if (q == ODP_QUEUE_INVALID)
+   return -1;
+
+   return odp_queue_destroy(q);
+}
+
+static int destroy_queues(void)
+{
+   int i, j, prios;
+
+   prios = odp_schedule_num_prio();
+
+   for (i = 0; i < prios; i++) {
+   for (j = 0; j < QUEUES_PER_PRIO; j++) {
+   char name[32];
+
+   snprintf(name, sizeof(name), "sched_%d_%d_n", i, j);
+   if (destroy_queue(name) != 0)
+   return -1;
+
+   snprintf(name, sizeof(name), "sched_%d_%d_a", i, j);
+   if (destroy_queue(name) != 0)
+   return -1;
+
+   snprintf(name, sizeof(name), "sched_%d_%d_o", i, j);
+   if (destroy_queue(name) != 0)
+   return -1;
+   }
+   }
+
+   return 0;
+}
+
+static int schd_suite_term(void)
+{
+   odp_pool_t pool;
+
+   if (destroy_queues() != 0) {
+   fprintf(stderr, "error: failed to destroy queues\n");
+   return -1;
+   }
+
+   pool = odp_pool_lookup(MSG_POOL_NAME);
+   if (odp_pool_destroy(pool) != 0) {
+   fprintf(stderr, "error: failed to destroy pool\n");
+   }
+
+   return 0;
+}
+
+struct CU_TestInfo schd_tests[] = {
{"schedule_wait_time",  test_schedule_wait_time},
{"schedule_num_prio",   test_schedule_num_prio},
{"schedule_1q_1t_n",test_schedule_1q_1t_n},
@@ -658,6 +714,7 @@ struct CU_TestInfo test_odp_schedule[] = {
 };
 
 CU_SuiteInfo odp_testsuites[] = {
-   {"Scheduler", schd_suite_init, NULL, NULL, NULL, test_odp_schedule},
+   {"Scheduler",
+   schd_suite_init, schd_suite_term, NULL, NULL, schd_tests},
CU_SUITE_INFO_NULL,
 };
-- 
1.8.3.2


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


[lng-odp] odp_pktio validation test

2015-03-20 Thread Radu-Andrei Bulie
Hi,

In the odp_pktio validation - a pktio is created and it is configured with a 
PKTIN queue.
Packets are then enqueued to the out queue of the device.
In the function wait_for_packet I think is an issue when an event is received.
There is  the following condition :
if (queue != ODP_QUEUE_INVALID)
  ev = queue_deq_wait_time(queue, ns);
else
  ev  = odp_schedule(NULL, ns);



The queue that comes as input param, is the PKTIN queue which is a scheduled 
queue.
As it can be noticed the queue_deq_wait_time will be called (PKTN queue is 
valid) and there,
an explicit dequeue operation will be performed on a scheduled queue which is 
not OK.
So a schedule would be proper instead of explicit dequeue.
A possible fix is to check for queue type instead of validity, and if the queue 
is POLL  then take the corresponding branch:

if (odp_queue_type(queue) == ODP_QUEUE_TYPE_POLL)
  ev = queue_deq_wait_time(queue, ns);
else
  ev  = odp_schedule(NULL, ns);


Regards,

Radu

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


Re: [lng-odp] [PATCH] test: debug: replace example with test

2015-03-20 Thread Maxim Uvarov

Merged,
Maxim.

On 03/20/15 06:23, Bill Fischofer wrote:



On Thu, Mar 19, 2015 at 1:07 PM, Mike Holmes > wrote:


The structures are part of the test hierarchy not example

Signed-off-by: Mike Holmes mailto:mike.hol...@linaro.org>>


Reviewed-by: Bill Fischofer >


---
 test/test_debug.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/test/test_debug.h b/test/test_debug.h
index 2ad743f..aec0977 100644
--- a/test/test_debug.h
+++ b/test/test_debug.h
@@ -6,7 +6,7 @@
 /**
  * @file
  *
- * example debug
+ * test debug
  */

 #ifndef TEST_DEBUG_H_
@@ -26,11 +26,11 @@ extern "C" {
 /**
  * log level.
  */
-typedef enum example_log_level {
+typedef enum test_log_level {
TEST_LOG_DBG,
TEST_LOG_ERR,
TEST_LOG_ABORT
-} example_log_level_e;
+} test_log_level_e;

 /**
  * default LOG macro.
--
2.1.0


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





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


Re: [lng-odp] pktio pps on linux-geneneric & HP

2015-03-20 Thread Ciprian Barbu
On Thu, Mar 19, 2015 at 11:48 AM, Maxim Uvarov  wrote:
> Did tests on packet i/o on virtual interfaces.
> On my laptop got interesting numbers:
>
> 157011 max pps without Huge Pages.
> and
> 175710 max pps with Huge Pages.

What was the packet size?

>
> Even if linux-generic is functional and not performance target Huge Pages
> benefit is visible there (11 %).
>
> Best regards,
> Maxim.
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp

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


Re: [lng-odp] [PATCH v2] performance: odp_atomic: move atomic test from api_test to performance

2015-03-20 Thread Maxim Uvarov

On 03/19/15 21:32, Mike Holmes wrote:

  dist_odp_scheduling_SOURCES = odp_scheduling.c
+dist_odp_atomic_SOURCES = odp_atomic.c

alphabetic order here please.

Maxim.

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


[lng-odp] [PATCH] validation: fixed memory leak in odp_cpumask.c

2015-03-20 Thread Christophe Milard
Signed-off-by: Christophe Milard 
---
 test/validation/odp_cpumask.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/validation/odp_cpumask.c b/test/validation/odp_cpumask.c
index 2285034..b7e18d6 100644
--- a/test/validation/odp_cpumask.c
+++ b/test/validation/odp_cpumask.c
@@ -148,6 +148,9 @@ static void test_odp_cpumask_to_from_str(void)
 
CU_ASSERT_NSTRING_EQUAL(buf_out, TEST_MASK_CPU_0,
stringlen(TEST_MASK_CPU_0) + 1);
+
+   free(buf_out);
+   free(buf_in);
 }
 
 static void test_odp_cpumask_equal(void)
-- 
1.9.1


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


[lng-odp] [PATCHv2] validation: fixed memory leak in odp_cpumask.c

2015-03-20 Thread Christophe Milard
CID 88273:  Resource leaks  (RESOURCE_LEAK)

Signed-off-by: Christophe Milard 
---

now with CID in comments.

 test/validation/odp_cpumask.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/validation/odp_cpumask.c b/test/validation/odp_cpumask.c
index 2285034..b7e18d6 100644
--- a/test/validation/odp_cpumask.c
+++ b/test/validation/odp_cpumask.c
@@ -148,6 +148,9 @@ static void test_odp_cpumask_to_from_str(void)
 
CU_ASSERT_NSTRING_EQUAL(buf_out, TEST_MASK_CPU_0,
stringlen(TEST_MASK_CPU_0) + 1);
+
+   free(buf_out);
+   free(buf_in);
 }
 
 static void test_odp_cpumask_equal(void)
-- 
1.9.1


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


[lng-odp] [Bug 1381] Incorrect pmr_term_value update in odp_pmr_create_xxx() fuction

2015-03-20 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1381

--- Comment #1 from Bala Manoharan  ---
V1 patch submitted:
https://patches.linaro.org/46130/

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


Re: [lng-odp] [RFC v3 0/4] Move the definition of odp syncronizers abstract types to platform

2015-03-20 Thread Jerin Jacob
On Wed, Mar 18, 2015 at 11:29:03AM -0500, Bill Fischofer wrote:

Ping

> This version looks good.  For this series:
> 
> Reviewed-and-tested-by: Bill Fischofer 
> 
> On Wed, Mar 18, 2015 at 9:11 AM, Jerin Jacob  > wrote:
> 
> > Move the definition of odp syncronizers abstract types to platform
> > from public headerfile.
> > This will allow the platform to define odp syncronizers abstract type.
> > Useful when native SDK has definition of the odp syncronizers and
> > ODP implementation decides to reuses them.
> >
> > v1..v2 Corrected the Doxygen documentation issues identified by Petri
> > v2..v3 Fixed compilation issues in 'make distcheck' identified by Bill
> >
> >
> > Jerin Jacob (4):
> >   spinlock: allow platform to override odp_spinlock_t
> >   rwlock: allow platform to override odp_rwlock_t
> >   ticketlock: allow platform to override odp_ticketlock_t
> >   barrier: allow platform to override odp_barrier_t
> >
> >  include/odp/api/barrier.h  |  7 +---
> >  include/odp/api/rwlock.h   | 11 +
> >  include/odp/api/spinlock.h | 10 +
> >  include/odp/api/ticketlock.h   | 12 +-
> >  platform/linux-generic/Makefile.am |  4 ++
> >  platform/linux-generic/include/odp/barrier.h   |  1 +
> >  .../linux-generic/include/odp/plat/barrier_types.h | 47
> > +
> >  .../linux-generic/include/odp/plat/rwlock_types.h  | 48
> > ++
> >  .../include/odp/plat/spinlock_types.h  | 46
> > +
> >  .../include/odp/plat/ticketlock_types.h| 46
> > +
> >  platform/linux-generic/include/odp/rwlock.h|  2 +
> >  platform/linux-generic/include/odp/spinlock.h  |  2 +
> >  platform/linux-generic/include/odp/ticketlock.h|  2 +
> >  13 files changed, 205 insertions(+), 33 deletions(-)
> >  create mode 100644 platform/linux-generic/include/odp/plat/barrier_types.h
> >  create mode 100644 platform/linux-generic/include/odp/plat/rwlock_types.h
> >  create mode 100644
> > platform/linux-generic/include/odp/plat/spinlock_types.h
> >  create mode 100644
> > platform/linux-generic/include/odp/plat/ticketlock_types.h
> >
> > --
> > 2.1.0
> >
> >
> > ___
> > lng-odp mailing list
> > lng-odp@lists.linaro.org
> > http://lists.linaro.org/mailman/listinfo/lng-odp
> >

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


Re: [lng-odp] odp_pktio validation test

2015-03-20 Thread Maxim Uvarov
Hello Raru-Andrei,  thanks for finding this.  Feel free to send patch 
for that issue.


Stuart, please review that change.

Best regards,
Maxim.

On 03/20/15 12:43, Radu-Andrei Bulie wrote:


Hi,

In the odp_pktio validation – a pktio is created and it is configured 
with a PKTIN queue.


Packets are then enqueued to the out queue of the device.

In the function *wait_for_packet***I think is an issue when an event 
is received.


There is  the following condition :

*if*(queue != ODP_QUEUE_INVALID)

  ev = queue_deq_wait_time(queue, ns);

*else*

  ev  = odp_schedule(NULL, ns);

The *queue* that comes as input param, is the PKTIN queue which is a 
scheduled queue.


As it can be noticed the queue_deq_wait_time will be called (PKTN 
queue is valid) and there,


*an explicit dequeue operation will be performed on a scheduled queue 
*which is not OK.


So a schedule would be proper instead of explicit dequeue.

A possible fix is to check for *queue type instead of validity*, and 
if the queue is POLL  then take the corresponding branch:


*if*(*odp_queue_type(*queue) == ODP_QUEUE_TYPE_POLL)

  ev = queue_deq_wait_time(queue, ns);

*else*

  ev  = odp_schedule(NULL, ns);

Regards,

Radu



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



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


Re: [lng-odp] odp_pktio validation test

2015-03-20 Thread Mike Holmes
Radu-Andrei Bulie or Maxim can you capture this as a bug

https://bugs.linaro.org/enter_bug.cgi?product=OpenDataPlane

On 20 March 2015 at 08:14, Maxim Uvarov  wrote:

> Hello Raru-Andrei,  thanks for finding this.  Feel free to send patch for
> that issue.
>
> Stuart, please review that change.
>
> Best regards,
> Maxim.
>
> On 03/20/15 12:43, Radu-Andrei Bulie wrote:
>
>>
>> Hi,
>>
>> In the odp_pktio validation – a pktio is created and it is configured
>> with a PKTIN queue.
>>
>> Packets are then enqueued to the out queue of the device.
>>
>> In the function *wait_for_packet***I think is an issue when an event is
>> received.
>>
>> There is  the following condition :
>>
>> *if*(queue != ODP_QUEUE_INVALID)
>>
>>   ev = queue_deq_wait_time(queue, ns);
>>
>> *else*
>>
>>   ev  = odp_schedule(NULL, ns);
>>
>> The *queue* that comes as input param, is the PKTIN queue which is a
>> scheduled queue.
>>
>> As it can be noticed the queue_deq_wait_time will be called (PKTN queue
>> is valid) and there,
>>
>> *an explicit dequeue operation will be performed on a scheduled queue
>> *which is not OK.
>>
>> So a schedule would be proper instead of explicit dequeue.
>>
>> A possible fix is to check for *queue type instead of validity*, and if
>> the queue is POLL  then take the corresponding branch:
>>
>> *if*(*odp_queue_type(*queue) == ODP_QUEUE_TYPE_POLL)
>>
>>   ev = queue_deq_wait_time(queue, ns);
>>
>> *else*
>>
>>   ev  = odp_schedule(NULL, ns);
>>
>> Regards,
>>
>> Radu
>>
>>
>>
>> ___
>> lng-odp mailing list
>> lng-odp@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/lng-odp
>>
>
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://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
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] odp_pktio validation test

2015-03-20 Thread Maxim Uvarov

On 03/20/15 15:23, Mike Holmes wrote:

Radu-Andrei Bulie or Maxim can you capture this as a bug

https://bugs.linaro.org/enter_bug.cgi?product=OpenDataPlane

https://bugs.linaro.org/show_bug.cgi?id=1383


On 20 March 2015 at 08:14, Maxim Uvarov > wrote:


Hello Raru-Andrei,  thanks for finding this.  Feel free to send
patch for that issue.

Stuart, please review that change.

Best regards,
Maxim.

On 03/20/15 12:43, Radu-Andrei Bulie wrote:


Hi,

In the odp_pktio validation – a pktio is created and it is
configured with a PKTIN queue.

Packets are then enqueued to the out queue of the device.

In the function *wait_for_packet***I think is an issue when an
event is received.

There is  the following condition :

*if*(queue != ODP_QUEUE_INVALID)

  ev = queue_deq_wait_time(queue, ns);

*else*

  ev  = odp_schedule(NULL, ns);

The *queue* that comes as input param, is the PKTIN queue
which is a scheduled queue.

As it can be noticed the queue_deq_wait_time will be called
(PKTN queue is valid) and there,

*an explicit dequeue operation will be performed on a
scheduled queue *which is not OK.

So a schedule would be proper instead of explicit dequeue.

A possible fix is to check for *queue type instead of
validity*, and if the queue is POLL  then take the
corresponding branch:

*if*(*odp_queue_type(*queue) == ODP_QUEUE_TYPE_POLL)

  ev = queue_deq_wait_time(queue, ns);

*else*

  ev  = odp_schedule(NULL, ns);

Regards,

Radu



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



___
lng-odp mailing list
lng-odp@lists.linaro.org 
http://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
http://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 1383] New: validation: pktio check for poll queue type

2015-03-20 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1383

Bug ID: 1383
   Summary: validation: pktio check for poll queue type
   Product: OpenDataPlane
   Version: unspecified
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: General ODP
  Assignee: lng-odp@lists.linaro.org
  Reporter: maxim.uva...@linaro.org

In the odp_pktio validation – a pktio is created and it is configured with a
PKTIN queue.

Packets are then enqueued to the out queue of the device.
In the function wait_for_packet I think is an issue when an event is received.
There is  the following condition :

if (queue != ODP_QUEUE_INVALID)

  ev = queue_deq_wait_time(queue, ns);
else
  ev  = odp_schedule(NULL, ns);


The queue that comes as input param, is the PKTIN queue which is a scheduled
queue.
As it can be noticed the queue_deq_wait_time will be called (PKTN queue is
valid) and there,an explicit dequeue operation will be performed on a scheduled
queue which is not OK.
So a schedule would be proper instead of explicit dequeue.

A possible fix is to check for queue type instead of validity, and if the queue
is POLL  then take the corresponding branch:


if (odp_queue_type(queue) == ODP_QUEUE_TYPE_POLL)
  ev = queue_deq_wait_time(queue, ns);
else
  ev  = odp_schedule(NULL, ns);

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


Re: [lng-odp] pktio pps on linux-geneneric & HP

2015-03-20 Thread Maxim Uvarov

On 03/20/15 12:51, Ciprian Barbu wrote:

On Thu, Mar 19, 2015 at 11:48 AM, Maxim Uvarov  wrote:

Did tests on packet i/o on virtual interfaces.
On my laptop got interesting numbers:

157011 max pps without Huge Pages.
and
175710 max pps with Huge Pages.

What was the packet size?

98 bytes,  that commands:

($TEST_DIR/../../example/generator/odp_generator -I $IF0 \
--srcmac fe:0f:97:c9:e0:44  --dstmac 
32:cb:9b:27:2f:1a \
--srcip 192.168.0.1 --dstip 192.168.0.2 -m u 
2>&1 > /dev/null) \

2>&1 > /dev/null &

echo "Run $TEST_DIR/../../example/l2fwd/odp_l2fwd -i $IF1,$IF2 
-m 0 -t 60 -c 2"
$TEST_DIR/../../example/l2fwd/odp_l2fwd -i $IF1,$IF2 -m 0 -t 60 
-c 2


Maxim.



Even if linux-generic is functional and not performance target Huge Pages
benefit is visible there (11 %).

Best regards,
Maxim.

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



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


Re: [lng-odp] odp_pktio validation test

2015-03-20 Thread Savolainen, Petri (Nokia - FI/Espoo)
Hi,

I'm currently reworking the scheduler and fixing this issue as part of that. 
Optimally, we'd get rid of the PKTIN type queues, and just use POLL or SCHED 
type to indicate if user is going to poll or use scheduler. Now PKTIN allows 
both polling and scheduling, which is wrong.

-Petri

> -Original Message-
> From: lng-odp-boun...@lists.linaro.org [mailto:lng-odp-
> boun...@lists.linaro.org] On Behalf Of ext Maxim Uvarov
> Sent: Friday, March 20, 2015 2:15 PM
> To: lng-odp@lists.linaro.org; Stuart Haslam
> Subject: Re: [lng-odp] odp_pktio validation test
> 
> Hello Raru-Andrei,  thanks for finding this.  Feel free to send patch
> for that issue.
> 
> Stuart, please review that change.
> 
> Best regards,
> Maxim.
> 
> On 03/20/15 12:43, Radu-Andrei Bulie wrote:
> >
> > Hi,
> >
> > In the odp_pktio validation - a pktio is created and it is configured
> > with a PKTIN queue.
> >
> > Packets are then enqueued to the out queue of the device.
> >
> > In the function *wait_for_packet***I think is an issue when an event
> > is received.
> >
> > There is  the following condition :
> >
> > *if*(queue != ODP_QUEUE_INVALID)
> >
> >   ev = queue_deq_wait_time(queue, ns);
> >
> > *else*
> >
> >   ev  = odp_schedule(NULL, ns);
> >
> > The *queue* that comes as input param, is the PKTIN queue which is a
> > scheduled queue.
> >
> > As it can be noticed the queue_deq_wait_time will be called (PKTN
> > queue is valid) and there,
> >
> > *an explicit dequeue operation will be performed on a scheduled queue
> > *which is not OK.
> >
> > So a schedule would be proper instead of explicit dequeue.
> >
> > A possible fix is to check for *queue type instead of validity*, and
> > if the queue is POLL  then take the corresponding branch:
> >
> > *if*(*odp_queue_type(*queue) == ODP_QUEUE_TYPE_POLL)
> >
> >   ev = queue_deq_wait_time(queue, ns);
> >
> > *else*
> >
> >   ev  = odp_schedule(NULL, ns);
> >
> > Regards,
> >
> > Radu
> >
> >
> >
> > ___
> > lng-odp mailing list
> > lng-odp@lists.linaro.org
> > http://lists.linaro.org/mailman/listinfo/lng-odp
> 
> 
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp

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


Re: [lng-odp] [PATCHv1] example: ODP Classifier example

2015-03-20 Thread Maxim Uvarov

Hello Bala, please find some comments bellow.

Best regards,
Maxim.

On 03/20/15 10:07, bala.manoha...@linaro.org wrote:

From: Balasubramanian Manoharan 

ODP Classifier example

This programs gets pmr rules as command-line parameter and configures the 
classification engine
in the system.

This initial version supports the following
* ODP_PMR_SIP_ADDR pmr term
* PMR term MATCH and RANGE type
* Multiple PMR rule can be set on a single pktio interface with different 
queues associated to each PMR rule
* Automatically configures a default queue and provides statistics for the same
* Prints statistics interms of the number of packets dispatched to each queue

Signed-off-by: Balasubramanian Manoharan 
---
  configure.ac|   1 +
  example/Makefile.am |   2 +-
  example/classifier/Makefile.am  |  10 +
  example/classifier/odp_classifier.c | 759 
  4 files changed, 771 insertions(+), 1 deletion(-)
  create mode 100644 example/classifier/Makefile.am
  create mode 100644 example/classifier/odp_classifier.c

diff --git a/configure.ac b/configure.ac
index 57054c5..51e4834 100644
--- a/configure.ac
+++ b/configure.ac
@@ -255,6 +255,7 @@ AC_CONFIG_FILES([Makefile
 example/l2fwd/Makefile
 example/packet/Makefile
 example/timer/Makefile
+example/classifier/Makefile

alphabetic order

 pkgconfig/libodp.pc
 platform/Makefile
 platform/linux-generic/Makefile
diff --git a/example/Makefile.am b/example/Makefile.am
index 3021571..aa09a8e 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -1 +1 @@
-SUBDIRS = generator ipsec l2fwd packet timer
+SUBDIRS = generator ipsec l2fwd packet timer classifier

alphabetic order

diff --git a/example/classifier/Makefile.am b/example/classifier/Makefile.am
new file mode 100644
index 000..938f094
--- /dev/null
+++ b/example/classifier/Makefile.am
@@ -0,0 +1,10 @@
+include $(top_srcdir)/example/Makefile.inc
+
+bin_PROGRAMS = odp_classifier
+odp_classifier_LDFLAGS = $(AM_LDFLAGS) -static
+odp_classifier_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/example
+
+noinst_HEADERS = \
+ $(top_srcdir)/example/example_debug.h
+
+dist_odp_classifier_SOURCES = odp_classifier.c
diff --git a/example/classifier/odp_classifier.c 
b/example/classifier/odp_classifier.c
new file mode 100644
index 000..8b34e7d
--- /dev/null
+++ b/example/classifier/odp_classifier.c
@@ -0,0 +1,759 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/** @def MAX_WORKERS
+ * @brief Maximum number of worker threads
+ */
+#define MAX_WORKERS32
+
+/** @def SHM_PKT_POOL_SIZE
+ * @brief Size of the shared memory block
+ */
+#define SHM_PKT_POOL_SIZE  (512*2048)
+
+/** @def SHM_PKT_POOL_BUF_SIZE
+ * @brief Buffer size of the packet pool buffer
+ */
+#define SHM_PKT_POOL_BUF_SIZE  1856
+
+/** @def MAX_PMR_COUNT
+ * @brief Maximum number of Classification Policy
+ */
+#define MAX_PMR_COUNT  8
+
+/** @def DISPLAY_STRING_LEN
+ * @brief Length of string used to display term value
+ */
+#define DISPLAY_STRING_LEN 32
+
+/** Get rid of path in filename - only for unix-type paths using '/' */
+#define NO_PATH(file_name) (strrchr((file_name), '/') ? \
+   strrchr((file_name), '/') + 1 : (file_name))
+
+typedef struct {
+   odp_queue_t queue;  /**< Associated queue handle */
+   odp_cos_t cos;  /**< Associated cos handle */
+   odp_pmr_t pmr;  /**< Associated pmr handle */
+   odp_atomic_u64_t packet_count;  /**< count of received packets */
+   odp_pmr_term_e term;/**< odp pmr term value */
+   char queuename[ODP_QUEUE_NAME_LEN]; /**< queue name */

queue_name is better for reading.

+   odp_pmr_match_type_e match_type;/**< pmr match type */
+   int val_sz; /**< size of the pmr term */
+   union {
+   struct {
+   uint32_t val;   /**< pmr term value */
+   uint32_t mask;  /**< pmr term mask */
+   } match;
+   struct  {
+   uint32_t val1;  /**< pmr term start range */
+   uint32_t val2;  /**< pmr term end range */
+   } range;
+   };
+   char value1[DISPLAY_STRING_LEN];/**< Display string1 */
+   char value2[DISPLAY_STRING_LEN];/**< Display string2 */
+} global_statistics;
+
+static global_statistics stats[MAX_PMR_COUNT];
+static int policy_count;
+static int queue_count;
+static int appl_mode;
+static odp_atomic_u64_t total_packets;
+
+enum packet_mode {
+   APPL_MODE_DROP, /**< Packet is dropped */
+   APPL_MODE_REPLY /**< Packet is sent back */

Re: [lng-odp] [PATCH 4/6] netdev-odp: allocate packet metadata in the same buffer as the packet itself

2015-03-20 Thread Maxim Uvarov

Hi Zoltan,

I don't know what is the code style of OVS but you need to be consistent 
in the style.

In some places you have

for (i = 0;

in other
for (i=0;

Thanks,
Maxim.


On 03/19/15 22:13, Zoltan Kiss wrote:

Allocating it after every packet receive gives a big performance penalty. So
move it into the same buffer pool, right after the packet itselg. Note,
initialization still happens for every packet, that needs to be further
optimized.

Signed-off-by: Zoltan Kiss 
---
  lib/netdev-odp.c | 67 +++-
  lib/ofpbuf.c |  1 -
  2 files changed, 37 insertions(+), 31 deletions(-)

diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
index 0b13f7f..4b13bfe 100644
--- a/lib/netdev-odp.c
+++ b/lib/netdev-odp.c
@@ -58,7 +58,6 @@ VLOG_DEFINE_THIS_MODULE(odp);
  static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20);
  
  static odp_buffer_pool_t pool;

-static odp_buffer_pool_t ofpbuf_pool;
  static odp_buffer_pool_t struct_pool;
  
  static int odp_initialized = 0;

@@ -95,7 +94,6 @@ void
  free_odp_buf(struct ofpbuf *b)
  {
  odp_packet_free(b->odp_pkt);
-odp_buffer_free(b->odp_ofpbuf);
  }
  
  int

@@ -130,11 +128,12 @@ static int
  odp_class_init(void)
  {
  odp_buffer_pool_param_t params;
-int result = 0;
+int result = 0, i;
+odp_packet_t* pkts;
  
-/* create packet pool */

+/* create packet & ofpbuf pool */
  
-params.buf_size = SHM_PKT_POOL_BUF_SIZE;

+params.buf_size = SHM_PKT_POOL_BUF_SIZE + SHM_OFPBUF_POOL_BUF_SIZE;
  params.buf_align = ODP_CACHE_LINE_SIZE;
  params.num_bufs = SHM_PKT_POOL_NUM_BUFS;
  params.buf_type = ODP_BUFFER_TYPE_PACKET;
@@ -147,19 +146,34 @@ odp_class_init(void)
  }
  odp_buffer_pool_print(pool);
  
-/* create ofpbuf pool */

-
-params.buf_size = SHM_OFPBUF_POOL_BUF_SIZE;
-params.num_bufs = SHM_OFPBUF_POOL_BUF_SIZE;
-params.buf_type = ODP_BUFFER_TYPE_RAW;
-
-ofpbuf_pool = odp_buffer_pool_create("ofpbuf_pool", ODP_SHM_NULL, ¶ms);
-
-if (ofpbuf_pool == ODP_BUFFER_POOL_INVALID) {
-VLOG_ERR("Error: ofpbuf pool create failed.\n");
+/* Allocate all the packets from the pool and initialize ofpbuf part */
+pkts = malloc(sizeof(odp_packet_t) * params.num_bufs);
+for (i=0; i < params.num_bufs; ++i) {
+struct dpif_packet *packet;
+char *start;
+pkts[i] = odp_packet_alloc(pool, 0);
+if (pkts[i] == ODP_PACKET_INVALID) {
+VLOG_ERR("Error: packet allocation failed.\n");
  return -1;
-}
-odp_buffer_pool_print(ofpbuf_pool);
+}
+start = (char *)odp_buffer_addr(odp_packet_to_buffer(pkts[i]));
+/* TODO: This 256 magic value is needed for ODP-DPDK, when the buffer 
is
+ *  allocated by rte_eth_rx_burst the start is at a different place.
+ *  Probably due to headroom, this is a workaround here at the moment 
*/
+packet = (struct dpif_packet*) (start + SHM_PKT_POOL_BUF_SIZE - 256);
+packet->ofpbuf.odp_pkt = pkts[i];
+/* TODO: odp_packet_alloc reset this to ODP_PACKET_OFFSET_INVALID, and
+ * ODP-DPDK doesn't set it later on, which causes a crash in
+ * emc_processing. Workaround this problem here for the moment */
+odp_packet_l2_offset_set(pkts[i], 0);
+ }
+
+/* Free our packets up */
+for (i=0; i < params.num_bufs; i++)
+odp_packet_free(pkts[i]);
+free(pkts);
+
+odp_buffer_pool_print(pool);
  
  /* create pool for structures */
  
@@ -359,10 +373,8 @@ netdev_odp_send(struct netdev *netdev, int qid OVS_UNUSED,

  }
  }
  } else {
-for (i = 0; i < cnt; i++) {
+for (i = 0; i < cnt; i++)
  odp_pkts[i] = pkts[i]->ofpbuf.odp_pkt;
-odp_packet_free(pkts[i]->ofpbuf.odp_ofpbuf);
-}
  pkts_ok = cnt;
  }
  
@@ -605,17 +617,12 @@ netdev_odp_rxq_recv(struct netdev_rxq *rxq_, struct dpif_packet **packets,

  return EINVAL;
  }
  
-/* Allocate an ofpbuf for each valid packet */

+/* Build the array of dpif_packet pointers */
  for (i = 0; i < pkts_ok; i++) {
-odp_buffer_t buf;
-buf = odp_buffer_alloc(ofpbuf_pool);
-if (buf == ODP_BUFFER_INVALID) {
-out_of_memory();
-}
-packets[i] = (struct dpif_packet*) odp_buffer_addr(buf);
-ofpbuf_init_odp(&packets[i]->ofpbuf, odp_packet_buf_len(pkt_tbl[i]));
-packets[i]->ofpbuf.odp_pkt = pkt_tbl[i];
-packets[i]->ofpbuf.odp_ofpbuf = buf;
+char *start;
+start = (char*)odp_buffer_addr(odp_packet_to_buffer(pkt_tbl[i]));
+packets[i] = (struct dpif_packet*) (start + SHM_PKT_POOL_BUF_SIZE);
+ofpbuf_init_odp(&packets[i]->ofpbuf, 0);
  rx_bytes += odp_packet_len(pkt_tbl[i]);
  }
  
diff --git a/lib/ofpbuf.c b/lib/ofpbuf.c

index 6f27b47..06a8c1c 100644
--- a/lib/ofpbuf.c
+++ b/lib/ofpbuf.c
@@ -155,7 +155,6 @@ ofpbuf_unin

Re: [lng-odp] [PATCH 5/6] netdev-odp: add error checking to clone_pkts

2015-03-20 Thread Maxim Uvarov

On 03/19/15 22:13, Zoltan Kiss wrote:

For odp_packet_push_tail

Signed-off-by: Zoltan Kiss 
---
  lib/netdev-odp.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
index 4b13bfe..87f6ec4 100644
--- a/lib/netdev-odp.c
+++ b/lib/netdev-odp.c
@@ -329,7 +329,8 @@ clone_pkts(struct netdev_odp *dev, struct dpif_packet 
**pkts,
  
  odp_packet_l2_offset_set(pkt, 0);
  
-odp_packet_push_tail(pkt, size);

+if (!odp_packet_push_tail(pkt, size))

odp_unlikely() is good to be here.

Maxim.

+VLOG_WARN_RL(&rl, "Can't push tail with %lu", size);
  odp_packet_copydata_in(pkt, 0, size, ofpbuf_data(&pkts[i]->ofpbuf));
  odp_pkts[newcnt] = pkt;
  newcnt++;



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


Re: [lng-odp] [PATCH 3/5] netdev-odp: rename odp_pool_param_t members

2015-03-20 Thread Maxim Uvarov

On 03/19/15 22:14, Zoltan Kiss wrote:

Signed-off-by: Zoltan Kiss 
---
  lib/netdev-odp.c | 21 +++--
  1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
index 7a0780e..2a04d24 100644
--- a/lib/netdev-odp.c
+++ b/lib/netdev-odp.c
@@ -133,10 +133,10 @@ odp_class_init(void)
  
  /* create packet & ofpbuf pool */
  
-params.buf_size = SHM_PKT_POOL_BUF_SIZE + SHM_OFPBUF_POOL_BUF_SIZE;

-params.buf_align = ODP_CACHE_LINE_SIZE;
-params.num_bufs = SHM_PKT_POOL_NUM_BUFS;
-params.buf_type = ODP_BUFFER_TYPE_PACKET;
+params.pkt.len= SHM_PKT_POOL_BUF_SIZE + SHM_OFPBUF_POOL_BUF_SIZE;
+params.pkt.seg_len = 0;
+params.pkt.num = SHM_PKT_POOL_NUM_BUFS;
+params.type = ODP_POOL_PACKET;
  
  pool = odp_pool_create("packet_pool", ODP_SHM_NULL, ¶ms);
  
@@ -147,8 +147,8 @@ odp_class_init(void)

  odp_pool_print(pool);
  
  /* Allocate all the packets from the pool and initialize ofpbuf part */

-pkts = malloc(sizeof(odp_packet_t) * params.num_bufs);
-for (i=0; i < params.num_bufs; ++i) {
+pkts = malloc(sizeof(odp_packet_t) * params.pkt.num);
+for (i=0; i < params.pkt.num; ++i) {
  struct dpif_packet *packet;
  char *start;
  pkts[i] = odp_packet_alloc(pool, 0);
@@ -169,7 +169,7 @@ odp_class_init(void)
   }
  
  /* Free our packets up */

-for (i=0; i < params.num_bufs; i++)
+for (i=0; i < params.pkt.num; i++)
  odp_packet_free(pkts[i]);
  free(pkts);


What are you doing here? Checking that all packets in the pool can be 
allocated? I think odp api / implementation should take care about that.


Maxim.

  
@@ -177,8 +177,9 @@ odp_class_init(void)
  
  /* create pool for structures */
  
-params.buf_size = SHM_STRUCT_POOL_BUF_SIZE;

-params.num_bufs = SHM_STRUCT_POOL_NUM_BUFS;
+params.type = ODP_POOL_BUFFER;
+params.buf.size = SHM_STRUCT_POOL_BUF_SIZE;
+params.buf.num = SHM_STRUCT_POOL_NUM_BUFS;
  
 struct_pool = odp_pool_create("struct_pool", ODP_SHM_NULL, ¶ms);
  
@@ -240,7 +241,7 @@ netdev_odp_construct(struct netdev *netdev_)

  goto out_err;
  }
  
-netdev->max_frame_len = info.params.buf_size;

+netdev->max_frame_len = info.params.pkt.len;
  
  ovs_mutex_init(&netdev->mutex);
  



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


Re: [lng-odp] [PATCH 4/6] netdev-odp: allocate packet metadata in the same buffer as the packet itself

2015-03-20 Thread Ciprian Barbu
On Thu, Mar 19, 2015 at 9:13 PM, Zoltan Kiss  wrote:
> Allocating it after every packet receive gives a big performance penalty. So
> move it into the same buffer pool, right after the packet itselg. Note,
> initialization still happens for every packet, that needs to be further
> optimized.
>
> Signed-off-by: Zoltan Kiss 
> ---
>  lib/netdev-odp.c | 67 
> +++-
>  lib/ofpbuf.c |  1 -
>  2 files changed, 37 insertions(+), 31 deletions(-)
>
> diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
> index 0b13f7f..4b13bfe 100644
> --- a/lib/netdev-odp.c
> +++ b/lib/netdev-odp.c
> @@ -58,7 +58,6 @@ VLOG_DEFINE_THIS_MODULE(odp);
>  static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20);
>
>  static odp_buffer_pool_t pool;
> -static odp_buffer_pool_t ofpbuf_pool;
>  static odp_buffer_pool_t struct_pool;
>
>  static int odp_initialized = 0;
> @@ -95,7 +94,6 @@ void
>  free_odp_buf(struct ofpbuf *b)
>  {
>  odp_packet_free(b->odp_pkt);
> -odp_buffer_free(b->odp_ofpbuf);
>  }
>
>  int
> @@ -130,11 +128,12 @@ static int
>  odp_class_init(void)
>  {
>  odp_buffer_pool_param_t params;
> -int result = 0;
> +int result = 0, i;
> +odp_packet_t* pkts;
>
> -/* create packet pool */
> +/* create packet & ofpbuf pool */
>
> -params.buf_size = SHM_PKT_POOL_BUF_SIZE;
> +params.buf_size = SHM_PKT_POOL_BUF_SIZE + SHM_OFPBUF_POOL_BUF_SIZE;
>  params.buf_align = ODP_CACHE_LINE_SIZE;
>  params.num_bufs = SHM_PKT_POOL_NUM_BUFS;
>  params.buf_type = ODP_BUFFER_TYPE_PACKET;
> @@ -147,19 +146,34 @@ odp_class_init(void)
>  }
>  odp_buffer_pool_print(pool);
>
> -/* create ofpbuf pool */
> -
> -params.buf_size = SHM_OFPBUF_POOL_BUF_SIZE;
> -params.num_bufs = SHM_OFPBUF_POOL_BUF_SIZE;
> -params.buf_type = ODP_BUFFER_TYPE_RAW;
> -
> -ofpbuf_pool = odp_buffer_pool_create("ofpbuf_pool", ODP_SHM_NULL, 
> ¶ms);
> -
> -if (ofpbuf_pool == ODP_BUFFER_POOL_INVALID) {
> -VLOG_ERR("Error: ofpbuf pool create failed.\n");
> +/* Allocate all the packets from the pool and initialize ofpbuf part */
> +pkts = malloc(sizeof(odp_packet_t) * params.num_bufs);
> +for (i=0; i < params.num_bufs; ++i) {
> +struct dpif_packet *packet;
> +char *start;
> +pkts[i] = odp_packet_alloc(pool, 0);
> +if (pkts[i] == ODP_PACKET_INVALID) {
> +VLOG_ERR("Error: packet allocation failed.\n");
>  return -1;
> -}
> -odp_buffer_pool_print(ofpbuf_pool);
> +}
> +start = (char *)odp_buffer_addr(odp_packet_to_buffer(pkts[i]));
> +/* TODO: This 256 magic value is needed for ODP-DPDK, when the 
> buffer is
> + *  allocated by rte_eth_rx_burst the start is at a different place.
> + *  Probably due to headroom, this is a workaround here at the 
> moment */
> +packet = (struct dpif_packet*) (start + SHM_PKT_POOL_BUF_SIZE - 256);
> +packet->ofpbuf.odp_pkt = pkts[i];
> +/* TODO: odp_packet_alloc reset this to ODP_PACKET_OFFSET_INVALID, 
> and
> + * ODP-DPDK doesn't set it later on, which causes a crash in
> + * emc_processing. Workaround this problem here for the moment */
> +odp_packet_l2_offset_set(pkts[i], 0);

I don't agree with this way of handling the odp-dpdk differences, the
demo was run on KS2 as well, not only Intel DPDK. The only reason to
even push these changes is so that people can replicate the demo, but
we can't just ignore the KS2 part.

In odp-ovs we still have the --with-odp-platform configure option, you
could use that for example to differentiate between platforms.

> + }
> +
> +/* Free our packets up */
> +for (i=0; i < params.num_bufs; i++)
> +odp_packet_free(pkts[i]);
> +free(pkts);
> +
> +odp_buffer_pool_print(pool);
>
>  /* create pool for structures */
>
> @@ -359,10 +373,8 @@ netdev_odp_send(struct netdev *netdev, int qid 
> OVS_UNUSED,
>  }
>  }
>  } else {
> -for (i = 0; i < cnt; i++) {
> +for (i = 0; i < cnt; i++)
>  odp_pkts[i] = pkts[i]->ofpbuf.odp_pkt;
> -odp_packet_free(pkts[i]->ofpbuf.odp_ofpbuf);
> -}
>  pkts_ok = cnt;
>  }
>
> @@ -605,17 +617,12 @@ netdev_odp_rxq_recv(struct netdev_rxq *rxq_, struct 
> dpif_packet **packets,
>  return EINVAL;
>  }
>
> -/* Allocate an ofpbuf for each valid packet */
> +/* Build the array of dpif_packet pointers */
>  for (i = 0; i < pkts_ok; i++) {
> -odp_buffer_t buf;
> -buf = odp_buffer_alloc(ofpbuf_pool);
> -if (buf == ODP_BUFFER_INVALID) {
> -out_of_memory();
> -}
> -packets[i] = (struct dpif_packet*) odp_buffer_addr(buf);
> -ofpbuf_init_odp(&packets[i]->ofpbuf, odp_packet_buf_len(pkt_tbl[i]));
> -packets[i]->ofpbuf.odp_pkt = pkt_tbl[i];
> -packets[i]->ofpbuf.odp_ofpbuf = buf;
> +char *

[lng-odp] [Bug 1386] New: Doxygen: input source `./platform/linux-netmap/include/odp' does not exist

2015-03-20 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1386

Bug ID: 1386
   Summary: Doxygen: input source
`./platform/linux-netmap/include/odp' does not exist
   Product: OpenDataPlane
   Version: 1.0
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Netmap
  Assignee: ciprian.ba...@linaro.org
  Reporter: mike.hol...@linaro.org
CC: lng-odp@lists.linaro.org

~/git/odp-netmap$ make doxygen-html
rm -rf doc/output
SRCDIR='.' PROJECT='OpenDataPlane' DOCDIR='doc/output' VERSION='1.0.0'
WITH_PLATFORM='linux-netmap' PERL_PATH='/usr/bin/perl' HAVE_DOT='NO'
GENERATE_MAN='NO' GENERATE_RTF='NO' GENERATE_XML='NO' GENERATE_HTMLHELP='NO'
GENERATE_CHI='NO' GENERATE_HTML='YES' GENERATE_LATEX='YES' /usr/bin/doxygen
./doc/doxygen.cfg
Warning: tag INPUT: input source `./platform/linux-netmap/include/odp' does not
exist
warning: source ./platform/linux-netmap/include/odp is not a readable file or
directory... skipping.

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


Re: [lng-odp] [PATCH 3/5] netdev-odp: rename odp_pool_param_t members

2015-03-20 Thread Ciprian Barbu
On Fri, Mar 20, 2015 at 5:49 PM, Maxim Uvarov  wrote:
> On 03/19/15 22:14, Zoltan Kiss wrote:
>>
>> Signed-off-by: Zoltan Kiss 
>> ---
>>   lib/netdev-odp.c | 21 +++--
>>   1 file changed, 11 insertions(+), 10 deletions(-)
>>
>> diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
>> index 7a0780e..2a04d24 100644
>> --- a/lib/netdev-odp.c
>> +++ b/lib/netdev-odp.c
>> @@ -133,10 +133,10 @@ odp_class_init(void)
>> /* create packet & ofpbuf pool */
>>   -params.buf_size = SHM_PKT_POOL_BUF_SIZE + SHM_OFPBUF_POOL_BUF_SIZE;
>> -params.buf_align = ODP_CACHE_LINE_SIZE;
>> -params.num_bufs = SHM_PKT_POOL_NUM_BUFS;
>> -params.buf_type = ODP_BUFFER_TYPE_PACKET;
>> +params.pkt.len= SHM_PKT_POOL_BUF_SIZE + SHM_OFPBUF_POOL_BUF_SIZE;
>> +params.pkt.seg_len = 0;
>> +params.pkt.num = SHM_PKT_POOL_NUM_BUFS;
>> +params.type = ODP_POOL_PACKET;
>> pool = odp_pool_create("packet_pool", ODP_SHM_NULL, ¶ms);
>>   @@ -147,8 +147,8 @@ odp_class_init(void)
>>   odp_pool_print(pool);
>> /* Allocate all the packets from the pool and initialize ofpbuf
>> part */
>> -pkts = malloc(sizeof(odp_packet_t) * params.num_bufs);
>> -for (i=0; i < params.num_bufs; ++i) {
>> +pkts = malloc(sizeof(odp_packet_t) * params.pkt.num);
>> +for (i=0; i < params.pkt.num; ++i) {
>>   struct dpif_packet *packet;
>>   char *start;
>>   pkts[i] = odp_packet_alloc(pool, 0);
>> @@ -169,7 +169,7 @@ odp_class_init(void)
>>}
>> /* Free our packets up */
>> -for (i=0; i < params.num_bufs; i++)
>> +for (i=0; i < params.pkt.num; i++)
>>   odp_packet_free(pkts[i]);
>>   free(pkts);
>
>
> What are you doing here? Checking that all packets in the pool can be
> allocated? I think odp api / implementation should take care about that.

Don't ignore the context, the previous series that makes performance
tweaks explains why everything in this function is needed! Between
line 147 and 169 there is code that is not included in this patch.

>
> Maxim.
>
>>   @@ -177,8 +177,9 @@ odp_class_init(void)
>> /* create pool for structures */
>>   -params.buf_size = SHM_STRUCT_POOL_BUF_SIZE;
>> -params.num_bufs = SHM_STRUCT_POOL_NUM_BUFS;
>> +params.type = ODP_POOL_BUFFER;
>> +params.buf.size = SHM_STRUCT_POOL_BUF_SIZE;
>> +params.buf.num = SHM_STRUCT_POOL_NUM_BUFS;
>>struct_pool = odp_pool_create("struct_pool", ODP_SHM_NULL,
>> ¶ms);
>>   @@ -240,7 +241,7 @@ netdev_odp_construct(struct netdev *netdev_)
>>   goto out_err;
>>   }
>>   -netdev->max_frame_len = info.params.buf_size;
>> +netdev->max_frame_len = info.params.pkt.len;
>> ovs_mutex_init(&netdev->mutex);
>>
>
>
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp

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


Re: [lng-odp] [PATCH 3/5] netdev-odp: rename odp_pool_param_t members

2015-03-20 Thread Zoltan Kiss



On 20/03/15 15:49, Maxim Uvarov wrote:

On 03/19/15 22:14, Zoltan Kiss wrote:

Signed-off-by: Zoltan Kiss 
---
  lib/netdev-odp.c | 21 +++--
  1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
index 7a0780e..2a04d24 100644
--- a/lib/netdev-odp.c
+++ b/lib/netdev-odp.c
@@ -133,10 +133,10 @@ odp_class_init(void)
  /* create packet & ofpbuf pool */
-params.buf_size = SHM_PKT_POOL_BUF_SIZE + SHM_OFPBUF_POOL_BUF_SIZE;
-params.buf_align = ODP_CACHE_LINE_SIZE;
-params.num_bufs = SHM_PKT_POOL_NUM_BUFS;
-params.buf_type = ODP_BUFFER_TYPE_PACKET;
+params.pkt.len= SHM_PKT_POOL_BUF_SIZE + SHM_OFPBUF_POOL_BUF_SIZE;
+params.pkt.seg_len = 0;
+params.pkt.num = SHM_PKT_POOL_NUM_BUFS;
+params.type = ODP_POOL_PACKET;
  pool = odp_pool_create("packet_pool", ODP_SHM_NULL, ¶ms);
@@ -147,8 +147,8 @@ odp_class_init(void)
  odp_pool_print(pool);
  /* Allocate all the packets from the pool and initialize ofpbuf
part */
-pkts = malloc(sizeof(odp_packet_t) * params.num_bufs);
-for (i=0; i < params.num_bufs; ++i) {
+pkts = malloc(sizeof(odp_packet_t) * params.pkt.num);
+for (i=0; i < params.pkt.num; ++i) {
  struct dpif_packet *packet;
  char *start;
  pkts[i] = odp_packet_alloc(pool, 0);
@@ -169,7 +169,7 @@ odp_class_init(void)
   }
  /* Free our packets up */
-for (i=0; i < params.num_bufs; i++)
+for (i=0; i < params.pkt.num; i++)
  odp_packet_free(pkts[i]);
  free(pkts);


What are you doing here? Checking that all packets in the pool can be
allocated? I think odp api / implementation should take care about that.
No, I need to allocate all the packets from the pool and preset some 
fields in the packet metadata area, where OVS store it's ofpbuf 
structure. Setting it after every receive has a perf penalty. See 
"netdev-odp: allocate packet metadata in the same buffer as the packet 
itself" in the previous series. That's where this originally comes from.


Maxim.


@@ -177,8 +177,9 @@ odp_class_init(void)
  /* create pool for structures */
-params.buf_size = SHM_STRUCT_POOL_BUF_SIZE;
-params.num_bufs = SHM_STRUCT_POOL_NUM_BUFS;
+params.type = ODP_POOL_BUFFER;
+params.buf.size = SHM_STRUCT_POOL_BUF_SIZE;
+params.buf.num = SHM_STRUCT_POOL_NUM_BUFS;
 struct_pool = odp_pool_create("struct_pool", ODP_SHM_NULL, ¶ms);
@@ -240,7 +241,7 @@ netdev_odp_construct(struct netdev *netdev_)
  goto out_err;
  }
-netdev->max_frame_len = info.params.buf_size;
+netdev->max_frame_len = info.params.pkt.len;
  ovs_mutex_init(&netdev->mutex);



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


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


Re: [lng-odp] [PATCH 3/5] netdev-odp: rename odp_pool_param_t members

2015-03-20 Thread Zoltan Kiss



On 20/03/15 16:42, Zoltan Kiss wrote:

No, I need to allocate all the packets from the pool and preset some
fields in the packet metadata area, where OVS store it's ofpbuf
structure. Setting it after every receive has a perf penalty. See
"netdev-odp: allocate packet metadata in the same buffer as the packet
itself" in the previous series. That's where this originally comes from.


Forgot to mention: this is something DPDK has facility for, you can add 
initializer functions for the buffer pool create function there. We 
discussed with Bill that something like that would be good for ODP.


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


Re: [lng-odp] [PATCH 5/6] netdev-odp: add error checking to clone_pkts

2015-03-20 Thread Zoltan Kiss



On 20/03/15 15:41, Maxim Uvarov wrote:

On 03/19/15 22:13, Zoltan Kiss wrote:

For odp_packet_push_tail

Signed-off-by: Zoltan Kiss 
---
  lib/netdev-odp.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
index 4b13bfe..87f6ec4 100644
--- a/lib/netdev-odp.c
+++ b/lib/netdev-odp.c
@@ -329,7 +329,8 @@ clone_pkts(struct netdev_odp *dev, struct
dpif_packet **pkts,
  odp_packet_l2_offset_set(pkt, 0);
-odp_packet_push_tail(pkt, size);
+if (!odp_packet_push_tail(pkt, size))

odp_unlikely() is good to be here.

Ok


Maxim.

+VLOG_WARN_RL(&rl, "Can't push tail with %lu", size);
  odp_packet_copydata_in(pkt, 0, size,
ofpbuf_data(&pkts[i]->ofpbuf));
  odp_pkts[newcnt] = pkt;
  newcnt++;



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


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


Re: [lng-odp] [PATCH 4/6] netdev-odp: allocate packet metadata in the same buffer as the packet itself

2015-03-20 Thread Zoltan Kiss
I'll fix that. Unfortunately OVS doesn't have a checkpatch, and its 
style is slightly different from kernel (e.g. 4 spaces for indentation), 
which is often confusing.


On 20/03/15 15:41, Maxim Uvarov wrote:

Hi Zoltan,

I don't know what is the code style of OVS but you need to be consistent
in the style.
In some places you have

for (i = 0;

in other
for (i=0;

Thanks,
Maxim.


On 03/19/15 22:13, Zoltan Kiss wrote:

Allocating it after every packet receive gives a big performance
penalty. So
move it into the same buffer pool, right after the packet itselg. Note,
initialization still happens for every packet, that needs to be further
optimized.

Signed-off-by: Zoltan Kiss 
---
  lib/netdev-odp.c | 67
+++-
  lib/ofpbuf.c |  1 -
  2 files changed, 37 insertions(+), 31 deletions(-)

diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
index 0b13f7f..4b13bfe 100644
--- a/lib/netdev-odp.c
+++ b/lib/netdev-odp.c
@@ -58,7 +58,6 @@ VLOG_DEFINE_THIS_MODULE(odp);
  static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(5, 20);
  static odp_buffer_pool_t pool;
-static odp_buffer_pool_t ofpbuf_pool;
  static odp_buffer_pool_t struct_pool;
  static int odp_initialized = 0;
@@ -95,7 +94,6 @@ void
  free_odp_buf(struct ofpbuf *b)
  {
  odp_packet_free(b->odp_pkt);
-odp_buffer_free(b->odp_ofpbuf);
  }
  int
@@ -130,11 +128,12 @@ static int
  odp_class_init(void)
  {
  odp_buffer_pool_param_t params;
-int result = 0;
+int result = 0, i;
+odp_packet_t* pkts;
-/* create packet pool */
+/* create packet & ofpbuf pool */
-params.buf_size = SHM_PKT_POOL_BUF_SIZE;
+params.buf_size = SHM_PKT_POOL_BUF_SIZE + SHM_OFPBUF_POOL_BUF_SIZE;
  params.buf_align = ODP_CACHE_LINE_SIZE;
  params.num_bufs = SHM_PKT_POOL_NUM_BUFS;
  params.buf_type = ODP_BUFFER_TYPE_PACKET;
@@ -147,19 +146,34 @@ odp_class_init(void)
  }
  odp_buffer_pool_print(pool);
-/* create ofpbuf pool */
-
-params.buf_size = SHM_OFPBUF_POOL_BUF_SIZE;
-params.num_bufs = SHM_OFPBUF_POOL_BUF_SIZE;
-params.buf_type = ODP_BUFFER_TYPE_RAW;
-
-ofpbuf_pool = odp_buffer_pool_create("ofpbuf_pool", ODP_SHM_NULL,
¶ms);
-
-if (ofpbuf_pool == ODP_BUFFER_POOL_INVALID) {
-VLOG_ERR("Error: ofpbuf pool create failed.\n");
+/* Allocate all the packets from the pool and initialize ofpbuf
part */
+pkts = malloc(sizeof(odp_packet_t) * params.num_bufs);
+for (i=0; i < params.num_bufs; ++i) {
+struct dpif_packet *packet;
+char *start;
+pkts[i] = odp_packet_alloc(pool, 0);
+if (pkts[i] == ODP_PACKET_INVALID) {
+VLOG_ERR("Error: packet allocation failed.\n");
  return -1;
-}
-odp_buffer_pool_print(ofpbuf_pool);
+}
+start = (char *)odp_buffer_addr(odp_packet_to_buffer(pkts[i]));
+/* TODO: This 256 magic value is needed for ODP-DPDK, when
the buffer is
+ *  allocated by rte_eth_rx_burst the start is at a different
place.
+ *  Probably due to headroom, this is a workaround here at
the moment */
+packet = (struct dpif_packet*) (start + SHM_PKT_POOL_BUF_SIZE
- 256);
+packet->ofpbuf.odp_pkt = pkts[i];
+/* TODO: odp_packet_alloc reset this to
ODP_PACKET_OFFSET_INVALID, and
+ * ODP-DPDK doesn't set it later on, which causes a crash in
+ * emc_processing. Workaround this problem here for the
moment */
+odp_packet_l2_offset_set(pkts[i], 0);
+ }
+
+/* Free our packets up */
+for (i=0; i < params.num_bufs; i++)
+odp_packet_free(pkts[i]);
+free(pkts);
+
+odp_buffer_pool_print(pool);
  /* create pool for structures */
@@ -359,10 +373,8 @@ netdev_odp_send(struct netdev *netdev, int qid
OVS_UNUSED,
  }
  }
  } else {
-for (i = 0; i < cnt; i++) {
+for (i = 0; i < cnt; i++)
  odp_pkts[i] = pkts[i]->ofpbuf.odp_pkt;
-odp_packet_free(pkts[i]->ofpbuf.odp_ofpbuf);
-}
  pkts_ok = cnt;
  }
@@ -605,17 +617,12 @@ netdev_odp_rxq_recv(struct netdev_rxq *rxq_,
struct dpif_packet **packets,
  return EINVAL;
  }
-/* Allocate an ofpbuf for each valid packet */
+/* Build the array of dpif_packet pointers */
  for (i = 0; i < pkts_ok; i++) {
-odp_buffer_t buf;
-buf = odp_buffer_alloc(ofpbuf_pool);
-if (buf == ODP_BUFFER_INVALID) {
-out_of_memory();
-}
-packets[i] = (struct dpif_packet*) odp_buffer_addr(buf);
-ofpbuf_init_odp(&packets[i]->ofpbuf,
odp_packet_buf_len(pkt_tbl[i]));
-packets[i]->ofpbuf.odp_pkt = pkt_tbl[i];
-packets[i]->ofpbuf.odp_ofpbuf = buf;
+char *start;
+start =
(char*)odp_buffer_addr(odp_packet_to_buffer(pkt_tbl[i]));
+packets[i] = (struct dpif_packet*) (start +
SHM_PKT_POOL_BUF_SIZE);
+ofpbuf_init_odp(&packets[i]->ofpbuf, 0);
  rx_bytes += odp_packet_le

Re: [lng-odp] [PATCH OVS 0/5]: Upgrade OVS to 1.0 API level

2015-03-20 Thread Ciprian Barbu
Worked for me, but since this series depends on the previous it can't
be applied until we deal with the previous series.

Otherwise I can add Reviewed-and-tested-by.

On Thu, Mar 19, 2015 at 9:16 PM, Zoltan Kiss  wrote:
> Shame on me, I forget to note again, this applies on top of "Leftover from
> Connect" series:
>
> http://lists.linaro.org/pipermail/lng-odp/2015-March/010278.html
>
>
> On 19/03/15 19:14, Zoltan Kiss wrote:
>>
>> These patches make OVS compile with ODP 1.0 API
>>
>

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


Re: [lng-odp] [PATCH 4/6] netdev-odp: allocate packet metadata in the same buffer as the packet itself

2015-03-20 Thread Zoltan Kiss



On 20/03/15 16:30, Ciprian Barbu wrote:

@@ -147,19 +146,34 @@ odp_class_init(void)
>  }
>  odp_buffer_pool_print(pool);
>
>-/* create ofpbuf pool */
>-
>-params.buf_size = SHM_OFPBUF_POOL_BUF_SIZE;
>-params.num_bufs = SHM_OFPBUF_POOL_BUF_SIZE;
>-params.buf_type = ODP_BUFFER_TYPE_RAW;
>-
>-ofpbuf_pool = odp_buffer_pool_create("ofpbuf_pool", ODP_SHM_NULL, 
¶ms);
>-
>-if (ofpbuf_pool == ODP_BUFFER_POOL_INVALID) {
>-VLOG_ERR("Error: ofpbuf pool create failed.\n");
>+/* Allocate all the packets from the pool and initialize ofpbuf part */
>+pkts = malloc(sizeof(odp_packet_t) * params.num_bufs);
>+for (i=0; i < params.num_bufs; ++i) {
>+struct dpif_packet *packet;
>+char *start;
>+pkts[i] = odp_packet_alloc(pool, 0);
>+if (pkts[i] == ODP_PACKET_INVALID) {
>+VLOG_ERR("Error: packet allocation failed.\n");
>  return -1;
>-}
>-odp_buffer_pool_print(ofpbuf_pool);
>+}
>+start = (char *)odp_buffer_addr(odp_packet_to_buffer(pkts[i]));
>+/* TODO: This 256 magic value is needed for ODP-DPDK, when the buffer 
is
>+ *  allocated by rte_eth_rx_burst the start is at a different place.
>+ *  Probably due to headroom, this is a workaround here at the moment 
*/
>+packet = (struct dpif_packet*) (start + SHM_PKT_POOL_BUF_SIZE - 256);
>+packet->ofpbuf.odp_pkt = pkts[i];
>+/* TODO: odp_packet_alloc reset this to ODP_PACKET_OFFSET_INVALID, and
>+ * ODP-DPDK doesn't set it later on, which causes a crash in
>+ * emc_processing. Workaround this problem here for the moment */
>+odp_packet_l2_offset_set(pkts[i], 0);

I don't agree with this way of handling the odp-dpdk differences, the
demo was run on KS2 as well, not only Intel DPDK. The only reason to
even push these changes is so that people can replicate the demo, but
we can't just ignore the KS2 part.

In odp-ovs we still have the --with-odp-platform configure option, you
could use that for example to differentiate between platforms.



I agree with you, I'll try to figure out something better for the first. 
The second is a workaround for a bug in ODP-DPDK, but I think it doesn't 
hurt other implementations.


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


Re: [lng-odp] [PATCH 3/5] netdev-odp: rename odp_pool_param_t members

2015-03-20 Thread Bill Fischofer
Actually, ODP already has this concept.  It's called user metadata and was
to be a feature of ODP pools (the structures to support this are actually
already part of linux-generic).  We deferred it from ODP v1.0 for practical
reasons, but this is something we should revisit.

Let's put this on the list of architecture things to discuss next week.
I'd like to understand the specifics of the OVS need so we can be sure to
get the best application match to the final ODP proposal.

On Fri, Mar 20, 2015 at 11:43 AM, Zoltan Kiss 
wrote:

>
>
> On 20/03/15 16:42, Zoltan Kiss wrote:
>
>> No, I need to allocate all the packets from the pool and preset some
>> fields in the packet metadata area, where OVS store it's ofpbuf
>> structure. Setting it after every receive has a perf penalty. See
>> "netdev-odp: allocate packet metadata in the same buffer as the packet
>> itself" in the previous series. That's where this originally comes from.
>>
>
> Forgot to mention: this is something DPDK has facility for, you can add
> initializer functions for the buffer pool create function there. We
> discussed with Bill that something like that would be good for ODP.
>
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH 3/5] netdev-odp: rename odp_pool_param_t members

2015-03-20 Thread Maxim Uvarov

On 03/20/15 19:42, Zoltan Kiss wrote:



On 20/03/15 15:49, Maxim Uvarov wrote:

On 03/19/15 22:14, Zoltan Kiss wrote:

Signed-off-by: Zoltan Kiss 
---
  lib/netdev-odp.c | 21 +++--
  1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
index 7a0780e..2a04d24 100644
--- a/lib/netdev-odp.c
+++ b/lib/netdev-odp.c
@@ -133,10 +133,10 @@ odp_class_init(void)
  /* create packet & ofpbuf pool */
-params.buf_size = SHM_PKT_POOL_BUF_SIZE + 
SHM_OFPBUF_POOL_BUF_SIZE;

-params.buf_align = ODP_CACHE_LINE_SIZE;
-params.num_bufs = SHM_PKT_POOL_NUM_BUFS;
-params.buf_type = ODP_BUFFER_TYPE_PACKET;
+params.pkt.len= SHM_PKT_POOL_BUF_SIZE + SHM_OFPBUF_POOL_BUF_SIZE;
+params.pkt.seg_len = 0;
+params.pkt.num = SHM_PKT_POOL_NUM_BUFS;
+params.type = ODP_POOL_PACKET;
  pool = odp_pool_create("packet_pool", ODP_SHM_NULL, ¶ms);
@@ -147,8 +147,8 @@ odp_class_init(void)
  odp_pool_print(pool);
  /* Allocate all the packets from the pool and initialize ofpbuf
part */
-pkts = malloc(sizeof(odp_packet_t) * params.num_bufs);
-for (i=0; i < params.num_bufs; ++i) {
+pkts = malloc(sizeof(odp_packet_t) * params.pkt.num);
+for (i=0; i < params.pkt.num; ++i) {
  struct dpif_packet *packet;
  char *start;
  pkts[i] = odp_packet_alloc(pool, 0);
@@ -169,7 +169,7 @@ odp_class_init(void)
   }
  /* Free our packets up */
-for (i=0; i < params.num_bufs; i++)
+for (i=0; i < params.pkt.num; i++)
  odp_packet_free(pkts[i]);
  free(pkts);


What are you doing here? Checking that all packets in the pool can be
allocated? I think odp api / implementation should take care about that.
No, I need to allocate all the packets from the pool and preset some 
fields in the packet metadata area, where OVS store it's ofpbuf 
structure. Setting it after every receive has a perf penalty. See 
"netdev-odp: allocate packet metadata in the same buffer as the packet 
itself" in the previous series. That's where this originally comes from.


Not sure if it's portable solution. Will it work on KS2 for example?

Maxim.


Maxim.


@@ -177,8 +177,9 @@ odp_class_init(void)
  /* create pool for structures */
-params.buf_size = SHM_STRUCT_POOL_BUF_SIZE;
-params.num_bufs = SHM_STRUCT_POOL_NUM_BUFS;
+params.type = ODP_POOL_BUFFER;
+params.buf.size = SHM_STRUCT_POOL_BUF_SIZE;
+params.buf.num = SHM_STRUCT_POOL_NUM_BUFS;
 struct_pool = odp_pool_create("struct_pool", ODP_SHM_NULL, 
¶ms);

@@ -240,7 +241,7 @@ netdev_odp_construct(struct netdev *netdev_)
  goto out_err;
  }
-netdev->max_frame_len = info.params.buf_size;
+netdev->max_frame_len = info.params.pkt.len;
  ovs_mutex_init(&netdev->mutex);



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



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


Re: [lng-odp] [PATCH 3/5] netdev-odp: rename odp_pool_param_t members

2015-03-20 Thread Bill Fischofer
The APIs are intended to be portable.  Whether linux-generic code is useful
for other implementations is separate question.

On Fri, Mar 20, 2015 at 12:03 PM, Maxim Uvarov 
wrote:

> On 03/20/15 19:42, Zoltan Kiss wrote:
>
>>
>>
>> On 20/03/15 15:49, Maxim Uvarov wrote:
>>
>>> On 03/19/15 22:14, Zoltan Kiss wrote:
>>>
 Signed-off-by: Zoltan Kiss 
 ---
   lib/netdev-odp.c | 21 +++--
   1 file changed, 11 insertions(+), 10 deletions(-)

 diff --git a/lib/netdev-odp.c b/lib/netdev-odp.c
 index 7a0780e..2a04d24 100644
 --- a/lib/netdev-odp.c
 +++ b/lib/netdev-odp.c
 @@ -133,10 +133,10 @@ odp_class_init(void)
   /* create packet & ofpbuf pool */
 -params.buf_size = SHM_PKT_POOL_BUF_SIZE + SHM_OFPBUF_POOL_BUF_SIZE;
 -params.buf_align = ODP_CACHE_LINE_SIZE;
 -params.num_bufs = SHM_PKT_POOL_NUM_BUFS;
 -params.buf_type = ODP_BUFFER_TYPE_PACKET;
 +params.pkt.len= SHM_PKT_POOL_BUF_SIZE + SHM_OFPBUF_POOL_BUF_SIZE;
 +params.pkt.seg_len = 0;
 +params.pkt.num = SHM_PKT_POOL_NUM_BUFS;
 +params.type = ODP_POOL_PACKET;
   pool = odp_pool_create("packet_pool", ODP_SHM_NULL, ¶ms);
 @@ -147,8 +147,8 @@ odp_class_init(void)
   odp_pool_print(pool);
   /* Allocate all the packets from the pool and initialize ofpbuf
 part */
 -pkts = malloc(sizeof(odp_packet_t) * params.num_bufs);
 -for (i=0; i < params.num_bufs; ++i) {
 +pkts = malloc(sizeof(odp_packet_t) * params.pkt.num);
 +for (i=0; i < params.pkt.num; ++i) {
   struct dpif_packet *packet;
   char *start;
   pkts[i] = odp_packet_alloc(pool, 0);
 @@ -169,7 +169,7 @@ odp_class_init(void)
}
   /* Free our packets up */
 -for (i=0; i < params.num_bufs; i++)
 +for (i=0; i < params.pkt.num; i++)
   odp_packet_free(pkts[i]);
   free(pkts);

>>>
>>> What are you doing here? Checking that all packets in the pool can be
>>> allocated? I think odp api / implementation should take care about that.
>>>
>> No, I need to allocate all the packets from the pool and preset some
>> fields in the packet metadata area, where OVS store it's ofpbuf structure.
>> Setting it after every receive has a perf penalty. See "netdev-odp:
>> allocate packet metadata in the same buffer as the packet itself" in the
>> previous series. That's where this originally comes from.
>>
>
> Not sure if it's portable solution. Will it work on KS2 for example?
>
> Maxim.
>
>
>>> Maxim.
>>>
>>>  @@ -177,8 +177,9 @@ odp_class_init(void)
   /* create pool for structures */
 -params.buf_size = SHM_STRUCT_POOL_BUF_SIZE;
 -params.num_bufs = SHM_STRUCT_POOL_NUM_BUFS;
 +params.type = ODP_POOL_BUFFER;
 +params.buf.size = SHM_STRUCT_POOL_BUF_SIZE;
 +params.buf.num = SHM_STRUCT_POOL_NUM_BUFS;
  struct_pool = odp_pool_create("struct_pool", ODP_SHM_NULL,
 ¶ms);
 @@ -240,7 +241,7 @@ netdev_odp_construct(struct netdev *netdev_)
   goto out_err;
   }
 -netdev->max_frame_len = info.params.buf_size;
 +netdev->max_frame_len = info.params.pkt.len;
   ovs_mutex_init(&netdev->mutex);

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


[lng-odp] Static assertion on tick_buf_t in timer.c

2015-03-20 Thread Sumith Dev Vojini
Hello,

While building ODP(v1.0.0) I encountered an assertion on the size of
tick_buf_t in timer.c. The structure is

typedef struct tick_buf_s {
 odp_atomic_u64_t exp_tck;/* Expiration tick or TMO_xxx */
 odp_buffer_t tmo_buf;/* ODP_BUFFER_INVALID if timer not active */
 #ifdef TB_NEEDS_PAD
 uint32_t pad;/* Need to be able to access padding for successful
CAS */
 #endif
 } tick_buf_t
 #ifdef ODP_ATOMIC_U128
 ODP_ALIGNED(16) /* 16-byte atomic operations need properly aligned
addresses */
;
_ODP_STATIC_ASSERT(sizeof(tick_buf_t) == 16, "sizeof(tick_buf_t) == 16");


odp_atomic_u64_t is of type struct odp_atomic_u64_s

struct odp_atomic_u64_s {
uint64_t v; /**< Actual storage for the atomic variable */
#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
/* Some architectures do not support lock-free operations on 64-bit
 * data types. We use a spin lock to ensure atomicity. */
char lock; /**< Spin lock (if needed) used to ensure atomic access
*/
#endif
} ODP_ALIGNED(sizeof(uint64_t)); /* Enforce alignement! */;

So the systems which cannot do atomic 64 bit operations will have lock
variable defined which increases the size of the that structure
odp_atomic_u64_s to 16 bytes due to the alignment requirements and the
assertion fails since tick_buf_s has two more variables increasing its size
to 24 bytes.



-- 
Regards
Sumith Dev
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [API-NEXT PATCHv2 3/3] validation: packet: use true == non-zero per ODP API Guidelines

2015-03-20 Thread Bill Fischofer
This change addresses Bug https://bugs.linaro.org/show_bug.cgi?id=1334

Signed-off-by: Bill Fischofer 
---
 test/validation/odp_packet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/validation/odp_packet.c b/test/validation/odp_packet.c
index 8f764bf..0c1d069 100644
--- a/test/validation/odp_packet.c
+++ b/test/validation/odp_packet.c
@@ -425,7 +425,7 @@ do { \
odp_packet_has_##flag##_set(packet, 0);   \
CU_ASSERT(odp_packet_has_##flag(packet) == 0);\
odp_packet_has_##flag##_set(packet, 1);   \
-   CU_ASSERT(odp_packet_has_##flag(packet) == 1);\
+   CU_ASSERT(odp_packet_has_##flag(packet) != 0);\
 } while (0)
 
 static void packet_in_flags(void)
-- 
2.1.0


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


[lng-odp] [API-NEXT PATCHv2 2/3] linux-generic: packet: use odp_bool_t for packet flag APIs

2015-03-20 Thread Bill Fischofer
This change addresses Bug https://bugs.linaro.org/show_bug.cgi?id=1334

Signed-off-by: Bill Fischofer 
---
 platform/linux-generic/odp_packet_flags.c | 36 +++
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/platform/linux-generic/odp_packet_flags.c 
b/platform/linux-generic/odp_packet_flags.c
index ab3d12f..8ec6b09 100644
--- a/platform/linux-generic/odp_packet_flags.c
+++ b/platform/linux-generic/odp_packet_flags.c
@@ -8,94 +8,94 @@
 #include 
 
 
-int odp_packet_has_error(odp_packet_t pkt)
+odp_bool_t odp_packet_has_error(odp_packet_t pkt)
 {
return (odp_packet_hdr(pkt)->error_flags.all != 0);
 }
 
 /* Get Input Flags */
 
-int odp_packet_has_l2(odp_packet_t pkt)
+odp_bool_t odp_packet_has_l2(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.l2;
 }
 
-int odp_packet_has_l3(odp_packet_t pkt)
+odp_bool_t odp_packet_has_l3(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.l3;
 }
 
-int odp_packet_has_l4(odp_packet_t pkt)
+odp_bool_t odp_packet_has_l4(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.l4;
 }
 
-int odp_packet_has_eth(odp_packet_t pkt)
+odp_bool_t odp_packet_has_eth(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.eth;
 }
 
-int odp_packet_has_jumbo(odp_packet_t pkt)
+odp_bool_t odp_packet_has_jumbo(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.jumbo;
 }
 
-int odp_packet_has_vlan(odp_packet_t pkt)
+odp_bool_t odp_packet_has_vlan(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.vlan;
 }
 
-int odp_packet_has_vlan_qinq(odp_packet_t pkt)
+odp_bool_t odp_packet_has_vlan_qinq(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.vlan_qinq;
 }
 
-int odp_packet_has_arp(odp_packet_t pkt)
+odp_bool_t odp_packet_has_arp(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.arp;
 }
 
-int odp_packet_has_ipv4(odp_packet_t pkt)
+odp_bool_t odp_packet_has_ipv4(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.ipv4;
 }
 
-int odp_packet_has_ipv6(odp_packet_t pkt)
+odp_bool_t odp_packet_has_ipv6(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.ipv6;
 }
 
-int odp_packet_has_ipfrag(odp_packet_t pkt)
+odp_bool_t odp_packet_has_ipfrag(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.ipfrag;
 }
 
-int odp_packet_has_ipopt(odp_packet_t pkt)
+odp_bool_t odp_packet_has_ipopt(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.ipopt;
 }
 
-int odp_packet_has_ipsec(odp_packet_t pkt)
+odp_bool_t odp_packet_has_ipsec(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.ipsec;
 }
 
-int odp_packet_has_udp(odp_packet_t pkt)
+odp_bool_t odp_packet_has_udp(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.udp;
 }
 
-int odp_packet_has_tcp(odp_packet_t pkt)
+odp_bool_t odp_packet_has_tcp(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.tcp;
 }
 
-int odp_packet_has_sctp(odp_packet_t pkt)
+odp_bool_t odp_packet_has_sctp(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.sctp;
 }
 
-int odp_packet_has_icmp(odp_packet_t pkt)
+odp_bool_t odp_packet_has_icmp(odp_packet_t pkt)
 {
return odp_packet_hdr(pkt)->input_flags.icmp;
 }
-- 
2.1.0


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


[lng-odp] [API-NEXT PATCHv2 1/3] api: packet: use odp_bool_t for packet flag APIs

2015-03-20 Thread Bill Fischofer
This change addresses Bug https://bugs.linaro.org/show_bug.cgi?id=1334

Signed-off-by: Bill Fischofer 
---

v2 adds doxygen fix to this patch.  Petri: Please review this for API
conformance.

 include/odp/api/packet_flags.h | 72 +-
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/include/odp/api/packet_flags.h b/include/odp/api/packet_flags.h
index b1e179e..ccfb747 100644
--- a/include/odp/api/packet_flags.h
+++ b/include/odp/api/packet_flags.h
@@ -32,163 +32,163 @@ extern "C" {
  * Checks all error flags at once.
  *
  * @param pkt Packet handle
- * @retval 1 packet has errors
+ * @retval non-zero packet has errors
  * @retval 0 packet has no errors
  */
-int odp_packet_has_error(odp_packet_t pkt);
+odp_bool_t odp_packet_has_error(odp_packet_t pkt);
 
 /**
  * Check for L2 header, e.g. ethernet
  *
  * @param pkt Packet handle
- * @retval 1 if packet contains a valid & known L2 header
+ * @retval non-zero if packet contains a valid & known L2 header
  * @retval 0 if packet does not contain a valid & known L2 header
  */
-int odp_packet_has_l2(odp_packet_t pkt);
+odp_bool_t odp_packet_has_l2(odp_packet_t pkt);
 
 /**
  * Check for L3 header, e.g. IPv4, IPv6
  *
  * @param pkt Packet handle
- * @retval 1 if packet contains a valid & known L3 header
+ * @retval non-zero if packet contains a valid & known L3 header
  * @retval 0 if packet does not contain a valid & known L3 header
  */
-int odp_packet_has_l3(odp_packet_t pkt);
+odp_bool_t odp_packet_has_l3(odp_packet_t pkt);
 
 /**
  * Check for L4 header, e.g. UDP, TCP, SCTP (also ICMP)
  *
  * @param pkt Packet handle
- * @retval 1 if packet contains a valid & known L4 header
+ * @retval non-zero if packet contains a valid & known L4 header
  * @retval 0 if packet does not contain a valid & known L4 header
  */
-int odp_packet_has_l4(odp_packet_t pkt);
+odp_bool_t odp_packet_has_l4(odp_packet_t pkt);
 
 /**
  * Check for Ethernet header
  *
  * @param pkt Packet handle
- * @retval 1 if packet contains a valid eth header
+ * @retval non-zero if packet contains a valid eth header
  * @retval 0 if packet does not contain a valid & known eth header
  */
-int odp_packet_has_eth(odp_packet_t pkt);
+odp_bool_t odp_packet_has_eth(odp_packet_t pkt);
 
 /**
  * Check for jumbo frame
  *
  * @param pkt Packet handle
- * @retval 1 if packet contains a jumbo frame
+ * @retval non-zero if packet contains a jumbo frame
  * @retval 0 if packet does not contain a jumbo frame
  */
-int odp_packet_has_jumbo(odp_packet_t pkt);
+odp_bool_t odp_packet_has_jumbo(odp_packet_t pkt);
 
 /**
  * Check for VLAN
  *
  * @param pkt Packet handle
- * @retval 1 if packet contains a VLAN header
+ * @retval non-zero if packet contains a VLAN header
  * @retval 0 if packet does not contain a VLAN header
  */
-int odp_packet_has_vlan(odp_packet_t pkt);
+odp_bool_t odp_packet_has_vlan(odp_packet_t pkt);
 
 /**
  * Check for VLAN QinQ (stacked VLAN)
  *
  * @param pkt Packet handle
- * @retval 1 if packet contains a VLAN QinQ header
+ * @retval non-zero if packet contains a VLAN QinQ header
  * @retval 0 if packet does not contain a VLAN QinQ header
  */
-int odp_packet_has_vlan_qinq(odp_packet_t pkt);
+odp_bool_t odp_packet_has_vlan_qinq(odp_packet_t pkt);
 
 /**
  * Check for ARP
  *
  * @param pkt Packet handle
- * @retval 1 if packet contains an ARP message
+ * @retval non-zero if packet contains an ARP message
  * @retval 0 if packet does not contain an ARP message
  */
-int odp_packet_has_arp(odp_packet_t pkt);
+odp_bool_t odp_packet_has_arp(odp_packet_t pkt);
 
 /**
  * Check for IPv4
  *
  * @param pkt Packet handle
- * @retval 1 if packet contains an IPv4 header
+ * @retval non-zero if packet contains an IPv4 header
  * @retval 0 if packet does not contain an IPv4 header
  */
-int odp_packet_has_ipv4(odp_packet_t pkt);
+odp_bool_t odp_packet_has_ipv4(odp_packet_t pkt);
 
 /**
  * Check for IPv6
  *
  * @param pkt Packet handle
- * @retval 1 if packet contains an IPv6 header
+ * @retval non-zero if packet contains an IPv6 header
  * @retval 0 if packet does not contain an IPv6 header
  */
-int odp_packet_has_ipv6(odp_packet_t pkt);
+odp_bool_t odp_packet_has_ipv6(odp_packet_t pkt);
 
 /**
  * Check for IP fragment
  *
  * @param pkt Packet handle
- * @retval 1 if packet is an IP fragment
+ * @retval non-zero if packet is an IP fragment
  * @retval 0 if packet is not an IP fragment
  */
-int odp_packet_has_ipfrag(odp_packet_t pkt);
+odp_bool_t odp_packet_has_ipfrag(odp_packet_t pkt);
 
 /**
  * Check for IP options
  *
  * @param pkt Packet handle
- * @retval 1 if packet contains IP options
+ * @retval non-zero if packet contains IP options
  * @retval 0 if packet does not contain IP options
  */
-int odp_packet_has_ipopt(odp_packet_t pkt);
+odp_bool_t odp_packet_has_ipopt(odp_packet_t pkt);
 
 /**
  * Check for IPSec
  *
  * @param pkt Packet handle
- * @retval 1 if packet requires IPSec processing
+ * @retval non-zero if packet re

Re: [lng-odp] Static assertion on tick_buf_t in timer.c

2015-03-20 Thread Mike Holmes
On 20 March 2015 at 14:10, Sumith Dev Vojini  wrote:

> Hello,
>
> While building ODP(v1.0.0) I encountered an assertion on the size of
> tick_buf_t in timer.c. The structure is
>
> typedef struct tick_buf_s {
>  odp_atomic_u64_t exp_tck;/* Expiration tick or TMO_xxx */
>  odp_buffer_t tmo_buf;/* ODP_BUFFER_INVALID if timer not active */
>  #ifdef TB_NEEDS_PAD
>  uint32_t pad;/* Need to be able to access padding for successful
> CAS */
>  #endif
>  } tick_buf_t
>  #ifdef ODP_ATOMIC_U128
>  ODP_ALIGNED(16) /* 16-byte atomic operations need properly aligned
> addresses */
> ;
> _ODP_STATIC_ASSERT(sizeof(tick_buf_t) == 16, "sizeof(tick_buf_t) == 16");
>
>
> odp_atomic_u64_t is of type struct odp_atomic_u64_s
>
> struct odp_atomic_u64_s {
> uint64_t v; /**< Actual storage for the atomic variable */
> #if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
> /* Some architectures do not support lock-free operations on 64-bit
>  * data types. We use a spin lock to ensure atomicity. */
> char lock; /**< Spin lock (if needed) used to ensure atomic access
> */
> #endif
> } ODP_ALIGNED(sizeof(uint64_t)); /* Enforce alignement! */;
>
> So the systems which cannot do atomic 64 bit operations will have lock
> variable defined which increases the size of the that structure
> odp_atomic_u64_s to 16 bytes due to the alignment requirements and the
> assertion fails since tick_buf_s has two more variables increasing its
> size to 24 bytes.
>
>
Thanks Sumith

Could you make a bug report ?

https://bugs.linaro.org/enter_bug.cgi?product=OpenDataPlane



>
> --
> Regards
> Sumith Dev
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://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
http://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH v3] performance: odp_atomic: move atomic test from api_test to performance

2015-03-20 Thread Mike Holmes
The api_test directory is being deleted, any test with value needs to migrate
Moved this test to performance because it can be used to gauge the
ability of the atomics to scale with core count.
The move required that odp_atomic run all tests by default

Signed-off-by: Mike Holmes 
---
 test/api_test/.gitignore   |   1 -
 test/api_test/Makefile.am  |   6 +-
 test/api_test/odp_atomic_test.h|  51 
 test/api_test/odp_common.c |   2 +-
 test/performance/.gitignore|   1 +
 test/performance/Makefile.am   |   5 +-
 .../odp_atomic_test.c => performance/odp_atomic.c} | 136 -
 7 files changed, 138 insertions(+), 64 deletions(-)
 delete mode 100644 test/api_test/odp_atomic_test.h
 rename test/{api_test/odp_atomic_test.c => performance/odp_atomic.c} (63%)

diff --git a/test/api_test/.gitignore b/test/api_test/.gitignore
index 84159e1..950f443 100644
--- a/test/api_test/.gitignore
+++ b/test/api_test/.gitignore
@@ -1,3 +1,2 @@
-odp_atomic
 odp_ring
 odp_shm
diff --git a/test/api_test/Makefile.am b/test/api_test/Makefile.am
index 86e1bc2..f231fee 100644
--- a/test/api_test/Makefile.am
+++ b/test/api_test/Makefile.am
@@ -1,21 +1,17 @@
 include $(top_srcdir)/test/Makefile.inc
 
-bin_PROGRAMS = odp_atomic odp_shm odp_ring
+bin_PROGRAMS = odp_shm odp_ring
 
-odp_atomic_CFLAGS = $(AM_CFLAGS)
 odp_shm_CFLAGS = $(AM_CFLAGS)
 odp_ring_CFLAGS = $(AM_CFLAGS)
 
-odp_atomic_LDFLAGS = $(AM_LDFLAGS) -static
 odp_shm_LDFLAGS = $(AM_LDFLAGS) -static
 odp_ring_LDFLAGS = $(AM_LDFLAGS) -static
 
 noinst_HEADERS = \
- $(top_srcdir)/test/api_test/odp_atomic_test.h \
  $(top_srcdir)/test/api_test/odp_common.h \
  $(top_srcdir)/test/api_test/odp_shm_test.h \
  $(top_srcdir)/test/test_debug.h
 
-dist_odp_atomic_SOURCES = odp_atomic_test.c odp_common.c
 dist_odp_shm_SOURCES = odp_shm_test.c odp_common.c
 dist_odp_ring_SOURCES = odp_ring_test.c odp_common.c
diff --git a/test/api_test/odp_atomic_test.h b/test/api_test/odp_atomic_test.h
deleted file mode 100644
index 89e7748..000
--- a/test/api_test/odp_atomic_test.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-#ifndef ODP_ATOMIC_TEST_H_
-#define ODP_ATOMIC_TEST_H_
-
-#include 
-#include 
-
-/**
- * add_sub_cnt could be any valid value
- * so to excercise explicit atomic_add/sub
- * ops. For now using 5..
- */
-#define ADD_SUB_CNT5
-
-#defineCNT 50
-#defineU32_INIT_VAL(1UL << 10)
-#defineU64_INIT_VAL(1ULL << 33)
-
-typedef enum {
-   TEST_MIX = 1, /* Must be first test case num */
-   TEST_INC_DEC_U32,
-   TEST_ADD_SUB_U32,
-   TEST_INC_DEC_64,
-   TEST_ADD_SUB_64,
-   TEST_MAX,
-} odp_test_atomic_t;
-
-
-void test_atomic_inc_dec_u32(void);
-void test_atomic_add_sub_u32(void);
-void test_atomic_inc_dec_64(void);
-void test_atomic_add_sub_64(void);
-void test_atomic_inc_u32(void);
-void test_atomic_dec_u32(void);
-void test_atomic_add_u32(void);
-void test_atomic_sub_u32(void);
-void test_atomic_inc_64(void);
-void test_atomic_dec_64(void);
-void test_atomic_add_64(void);
-void test_atomic_sub_64(void);
-void test_atomic_init(void);
-void test_atomic_basic(void);
-void test_atomic_store(void);
-int test_atomic_validate(void);
-
-#endif /* ODP_ATOMIC_TEST_H_ */
diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c
index 5158d87..18b365e 100644
--- a/test/api_test/odp_common.c
+++ b/test/api_test/odp_common.c
@@ -14,10 +14,10 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
+#define MAX_WORKERS   32/**< Max worker threads */
 
 /* Globals */
 static odph_linux_pthread_t thread_tbl[MAX_WORKERS]; /**< worker threads 
table*/
diff --git a/test/performance/.gitignore b/test/performance/.gitignore
index 9ccb102..1bdb90d 100644
--- a/test/performance/.gitignore
+++ b/test/performance/.gitignore
@@ -1,3 +1,4 @@
 *.log
 *.trs
 odp_scheduling
+odp_atomic
diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am
index 54cf529..b0f7457 100644
--- a/test/performance/Makefile.am
+++ b/test/performance/Makefile.am
@@ -2,7 +2,7 @@ include $(top_srcdir)/test/Makefile.inc
 
 TESTS_ENVIRONMENT = TEST_DIR=${builddir}
 
-EXECUTABLES =
+EXECUTABLES = odp_atomic
 
 COMPILE_ONLY = odp_scheduling
 
@@ -14,10 +14,13 @@ endif
 
 bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
 
+odp_atomic_LDFLAGS = $(AM_LDFLAGS) -static
+odp_atomic_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/test
 odp_scheduling_LDFLAGS = $(AM_LDFLAGS) -static
 odp_scheduling_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/test
 
 noinst_HEADERS = \
  $(top_srcdir)/test/test_debug.h
 
+dist_odp_atomic_SOURCES = odp_atomic.c
 dist_odp_scheduling_SOURCES = odp_scheduling.c
diff --git a/test/api_t

Re: [lng-odp] [PATCH v3] performance: odp_atomic: move atomic test from api_test to performance

2015-03-20 Thread Bill Fischofer
On Fri, Mar 20, 2015 at 1:19 PM, Mike Holmes  wrote:

> The api_test directory is being deleted, any test with value needs to
> migrate
> Moved this test to performance because it can be used to gauge the
> ability of the atomics to scale with core count.
> The move required that odp_atomic run all tests by default
>
> Signed-off-by: Mike Holmes 
>

Reviewed-by: Bill Fischofer 


> ---
>  test/api_test/.gitignore   |   1 -
>  test/api_test/Makefile.am  |   6 +-
>  test/api_test/odp_atomic_test.h|  51 
>  test/api_test/odp_common.c |   2 +-
>  test/performance/.gitignore|   1 +
>  test/performance/Makefile.am   |   5 +-
>  .../odp_atomic_test.c => performance/odp_atomic.c} | 136
> -
>  7 files changed, 138 insertions(+), 64 deletions(-)
>  delete mode 100644 test/api_test/odp_atomic_test.h
>  rename test/{api_test/odp_atomic_test.c => performance/odp_atomic.c} (63%)
>
> diff --git a/test/api_test/.gitignore b/test/api_test/.gitignore
> index 84159e1..950f443 100644
> --- a/test/api_test/.gitignore
> +++ b/test/api_test/.gitignore
> @@ -1,3 +1,2 @@
> -odp_atomic
>  odp_ring
>  odp_shm
> diff --git a/test/api_test/Makefile.am b/test/api_test/Makefile.am
> index 86e1bc2..f231fee 100644
> --- a/test/api_test/Makefile.am
> +++ b/test/api_test/Makefile.am
> @@ -1,21 +1,17 @@
>  include $(top_srcdir)/test/Makefile.inc
>
> -bin_PROGRAMS = odp_atomic odp_shm odp_ring
> +bin_PROGRAMS = odp_shm odp_ring
>
> -odp_atomic_CFLAGS = $(AM_CFLAGS)
>  odp_shm_CFLAGS = $(AM_CFLAGS)
>  odp_ring_CFLAGS = $(AM_CFLAGS)
>
> -odp_atomic_LDFLAGS = $(AM_LDFLAGS) -static
>  odp_shm_LDFLAGS = $(AM_LDFLAGS) -static
>  odp_ring_LDFLAGS = $(AM_LDFLAGS) -static
>
>  noinst_HEADERS = \
> - $(top_srcdir)/test/api_test/odp_atomic_test.h \
>   $(top_srcdir)/test/api_test/odp_common.h \
>   $(top_srcdir)/test/api_test/odp_shm_test.h \
>   $(top_srcdir)/test/test_debug.h
>
> -dist_odp_atomic_SOURCES = odp_atomic_test.c odp_common.c
>  dist_odp_shm_SOURCES = odp_shm_test.c odp_common.c
>  dist_odp_ring_SOURCES = odp_ring_test.c odp_common.c
> diff --git a/test/api_test/odp_atomic_test.h
> b/test/api_test/odp_atomic_test.h
> deleted file mode 100644
> index 89e7748..000
> --- a/test/api_test/odp_atomic_test.h
> +++ /dev/null
> @@ -1,51 +0,0 @@
> -/* Copyright (c) 2013, Linaro Limited
> - * All rights reserved.
> - *
> - * SPDX-License-Identifier: BSD-3-Clause
> - */
> -
> -#ifndef ODP_ATOMIC_TEST_H_
> -#define ODP_ATOMIC_TEST_H_
> -
> -#include 
> -#include 
> -
> -/**
> - * add_sub_cnt could be any valid value
> - * so to excercise explicit atomic_add/sub
> - * ops. For now using 5..
> - */
> -#define ADD_SUB_CNT5
> -
> -#defineCNT 50
> -#defineU32_INIT_VAL(1UL << 10)
> -#defineU64_INIT_VAL(1ULL << 33)
> -
> -typedef enum {
> -   TEST_MIX = 1, /* Must be first test case num */
> -   TEST_INC_DEC_U32,
> -   TEST_ADD_SUB_U32,
> -   TEST_INC_DEC_64,
> -   TEST_ADD_SUB_64,
> -   TEST_MAX,
> -} odp_test_atomic_t;
> -
> -
> -void test_atomic_inc_dec_u32(void);
> -void test_atomic_add_sub_u32(void);
> -void test_atomic_inc_dec_64(void);
> -void test_atomic_add_sub_64(void);
> -void test_atomic_inc_u32(void);
> -void test_atomic_dec_u32(void);
> -void test_atomic_add_u32(void);
> -void test_atomic_sub_u32(void);
> -void test_atomic_inc_64(void);
> -void test_atomic_dec_64(void);
> -void test_atomic_add_64(void);
> -void test_atomic_sub_64(void);
> -void test_atomic_init(void);
> -void test_atomic_basic(void);
> -void test_atomic_store(void);
> -int test_atomic_validate(void);
> -
> -#endif /* ODP_ATOMIC_TEST_H_ */
> diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c
> index 5158d87..18b365e 100644
> --- a/test/api_test/odp_common.c
> +++ b/test/api_test/odp_common.c
> @@ -14,10 +14,10 @@
>  #include 
>  #include 
>  #include 
> -#include 
>  #include 
>  #include 
>
> +#define MAX_WORKERS   32/**< Max worker threads */
>
>  /* Globals */
>  static odph_linux_pthread_t thread_tbl[MAX_WORKERS]; /**< worker threads
> table*/
> diff --git a/test/performance/.gitignore b/test/performance/.gitignore
> index 9ccb102..1bdb90d 100644
> --- a/test/performance/.gitignore
> +++ b/test/performance/.gitignore
> @@ -1,3 +1,4 @@
>  *.log
>  *.trs
>  odp_scheduling
> +odp_atomic
> diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am
> index 54cf529..b0f7457 100644
> --- a/test/performance/Makefile.am
> +++ b/test/performance/Makefile.am
> @@ -2,7 +2,7 @@ include $(top_srcdir)/test/Makefile.inc
>
>  TESTS_ENVIRONMENT = TEST_DIR=${builddir}
>
> -EXECUTABLES =
> +EXECUTABLES = odp_atomic
>
>  COMPILE_ONLY = odp_scheduling
>
> @@ -14,10 +14,13 @@ endif
>
>  bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
>
> +odp_atomic_LDFLAG

Re: [lng-odp] [PATCH v3] performance: odp_atomic: move atomic test from api_test to performance

2015-03-20 Thread Bill Fischofer
Fix typo in Maxim's e-mail address.

On Fri, Mar 20, 2015 at 1:22 PM, Bill Fischofer 
wrote:

>
>
> On Fri, Mar 20, 2015 at 1:19 PM, Mike Holmes 
> wrote:
>
>> The api_test directory is being deleted, any test with value needs to
>> migrate
>> Moved this test to performance because it can be used to gauge the
>> ability of the atomics to scale with core count.
>> The move required that odp_atomic run all tests by default
>>
>> Signed-off-by: Mike Holmes 
>>
>
> Reviewed-by: Bill Fischofer 
>
>
>> ---
>>  test/api_test/.gitignore   |   1 -
>>  test/api_test/Makefile.am  |   6 +-
>>  test/api_test/odp_atomic_test.h|  51 
>>  test/api_test/odp_common.c |   2 +-
>>  test/performance/.gitignore|   1 +
>>  test/performance/Makefile.am   |   5 +-
>>  .../odp_atomic_test.c => performance/odp_atomic.c} | 136
>> -
>>  7 files changed, 138 insertions(+), 64 deletions(-)
>>  delete mode 100644 test/api_test/odp_atomic_test.h
>>  rename test/{api_test/odp_atomic_test.c => performance/odp_atomic.c}
>> (63%)
>>
>> diff --git a/test/api_test/.gitignore b/test/api_test/.gitignore
>> index 84159e1..950f443 100644
>> --- a/test/api_test/.gitignore
>> +++ b/test/api_test/.gitignore
>> @@ -1,3 +1,2 @@
>> -odp_atomic
>>  odp_ring
>>  odp_shm
>> diff --git a/test/api_test/Makefile.am b/test/api_test/Makefile.am
>> index 86e1bc2..f231fee 100644
>> --- a/test/api_test/Makefile.am
>> +++ b/test/api_test/Makefile.am
>> @@ -1,21 +1,17 @@
>>  include $(top_srcdir)/test/Makefile.inc
>>
>> -bin_PROGRAMS = odp_atomic odp_shm odp_ring
>> +bin_PROGRAMS = odp_shm odp_ring
>>
>> -odp_atomic_CFLAGS = $(AM_CFLAGS)
>>  odp_shm_CFLAGS = $(AM_CFLAGS)
>>  odp_ring_CFLAGS = $(AM_CFLAGS)
>>
>> -odp_atomic_LDFLAGS = $(AM_LDFLAGS) -static
>>  odp_shm_LDFLAGS = $(AM_LDFLAGS) -static
>>  odp_ring_LDFLAGS = $(AM_LDFLAGS) -static
>>
>>  noinst_HEADERS = \
>> - $(top_srcdir)/test/api_test/odp_atomic_test.h \
>>   $(top_srcdir)/test/api_test/odp_common.h \
>>   $(top_srcdir)/test/api_test/odp_shm_test.h \
>>   $(top_srcdir)/test/test_debug.h
>>
>> -dist_odp_atomic_SOURCES = odp_atomic_test.c odp_common.c
>>  dist_odp_shm_SOURCES = odp_shm_test.c odp_common.c
>>  dist_odp_ring_SOURCES = odp_ring_test.c odp_common.c
>> diff --git a/test/api_test/odp_atomic_test.h
>> b/test/api_test/odp_atomic_test.h
>> deleted file mode 100644
>> index 89e7748..000
>> --- a/test/api_test/odp_atomic_test.h
>> +++ /dev/null
>> @@ -1,51 +0,0 @@
>> -/* Copyright (c) 2013, Linaro Limited
>> - * All rights reserved.
>> - *
>> - * SPDX-License-Identifier: BSD-3-Clause
>> - */
>> -
>> -#ifndef ODP_ATOMIC_TEST_H_
>> -#define ODP_ATOMIC_TEST_H_
>> -
>> -#include 
>> -#include 
>> -
>> -/**
>> - * add_sub_cnt could be any valid value
>> - * so to excercise explicit atomic_add/sub
>> - * ops. For now using 5..
>> - */
>> -#define ADD_SUB_CNT5
>> -
>> -#defineCNT 50
>> -#defineU32_INIT_VAL(1UL << 10)
>> -#defineU64_INIT_VAL(1ULL << 33)
>> -
>> -typedef enum {
>> -   TEST_MIX = 1, /* Must be first test case num */
>> -   TEST_INC_DEC_U32,
>> -   TEST_ADD_SUB_U32,
>> -   TEST_INC_DEC_64,
>> -   TEST_ADD_SUB_64,
>> -   TEST_MAX,
>> -} odp_test_atomic_t;
>> -
>> -
>> -void test_atomic_inc_dec_u32(void);
>> -void test_atomic_add_sub_u32(void);
>> -void test_atomic_inc_dec_64(void);
>> -void test_atomic_add_sub_64(void);
>> -void test_atomic_inc_u32(void);
>> -void test_atomic_dec_u32(void);
>> -void test_atomic_add_u32(void);
>> -void test_atomic_sub_u32(void);
>> -void test_atomic_inc_64(void);
>> -void test_atomic_dec_64(void);
>> -void test_atomic_add_64(void);
>> -void test_atomic_sub_64(void);
>> -void test_atomic_init(void);
>> -void test_atomic_basic(void);
>> -void test_atomic_store(void);
>> -int test_atomic_validate(void);
>> -
>> -#endif /* ODP_ATOMIC_TEST_H_ */
>> diff --git a/test/api_test/odp_common.c b/test/api_test/odp_common.c
>> index 5158d87..18b365e 100644
>> --- a/test/api_test/odp_common.c
>> +++ b/test/api_test/odp_common.c
>> @@ -14,10 +14,10 @@
>>  #include 
>>  #include 
>>  #include 
>> -#include 
>>  #include 
>>  #include 
>>
>> +#define MAX_WORKERS   32/**< Max worker threads */
>>
>>  /* Globals */
>>  static odph_linux_pthread_t thread_tbl[MAX_WORKERS]; /**< worker threads
>> table*/
>> diff --git a/test/performance/.gitignore b/test/performance/.gitignore
>> index 9ccb102..1bdb90d 100644
>> --- a/test/performance/.gitignore
>> +++ b/test/performance/.gitignore
>> @@ -1,3 +1,4 @@
>>  *.log
>>  *.trs
>>  odp_scheduling
>> +odp_atomic
>> diff --git a/test/performance/Makefile.am b/test/performance/Makefile.am
>> index 54cf529..b0f7457 100644
>> --- a/test/performance/Makefile.am
>> +++ b/test/performance/Makefile.am
>> @@ -2,7 +2,7 @@ include $(top_s

[lng-odp] [Bug 1334] packet flag APIs are booleans and should follow boolean guidelines

2015-03-20 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1334

--- Comment #3 from Bill Fischofer  ---
Patch series starting at http://patches.opendataplane.org/patch/1175/ submitted
to API-NEXT to address this issue.

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


[lng-odp] [Bug 1389] New: Static assertion on tick_buf_t in timer.c

2015-03-20 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1389

Bug ID: 1389
   Summary: Static assertion on tick_buf_t in timer.c
   Product: OpenDataPlane
   Version: 1.0
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: normal
  Priority: ---
 Component: Timers
  Assignee: ola.liljed...@linaro.org
  Reporter: sumith.hy...@gmail.com
CC: lng-odp@lists.linaro.org

Overview: More detailed restatement of summary.
While building ODP(v1.0.0) encountered an assertion on the size of tick_buf_t
in timer.c.

Steps to Reproduce: Minimized, easy-to-follow steps that will trigger the bug.
Include any special setup steps.
1. Do a native build of ODP on a board which does not support atomic 64bit ops. 


Actual Results: 
Build failed due to an assertion failure.
Expected Results: 
build successfully
Additional Information:

The structure is

typedef struct tick_buf_s {
 odp_atomic_u64_t exp_tck;/* Expiration tick or TMO_xxx */
 odp_buffer_t tmo_buf;/* ODP_BUFFER_INVALID if timer not active */
 #ifdef TB_NEEDS_PAD
 uint32_t pad;/* Need to be able to access padding for successful CAS
*/
 #endif
 } tick_buf_t
 #ifdef ODP_ATOMIC_U128
 ODP_ALIGNED(16) /* 16-byte atomic operations need properly aligned addresses
*/ 
;
_ODP_STATIC_ASSERT(sizeof(tick_buf_t) == 16, "sizeof(tick_buf_t) == 16");


odp_atomic_u64_t is of type struct odp_atomic_u64_s

struct odp_atomic_u64_s {
uint64_t v; /**< Actual storage for the atomic variable */
#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
/* Some architectures do not support lock-free operations on 64-bit
 * data types. We use a spin lock to ensure atomicity. */
char lock; /**< Spin lock (if needed) used to ensure atomic access */
#endif
} ODP_ALIGNED(sizeof(uint64_t)); /* Enforce alignement! */;

So the systems which cannot do atomic 64 bit operations will have lock variable
defined which increases the size of the that structure odp_atomic_u64_s to 16
bytes due to the alignment requirements and the assertion fails since
tick_buf_s has two more variables increasing its size to 24 bytes.

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


[lng-odp] [PATCH] README: Update content and links

2015-03-20 Thread Mike Holmes
The 3rd party application repo is not supported and the architecture
document is stale, in addition the ability to run the tests is now part
of the build system.
Make these updates to the document.

Signed-off-by: Mike Holmes 
---
 README | 21 ++---
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/README b/README
index a0eb2f3..ccdbed6 100644
--- a/README
+++ b/README
@@ -3,7 +3,6 @@ All rights reserved.
 
 SPDX-License-Identifier:BSD-3-Clause
 
-
 OpenDataPlane (ODP) project source code.
 http://www.opendataplane.org/
 
@@ -25,20 +24,20 @@ Main git repository:
 Configure options:
 ./configure --help
 
-ODP patches for 3-rd party applications:
-git://git.linaro.org/lng/odp-apps.git
-
-ODP architecture git tree:
-git://git.linaro.org/lng/odp-architecture.git
+To execute all the testcases, assuming CUnit is installed for the 
validation tests:
+./bootstrap
+./configure --enable-test-perf --enable-test-vald
+make check
 
 Patches tracking system:
-https://patches.linaro.org/patchwork/project/lng-odp/list/
+http://patches.opendataplane.org/project/lng-odp/list/
 
 Mailing list:
 lng-odp@lists.linaro.org
-   Please read CONTRIBUTING file before submitting patches.
-   Email prefixes:
-[PATCH] means patch is for odp.git;
+
+Please read CONTRIBUTING file before submitting patches.
+Email prefixes:
+[PATCH] means patch is for odp.git
 
 Bug tracking:
- 
https://bugs.linaro.org/buglist.cgi?component=General&list_id=734&product=OpenDataPlane
+https://bugs.linaro.org/describecomponents.cgi?product=OpenDataPlane
-- 
2.1.0


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


[lng-odp] [PATCH] linux-generic: strongtypes: use named structs for C++

2015-03-20 Thread Ola Liljedahl
Typedefs to anonymous structs creates problems for C++ programs:
GCC:
warning: ‘odp_crypto_op_params’ has a field ‘odp_crypto_op_params::pkt’
whose type uses the anonymous namespace
error: anonymous type with no linkage used to declare function
‘* ppp_packet::get_queue() const’ with linkage
CLANG:
extern odp_pool_t tmo_pool;
warning: variable 'tmo_pool' has internal linkage but is not defined
When linking:
undefined reference to `tmo_pool'

The solution is to add a (unique) name to all structs used by the strong
typing typedefs.

Signed-off-by: Ola Liljedahl 
---
(This document/code contribution attached is provided under the terms of
agreement LES-LTM-21309)

 platform/linux-generic/include/odp/plat/buffer_types.h | 4 ++--
 platform/linux-generic/include/odp/plat/classification_types.h | 8 
 platform/linux-generic/include/odp/plat/crypto_types.h | 2 +-
 platform/linux-generic/include/odp/plat/event_types.h  | 2 +-
 platform/linux-generic/include/odp/plat/packet_io_types.h  | 2 +-
 platform/linux-generic/include/odp/plat/packet_types.h | 4 ++--
 platform/linux-generic/include/odp/plat/pool_types.h   | 2 +-
 platform/linux-generic/include/odp/plat/queue_types.h  | 4 ++--
 platform/linux-generic/include/odp/plat/shared_memory_types.h  | 2 +-
 platform/linux-generic/include/odp/plat/strong_types.h | 6 +-
 10 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/platform/linux-generic/include/odp/plat/buffer_types.h 
b/platform/linux-generic/include/odp/plat/buffer_types.h
index 3e7070e..0c017ae 100644
--- a/platform/linux-generic/include/odp/plat/buffer_types.h
+++ b/platform/linux-generic/include/odp/plat/buffer_types.h
@@ -26,13 +26,13 @@ extern "C" {
  */
 
 /** ODP buffer */
-typedef odp_handle_t odp_buffer_t;
+typedef ODP_HANDLE_T(odp_buffer_t);
 
 /** Invalid buffer */
 #define ODP_BUFFER_INVALID _odp_cast_scalar(odp_buffer_t, 0x)
 
 /** ODP buffer segment */
-typedef odp_handle_t odp_buffer_seg_t;
+typedef ODP_HANDLE_T(odp_buffer_seg_t);
 
 /** Invalid segment */
 #define ODP_SEGMENT_INVALID ((odp_buffer_seg_t)ODP_BUFFER_INVALID)
diff --git a/platform/linux-generic/include/odp/plat/classification_types.h 
b/platform/linux-generic/include/odp/plat/classification_types.h
index 042d8c8..767da7d 100644
--- a/platform/linux-generic/include/odp/plat/classification_types.h
+++ b/platform/linux-generic/include/odp/plat/classification_types.h
@@ -23,18 +23,18 @@ extern "C" {
  *  @{
  */
 
-typedef odp_handle_t odp_cos_t;
-typedef odp_handle_t odp_flowsig_t;
+typedef ODP_HANDLE_T(odp_cos_t);
+typedef ODP_HANDLE_T(odp_flowsig_t);
 
 #define ODP_COS_INVALID  _odp_cast_scalar(odp_cos_t, ~0)
 #define ODP_COS_NAME_LEN 32
 
 typedef uint16_t odp_cos_flow_set_t;
 
-typedef odp_handle_t odp_pmr_t;
+typedef ODP_HANDLE_T(odp_pmr_t);
 #define ODP_PMR_INVAL _odp_cast_scalar(odp_pmr_t, ~0)
 
-typedef odp_handle_t odp_pmr_set_t;
+typedef ODP_HANDLE_T(odp_pmr_set_t);
 #define ODP_PMR_SET_INVAL _odp_cast_scalar(odp_pmr_set_t, ~0)
 
 /** Get printable format of odp_cos_t */
diff --git a/platform/linux-generic/include/odp/plat/crypto_types.h 
b/platform/linux-generic/include/odp/plat/crypto_types.h
index 1b10a5d..a91d88e 100644
--- a/platform/linux-generic/include/odp/plat/crypto_types.h
+++ b/platform/linux-generic/include/odp/plat/crypto_types.h
@@ -25,7 +25,7 @@ extern "C" {
 #define ODP_CRYPTO_SESSION_INVALID (0xULL)
 
 typedef uint64_t odp_crypto_session_t;
-typedef odp_handle_t odp_crypto_compl_t;
+typedef ODP_HANDLE_T(odp_crypto_compl_t);
 
 enum odp_crypto_op_mode {
ODP_CRYPTO_SYNC,
diff --git a/platform/linux-generic/include/odp/plat/event_types.h 
b/platform/linux-generic/include/odp/plat/event_types.h
index 24be22f..d91937d 100644
--- a/platform/linux-generic/include/odp/plat/event_types.h
+++ b/platform/linux-generic/include/odp/plat/event_types.h
@@ -26,7 +26,7 @@ extern "C" {
  *  @{
  */
 
-typedef odp_handle_t odp_event_t;
+typedef ODP_HANDLE_T(odp_event_t);
 
 #define ODP_EVENT_INVALID _odp_cast_scalar(odp_event_t, 0x)
 
diff --git a/platform/linux-generic/include/odp/plat/packet_io_types.h 
b/platform/linux-generic/include/odp/plat/packet_io_types.h
index 60592e3..3cc64c6 100644
--- a/platform/linux-generic/include/odp/plat/packet_io_types.h
+++ b/platform/linux-generic/include/odp/plat/packet_io_types.h
@@ -26,7 +26,7 @@ extern "C" {
  *  @{
  */
 
-typedef odp_handle_t odp_pktio_t;
+typedef ODP_HANDLE_T(odp_pktio_t);
 
 #define ODP_PKTIO_INVALID _odp_cast_scalar(odp_pktio_t, 0)
 
diff --git a/platform/linux-generic/include/odp/plat/packet_types.h 
b/platform/linux-generic/include/odp/plat/packet_types.h
index 57e9662..45cb801 100644
--- a/platform/linux-generic/include/odp/plat/packet_types.h
+++ b/platform/linux-generic/include/odp/plat/packet_types.h
@@ -26,13 +26,13 @@ extern "C" {
  *  @{
  */
 
-typedef odp_handle_t odp_packet_t;
+typedef ODP_HANDLE_T(odp_packet_t);
 
 #define ODP_PACK

Re: [lng-odp] [PATCH] linux-generic: strongtypes: use named structs for C++

2015-03-20 Thread Bill Fischofer
This patch seems to generate a raft of doxygen warnings:

rm -rf doc/output
SRCDIR='.' PROJECT='OpenDataPlane' DOCDIR='doc/output' VERSION='1.0.1'
WITH_PLATFORM='linux-generic' PERL_PATH='/usr/bin/perl' HAVE_DOT='NO'
GENERATE_MAN='NO' GENERATE_RTF='NO' GENERATE_XML='NO'
GENERATE_HTMLHELP='NO' GENERATE_CHI='NO' GENERATE_HTML='YES'
GENERATE_LATEX='YES' /usr/bin/doxygen ./doc/doxygen.cfg
/home/bill/linaro/check-odp/build/odp-apply/include/odp/api/buffer.h:29:
warning: documented symbol `odp_buffer_t' was not declared or defined.
/home/bill/linaro/check-odp/build/odp-apply/include/odp/api/buffer.h:39:
warning: documented symbol `odp_buffer_seg_t' was not declared or defined.
/home/bill/linaro/check-odp/build/odp-apply/include/odp/api/classification.h:29:
warning: documented symbol `odp_cos_t' was not declared or defined.
/home/bill/linaro/check-odp/build/odp-apply/include/odp/api/classification.h:34:
warning: documented symbol `odp_flowsig_t' was not declared or defined.
/home/bill/linaro/check-odp/build/odp-apply/include/odp/api/classification.h:186:
warning: documented symbol `odp_pmr_t' was not declared or defined.
/home/bill/linaro/check-odp/build/odp-apply/include/odp/api/classification.h:349:
warning: documented symbol `odp_pmr_set_t' was not declared or defined.
/home/bill/linaro/check-odp/build/odp-apply/include/odp/api/crypto.h:37:
warning: documented symbol `odp_crypto_compl_t' was not declared or defined.
/home/bill/linaro/check-odp/build/odp-apply/include/odp/api/event.h:29:
warning: documented symbol `odp_event_t' was not declared or defined.
/home/bill/linaro/check-odp/build/odp-apply/include/odp/api/packet.h:27:
warning: documented symbol `odp_packet_t' was not declared or defined.
/home/bill/linaro/check-odp/build/odp-apply/include/odp/api/packet.h:42:
warning: documented symbol `odp_packet_seg_t' was not declared or defined.
/home/bill/linaro/check-odp/build/odp-apply/include/odp/api/packet_io.h:27:
warning: documented symbol `odp_pktio_t' was not declared or defined.
/home/bill/linaro/check-odp/build/odp-apply/include/odp/api/pool.h:31:
warning: documented symbol `odp_pool_t' was not declared or defined.
/home/bill/linaro/check-odp/build/odp-apply/include/odp/api/queue.h:28:
warning: documented symbol `odp_queue_t' was not declared or defined.
/home/bill/linaro/check-odp/build/odp-apply/include/odp/api/queue.h:33:
warning: documented symbol `odp_queue_group_t' was not declared or defined.
/home/bill/linaro/check-odp/build/odp-apply/include/odp/api/shared_memory.h:28:
warning: documented symbol `odp_shm_t' was not declared or defined.
/home/bill/linaro/check-odp/build/odp-apply/platform/linux-generic/include/odp/plat/classification_types.h:26:
warning: Member ODP_HANDLE_T(odp_cos_t) (function) of group
odp_classification is not documented.
/home/bill/linaro/check-odp/build/odp-apply/platform/linux-generic/include/odp/plat/classification_types.h:27:
warning: Member ODP_HANDLE_T(odp_flowsig_t) (function) of group
odp_classification is not documented.
/home/bill/linaro/check-odp/build/odp-apply/platform/linux-generic/include/odp/plat/classification_types.h:34:
warning: Member ODP_HANDLE_T(odp_pmr_t) (function) of group
odp_classification is not documented.
/home/bill/linaro/check-odp/build/odp-apply/platform/linux-generic/include/odp/plat/classification_types.h:37:
warning: Member ODP_HANDLE_T(odp_pmr_set_t) (function) of group
odp_classification is not documented.
/home/bill/linaro/check-odp/build/odp-apply/platform/linux-generic/include/odp/plat/crypto_types.h:28:
warning: Member ODP_HANDLE_T(odp_crypto_compl_t) (function) of group
odp_crypto is not documented.
/home/bill/linaro/check-odp/build/odp-apply/platform/linux-generic/include/odp/plat/event_types.h:29:
warning: Member ODP_HANDLE_T(odp_event_t) (function) of group odp_event is
not documented.
/home/bill/linaro/check-odp/build/odp-apply/platform/linux-generic/include/odp/plat/packet_io_types.h:29:
warning: Member ODP_HANDLE_T(odp_pktio_t) (function) of group odp_packet_io
is not documented.
/home/bill/linaro/check-odp/build/odp-apply/platform/linux-generic/include/odp/plat/packet_types.h:29:
warning: Member ODP_HANDLE_T(odp_packet_t) (function) of group odp_packet
is not documented.
/home/bill/linaro/check-odp/build/odp-apply/platform/linux-generic/include/odp/plat/packet_types.h:35:
warning: Member ODP_HANDLE_T(odp_packet_seg_t) (function) of group
odp_packet is not documented.
/home/bill/linaro/check-odp/build/odp-apply/platform/linux-generic/include/odp/plat/pool_types.h:28:
warning: Member ODP_HANDLE_T(odp_pool_t) (function) of group odp_buffer is
not documented.
/home/bill/linaro/check-odp/build/odp-apply/platform/linux-generic/include/odp/plat/queue_types.h:28:
warning: Member ODP_HANDLE_T(odp_queue_t) (function) of group odp_queue is
not documented.
/home/bill/linaro/check-odp/build/odp-apply/platform/linux-generic/include/odp/plat/queue_types.h:30:
warning: Member ODP_HANDLE_T(odp_queue_group_t) (function) of group
odp_queue is n

Re: [lng-odp] [PATCHv2] validation: fixed memory leak in odp_cpumask.c

2015-03-20 Thread Bill Fischofer
On Fri, Mar 20, 2015 at 7:00 AM, Christophe Milard <
christophe.mil...@linaro.org> wrote:

> CID 88273:  Resource leaks  (RESOURCE_LEAK)
>
> Signed-off-by: Christophe Milard 
>

Reviewed-and-tested-by: Bill Fischofer 


> ---
>
> now with CID in comments.
>
>  test/validation/odp_cpumask.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/test/validation/odp_cpumask.c b/test/validation/odp_cpumask.c
> index 2285034..b7e18d6 100644
> --- a/test/validation/odp_cpumask.c
> +++ b/test/validation/odp_cpumask.c
> @@ -148,6 +148,9 @@ static void test_odp_cpumask_to_from_str(void)
>
> CU_ASSERT_NSTRING_EQUAL(buf_out, TEST_MASK_CPU_0,
> stringlen(TEST_MASK_CPU_0) + 1);
> +
> +   free(buf_out);
> +   free(buf_in);
>  }
>
>  static void test_odp_cpumask_equal(void)
> --
> 1.9.1
>
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCHv1] fix: incorrect pmr_term_value update in odp_pmr_create_xxx() function

2015-03-20 Thread Bill Fischofer
On Fri, Mar 20, 2015 at 1:31 AM,  wrote:

> From: Balasubramanian Manoharan 
>
> Fix for incorrect pmr_term_value update in odp_pmr_create_match() and
> odp_pmr_create_range() functions.
> Fixes https://bugs.linaro.org/show_bug.cgi?id=1381
>
> Signed-off-by: Balasubramanian Manoharan 
> ---
>  platform/linux-generic/odp_classification.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/platform/linux-generic/odp_classification.c
> b/platform/linux-generic/odp_classification.c
> index 9fb034f..b7a4fe6 100644
> --- a/platform/linux-generic/odp_classification.c
> +++ b/platform/linux-generic/odp_classification.c
> @@ -438,6 +438,7 @@ odp_pmr_t odp_pmr_create_match(odp_pmr_term_e term,
> pmr->s.pmr_term_value[0].mask.mask =  0;
> memcpy(&pmr->s.pmr_term_value[0].mask.val, val, val_sz);
> memcpy(&pmr->s.pmr_term_value[0].mask.mask, mask, val_sz);
> +   pmr->s.pmr_term_value[0].mask.val &=
> pmr->s.pmr_term_value[0].mask.mask;
> UNLOCK(&pmr->s.lock);
> return id;
>  }
> @@ -460,7 +461,7 @@ odp_pmr_t odp_pmr_create_range(odp_pmr_term_e term,
> return ODP_PMR_INVAL;
>
> pmr->s.num_pmr = 1;
> -   pmr->s.pmr_term_value[0].match_type = ODP_PMR_MASK;
> +   pmr->s.pmr_term_value[0].match_type = ODP_PMR_RANGE;
> pmr->s.pmr_term_value[0].term = term;
> pmr->s.pmr_term_value[0].range.val1 =  0;
> pmr->s.pmr_term_value[0].range.val2 =  0;
> @@ -601,6 +602,7 @@ int odp_pmr_match_set_create(int num_terms,
> odp_pmr_match_t *terms,
>terms[i].mask.val, val_sz);
> memcpy(&pmr->s.pmr_term_value[i].mask.mask,
>terms[i].mask.mask, val_sz);
> +   pmr->s.pmr_term_value[i].mask.val &=
> pmr->s.pmr_term_value[i].mask.mask;
>

Fails checkpatch:
WARNING: line over 80 characters
#41: FILE: platform/linux-generic/odp_classification.c:605:
+ pmr->s.pmr_term_value[i].mask.val &= pmr->s.pmr_term_value[i].mask.mask;



> } else {
> val_sz = terms[i].range.val_sz;
> if (val_sz > ODP_PMR_TERM_BYTES_MAX)
> --
> 2.0.1.472.g6f92e5f
>
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp