Re: [lng-odp] [API-NEXT PATCHv2 1/4] api: rwlock: add trylock variants for rwlock and rwlock_recursive

2016-03-19 Thread Maxim Uvarov

Petri, ok?

Maxim.

On 03/05/16 23:10, Bill Fischofer wrote:

Add the following APIs:
- odp_rwlock_read_trylock()
- odp_rwlock_write_trylock()
- odp_rwlock_recursive_read_trylock()
- odp_rwlock_recursive_write_trylock()

Suggested-by: Sorin Vultureanu 
Signed-off-by: Bill Fischofer 
---
  include/odp/api/spec/rwlock.h   | 23 ++-
  include/odp/api/spec/rwlock_recursive.h | 23 +++
  2 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/include/odp/api/spec/rwlock.h b/include/odp/api/spec/rwlock.h
index 54f426f..9ca8872 100644
--- a/include/odp/api/spec/rwlock.h
+++ b/include/odp/api/spec/rwlock.h
@@ -25,7 +25,8 @@ extern "C" {
   * A reader/writer lock allows multiple simultaneous readers but only one
   * writer at a time. A thread that wants write access will have to wait until
   * there are no threads that want read access. This casues a risk for
- * starvation.
+ * starvation. The trylock variants can be used to avoid blocking when
+ * the lock is not immediately available.
   * @{
   */
  
@@ -50,6 +51,16 @@ void odp_rwlock_init(odp_rwlock_t *rwlock);

  void odp_rwlock_read_lock(odp_rwlock_t *rwlock);
  
  /**

+ * Try to acquire read permission to a reader/writer lock.
+ *
+ * @param rwlock Pointer to a reader/writer lock
+ *
+ * @retval  0 Lock was not available for read access
+ * @retval !0 Read access to lock acquired
+ */
+int odp_rwlock_read_trylock(odp_rwlock_t *rwlock);
+
+/**
   * Release read permission on a reader/writer lock.
   *
   * @param rwlock Pointer to a reader/writer lock
@@ -64,6 +75,16 @@ void odp_rwlock_read_unlock(odp_rwlock_t *rwlock);
  void odp_rwlock_write_lock(odp_rwlock_t *rwlock);
  
  /**

+ * Try to acquire write permission to a reader/writer lock.
+ *
+ * @param rwlock Pointer to a reader/writer lock
+ *
+ * @retval  0 Lock was not available for write access
+ * @retval !0 Write access to lock acquired
+ */
+int odp_rwlock_write_trylock(odp_rwlock_t *rwlock);
+
+/**
   * Release write permission on a reader/writer lock.
   *
   * @param rwlock Pointer to a reader/writer lock
diff --git a/include/odp/api/spec/rwlock_recursive.h 
b/include/odp/api/spec/rwlock_recursive.h
index 10b2f79..965fcc0 100644
--- a/include/odp/api/spec/rwlock_recursive.h
+++ b/include/odp/api/spec/rwlock_recursive.h
@@ -35,6 +35,9 @@ extern "C" {
   *
   * ... but this is not supported.
   *   * read_lock(); write_lock(); write_unlock(); read_unlock();
+ *
+ * The trylock variants can be used to avoid blocking when the lock
+ * is not immediately available.
   * @{
   */
  
@@ -62,6 +65,16 @@ void odp_rwlock_recursive_init(odp_rwlock_recursive_t *lock);

  void odp_rwlock_recursive_read_lock(odp_rwlock_recursive_t *lock);
  
  /**

+ * Try to acquire recursive rwlock for reading
+ *
+ * @param lockPointer to a lock
+ *
+ * @retval  0 Lock was not available for read access
+ * @retval !0 Read access to lock acquired
+ */
+int odp_rwlock_recursive_read_trylock(odp_rwlock_recursive_t *lock);
+
+/**
   * Release recursive rwlock after reading
   *
   * @param lockPointer to a lock
@@ -80,6 +93,16 @@ void odp_rwlock_recursive_read_unlock(odp_rwlock_recursive_t 
*lock);
  void odp_rwlock_recursive_write_lock(odp_rwlock_recursive_t *lock);
  
  /**

+ * Try to acquire recursive rwlock for writing
+ *
+ * @param lockPointer to a lock
+ *
+ * @retval  0 Lock was not available for write access
+ * @retval !0 Write access to lock acquired
+ */
+int odp_rwlock_recursive_write_trylock(odp_rwlock_recursive_t *lock);
+
+/**
   * Release recursive rwlock after writing
   *
   * @param lockPointer to a lock


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


Re: [lng-odp] Accesing hardware time stamps

2016-03-19 Thread Maxim Uvarov

As I understand main target is support RTP traffic.

Here is interesting background with tests and not that at a least TI 
chips can support that:


http://processors.wiki.ti.com/index.php/TI81XX_PSP_ETHERNET_Switch_User_Guide#IEEE_1588.2F802.1AS_PTP_Support

Other SoC hardware has programmable classifier on internal pipe which I 
sure can set timestamps somewhere in packet.
I think we just need to discuss who supports what and if both input and 
output are supported in common hardware than add that api.


Maxim.


On 03/18/16 11:50, Savolainen, Petri (Nokia - FI/Espoo) wrote:


Hi,

Not yet, but going to do that soon. Do you need also an API for 
reading (sampling) the packet input HW timestamp from the interface?


For example, rte_eth_timesync_read_rx_timestamp does that. I was going 
to add (first) only ability to the read timestamp stored in the 
received packet, timestamp frequency and a configuration option to 
enable/disable timestamping per interface (during pktio open). We have 
odp_time_ and odp_cpu_cycle APIs to read wall clock time and CPU cycle 
counters. More adcanced packet input clock (or IEEE 1588 clock) 
features could added later on.


-Petri

*From:*EXT Dominic Pigott [mailto:d...@intelligentcompute.com]
*Sent:* Thursday, March 17, 2016 4:39 PM
*To:* Savolainen, Petri (Nokia - FI/Espoo) 
*Cc:* lng-odp 
*Subject:* Re: Accesing hardware time stamps

Hi Petri

Thanks for the answer, did you have any time to look at this further? 
Most modern NICs can generate the timestamps in hardware so the 
overhead should be low, but its vendor specific. DPDK implements a 
standard API in  2.1 I believe:


http://dpdk.org/doc/guides/rel_notes/release_2_1.html?highlight=timestamp

Regards

Dom



*From: *"Savolainen, Petri (Nokia - FI/Espoo)" 
mailto:petri.savolai...@nokia.com>>
*To: *"EXT Dominic Pigott" >, "lng-odp" 
mailto:lng-odp@lists.linaro.org>>

*Sent: *Friday, 11 March, 2016 05:13:52
*Subject: *RE: Accesing hardware time stamps

Hi,

There’s not yet packet time stamping, but I’m thinking to add a 64 bit 
time stamp into packet metadata and have a packet input configuration 
option to enable/disable timestamping, since it may take lots of CPU 
cycles to timestamp every packet (also when application would not need 
it).


I’ll look into it more detail at next week.

-Petri

*From:*lng-odp [mailto:lng-odp-boun...@lists.linaro.org] *On Behalf Of 
*EXT Dominic Pigott

*Sent:* Thursday, March 10, 2016 1:08 PM
*To:* lng-odp@lists.linaro.org 
*Subject:* [lng-odp] Accesing hardware time stamps

Hi,

I cannot find in the documentation, but is it possible to access a 
packets hardware time stamp via the ODP API?


Regards

Dom



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


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


[lng-odp] [PATCH 00/11] cleanup debian builds

2016-03-19 Thread Anders Roxell
Hi,

A few patches to cleanup the debian package build.

Cheers,
Anders

Anders Roxell (11):
  pkg/debian/control: add graphviz to Build-Depends
  configure: default test-helper to disabled
  rename libodp to libodp-linux
  rename libodphelper to libodphelper-linux
  scripts/builddeb: remove SO-version from -dev and -bin pkg
  helper/Makefile: add SO-version to helper lib
  dbg/debian: add libodphelper-linux* packages
  pkg/debian/rules: make sure every package is stripped by default
  pkg/debian/control: fix bin package section name
  pkg/debian/control: fix dependency for libodp-linux-dev packages
  pkg/debian: run tests before creating packages

 configure.ac   |  6 +--
 example/Makefile.inc   |  2 +-
 helper/Makefile.am |  8 ++--
 helper/test/Makefile.am|  4 +-
 pkg/debian/control | 43 +-
 pkg/debian/libodp-dev.install  |  4 --
 ...libodphelper-dev.dirs => libodp-linux-dev.dirs} |  0
 pkg/debian/libodp-linux-dev.install|  5 +++
 .../{libodphelper.dirs => libodp-linux.dirs}   |  0
 pkg/debian/libodp-linux.install|  1 +
 pkg/debian/libodp.install  |  1 -
 pkg/debian/libodphelper-dev.install|  4 --
 ...libodp-dev.dirs => libodphelper-linux-dev.dirs} |  0
 pkg/debian/libodphelper-linux-dev.install  |  4 ++
 .../{libodp.dirs => libodphelper-linux.dirs}   |  0
 pkg/debian/libodphelper-linux.install  |  1 +
 pkg/debian/libodphelper.install|  1 -
 pkg/debian/{odp-bin.dirs => odp-linux-bin.dirs}|  0
 .../{odp-bin.install => odp-linux-bin.install} |  0
 pkg/debian/rules   | 11 +-
 pkgconfig/{libodp.pc.in => libodp-linux.pc.in} |  2 +-
 ...libodphelper.pc.in => libodphelper-linux.pc.in} |  2 +-
 platform/Makefile.inc  |  8 ++--
 platform/linux-generic/Makefile.am |  4 +-
 scripts/builddeb   |  6 +--
 test/Makefile.inc  |  2 +-
 test/validation/Makefile.inc   |  2 +-
 27 files changed, 79 insertions(+), 42 deletions(-)
 delete mode 100644 pkg/debian/libodp-dev.install
 rename pkg/debian/{libodphelper-dev.dirs => libodp-linux-dev.dirs} (100%)
 create mode 100644 pkg/debian/libodp-linux-dev.install
 rename pkg/debian/{libodphelper.dirs => libodp-linux.dirs} (100%)
 create mode 100644 pkg/debian/libodp-linux.install
 delete mode 100644 pkg/debian/libodp.install
 delete mode 100644 pkg/debian/libodphelper-dev.install
 rename pkg/debian/{libodp-dev.dirs => libodphelper-linux-dev.dirs} (100%)
 create mode 100644 pkg/debian/libodphelper-linux-dev.install
 rename pkg/debian/{libodp.dirs => libodphelper-linux.dirs} (100%)
 create mode 100644 pkg/debian/libodphelper-linux.install
 delete mode 100644 pkg/debian/libodphelper.install
 rename pkg/debian/{odp-bin.dirs => odp-linux-bin.dirs} (100%)
 rename pkg/debian/{odp-bin.install => odp-linux-bin.install} (100%)
 rename pkgconfig/{libodp.pc.in => libodp-linux.pc.in} (91%)
 rename pkgconfig/{libodphelper.pc.in => libodphelper-linux.pc.in} (90%)

-- 
2.1.4

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


Re: [lng-odp] [PATCH 2/3] DEPENDENCIES: improve netmap installation instructions

2016-03-19 Thread Maxim Uvarov

On 03/18/16 14:42, Elo, Matias (Nokia - FI/Espoo) wrote:

-Original Message-
From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT Maxim
Uvarov
Sent: Friday, March 18, 2016 12:26 PM
To: lng-odp@lists.linaro.org
Subject: Re: [lng-odp] [PATCH 2/3] DEPENDENCIES: improve netmap installation
instructions

On 03/09/16 09:37, Matias Elo wrote:

The latest netmap release version is getting old and no
new releases are planned in the near future. Modify netmap
installation instructions to prefer the latest netmap master
branch commit for the best performance and bug fixes.

Signed-off-by: Matias Elo 
---
   DEPENDENCIES | 7 ---
   1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/DEPENDENCIES b/DEPENDENCIES
index fe7df40..632783a 100644
--- a/DEPENDENCIES
+++ b/DEPENDENCIES
@@ -82,13 +82,14 @@ Prerequisites for building the OpenDataPlane (ODP) API

   3.3.1 Building netmap kernel modules

-   ODP works (at least) with the latest release version of netmap, which is
-   currently at API version 11.1.
+   ODP works at least with the latest release version of netmap, which is
+   currently 11.1. However, if possible one should try to use the latest netmap
+   master branch commit for the best performance and the latest bug fixes.

  # Checkout netmap code
  $ git clone https://github.com/luigirizzo/netmap.git
  $ cd netmap
-   $ git checkout v11.1
+   ($ git checkout v11.1)


why () is needed here?

I wanted to highlight that checkout is optional.

-Matias

That should be more understandable:

git checkout v11.1 (optional)





Maxim.


  This is enough to build ODP. If you don't want to build netmap kernel
  modules you can jump to section 3.3.2.

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


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


Re: [lng-odp] [PATCH] scripts: add builddpdk

2016-03-19 Thread Nikolay Nikolaev
On Fri, Mar 18, 2016 at 1:59 PM, Maxim Uvarov  wrote:
> Add script to quickly build odp with dpdk pktio support.
>
> Signed-off-by: Maxim Uvarov 
> ---
>  .gitignore|  1 +
>  scripts/builddpdk | 26 ++
>  2 files changed, 27 insertions(+)
>  create mode 100755 scripts/builddpdk
>
> diff --git a/.gitignore b/.gitignore
> index b4c146b..4945d25 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -31,6 +31,7 @@ core
>  cscope.out
>  depcomp
>  doc/output
> +dpdk/
>  install-sh
>  lib/
>  libtool
> diff --git a/scripts/builddpdk b/scripts/builddpdk
> new file mode 100755
> index 000..b178c19
> --- /dev/null
> +++ b/scripts/builddpdk
> @@ -0,0 +1,26 @@
> +#!/bin/bash
> +
> +TARGET="x86_64-native-linuxapp-gcc"
You can use this form to allow setting the target externaly (e.g. if
you need to compile for ARM):

TARGET=${TARGET:-"x86_64-native-linuxapp-gcc"}
echo "Building DPDK with target ${TARGET}"

> +
> +git clone http://dpdk.org/git/dpdk dpdk
this will result in a terrible output of git status. Maybe you can
clone to ".dpdk" (note the dot),
which will be ignored by git AFAIK.

> +cd dpdk
You may use bash's pushd/popd for going back and forth between the
folders instead of cd.

> +git checkout -b bv2.2.0 v2.2.0
> +
> +#Make and edit DPDK configuration
> +make config T=x86_64-native-linuxapp-gcc O=x86_64-native-linuxapp-gcc
Maybe you want:
make config T=${TARGET} O=${TARGET}

regards,
Nikolay Nikolaev

> +cd x86_64-native-linuxapp-gcc
> +sed -ri 's,(CONFIG_RTE_BUILD_COMBINE_LIBS=).*,\1y,' .config
> +#To use I/O without DPDK supported NIC's enable pcap pmd:
> +sed -ri 's,(CONFIG_RTE_LIBRTE_PMD_PCAP=).*,\1y,' .config
> +cd ..
> +
> +#Build DPDK
> +make install T=${TARGET} EXTRA_CFLAGS="-fPIC"
> +cd ..
> +
> +#Build ODP
> +./bootstrap;
> +./configure  --enable-test-vald  --enable-test-perf --enable-test-cpp \
> +--enable-debug --enable-debug-print \
> +--with-dpdk-path=`pwd`/dpdk/${TARGET}/include
> +make
> --
> 2.7.1.250.gff4ea60
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT PATCH] api: pktio: add odp_pktin_recv_tmo

2016-03-19 Thread Bala Manoharan
Hi,

odp_pktin_recv_tmo() function called with wait value equal to ODP_PKTIN_NO_WAIT
is similar to odp_pktin_recv() function. Hence why cant we simply merge
these two functions as a single one. odp_pktin_recv() functions looks
redundant.

Regards,
Bala

On 17 March 2016 at 19:37, Petri Savolainen 
wrote:

> Added single queue recv function with timeout. In a simple
> configuration each thread polls a single input queue. Timeout
> version of single queue receive allows thread to sleep when
> there are no packets. odp_pktin_recv_mq_tmo would be unnecessary
> complex to use for single input queue.
>
> Signed-off-by: Petri Savolainen 
> ---
>  include/odp/api/spec/packet_io.h   | 36 ++---
>  platform/linux-generic/odp_packet_io.c | 49
> +-
>  2 files changed, 81 insertions(+), 4 deletions(-)
>
> diff --git a/include/odp/api/spec/packet_io.h
> b/include/odp/api/spec/packet_io.h
> index 6fe2cac..1860b31 100644
> --- a/include/odp/api/spec/packet_io.h
> +++ b/include/odp/api/spec/packet_io.h
> @@ -522,8 +522,10 @@ odp_pktio_t odp_pktio_lookup(const char *name);
>  /**
>   * Receive packets directly from an interface input queue
>   *
> - * Receives up to 'num' packets from the pktio interface input queue. When
> - * input queue parameter 'op_mode' has been set to ODP_PKTIO_OP_MT_UNSAFE,
> + * Receives up to 'num' packets from the pktio interface input queue.
> Returns
> + * the number of packets received.
> + *
> + * When input queue parameter 'op_mode' has been set to
> ODP_PKTIO_OP_MT_UNSAFE,
>   * the operation is optimized for single thread operation per queue and
> the same
>   * queue must not be accessed simultaneously from multiple threads.
>   *
> @@ -539,7 +541,35 @@ odp_pktio_t odp_pktio_lookup(const char *name);
>  int odp_pktin_recv(odp_pktin_queue_t queue, odp_packet_t packets[], int
> num);
>
>  /**
> - * Receive packets directly from multiple interface input queues
> + * Receive packets directly from an interface input queue with timeout
> + *
> + * Receives up to 'num' packets from the pktio interface input queue. If
> there
> + * are no packets available, waits for packets depeding on 'wait'
> parameter
> + * value. Returns the number of packets received.
> + *
> + * When input queue parameter 'op_mode' has been set to
> ODP_PKTIO_OP_MT_UNSAFE,
> + * the operation is optimized for single thread operation per queue and
> the same
> + * queue must not be accessed simultaneously from multiple threads.
> + *
> + * @param  queue  Packet input queue handle for receiving packets
> + * @param[out] packets[]  Packet handle array for output of received
> packets
> + * @param  numMaximum number of packets to receive
> + * @param  wait   Wait time specified as as follows:
> + ** ODP_PKTIN_NO_WAIT: Do not wait
> + ** ODP_PKTIN_WAIT:Wait infinitely
> + ** Other values specify the minimum time to wait.
> + *  Use odp_pktin_wait_time() to convert
> nanoseconds
> + *  to a valid parameter value. Wait time may be
> + *  rounded up a small, platform specific amount.
> + *
> + * @return Number of packets received
> + * @retval <0 on failure
> + */
> +int odp_pktin_recv_tmo(odp_pktin_queue_t queue, odp_packet_t packets[],
> +  int num, uint64_t wait);
> +
> +/**
> + * Receive packets directly from multiple interface input queues with
> timeout
>   *
>   * Receives up to 'num' packets from one of the specified pktio interface
> input
>   * queues. The index of the source queue is stored into 'from' output
> diff --git a/platform/linux-generic/odp_packet_io.c
> b/platform/linux-generic/odp_packet_io.c
> index aafb3d9..948baa8 100644
> --- a/platform/linux-generic/odp_packet_io.c
> +++ b/platform/linux-generic/odp_packet_io.c
> @@ -21,6 +21,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  #include 
>  #include 
> @@ -28,7 +29,12 @@
>  #include 
>  #include 
>
> -#define SLEEP_NSEC 1000
> +/* Sleep this many nanoseconds between pktin receive calls */
> +#define SLEEP_NSEC  1000
> +
> +/* Check total sleep time about every SLEEP_CHECK * SLEEP_NSEC
> nanoseconds.
> + * Must be power of two. */
> +#define SLEEP_CHECK 32
>
>  pktio_table_t *pktio_tbl;
>
> @@ -1387,6 +1393,47 @@ int odp_pktin_recv(odp_pktin_queue_t queue,
> odp_packet_t packets[], int num)
> return single_recv_queue(entry, queue.index, packets, num);
>  }
>
> +int odp_pktin_recv_tmo(odp_pktin_queue_t queue, odp_packet_t packets[],
> int num,
> +  uint64_t wait)
> +{
> +   int ret;
> +   odp_time_t t1, t2;
> +   struct timespec ts;
> +
> +   if (wait != ODP_PKTIN_WAIT) {
> +   ts.tv_sec  = 0;
> +   ts.tv_nsec = SLEEP_NSEC;
> +
> +   t1 = odp_time_sum(odp_time_local(),
> + odp_time_local_fr

[lng-odp] [PATCH v2 2/2] linux-generic: packet: don't look for L2 header if there isn't any

2016-03-19 Thread Zoltan Kiss
The L2 offset functions should consider the L2 flag: return negative
answer if there isn't any, and implicitly set it when offset is set.
E.g. user created packets don't have L2 headers immediately.

Signed-off-by: Zoltan Kiss 
---
 platform/linux-generic/include/odp_packet_internal.h | 5 +
 platform/linux-generic/odp_packet.c  | 5 +
 2 files changed, 10 insertions(+)

diff --git a/platform/linux-generic/include/odp_packet_internal.h 
b/platform/linux-generic/include/odp_packet_internal.h
index 7974a20..92b770f 100644
--- a/platform/linux-generic/include/odp_packet_internal.h
+++ b/platform/linux-generic/include/odp_packet_internal.h
@@ -272,6 +272,11 @@ static inline int packet_hdr_has_l2(odp_packet_hdr_t 
*pkt_hdr)
return pkt_hdr->input_flags.l2;
 }
 
+static inline void packet_hdr_has_l2_set(odp_packet_hdr_t *pkt_hdr, int val)
+{
+   pkt_hdr->input_flags.l2 = val;
+}
+
 static inline int packet_hdr_has_eth(odp_packet_hdr_t *pkt_hdr)
 {
return pkt_hdr->input_flags.eth;
diff --git a/platform/linux-generic/odp_packet.c 
b/platform/linux-generic/odp_packet.c
index aac42b6..2c44316 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -353,12 +353,16 @@ uint32_t odp_packet_user_area_size(odp_packet_t pkt)
 void *odp_packet_l2_ptr(odp_packet_t pkt, uint32_t *len)
 {
odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
+   if (!packet_hdr_has_l2(pkt_hdr))
+   return NULL;
return packet_map(pkt_hdr, pkt_hdr->l2_offset, len);
 }
 
 uint32_t odp_packet_l2_offset(odp_packet_t pkt)
 {
odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
+   if (!packet_hdr_has_l2(pkt_hdr))
+   return ODP_PACKET_OFFSET_INVALID;
return pkt_hdr->l2_offset;
 }
 
@@ -369,6 +373,7 @@ int odp_packet_l2_offset_set(odp_packet_t pkt, uint32_t 
offset)
if (offset >= pkt_hdr->frame_len)
return -1;
 
+   packet_hdr_has_l2_set(pkt_hdr, 1);
pkt_hdr->l2_offset = offset;
return 0;
 }
-- 
1.9.1

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


Re: [lng-odp] [PATCH 2/3] DEPENDENCIES: improve netmap installation instructions

2016-03-19 Thread Maxim Uvarov

On 03/09/16 09:37, Matias Elo wrote:

The latest netmap release version is getting old and no
new releases are planned in the near future. Modify netmap
installation instructions to prefer the latest netmap master
branch commit for the best performance and bug fixes.

Signed-off-by: Matias Elo 
---
  DEPENDENCIES | 7 ---
  1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/DEPENDENCIES b/DEPENDENCIES
index fe7df40..632783a 100644
--- a/DEPENDENCIES
+++ b/DEPENDENCIES
@@ -82,13 +82,14 @@ Prerequisites for building the OpenDataPlane (ODP) API
  
  3.3.1 Building netmap kernel modules
  
-   ODP works (at least) with the latest release version of netmap, which is

-   currently at API version 11.1.
+   ODP works at least with the latest release version of netmap, which is
+   currently 11.1. However, if possible one should try to use the latest netmap
+   master branch commit for the best performance and the latest bug fixes.
  
 # Checkout netmap code

 $ git clone https://github.com/luigirizzo/netmap.git
 $ cd netmap
-   $ git checkout v11.1
+   ($ git checkout v11.1)
  


why () is needed here?

Maxim.


 This is enough to build ODP. If you don't want to build netmap kernel
 modules you can jump to section 3.3.2.


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


Re: [lng-odp] [PATCH v2 5/6] linux-generic: dpdk: pass ODP_PLATFORM_PARAMS environment variable to dpdk init

2016-03-19 Thread Elo, Matias (Nokia - FI/Espoo)


> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT Maxim
> Uvarov
> Sent: Wednesday, March 16, 2016 3:12 PM
> To: lng-odp@lists.linaro.org
> Subject: Re: [lng-odp] [PATCH v2 5/6] linux-generic: dpdk: pass
> ODP_PLATFORM_PARAMS environment variable to dpdk init
> 
> On 03/09/16 16:34, Matias Elo wrote:
> > Pass ODP_PLATFORM_PARAMS environment variable to
> > rte_eal_init(). This can be used to pass DPDK only
> > configuration options from command line. E.g. configuring
> > vdev interfaces.
> >
> > Signed-off-by: Matias Elo 
> > ---
> >   platform/linux-generic/pktio/dpdk.c | 11 ---
> >   1 file changed, 8 insertions(+), 3 deletions(-)
> >
> > diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-
> generic/pktio/dpdk.c
> > index 5278651..2edba52 100644
> > --- a/platform/linux-generic/pktio/dpdk.c
> > +++ b/platform/linux-generic/pktio/dpdk.c
> > @@ -326,6 +326,7 @@ static int dpdk_pktio_init(void)
> > int i;
> > odp_cpumask_t mask;
> > char mask_str[ODP_CPUMASK_STR_SIZE];
> > +   const char *cmdline;
> > int32_t masklen;
> > int mem_str_len;
> > int cmd_len;
> > @@ -365,15 +366,19 @@ static int dpdk_pktio_init(void)
> >
> > mem_str_len = snprintf(NULL, 0, "%d", DPDK_MEMORY_MB);
> >
> > +   cmdline = getenv("ODP_PLATFORM_PARAMS");
> 
> this might be not really good name for linux-generic. I think it's
> better to name it as:
> ODP_PKTIO_DPDK_PARAMS

True, I'll fix this in v3.

-Matias

> 
> Maxim.
> > +   if (cmdline == NULL)
> > +   cmdline = "";
> > +
> > /* masklen includes the terminating null as well */
> > cmd_len = strlen("odpdpdk -c -m ") + masklen + mem_str_len +
> > -   strlen(" ");
> > +   strlen(cmdline) + strlen("  ");
> >
> > char full_cmd[cmd_len];
> >
> > /* first argument is facility log, simply bind it to odpdpdk for now.*/
> > -   cmd_len = snprintf(full_cmd, cmd_len, "odpdpdk -c %s -m %d",
> > -  mask_str, DPDK_MEMORY_MB);
> > +   cmd_len = snprintf(full_cmd, cmd_len, "odpdpdk -c %s -m %d %s",
> > +  mask_str, DPDK_MEMORY_MB, cmdline);
> >
> > for (i = 0, dpdk_argc = 1; i < cmd_len; ++i) {
> > if (isspace(full_cmd[i]))
> 
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH 05/11] scripts/builddeb: remove SO-version from -dev and -bin pkg

2016-03-19 Thread Anders Roxell
Signed-off-by: Anders Roxell 
---
 scripts/builddeb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/builddeb b/scripts/builddeb
index 0fa8754..988cb5d 100755
--- a/scripts/builddeb
+++ b/scripts/builddeb
@@ -23,7 +23,7 @@ cp -r ${ROOT_DIR}/pkg/debian .
 current=$(echo ${version} | awk -F . '{printf("%d\n", (($1 * 100) + $2))}')
 rename 's,(.*linux)(.*),${1}'"${current}"'${2},' debian/*odp*-linux.install
 
-sed -i "s:\(.*odp-linux\)\([^\.]\|$\):\1${current}\2:g" debian/control
+sed -i "s:\(.*odp-linux\)\(-dbg\|$\| \):\1${current}\2:g" debian/control
 sed -i "s:\(.*odp-linux\)\(.*\):\1${current}\2:g" debian/rules
 
 if [ $(egrep "\.([a-z0-9]{8}\>|dirty)" .scmversion |wc -l) -gt 0 ]; then
-- 
2.1.4

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


[lng-odp] [API-NEXT PATCH] api: init: add instance handle

2016-03-19 Thread Petri Savolainen
Added opaque odp_instance_t handle for storing ODP
instance ID. Global init generates instance ID which
is used to identify an ODP instance in the system.
Instance ID allows to launch multiple separate ODP
applications (without name space clash). Application
threads define in odp_init_local() call which instance
they join. Simultaneously, a thread may belong to only
single instance and thus odp_term_local() call does not
need instance handle parameter. Currently, linux-generic
implementation supports only single instance.

Linux helper pthread and process create APIs were updated
with instance handle through a new type (odph_linux_thr_param_t).
Process API calls were missing thread type selection. A params
type decreases number of parameters needed (from 6 to 3 for
pthreads) and reduces need for future function prototype changes
(if e.g. new parameters need to be added).

Signed-off-by: Petri Savolainen 
---
 example/classifier/odp_classifier.c| 15 --
 example/generator/odp_generator.c  | 32 
 example/ipsec/odp_ipsec.c  | 15 --
 example/l2fwd_simple/odp_l2fwd_simple.c| 16 --
 example/packet/odp_pktio.c | 18 +--
 example/time/time_global_test.c| 17 --
 example/timer/odp_timer_test.c | 17 --
 example/traffic_mgmt/odp_traffic_mgmt.c|  5 +-
 helper/include/odp/helper/linux.h  | 54 ++-
 helper/linux.c | 51 +-
 helper/test/chksum.c   |  7 +--
 helper/test/process.c  | 14 +++--
 helper/test/table.c|  7 +--
 helper/test/thread.c   | 16 --
 include/odp/api/spec/init.h| 60 ++
 .../include/odp/api/plat/init_types.h  |  4 ++
 platform/linux-generic/include/odp_internal.h  |  1 +
 platform/linux-generic/odp_init.c  | 19 +--
 platform/linux-generic/odp_traffic_mngr.c  |  3 +-
 platform/linux-generic/test/ring/ringtest.c| 26 ++
 test/performance/odp_crypto.c  | 18 ---
 test/performance/odp_l2fwd.c   | 16 --
 test/performance/odp_pktio_perf.c  | 21 ++--
 test/performance/odp_scheduling.c  | 18 +--
 test/validation/atomic/atomic.c|  6 +--
 test/validation/atomic/atomic.h|  2 +-
 test/validation/barrier/barrier.c  |  6 +--
 test/validation/barrier/barrier.h  |  2 +-
 test/validation/common/odp_cunit_common.c  | 37 +++--
 test/validation/common/odp_cunit_common.h  |  5 +-
 test/validation/crypto/crypto.c| 10 ++--
 test/validation/crypto/crypto.h|  4 +-
 test/validation/init/init.c| 15 +++---
 test/validation/lock/lock.c|  6 +--
 test/validation/lock/lock.h|  2 +-
 35 files changed, 363 insertions(+), 202 deletions(-)

diff --git a/example/classifier/odp_classifier.c 
b/example/classifier/odp_classifier.c
index 2f47e74..612ce22 100644
--- a/example/classifier/odp_classifier.c
+++ b/example/classifier/odp_classifier.c
@@ -475,15 +475,17 @@ int main(int argc, char *argv[])
appl_args_t *args;
odp_cos_t default_cos;
odp_shm_t shm;
+   odp_instance_t instance;
+   odph_linux_thr_params_t thr_params;
 
/* Init ODP before calling anything else */
-   if (odp_init_global(NULL, NULL)) {
+   if (odp_init_global(&instance, NULL, NULL)) {
EXAMPLE_ERR("Error: ODP global init failed.\n");
exit(EXIT_FAILURE);
}
 
/* Init this thread */
-   if (odp_init_local(ODP_THREAD_CONTROL)) {
+   if (odp_init_local(instance, ODP_THREAD_CONTROL)) {
EXAMPLE_ERR("Error: ODP local init failed.\n");
exit(EXIT_FAILURE);
}
@@ -557,6 +559,12 @@ int main(int argc, char *argv[])
/* Create and init worker threads */
memset(thread_tbl, 0, sizeof(thread_tbl));
 
+   memset(&thr_params, 0, sizeof(thr_params));
+   thr_params.start= pktio_receive_thread;
+   thr_params.arg  = args;
+   thr_params.thr_type = ODP_THREAD_WORKER;
+   thr_params.instance = instance;
+
cpu = odp_cpumask_first(&cpumask);
for (i = 0; i < num_workers; ++i) {
odp_cpumask_t thd_mask;
@@ -566,8 +574,7 @@ int main(int argc, char *argv[])
odp_cpumask_zero(&thd_mask);
odp_cpumask_set(&thd_mask, cpu);
odph_linux_pthread_create(&thread_tbl[i], &thd_mask,
- pktio_receive_thread,
- args, ODP_

Re: [lng-odp] [PATCH 1/3] linux-generic: netmap: handle case where all rx/tx rings cannot be stored

2016-03-19 Thread Maxim Uvarov

Merged patches 1 and 3.

Left comment for patch 2.

Maxim.

On 03/09/16 09:37, Matias Elo wrote:

Don't fail netmap_open() if all netmap rx/tx rings cannot be
stored. Instead, adjust capa.max_intput_queues /
capa.max_output_values accordingly.

Signed-off-by: Matias Elo 
---
  platform/linux-generic/pktio/netmap.c | 33 +
  1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/platform/linux-generic/pktio/netmap.c 
b/platform/linux-generic/pktio/netmap.c
index 6feeb3b..bca2aaf 100644
--- a/platform/linux-generic/pktio/netmap.c
+++ b/platform/linux-generic/pktio/netmap.c
@@ -325,27 +325,28 @@ static int netmap_open(odp_pktio_t id ODP_UNUSED, 
pktio_entry_t *pktio_entry,
ODP_ERR("nm_open(%s) failed\n", pkt_nm->nm_name);
goto error;
}
-   if (desc->nifp->ni_rx_rings > NM_MAX_DESC) {
-   ODP_ERR("Unable to store all %" PRIu32 " rx rings (max %d)\n",
-   desc->nifp->ni_rx_rings, NM_MAX_DESC);
-   nm_close(desc);
-   goto error;
-   }
pkt_nm->num_rx_rings = desc->nifp->ni_rx_rings;
pkt_nm->capa.max_input_queues = PKTIO_MAX_QUEUES;
-   if (desc->nifp->ni_rx_rings < PKTIO_MAX_QUEUES)
-   pkt_nm->capa.max_input_queues = desc->nifp->ni_rx_rings;
-
-   if (desc->nifp->ni_tx_rings > NM_MAX_DESC) {
-   ODP_ERR("Unable to store all %" PRIu32 " tx rings (max %d)\n",
-   desc->nifp->ni_tx_rings, NM_MAX_DESC);
-   nm_close(desc);
-   goto error;
+   if (pkt_nm->num_rx_rings < PKTIO_MAX_QUEUES)
+   pkt_nm->capa.max_input_queues = pkt_nm->num_rx_rings;
+   if (pkt_nm->capa.max_input_queues > NM_MAX_DESC) {
+   /* Have to use a single descriptor to fetch packets from all
+* netmap rings */
+   pkt_nm->capa.max_input_queues = 1;
+   ODP_DBG("Unable to store all %" PRIu32 " rx rings (max %d)\n"
+   "  max input queues: %u\n", pkt_nm->num_rx_rings,
+   NM_MAX_DESC, pkt_nm->capa.max_input_queues);
}
pkt_nm->num_tx_rings = desc->nifp->ni_tx_rings;
pkt_nm->capa.max_output_queues = PKTIO_MAX_QUEUES;
-   if (desc->nifp->ni_tx_rings < PKTIO_MAX_QUEUES)
-   pkt_nm->capa.max_output_queues = desc->nifp->ni_tx_rings;
+   if (pkt_nm->num_tx_rings < PKTIO_MAX_QUEUES)
+   pkt_nm->capa.max_output_queues = pkt_nm->num_tx_rings;
+   if (pkt_nm->capa.max_output_queues > NM_MAX_DESC) {
+   pkt_nm->capa.max_output_queues = NM_MAX_DESC;
+   ODP_DBG("Unable to store all %" PRIu32 " tx rings (max %d)\n"
+   "  max output queues: %u\n", pkt_nm->num_tx_rings,
+   NM_MAX_DESC, pkt_nm->capa.max_output_queues);
+   }
  
  	pkt_nm->capa.set_op.op.promisc_mode = 1;
  


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


[lng-odp] [PATCH 07/11] dbg/debian: add libodphelper-linux* packages

2016-03-19 Thread Anders Roxell
Signed-off-by: Anders Roxell 
---
 pkg/debian/control | 27 ++-
 pkg/debian/rules   |  3 ++-
 scripts/builddeb   |  4 ++--
 3 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/pkg/debian/control b/pkg/debian/control
index 8a1f679..0c5821b 100644
--- a/pkg/debian/control
+++ b/pkg/debian/control
@@ -14,7 +14,7 @@ Package: odp-linux-bin
 Section: libdevel
 Architecture: any
 Multi-Arch: allowed
-Depends: libodp-linux (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}
 Description: Example binaries for OpenDataPlane
  These are the executable examples from the reference implementation.
 
@@ -42,3 +42,28 @@ Multi-Arch: same
 Depends: ${misc:Depends}, ${shlibs:Depends}
 Description: Library for OpenDataPlane
  This is the OpenDataPlane library from the reference implementation.
+
+Package: libodphelper-linux-dbg
+Priority: extra
+Section: debug
+Architecture: any
+Multi-Arch: same
+Depends: libodphelper-linux (= ${binary:Version}), ${misc:Depends}
+Description: Debug symbols for OpenDataPlane
+ This is the OpenDataPlane helper library from the reference implementation
+ with debug turned on.
+
+Package: libodphelper-linux-dev
+Section: libdevel
+Architecture: any
+Multi-Arch: same
+Depends: ${misc:Depends}, ${shlibs:Depends}, libssl-dev
+Description: Helper development files for OpenDataPlane
+ These are the helper source file for the OpenDataPlane reference 
implementation.
+
+Package: libodphelper-linux
+Architecture: any
+Multi-Arch: same
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: Helper library for OpenDataPlane
+ This is the OpenDataPlane helper library from the reference implementation.
diff --git a/pkg/debian/rules b/pkg/debian/rules
index be8a2ae..4f7a057 100755
--- a/pkg/debian/rules
+++ b/pkg/debian/rules
@@ -18,4 +18,5 @@ override_dh_auto_configure:
 
 .PHONY: override_dh_strip
 override_dh_strip:
-   dh_strip --dbg-package=libodp-linux-dbg
+   dh_strip -p libodp-linux --dbg-package=libodp-linux-dbg
+   dh_strip -p libodphelper-linux --dbg-package=libodphelper-linux-dbg
diff --git a/scripts/builddeb b/scripts/builddeb
index 988cb5d..8bde7cf 100755
--- a/scripts/builddeb
+++ b/scripts/builddeb
@@ -23,8 +23,8 @@ cp -r ${ROOT_DIR}/pkg/debian .
 current=$(echo ${version} | awk -F . '{printf("%d\n", (($1 * 100) + $2))}')
 rename 's,(.*linux)(.*),${1}'"${current}"'${2},' debian/*odp*-linux.install
 
-sed -i "s:\(.*odp-linux\)\(-dbg\|$\| \):\1${current}\2:g" debian/control
-sed -i "s:\(.*odp-linux\)\(.*\):\1${current}\2:g" debian/rules
+sed -i "s:\(libodp[a-zA-Z\-]\+linux\)\(-dbg\|$\| \):\1${current}\2:g" 
debian/control
+sed -i "s:\(libodp[a-zA-Z\-]\+linux\)\(-dbg\| \):\1${current}\2:g" debian/rules
 
 if [ $(egrep "\.([a-z0-9]{8}\>|dirty)" .scmversion |wc -l) -gt 0 ]; then
export DEBFULLNAME="Donald Duck"
-- 
2.1.4

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


Re: [lng-odp] Accesing hardware time stamps

2016-03-19 Thread Savolainen, Petri (Nokia - FI/Espoo)
Hi,

Not yet, but going to do that soon. Do you need also an API for reading 
(sampling) the packet input HW timestamp from the interface?

For example, rte_eth_timesync_read_rx_timestamp does that. I was going to add 
(first) only ability to the read timestamp stored in the received packet, 
timestamp frequency and a configuration option to enable/disable timestamping 
per interface (during pktio open). We have odp_time_ and odp_cpu_cycle APIs to 
read wall clock time and CPU cycle counters. More adcanced packet input clock 
(or IEEE 1588 clock) features could added later on.

-Petri



From: EXT Dominic Pigott [mailto:d...@intelligentcompute.com]
Sent: Thursday, March 17, 2016 4:39 PM
To: Savolainen, Petri (Nokia - FI/Espoo) 
Cc: lng-odp 
Subject: Re: Accesing hardware time stamps

Hi Petri

Thanks for the answer, did you have any time to look at this further? Most 
modern NICs can generate the timestamps in hardware so the overhead should be 
low, but its vendor specific. DPDK implements a standard API in  2.1 I believe:

http://dpdk.org/doc/guides/rel_notes/release_2_1.html?highlight=timestamp

Regards
Dom


From: "Savolainen, Petri (Nokia - FI/Espoo)" 
mailto:petri.savolai...@nokia.com>>
To: "EXT Dominic Pigott" 
mailto:d...@intelligentcompute.com>>, "lng-odp" 
mailto:lng-odp@lists.linaro.org>>
Sent: Friday, 11 March, 2016 05:13:52
Subject: RE: Accesing hardware time stamps

Hi,

There’s not yet packet time stamping, but I’m thinking to add a 64 bit time 
stamp into packet metadata and have a packet input configuration option to 
enable/disable timestamping, since it may take lots of CPU cycles to timestamp 
every packet (also when application would not need it).

I’ll look into it more detail at next week.

-Petri


From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT 
Dominic Pigott
Sent: Thursday, March 10, 2016 1:08 PM
To: lng-odp@lists.linaro.org
Subject: [lng-odp] Accesing hardware time stamps

Hi,

I cannot find in the documentation, but is it possible to access a packets 
hardware time stamp via the ODP API?

Regards
Dom

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


Re: [lng-odp] [PATCH 2/2] linux-generic: packet: don't look for L2 header if there isn't any

2016-03-19 Thread Zoltan Kiss
My bad, I read those comments made for the other patch but I haven't 
applied them on this one.


On 18/03/16 12:07, Maxim Uvarov wrote:

On 03/18/16 14:39, Zoltan Kiss wrote:

Ping, added Bill



ping for what?  There are comments to rename functions.

Maxim.


On 11/03/16 07:03, Zoltan Kiss wrote:

Ping

On 03/03/16 03:05, Zoltan Kiss wrote:

The L2 offset functions should consider the L2 flag: return negative
answer if there isn't any, and implicitly set it when offset is set.
E.g. user created packets don't have L2 headers immediately.

Signed-off-by: Zoltan Kiss 
---
  platform/linux-generic/include/odp_packet_internal.h | 5 +
  platform/linux-generic/odp_packet.c  | 5 +
  2 files changed, 10 insertions(+)

diff --git a/platform/linux-generic/include/odp_packet_internal.h
b/platform/linux-generic/include/odp_packet_internal.h
index d9fe544..1dc875e 100644
--- a/platform/linux-generic/include/odp_packet_internal.h
+++ b/platform/linux-generic/include/odp_packet_internal.h
@@ -263,6 +263,11 @@ static inline int
odp_packet_hdr_has_l2(odp_packet_hdr_t *pkt_hdr)
  return pkt_hdr->input_flags.l2;
  }
+static inline void odp_packet_hdr_has_l2_set(odp_packet_hdr_t
*pkt_hdr, int val)
+{
+pkt_hdr->input_flags.l2 = val;
+}
+
  static inline int odp_packet_hdr_has_eth(odp_packet_hdr_t *pkt_hdr)
  {
  return pkt_hdr->input_flags.eth;
diff --git a/platform/linux-generic/odp_packet.c
b/platform/linux-generic/odp_packet.c
index db85b5e..94d7f85 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -353,12 +353,16 @@ uint32_t odp_packet_user_area_size(odp_packet_t
pkt)
  void *odp_packet_l2_ptr(odp_packet_t pkt, uint32_t *len)
  {
  odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
+if (!odp_packet_hdr_has_l2(pkt_hdr))
+return NULL;
  return packet_map(pkt_hdr, pkt_hdr->l2_offset, len);
  }
  uint32_t odp_packet_l2_offset(odp_packet_t pkt)
  {
  odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
+if (!odp_packet_hdr_has_l2(pkt_hdr))
+return ODP_PACKET_OFFSET_INVALID;
  return pkt_hdr->l2_offset;
  }
@@ -369,6 +373,7 @@ int odp_packet_l2_offset_set(odp_packet_t pkt,
uint32_t offset)
  if (offset >= pkt_hdr->frame_len)
  return -1;
+odp_packet_hdr_has_l2_set(pkt_hdr, 1);
  pkt_hdr->l2_offset = offset;
  return 0;
  }





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


[lng-odp] [PATCH 09/11] pkg/debian/control: fix bin package section name

2016-03-19 Thread Anders Roxell
Signed-off-by: Anders Roxell 
---
 pkg/debian/control | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/debian/control b/pkg/debian/control
index 0c5821b..1345770 100644
--- a/pkg/debian/control
+++ b/pkg/debian/control
@@ -11,7 +11,7 @@ Vcs-Git: git://git.linaro.org/lng/odp.git
 Vcs-Browser: https://git.linaro.org/lng/odp.git
 
 Package: odp-linux-bin
-Section: libdevel
+Section: devel
 Architecture: any
 Multi-Arch: allowed
 Depends: ${misc:Depends}, ${shlibs:Depends}
-- 
2.1.4

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


[lng-odp] [PATCH 01/11] pkg/debian/control: add graphviz to Build-Depends

2016-03-19 Thread Anders Roxell
Signed-off-by: Anders Roxell 
---
 pkg/debian/control | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pkg/debian/control b/pkg/debian/control
index 873070a..40b3842 100644
--- a/pkg/debian/control
+++ b/pkg/debian/control
@@ -3,7 +3,7 @@ Priority: optional
 Maintainer: Anders Roxell 
 Build-Depends: debhelper (>= 9), dh-autoreconf, libssl-dev, doxygen,
 imagemagick, libmagickcore-6.q16-2-extra | libmagickcore-extra,
-ghostscript, asciidoc, mscgen, texlive-latex-recommended
+ghostscript, asciidoc, mscgen, texlive-latex-recommended, graphviz
 Standards-Version: 3.9.6
 Section: libs
 Homepage: http://www.opendataplane.org/
-- 
2.1.4

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


[lng-odp] [API-NEXT PATCH 3/3] example: l2fwd_simple: use pktin_recv_tmo

2016-03-19 Thread Petri Savolainen
Use timeout version of the pktin recv call to reduce CPU
load when there are no packets available.

Signed-off-by: Petri Savolainen 
---
 example/l2fwd_simple/odp_l2fwd_simple.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/example/l2fwd_simple/odp_l2fwd_simple.c 
b/example/l2fwd_simple/odp_l2fwd_simple.c
index 11d342f..0bb923d 100644
--- a/example/l2fwd_simple/odp_l2fwd_simple.c
+++ b/example/l2fwd_simple/odp_l2fwd_simple.c
@@ -86,7 +86,9 @@ static void *run_worker(void *arg ODP_UNUSED)
printf("started all\n");
 
for (;;) {
-   pkts = odp_pktin_recv(global.if0in, pkt_tbl, MAX_PKT_BURST);
+   pkts = odp_pktin_recv_tmo(global.if0in, pkt_tbl, MAX_PKT_BURST,
+ ODP_PKTIN_WAIT);
+
if (odp_unlikely(pkts <= 0))
continue;
for (i = 0; i < pkts; i++) {
-- 
2.7.2

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


Re: [lng-odp] [PATCH] linux-generic: dpdk: add packet classification support

2016-03-19 Thread Maxim Uvarov

Merged,
Maxim.

On 03/18/16 13:44, Elo, Matias (Nokia - FI/Espoo) wrote:


Thanks,

Matias

*From:*EXT Bala Manoharan [mailto:bala.manoha...@linaro.org]
*Sent:* Friday, March 18, 2016 12:37 PM
*To:* Elo, Matias (Nokia - FI/Espoo) 
*Cc:* lng-odp@lists.linaro.org
*Subject:* Re: [lng-odp] [PATCH] linux-generic: dpdk: add packet 
classification support


Reviewed-by: Balasubramanian Manoharan >


On 18 March 2016 at 14:02, Elo, Matias (Nokia - FI/Espoo) 
mailto:matias@nokia.com>> wrote:


Ping.


> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org
] On Behalf Of EXT Matias
> Elo
> Sent: Friday, March 11, 2016 2:48 PM
> To: lng-odp@lists.linaro.org 
> Subject: [lng-odp] [PATCH] linux-generic: dpdk: add packet
classification support
>
> Add packet classification support using _odp_packet_cls_enq
> helper function.
>
> Signed-off-by: Matias Elo mailto:matias@nokia.com>>
> ---
>  platform/linux-generic/pktio/dpdk.c | 54
+--
> --
>  1 file changed, 31 insertions(+), 23 deletions(-)
>
> diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-
> generic/pktio/dpdk.c
> index a39e7dc..3b65d97 100644
> --- a/platform/linux-generic/pktio/dpdk.c
> +++ b/platform/linux-generic/pktio/dpdk.c
> @@ -554,6 +554,7 @@ static inline int mbuf_to_pkt(pktio_entry_t
*pktio_entry,
>   struct rte_mbuf *mbuf;
>   void *buf;
>   int i, j;
> + int nb_pkts = 0;
>
>   for (i = 0; i < num; i++) {
>   mbuf = mbuf_table[i];
> @@ -567,37 +568,44 @@ static inline int mbuf_to_pkt(pktio_entry_t
> *pktio_entry,
>
>   pkt_len = rte_pktmbuf_pkt_len(mbuf);
>
> - pkt = packet_alloc(pktio_entry->s.pkt_dpdk.pool,
pkt_len, 1);
> - if (pkt == ODP_PACKET_INVALID) {
> - ODP_ERR("packet_alloc failed\n");
> - goto fail;
> - }
> + if (pktio_cls_enabled(pktio_entry)) {
> + if (_odp_packet_cls_enq(pktio_entry,
> +(const uint8_t *)buf, pkt_len,
> +&pkt_table[nb_pkts]))
> + nb_pkts++;
> + } else {
> + pkt =
packet_alloc(pktio_entry->s.pkt_dpdk.pool,
> + pkt_len, 1);
> + if (pkt == ODP_PACKET_INVALID) {
> +  ODP_ERR("packet_alloc failed\n");
> + goto fail;
> + }
>
> - pkt_hdr = odp_packet_hdr(pkt);
> + pkt_hdr = odp_packet_hdr(pkt);
>
> - /* For now copy the data in the mbuf,
> -worry about zero-copy later */
> - if (odp_packet_copydata_in(pkt, 0, pkt_len, buf)
!= 0) {
> -  ODP_ERR("odp_packet_copydata_in failed\n");
> - odp_packet_free(pkt);
> - goto fail;
> - }
> + /* For now copy the data in the mbuf,
> +worry about zero-copy later */
> + if (odp_packet_copydata_in(pkt, 0,
pkt_len, buf) != 0) {
> +  ODP_ERR("odp_packet_copydata_in failed\n");
> +  odp_packet_free(pkt);
> + goto fail;
> + }
>
> - packet_parse_l2(pkt_hdr);
> +  packet_parse_l2(pkt_hdr);
>
> - pkt_hdr->input = pktio_entry->s.handle;
> + pkt_hdr->input = pktio_entry->s.handle;
>
> - if (mbuf->ol_flags & PKT_RX_RSS_HASH) {
> - pkt_hdr->has_hash = 1;
> - pkt_hdr->flow_hash = mbuf->hash.rss;
> - }
> -
> - pkt_table[i] = pkt;
> + if (mbuf->ol_flags & PKT_RX_RSS_HASH) {
> +  pkt_hdr->has_hash = 1;
> +  pkt_hdr->flow_hash = mbuf->hash.rss;
> + }
>
> + pkt_table[nb_pkts++] = pkt;
> + }
>   rte_pktmbuf_free(mbuf);
>   }
>
> - return i;
> + return nb_pkts;
>
>  fail:
>   ODP_ERR("Creating ODP packet failed\n");
> @@ -653,7 +661,7 @@ static int dpdk_recv_queue(pktio_entry_t
*pktio_entry,
>  {
>   pkt_dpdk_t *pkt_dpdk = &pktio_entry->s.pkt_dpdk;
>   pkt_cache_t *rx_cache = &pkt_dpdk->rx_cache[index];
> - uint16_t nb_rx;
> + int nb_rx;
>   struct rte_mbuf *rx_mbufs[num];
>   int i;
>   unsigned cache_idx;
> --
> 1.9.1
>
> ___
> lng-odp mailing list

Re: [lng-odp] [API-NEXT PATCH 1/2] api: sched: add schedule group info struct

2016-03-19 Thread Maxim Uvarov

Merged,
Maxim.

On 03/17/16 11:05, Savolainen, Petri (Nokia - FI/Espoo) wrote:


Ping.

*From:*EXT Bill Fischofer [mailto:bill.fischo...@linaro.org]
*Sent:* Wednesday, March 02, 2016 1:59 PM
*To:* Savolainen, Petri (Nokia - FI/Espoo) 
*Cc:* LNG ODP Mailman List 
*Subject:* Re: [lng-odp] [API-NEXT PATCH 1/2] api: sched: add schedule 
group info struct


For this series:

Reviewed-and-tested-by: Bill Fischofer >


On Wed, Mar 2, 2016 at 4:36 AM, Petri Savolainen 
mailto:petri.savolai...@nokia.com>> wrote:


Added info struct and call to enable request of schedule
group name among all other (potential new) parameters.
Currently, there are only two parameters: name and thrmask.
Thread mask call can be left as is, since it's suitable for
fast path usage.

Signed-off-by: Petri Savolainen mailto:petri.savolai...@nokia.com>>
---
 include/odp/api/spec/schedule.h | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/include/odp/api/spec/schedule.h
b/include/odp/api/spec/schedule.h
index 4ae681d..cd1325a 100644
--- a/include/odp/api/spec/schedule.h
+++ b/include/odp/api/spec/schedule.h
@@ -300,6 +300,32 @@ int
odp_schedule_group_thrmask(odp_schedule_group_t group,
   odp_thrmask_t *thrmask);

 /**
+ * Schedule group information
+ */
+typedef struct odp_schedule_group_info_t {
+   const char*name;   /**< Schedule group name */
+   odp_thrmask_t thrmask; /**< Thread mask of the schedule
group */
+} odp_schedule_group_info_t;
+
+/**
+ * Retrieve information about a schedule group
+ *
+ * Fills in schedule group information structure with current values.
+ * The call is not synchronized with calls modifying the schedule
group. So,
+ * the application should ensure that it does not simultaneously
modify and
+ * retrieve information about the same group with this call. The
call is not
+ * intended for fast path use. The info structure is written only
on success.
+ *
+ * @param  group   Schedule group handle
+ * @param[out] infoPointer to schedule group info struct for
output
+ *
+ * @retval  0 On success
+ * @retval <0 On failure
+ */
+int odp_schedule_group_info(odp_schedule_group_t group,
+   odp_schedule_group_info_t *info);
+
+/**
  * Acquire ordered context lock
  *
  * This call is valid only when holding an ordered
synchronization context.
--
2.7.2

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



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


Re: [lng-odp] [API-NEXT PATCH] api: pktio: add odp_pktin_recv_tmo

2016-03-19 Thread Savolainen, Petri (Nokia - FI/Espoo)
Usage and implementation are simpler without the wait parameter. I think it’s 
better to keep these two versions separate: one that never calls any system 
calls, and one that may use system calls to check time and sleep. The no_wait 
option is handy if application needs to swap between wait X nsec and no_wait.

-Petri


From: EXT Bala Manoharan [mailto:bala.manoha...@linaro.org]
Sent: Thursday, March 17, 2016 4:32 PM
To: Savolainen, Petri (Nokia - FI/Espoo) 
Cc: LNG ODP Mailman List 
Subject: Re: [lng-odp] [API-NEXT PATCH] api: pktio: add odp_pktin_recv_tmo

Hi,

odp_pktin_recv_tmo() function called with wait value equal to ODP_PKTIN_NO_WAIT 
is similar to odp_pktin_recv() function. Hence why cant we simply merge these 
two functions as a single one. odp_pktin_recv() functions looks redundant.

Regards,
Bala

On 17 March 2016 at 19:37, Petri Savolainen 
mailto:petri.savolai...@nokia.com>> wrote:
Added single queue recv function with timeout. In a simple
configuration each thread polls a single input queue. Timeout
version of single queue receive allows thread to sleep when
there are no packets. odp_pktin_recv_mq_tmo would be unnecessary
complex to use for single input queue.

Signed-off-by: Petri Savolainen 
mailto:petri.savolai...@nokia.com>>
---
 include/odp/api/spec/packet_io.h   | 36 ++---
 platform/linux-generic/odp_packet_io.c | 49 +-
 2 files changed, 81 insertions(+), 4 deletions(-)

diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h
index 6fe2cac..1860b31 100644
--- a/include/odp/api/spec/packet_io.h
+++ b/include/odp/api/spec/packet_io.h
@@ -522,8 +522,10 @@ odp_pktio_t odp_pktio_lookup(const char *name);
 /**
  * Receive packets directly from an interface input queue
  *
- * Receives up to 'num' packets from the pktio interface input queue. When
- * input queue parameter 'op_mode' has been set to ODP_PKTIO_OP_MT_UNSAFE,
+ * Receives up to 'num' packets from the pktio interface input queue. Returns
+ * the number of packets received.
+ *
+ * When input queue parameter 'op_mode' has been set to ODP_PKTIO_OP_MT_UNSAFE,
  * the operation is optimized for single thread operation per queue and the 
same
  * queue must not be accessed simultaneously from multiple threads.
  *
@@ -539,7 +541,35 @@ odp_pktio_t odp_pktio_lookup(const char *name);
 int odp_pktin_recv(odp_pktin_queue_t queue, odp_packet_t packets[], int num);

 /**
- * Receive packets directly from multiple interface input queues
+ * Receive packets directly from an interface input queue with timeout
+ *
+ * Receives up to 'num' packets from the pktio interface input queue. If there
+ * are no packets available, waits for packets depeding on 'wait' parameter
+ * value. Returns the number of packets received.
+ *
+ * When input queue parameter 'op_mode' has been set to ODP_PKTIO_OP_MT_UNSAFE,
+ * the operation is optimized for single thread operation per queue and the 
same
+ * queue must not be accessed simultaneously from multiple threads.
+ *
+ * @param  queue  Packet input queue handle for receiving packets
+ * @param[out] packets[]  Packet handle array for output of received packets
+ * @param  numMaximum number of packets to receive
+ * @param  wait   Wait time specified as as follows:
+ ** ODP_PKTIN_NO_WAIT: Do not wait
+ ** ODP_PKTIN_WAIT:Wait infinitely
+ ** Other values specify the minimum time to wait.
+ *  Use odp_pktin_wait_time() to convert nanoseconds
+ *  to a valid parameter value. Wait time may be
+ *  rounded up a small, platform specific amount.
+ *
+ * @return Number of packets received
+ * @retval <0 on failure
+ */
+int odp_pktin_recv_tmo(odp_pktin_queue_t queue, odp_packet_t packets[],
+  int num, uint64_t wait);
+
+/**
+ * Receive packets directly from multiple interface input queues with timeout
  *
  * Receives up to 'num' packets from one of the specified pktio interface input
  * queues. The index of the source queue is stored into 'from' output
diff --git a/platform/linux-generic/odp_packet_io.c 
b/platform/linux-generic/odp_packet_io.c
index aafb3d9..948baa8 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 
@@ -28,7 +29,12 @@
 #include 
 #include 

-#define SLEEP_NSEC 1000
+/* Sleep this many nanoseconds between pktin receive calls */
+#define SLEEP_NSEC  1000
+
+/* Check total sleep time about every SLEEP_CHECK * SLEEP_NSEC nanoseconds.
+ * Must be power of two. */
+#define SLEEP_CHECK 32

 pktio_table_t *pktio_tbl;

@@ -1387,6 +1393,47 @@ int odp_pktin_recv(odp_pktin_queue_t queue, odp_packet_t 
packets[], int num)
return single_recv_queue(entry, queue.index, packets, num);
 }

+int odp_pktin_r

[lng-odp] [Bug 2129] New: CID 158774 CID 158775: Error handling issues: odp_system_info.c:

2016-03-19 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2129

Bug ID: 2129
   Summary: CID 158774 CID 158775:  Error handling issues:
odp_system_info.c:
   Product: OpenDataPlane - linux- generic reference
   Version: 1.8
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: General ODP
  Assignee: lng-odp@lists.linaro.org
  Reporter: mike.hol...@linaro.org


*** CID 158775:  Error handling issues  (CHECKED_RETURN)
/platform/linux-generic/odp_system_info.c: 69 in systemcpu_cache_line_size()
63  /* File not found */
64  return 0;
65  }
66
67  if (fgets(str, sizeof(str), file) != NULL) {
68  /* Read cache line size */
>>> CID 158775:  Error handling issues  (CHECKED_RETURN)
>>> Calling "sscanf" without checking return value (as is done elsewhere 14 
>>> out of 17 times).
69  sscanf(str, "%i", &size);
70  }
71
72  fclose(file);
73
74  return size;

** CID 158774:  Error handling issues  (CHECKED_RETURN)
/platform/linux-generic/odp_system_info.c: 102 in huge_page_size()



*** CID 158774:  Error handling issues  (CHECKED_RETURN)
/platform/linux-generic/odp_system_info.c: 102 in huge_page_size()
96  ODP_ERR("%s not found\n", HUGE_PAGE_DIR);
97  return 0;
98  }
99
100 while ((dirent = readdir(dir)) != NULL) {
101 int temp = 0;
>>> CID 158774:  Error handling issues  (CHECKED_RETURN)
>>> Calling "sscanf" without checking return value (as is done elsewhere 14 
>>> out of 17 times).
102 sscanf(dirent->d_name, "hugepages-%i", &temp);
103
104 if (temp > size)
105 size = temp;
106 }
107

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


Re: [lng-odp] [PATCHv3] linux-generic:release memory during session destory

2016-03-19 Thread Maxim Uvarov
changes are ok, but patch should match code style. Please fix and add 
Bala's review to next version.


perl ./scripts/checkpatch.pl 
0001-linux-generic-release-memory-during-session-destory.patch

WARNING: 'destory' may be misspelled - perhaps 'destroy'?
#4:
Subject: [PATCH] linux-generic:release memory during session destory

ERROR: code indent should use tabs where possible
#20: FILE: platform/linux-generic/odp_crypto.c:707:
+if (generic->cipher.alg == ODP_CIPHER_ALG_AES128_GCM)$

WARNING: please, no spaces at the start of a line
#20: FILE: platform/linux-generic/odp_crypto.c:707:
+if (generic->cipher.alg == ODP_CIPHER_ALG_AES128_GCM)$

ERROR: code indent should use tabs where possible
#21: FILE: platform/linux-generic/odp_crypto.c:708:
+ ^IEVP_CIPHER_CTX_free(generic->cipher.data.aes_gcm.ctx);$

WARNING: please, no space before tabs
#21: FILE: platform/linux-generic/odp_crypto.c:708:
+ ^IEVP_CIPHER_CTX_free(generic->cipher.data.aes_gcm.ctx);$

WARNING: please, no spaces at the start of a line
#21: FILE: platform/linux-generic/odp_crypto.c:708:
+ ^IEVP_CIPHER_CTX_free(generic->cipher.data.aes_gcm.ctx);$

total: 2 errors, 4 warnings, 0 checks, 8 lines checked

Thank you,
Maxim.

On 03/16/16 16:22, Bala Manoharan wrote:
Reviewed-by: Balasubramanian Manoharan >


On 15 March 2016 at 18:39, balakrishna.garapati 
> wrote:


Signed-off-by: balakrishna.garapati
mailto:balakrishna.garap...@linaro.org>>
---
 platform/linux-generic/odp_crypto.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/platform/linux-generic/odp_crypto.c
b/platform/linux-generic/odp_crypto.c
index 08b479d..e468677 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -704,6 +704,8 @@ int
odp_crypto_session_destroy(odp_crypto_session_t session)
odp_crypto_generic_session_t *generic;

generic = (odp_crypto_generic_session_t *)(intptr_t)session;
+if (generic->cipher.alg == ODP_CIPHER_ALG_AES128_GCM)
+  EVP_CIPHER_CTX_free(generic->cipher.data.aes_gcm.ctx);
memset(generic, 0, sizeof(*generic));
free_session(generic);
return 0;
--
1.9.1




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


[lng-odp] [Bug 1547] Untested API copy_md_to_packet

2016-03-19 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=1547

Mike Holmes  changed:

   What|Removed |Added

   Assignee|alexandru.badicioiu@linaro. |balakrishna.garapati@linaro
   |org |.org

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


[lng-odp] [PATCH] test: l2fwd: change destination mac addresses by default

2016-03-19 Thread Matias Elo
With the previous default settings only the source addresses
of forwarded packets were changed. This caused forwarded
packets' destination and source addresses being the same
when only one interface was used. Fix this by changing the
destination mac addresses by default. This change has
negligible effect to throughput performance.

Signed-off-by: Matias Elo 
---
 test/performance/odp_l2fwd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c
index 216e6c6..77ea5e9 100644
--- a/test/performance/odp_l2fwd.c
+++ b/test/performance/odp_l2fwd.c
@@ -1019,8 +1019,8 @@ static void usage(char *progname)
   "  -t, --time   Time in seconds to run.\n"
   "  -a, --accuracy  Time in seconds get print 
statistics\n"
   "  (default is 1 second).\n"
-  "  -d, --dst_change  0: Don't change packets' dst eth addresses 
(default)\n"
-  "1: Change packets' dst eth addresses\n"
+  "  -d, --dst_change  0: Don't change packets' dst eth 
addresses\n"
+  "1: Change packets' dst eth addresses 
(default)\n"
   "  -s, --src_change  0: Don't change packets' src eth 
addresses\n"
   "1: Change packets' src eth addresses 
(default)\n"
   "  -r, --dst_addrDestination addresses (comma-separated, no 
spaces)\n"
@@ -1068,6 +1068,7 @@ static void parse_args(int argc, char *argv[], 
appl_args_t *appl_args)
 
appl_args->time = 0; /* loop forever if time to run is 0 */
appl_args->accuracy = 1; /* get and print pps stats second */
+   appl_args->dst_change = 1; /* change eth dst address by default */
appl_args->src_change = 1; /* change eth src address by default */
appl_args->error_check = 0; /* don't check packet errors by default */
 
-- 
1.9.1

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


[lng-odp] [Bug 2090] example/timer/odp_timer_test.c

2016-03-19 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2090

Mike Holmes  changed:

   What|Removed |Added

 Status|UNCONFIRMED |CONFIRMED
 Ever confirmed|0   |1

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


[lng-odp] [API-NEXT PATCH 2/3] linux-generic: pktio: fix pktin_recv_mq_tmo wait time drift

2016-03-19 Thread Petri Savolainen
Aligned pktin_recv_mq_tmo and pktin_recv_tmo implementations.
Original mq_tmo implementation drifts wait time since the
nanosleep takes longer than one microsecond.

Signed-off-by: Petri Savolainen 
Suggested-by: Juha-Matti Tilli 
---
 platform/linux-generic/odp_packet_io.c | 30 ++
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/platform/linux-generic/odp_packet_io.c 
b/platform/linux-generic/odp_packet_io.c
index bf6e923..88f2092 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -1446,7 +1446,9 @@ int odp_pktin_recv_mq_tmo(const odp_pktin_queue_t 
queues[], unsigned num_q,
 {
unsigned i;
int ret;
+   odp_time_t t1, t2;
struct timespec ts;
+   int started = 0;
 
ts.tv_sec  = 0;
ts.tv_nsec = SLEEP_NSEC;
@@ -1455,22 +1457,34 @@ int odp_pktin_recv_mq_tmo(const odp_pktin_queue_t 
queues[], unsigned num_q,
for (i = 0; i < num_q; i++) {
ret = odp_pktin_recv(queues[i], packets, num);
 
-   if (ret > 0) {
-   if (from)
-   *from = i;
+   if (ret > 0 && from)
+   *from = i;
 
+   if (ret != 0)
return ret;
-   }
-
-   if (ret < 0)
-   return -1;
}
 
if (wait == 0)
return 0;
 
-   if (wait != ODP_PKTIN_WAIT)
+   if (wait != ODP_PKTIN_WAIT) {
+   if (odp_unlikely(!started)) {
+   odp_time_t t;
+
+   t = odp_time_local_from_ns(wait * SLEEP_NSEC);
+   started = 1;
+   t1 = odp_time_sum(odp_time_local(), t);
+   }
+
+   if ((wait & (SLEEP_CHECK - 1)) == 0) {
+   t2 = odp_time_local();
+
+   if (odp_time_cmp(t2, t1) > 0)
+   return 0;
+   }
+
wait--;
+   }
 
nanosleep(&ts, NULL);
}
-- 
2.7.2

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


[lng-odp] [API-NEXT PATCH] api: pktio: add odp_pktin_recv_tmo

2016-03-19 Thread Petri Savolainen
Added single queue recv function with timeout. In a simple
configuration each thread polls a single input queue. Timeout
version of single queue receive allows thread to sleep when
there are no packets. odp_pktin_recv_mq_tmo would be unnecessary
complex to use for single input queue.

Signed-off-by: Petri Savolainen 
---
 include/odp/api/spec/packet_io.h   | 36 ++---
 platform/linux-generic/odp_packet_io.c | 49 +-
 2 files changed, 81 insertions(+), 4 deletions(-)

diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h
index 6fe2cac..1860b31 100644
--- a/include/odp/api/spec/packet_io.h
+++ b/include/odp/api/spec/packet_io.h
@@ -522,8 +522,10 @@ odp_pktio_t odp_pktio_lookup(const char *name);
 /**
  * Receive packets directly from an interface input queue
  *
- * Receives up to 'num' packets from the pktio interface input queue. When
- * input queue parameter 'op_mode' has been set to ODP_PKTIO_OP_MT_UNSAFE,
+ * Receives up to 'num' packets from the pktio interface input queue. Returns
+ * the number of packets received.
+ *
+ * When input queue parameter 'op_mode' has been set to ODP_PKTIO_OP_MT_UNSAFE,
  * the operation is optimized for single thread operation per queue and the 
same
  * queue must not be accessed simultaneously from multiple threads.
  *
@@ -539,7 +541,35 @@ odp_pktio_t odp_pktio_lookup(const char *name);
 int odp_pktin_recv(odp_pktin_queue_t queue, odp_packet_t packets[], int num);
 
 /**
- * Receive packets directly from multiple interface input queues
+ * Receive packets directly from an interface input queue with timeout
+ *
+ * Receives up to 'num' packets from the pktio interface input queue. If there
+ * are no packets available, waits for packets depeding on 'wait' parameter
+ * value. Returns the number of packets received.
+ *
+ * When input queue parameter 'op_mode' has been set to ODP_PKTIO_OP_MT_UNSAFE,
+ * the operation is optimized for single thread operation per queue and the 
same
+ * queue must not be accessed simultaneously from multiple threads.
+ *
+ * @param  queue  Packet input queue handle for receiving packets
+ * @param[out] packets[]  Packet handle array for output of received packets
+ * @param  numMaximum number of packets to receive
+ * @param  wait   Wait time specified as as follows:
+ ** ODP_PKTIN_NO_WAIT: Do not wait
+ ** ODP_PKTIN_WAIT:Wait infinitely
+ ** Other values specify the minimum time to wait.
+ *  Use odp_pktin_wait_time() to convert nanoseconds
+ *  to a valid parameter value. Wait time may be
+ *  rounded up a small, platform specific amount.
+ *
+ * @return Number of packets received
+ * @retval <0 on failure
+ */
+int odp_pktin_recv_tmo(odp_pktin_queue_t queue, odp_packet_t packets[],
+  int num, uint64_t wait);
+
+/**
+ * Receive packets directly from multiple interface input queues with timeout
  *
  * Receives up to 'num' packets from one of the specified pktio interface input
  * queues. The index of the source queue is stored into 'from' output
diff --git a/platform/linux-generic/odp_packet_io.c 
b/platform/linux-generic/odp_packet_io.c
index aafb3d9..948baa8 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -28,7 +29,12 @@
 #include 
 #include 
 
-#define SLEEP_NSEC 1000
+/* Sleep this many nanoseconds between pktin receive calls */
+#define SLEEP_NSEC  1000
+
+/* Check total sleep time about every SLEEP_CHECK * SLEEP_NSEC nanoseconds.
+ * Must be power of two. */
+#define SLEEP_CHECK 32
 
 pktio_table_t *pktio_tbl;
 
@@ -1387,6 +1393,47 @@ int odp_pktin_recv(odp_pktin_queue_t queue, odp_packet_t 
packets[], int num)
return single_recv_queue(entry, queue.index, packets, num);
 }
 
+int odp_pktin_recv_tmo(odp_pktin_queue_t queue, odp_packet_t packets[], int 
num,
+  uint64_t wait)
+{
+   int ret;
+   odp_time_t t1, t2;
+   struct timespec ts;
+
+   if (wait != ODP_PKTIN_WAIT) {
+   ts.tv_sec  = 0;
+   ts.tv_nsec = SLEEP_NSEC;
+
+   t1 = odp_time_sum(odp_time_local(),
+ odp_time_local_from_ns(wait * SLEEP_NSEC));
+   }
+
+   while (1) {
+   ret = odp_pktin_recv(queue, packets, num);
+
+   if (ret != 0)
+   return ret;
+
+   if (wait == 0)
+   return 0;
+
+   if (wait != ODP_PKTIN_WAIT) {
+   wait--;
+
+   /* check every SLEEP_CHECK rounds if total wait time
+* has been exceeded. */
+   if ((wait & SLEEP_CHECK) == 0) {
+   

[lng-odp] [PATCH v2 1/2] linux-generic: packet_flags: use accessors to modify eth and l2 flag

2016-03-19 Thread Zoltan Kiss
This makes it possible for other implementations like ODP-DPDK to reuse
classification code while using a different packet API.

Signed-off-by: Zoltan Kiss 
---
 platform/linux-generic/include/odp_classification_inlines.h |  2 +-
 platform/linux-generic/include/odp_packet_internal.h| 10 ++
 platform/linux-generic/odp_classification.c |  4 ++--
 3 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/platform/linux-generic/include/odp_classification_inlines.h 
b/platform/linux-generic/include/odp_classification_inlines.h
index 8bd010d..bac5b48 100644
--- a/platform/linux-generic/include/odp_classification_inlines.h
+++ b/platform/linux-generic/include/odp_classification_inlines.h
@@ -162,7 +162,7 @@ static inline int verify_pmr_dmac(const uint8_t *pkt_addr,
uint64_t dmac_be = 0;
const odph_ethhdr_t *eth;
 
-   if (!pkt_hdr->input_flags.eth)
+   if (!packet_hdr_has_eth(pkt_hdr))
return 0;
 
eth = (const odph_ethhdr_t *)(pkt_addr + pkt_hdr->l2_offset);
diff --git a/platform/linux-generic/include/odp_packet_internal.h 
b/platform/linux-generic/include/odp_packet_internal.h
index b632ece..7974a20 100644
--- a/platform/linux-generic/include/odp_packet_internal.h
+++ b/platform/linux-generic/include/odp_packet_internal.h
@@ -267,6 +267,16 @@ odp_buffer_t _odp_packet_to_buffer(odp_packet_t pkt);
 /* Convert a buffer handle to a packet handle */
 odp_packet_t _odp_packet_from_buffer(odp_buffer_t buf);
 
+static inline int packet_hdr_has_l2(odp_packet_hdr_t *pkt_hdr)
+{
+   return pkt_hdr->input_flags.l2;
+}
+
+static inline int packet_hdr_has_eth(odp_packet_hdr_t *pkt_hdr)
+{
+   return pkt_hdr->input_flags.eth;
+}
+
 int _odp_parse_common(odp_packet_hdr_t *pkt_hdr, const uint8_t *parseptr);
 
 int _odp_cls_parse(odp_packet_hdr_t *pkt_hdr, const uint8_t *parseptr);
diff --git a/platform/linux-generic/odp_classification.c 
b/platform/linux-generic/odp_classification.c
index 6c9f7c1..f5e4673 100644
--- a/platform/linux-generic/odp_classification.c
+++ b/platform/linux-generic/odp_classification.c
@@ -843,8 +843,8 @@ cos_t *match_qos_l2_cos(pmr_l2_cos_t *l2_cos, const uint8_t 
*pkt_addr,
const odph_vlanhdr_t *vlan;
uint16_t qos;
 
-   if (hdr->input_flags.l2 && hdr->input_flags.vlan &&
-   hdr->input_flags.eth) {
+   if (packet_hdr_has_l2(hdr) && hdr->input_flags.vlan &&
+   packet_hdr_has_eth(hdr)) {
eth = (const odph_ethhdr_t *)(pkt_addr + hdr->l2_offset);
vlan = (const odph_vlanhdr_t *)(ð->type);
qos = odp_be_to_cpu_16(vlan->tci);
-- 
1.9.1

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


Re: [lng-odp] [API-NEXT PATCH 1/2] api: sched: add schedule group info struct

2016-03-19 Thread Savolainen, Petri (Nokia - FI/Espoo)
Ping.



From: EXT Bill Fischofer [mailto:bill.fischo...@linaro.org]
Sent: Wednesday, March 02, 2016 1:59 PM
To: Savolainen, Petri (Nokia - FI/Espoo) 
Cc: LNG ODP Mailman List 
Subject: Re: [lng-odp] [API-NEXT PATCH 1/2] api: sched: add schedule group info 
struct

For this series:

Reviewed-and-tested-by: Bill Fischofer 
mailto:bill.fischo...@linaro.org>>

On Wed, Mar 2, 2016 at 4:36 AM, Petri Savolainen 
mailto:petri.savolai...@nokia.com>> wrote:
Added info struct and call to enable request of schedule
group name among all other (potential new) parameters.
Currently, there are only two parameters: name and thrmask.
Thread mask call can be left as is, since it's suitable for
fast path usage.

Signed-off-by: Petri Savolainen 
mailto:petri.savolai...@nokia.com>>
---
 include/odp/api/spec/schedule.h | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h
index 4ae681d..cd1325a 100644
--- a/include/odp/api/spec/schedule.h
+++ b/include/odp/api/spec/schedule.h
@@ -300,6 +300,32 @@ int odp_schedule_group_thrmask(odp_schedule_group_t group,
   odp_thrmask_t *thrmask);

 /**
+ * Schedule group information
+ */
+typedef struct odp_schedule_group_info_t {
+   const char*name;   /**< Schedule group name */
+   odp_thrmask_t thrmask; /**< Thread mask of the schedule group */
+} odp_schedule_group_info_t;
+
+/**
+ * Retrieve information about a schedule group
+ *
+ * Fills in schedule group information structure with current values.
+ * The call is not synchronized with calls modifying the schedule group. So,
+ * the application should ensure that it does not simultaneously modify and
+ * retrieve information about the same group with this call. The call is not
+ * intended for fast path use. The info structure is written only on success.
+ *
+ * @param  group   Schedule group handle
+ * @param[out] infoPointer to schedule group info struct for output
+ *
+ * @retval  0 On success
+ * @retval <0 On failure
+ */
+int odp_schedule_group_info(odp_schedule_group_t group,
+   odp_schedule_group_info_t *info);
+
+/**
  * Acquire ordered context lock
  *
  * This call is valid only when holding an ordered synchronization context.
--
2.7.2

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

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


Re: [lng-odp] [PATCH 1/3] linux-generic: netmap: handle case where all rx/tx rings cannot be stored

2016-03-19 Thread Elo, Matias (Nokia - FI/Espoo)
Ping.

> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT 
> Matias
> Elo
> Sent: Wednesday, March 09, 2016 8:38 AM
> To: lng-odp@lists.linaro.org
> Subject: [lng-odp] [PATCH 1/3] linux-generic: netmap: handle case where all 
> rx/tx
> rings cannot be stored
> 
> Don't fail netmap_open() if all netmap rx/tx rings cannot be
> stored. Instead, adjust capa.max_intput_queues /
> capa.max_output_values accordingly.
> 
> Signed-off-by: Matias Elo 
> ---
>  platform/linux-generic/pktio/netmap.c | 33 +
>  1 file changed, 17 insertions(+), 16 deletions(-)
> 
> diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-
> generic/pktio/netmap.c
> index 6feeb3b..bca2aaf 100644
> --- a/platform/linux-generic/pktio/netmap.c
> +++ b/platform/linux-generic/pktio/netmap.c
> @@ -325,27 +325,28 @@ static int netmap_open(odp_pktio_t id ODP_UNUSED,
> pktio_entry_t *pktio_entry,
>   ODP_ERR("nm_open(%s) failed\n", pkt_nm->nm_name);
>   goto error;
>   }
> - if (desc->nifp->ni_rx_rings > NM_MAX_DESC) {
> - ODP_ERR("Unable to store all %" PRIu32 " rx rings (max %d)\n",
> - desc->nifp->ni_rx_rings, NM_MAX_DESC);
> - nm_close(desc);
> - goto error;
> - }
>   pkt_nm->num_rx_rings = desc->nifp->ni_rx_rings;
>   pkt_nm->capa.max_input_queues = PKTIO_MAX_QUEUES;
> - if (desc->nifp->ni_rx_rings < PKTIO_MAX_QUEUES)
> - pkt_nm->capa.max_input_queues = desc->nifp->ni_rx_rings;
> -
> - if (desc->nifp->ni_tx_rings > NM_MAX_DESC) {
> - ODP_ERR("Unable to store all %" PRIu32 " tx rings (max %d)\n",
> - desc->nifp->ni_tx_rings, NM_MAX_DESC);
> - nm_close(desc);
> - goto error;
> + if (pkt_nm->num_rx_rings < PKTIO_MAX_QUEUES)
> + pkt_nm->capa.max_input_queues = pkt_nm->num_rx_rings;
> + if (pkt_nm->capa.max_input_queues > NM_MAX_DESC) {
> + /* Have to use a single descriptor to fetch packets from all
> +  * netmap rings */
> + pkt_nm->capa.max_input_queues = 1;
> + ODP_DBG("Unable to store all %" PRIu32 " rx rings (max %d)\n"
> + "  max input queues: %u\n", pkt_nm->num_rx_rings,
> + NM_MAX_DESC, pkt_nm->capa.max_input_queues);
>   }
>   pkt_nm->num_tx_rings = desc->nifp->ni_tx_rings;
>   pkt_nm->capa.max_output_queues = PKTIO_MAX_QUEUES;
> - if (desc->nifp->ni_tx_rings < PKTIO_MAX_QUEUES)
> - pkt_nm->capa.max_output_queues = desc->nifp->ni_tx_rings;
> + if (pkt_nm->num_tx_rings < PKTIO_MAX_QUEUES)
> + pkt_nm->capa.max_output_queues = pkt_nm->num_tx_rings;
> + if (pkt_nm->capa.max_output_queues > NM_MAX_DESC) {
> + pkt_nm->capa.max_output_queues = NM_MAX_DESC;
> + ODP_DBG("Unable to store all %" PRIu32 " tx rings (max %d)\n"
> + "  max output queues: %u\n", pkt_nm->num_tx_rings,
> + NM_MAX_DESC, pkt_nm->capa.max_output_queues);
> + }
> 
>   pkt_nm->capa.set_op.op.promisc_mode = 1;
> 
> --
> 1.9.1
> 
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] test: l2fwd: change destination mac addresses by default

2016-03-19 Thread Maxim Uvarov

Merged,
Maxim.

On 03/17/16 11:18, Savolainen, Petri (Nokia - FI/Espoo) wrote:

Reviewed-by: Petri Savolainen 

We saw a NIC to drop all outgoing packets which have the NIC MAC address as the 
destination address (which is the right thing to do). This change avoids that 
to happen (by default).

-Petri



-Original Message-
From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT
Matias Elo
Sent: Thursday, March 17, 2016 9:00 AM
To: lng-odp@lists.linaro.org
Subject: [lng-odp] [PATCH] test: l2fwd: change destination mac addresses
by default

With the previous default settings only the source addresses
of forwarded packets were changed. This caused forwarded
packets' destination and source addresses being the same
when only one interface was used. Fix this by changing the
destination mac addresses by default. This change has
negligible effect to throughput performance.

Signed-off-by: Matias Elo 
---
  test/performance/odp_l2fwd.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c
index 216e6c6..77ea5e9 100644
--- a/test/performance/odp_l2fwd.c
+++ b/test/performance/odp_l2fwd.c
@@ -1019,8 +1019,8 @@ static void usage(char *progname)
   "  -t, --time   Time in seconds to run.\n"
   "  -a, --accuracy  Time in seconds get print
statistics\n"
   "  (default is 1 second).\n"
-  "  -d, --dst_change  0: Don't change packets' dst eth
addresses (default)\n"
-  "1: Change packets' dst eth addresses\n"
+  "  -d, --dst_change  0: Don't change packets' dst eth
addresses\n"
+  "1: Change packets' dst eth addresses
(default)\n"
   "  -s, --src_change  0: Don't change packets' src eth
addresses\n"
   "1: Change packets' src eth addresses
(default)\n"
   "  -r, --dst_addrDestination addresses (comma-separated,
no spaces)\n"
@@ -1068,6 +1068,7 @@ static void parse_args(int argc, char *argv[],
appl_args_t *appl_args)

appl_args->time = 0; /* loop forever if time to run is 0 */
appl_args->accuracy = 1; /* get and print pps stats second */
+   appl_args->dst_change = 1; /* change eth dst address by default */
appl_args->src_change = 1; /* change eth src address by default */
appl_args->error_check = 0; /* don't check packet errors by default
*/

--
1.9.1

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

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


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


[lng-odp] [Bug 2120] CID 158534: Memory - illegal accesses odp_traffic_mngr.c

2016-03-19 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2120

Mike Holmes  changed:

   What|Removed |Added

   Assignee|lng-odp@lists.linaro.org|bill.fischo...@linaro.org

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


[lng-odp] [PATCHv2] scripts: add builddpdk

2016-03-19 Thread Maxim Uvarov
Add script to quickly build odp with dpdk pktio support.

Signed-off-by: Maxim Uvarov 
---
 v2: - make target pass thought env;
 - use vars in 2 more palaces
 - use pushd/popd

 .gitignore|  1 +
 scripts/builddpdk | 26 ++
 2 files changed, 27 insertions(+)
 create mode 100755 scripts/builddpdk

diff --git a/.gitignore b/.gitignore
index b4c146b..4945d25 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,6 +31,7 @@ core
 cscope.out
 depcomp
 doc/output
+dpdk/
 install-sh
 lib/
 libtool
diff --git a/scripts/builddpdk b/scripts/builddpdk
new file mode 100755
index 000..bcc00b0
--- /dev/null
+++ b/scripts/builddpdk
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+TARGET=${TARGET:-"x86_64-native-linuxapp-gcc"}
+
+git clone http://dpdk.org/git/dpdk dpdk
+pushd dpdk
+git checkout -b bv2.2.0 v2.2.0
+
+#Make and edit DPDK configuration
+make config T=${TARGET} O=${TARGET}
+pushd x86_64-native-linuxapp-gcc
+sed -ri 's,(CONFIG_RTE_BUILD_COMBINE_LIBS=).*,\1y,' .config
+#To use I/O without DPDK supported NIC's enable pcap pmd:
+sed -ri 's,(CONFIG_RTE_LIBRTE_PMD_PCAP=).*,\1y,' .config
+popd
+
+#Build DPDK
+make install T=${TARGET} EXTRA_CFLAGS="-fPIC"
+popd
+
+#Build ODP
+./bootstrap;
+./configure  --enable-test-vald  --enable-test-perf --enable-test-cpp \
+--enable-debug --enable-debug-print \
+--with-dpdk-path=`pwd`/dpdk/${TARGET}
+make
-- 
2.7.1.250.gff4ea60

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


Re: [lng-odp] Questions about ODP installation

2016-03-19 Thread Mike Holmes
On 15 March 2016 at 11:41, Tilli, Juha-Matti (Nokia - FI/Espoo) <
juha-matti.ti...@nokia.com> wrote:

> Hello,
>
> Now that ODP contains most of the previously missing features I’ve wanted
> and I’ve learned how to use it, I’m about to take ODP into use in my
> application. I installed it to a custom prefix and noticed several
> interesting things:
>
> 1) The bin/ directory contains binaries correctly named with the odp_
> prefix. However, it also contains binaries that don’t have the odp_ prefix
> and have so common name that there is great danger of them conflicting with
> other installed packages in case ODP is installed to /usr/local. For
> example: chksum, parse, process, table, thread. Surely, somebody else has
> thought of those names too and have decided to use them!
>

Agree, do you have a patch to correctly prefix them ?


> 2) Many binaries installed in the bin/ directory seem to be statically
> linked. While this means that they can be executed without LD_LIBRARY_PATH
> environment variable (or an equivalent solution such as
> -Wl,-rpath,$PREFIX/lib) in case the user installed to somewhere else than
> /usr/local, it also means that the binaries use more disk space than they
> should. odp_l2fwd seems to be an exception: it is dynamically linked (and
> it is linked with rpath because it runs without LD_LIBRARY_PATH).
>
>

The dynamic case needs a compile time option adding to strip the static
inline from the odp-linux implementation or the binaries really are not
dynamic, and you must use the lib with matching headers it was compiled
with. Very happy to take a patch to fix this, it has been on the list for a
while.


> My question is: are (1) and (2) intentional? Should all binaries instead
> be named with odp_ prefix and all binaries be dynamically linked? If the
> binaries are dynamically linked, should -Wl,-rpath,$PREFIX/lib be used
> during linking them to make them run without LD_LIBRARY_PATH?
>
> At least I’m planning to link my custom application dynamically and am
> planning to use -Wl,-rpath during linking so that it starts properly if a
> non-standard prefix is used for ODP. I don’t use autotools, libtool and
> other such monstrosities in my software so I have at least the freedom to
> decide all arguments given to the linker.
>
> An interesting observation too is that all binaries are installed,
> including binaries from the example/ directory. Not sure if this is a good
> thing or a bad thing.
>
> Another interesting observation is that libodp.so.107.0.0 is 1.3
> megabytes. Comparison: libc is 1.7 megabytes on my system. Is ODP really
> that big?
>

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


-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org  *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] Accesing hardware time stamps

2016-03-19 Thread Ivan Khoronzhuk



On 18.03.16 10:50, Savolainen, Petri (Nokia - FI/Espoo) wrote:

Hi,

Not yet, but going to do that soon. Do you need also an API for reading 
(sampling) the packet input HW timestamp from the interface?

For example, rte_eth_timesync_read_rx_timestamp does that. I was going to add 
(first) only ability to the read timestamp stored in the received packet,
 timestamp frequency and a configuration option to enable/disable timestamping 
per interface (during pktio open).
 We have odp_time_ and odp_cpu_cycle APIs to read wall clock time and CPU cycle 
counters. More adcanced packet input clock (or IEEE 1588 clock) features could 
added later on.

Yep, but odp_time API covers different h/w counter then timestamps of incoming 
packets.
Not sure if enabale/disable API is needed. The packet timestamps don't consume 
CPU time
in normal circumstances and they are present or not. If h/w doesn't support 
timestamping
then it can be emulated with odp_time_*, but it's rather an exception then rule.
It should be warned that packet time stamp is not comparable with time API 
types.
And one though, maybe it can be used with time API as a different time 
typedislike
it, as time API can consume more cycles after that, but it's possible.



-Petri

*From:*EXT Dominic Pigott [mailto:d...@intelligentcompute.com]
*Sent:* Thursday, March 17, 2016 4:39 PM
*To:* Savolainen, Petri (Nokia - FI/Espoo) 
*Cc:* lng-odp 
*Subject:* Re: Accesing hardware time stamps

Hi Petri

Thanks for the answer, did you have any time to look at this further? Most 
modern NICs can generate the timestamps in hardware so the overhead should be 
low, but its vendor specific. DPDK implements a standard API in  2.1 I believe:

http://dpdk.org/doc/guides/rel_notes/release_2_1.html?highlight=timestamp

Regards

Dom

--

*From: *"Savolainen, Petri (Nokia - FI/Espoo)" mailto:petri.savolai...@nokia.com>>
*To: *"EXT Dominic Pigott" mailto:d...@intelligentcompute.com>>, 
"lng-odp" mailto:lng-odp@lists.linaro.org>>
*Sent: *Friday, 11 March, 2016 05:13:52
*Subject: *RE: Accesing hardware time stamps

Hi,

There’s not yet packet time stamping, but I’m thinking to add a 64 bit time 
stamp into packet metadata and have a packet input configuration option to 
enable/disable timestamping, since it may take lots of CPU cycles to timestamp 
every packet (also when application would not need it).

I’ll look into it more detail at next week.

-Petri

*From:*lng-odp [mailto:lng-odp-boun...@lists.linaro.org] *On Behalf Of *EXT 
Dominic Pigott
*Sent:* Thursday, March 10, 2016 1:08 PM
*To:* lng-odp@lists.linaro.org 
*Subject:* [lng-odp] Accesing hardware time stamps

Hi,

I cannot find in the documentation, but is it possible to access a packets 
hardware time stamp via the ODP API?

Regards

Dom



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



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


[lng-odp] Change in lng/odp[master]: validation: timer: don't access non-existing timers

2016-03-19 Thread lava-bot (Code Review)
lava-bot has posted comments on this change.

Change subject: validation: timer: don't access non-existing timers
..


Patch Set 1: Code-Review-1

"Build Failed 

https://ci.linaro.org/jenkins/job/odp-api-check-gerrit/3/ : [OUTPUT]:"

-- 
To view, visit https://review.linaro.org/10969
To unsubscribe, visit https://review.linaro.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3648cb7c2b7af91276f8aa4d06ee0f26e3236e7d
Gerrit-PatchSet: 1
Gerrit-Project: lng/odp
Gerrit-Branch: master
Gerrit-Owner: Maxim Uvarov 
Gerrit-Reviewer: lava-bot 
Gerrit-HasComments: No
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [Bug 2102] make distcheck does not inherit original options

2016-03-19 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2102

Mike Holmes  changed:

   What|Removed |Added

 CC||mike.hol...@linaro.org
 Status|UNCONFIRMED |CONFIRMED
 Ever confirmed|0   |1

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


Re: [lng-odp] [API-NEXT PATCHv2 4/4] api: spinlock: change rc for spinlock_trylock to match other trylock APIs

2016-03-19 Thread Savolainen, Petri (Nokia - FI/Espoo)
Reviewed-by: Petri Savolainen 


> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT
> Bill Fischofer
> Sent: Saturday, March 05, 2016 10:11 PM
> To: lng-odp@lists.linaro.org
> Subject: [lng-odp] [API-NEXT PATCHv2 4/4] api: spinlock: change rc for
> spinlock_trylock to match other trylock APIs
> 
> Signed-off-by: Bill Fischofer 
> ---
>  include/odp/api/spec/spinlock.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/odp/api/spec/spinlock.h
> b/include/odp/api/spec/spinlock.h
> index 154d025..a73359d 100644
> --- a/include/odp/api/spec/spinlock.h
> +++ b/include/odp/api/spec/spinlock.h
> @@ -54,8 +54,8 @@ void odp_spinlock_lock(odp_spinlock_t *splock);
>   *
>   * @param splock Pointer to a spin lock
>   *
> - * @retval 1 lock acquired
> - * @retval 0 lock not acquired
> + * @retval  0 lock not acquired
> + * @retval !0 lock acquired
>   */
>  int odp_spinlock_trylock(odp_spinlock_t *splock);
> 
> --
> 2.5.0
> 
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCHv4] linux-generic:release memory during session destroy

2016-03-19 Thread Maxim Uvarov

Merged

On 03/18/16 12:33, balakrishna.garapati wrote:

v2:Added the whitespace after if.
v3:link to the bug that this patch resolves.
https://bugs.linaro.org/show_bug.cgi?id=2127
v4:formating fixes


this changes has to be


Signed-off-by: balakrishna.garapati 
Reviewed-by: Balasubramanian Manoharan 
---


here. I.e. under ---. In that case git am will skip that lines from 
final patch.


Maxim.


  platform/linux-generic/odp_crypto.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/platform/linux-generic/odp_crypto.c 
b/platform/linux-generic/odp_crypto.c
index 08b479d..7448575 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -704,6 +704,8 @@ int odp_crypto_session_destroy(odp_crypto_session_t session)
odp_crypto_generic_session_t *generic;

generic = (odp_crypto_generic_session_t *)(intptr_t)session;
+   if (generic->cipher.alg == ODP_CIPHER_ALG_AES128_GCM)
+   EVP_CIPHER_CTX_free(generic->cipher.data.aes_gcm.ctx);
memset(generic, 0, sizeof(*generic));
free_session(generic);
return 0;
--
1.9.1



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


Re: [lng-odp] [PATCHv2] scripts: add builddpdk

2016-03-19 Thread Mike Holmes
On 18 March 2016 at 10:47, Maxim Uvarov  wrote:

> On 03/18/16 17:25, Mike Holmes wrote:
>
>>
>>
>> On 18 March 2016 at 10:16, Maxim Uvarov > maxim.uva...@linaro.org>> wrote:
>>
>> Add script to quickly build odp with dpdk pktio support.
>>
>> Signed-off-by: Maxim Uvarov > >
>> ---
>>  v2: - make target pass thought env;
>>  - use vars in 2 more palaces
>>  - use pushd/popd
>>
>>  .gitignore|  1 +
>>  scripts/builddpdk | 26 ++
>>  2 files changed, 27 insertions(+)
>>  create mode 100755 scripts/builddpdk
>>
>> diff --git a/.gitignore b/.gitignore
>> index b4c146b..4945d25 100644
>> --- a/.gitignore
>> +++ b/.gitignore
>> @@ -31,6 +31,7 @@ core
>>  cscope.out
>>  depcomp
>>  doc/output
>> +dpdk/
>>  install-sh
>>  lib/
>>  libtool
>> diff --git a/scripts/builddpdk b/scripts/builddpdk
>>
>>
>> This is going to get confused with odp-dpdk, name it something like
>> builddpdkpktio, we also need to put in clear documentation in this script
>> on how it is related to odp-dpdk and refer people to the full odp-dpdk.
>>
>
> I want to do the same script for netmap.
> How about that names?:
>
> scripts/build-pktio-dpdk
> scripts/build-pktio-netmap
>

I think that is better for the names, and we need to well document in the
readme as well as these scripts what it means to build in this way.


>
> Maxim
>
>>
>> new file mode 100755
>> index 000..bcc00b0
>> --- /dev/null
>> +++ b/scripts/builddpdk
>> @@ -0,0 +1,26 @@
>> +#!/bin/bash
>> +
>> +TARGET=${TARGET:-"x86_64-native-linuxapp-gcc"}
>> +
>> +git clone http://dpdk.org/git/dpdk dpdk
>> +pushd dpdk
>> +git checkout -b bv2.2.0 v2.2.0
>> +
>> +#Make and edit DPDK configuration
>> +make config T=${TARGET} O=${TARGET}
>> +pushd x86_64-native-linuxapp-gcc
>> +sed -ri 's,(CONFIG_RTE_BUILD_COMBINE_LIBS=).*,\1y,' .config
>> +#To use I/O without DPDK supported NIC's enable pcap pmd:
>> +sed -ri 's,(CONFIG_RTE_LIBRTE_PMD_PCAP=).*,\1y,' .config
>> +popd
>> +
>> +#Build DPDK
>> +make install T=${TARGET} EXTRA_CFLAGS="-fPIC"
>> +popd
>> +
>> +#Build ODP
>> +./bootstrap;
>> +./configure  --enable-test-vald  --enable-test-perf
>> --enable-test-cpp \
>> +--enable-debug --enable-debug-print \
>> +--with-dpdk-path=`pwd`/dpdk/${TARGET}
>> +make
>> --
>> 2.7.1.250.gff4ea60
>>
>> ___
>> lng-odp mailing list
>> lng-odp@lists.linaro.org 
>> https://lists.linaro.org/mailman/listinfo/lng-odp
>>
>>
>>
>>
>> --
>> Mike Holmes
>> Technical Manager - Linaro Networking Group
>> Linaro.org ***│ *Open source software for ARM
>> SoCs
>> "Work should be fun and collaborative, the rest follows"
>>
>>
>


-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org  *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] test: l2fwd: change destination mac addresses by default

2016-03-19 Thread Savolainen, Petri (Nokia - FI/Espoo)
Reviewed-by: Petri Savolainen 

We saw a NIC to drop all outgoing packets which have the NIC MAC address as the 
destination address (which is the right thing to do). This change avoids that 
to happen (by default).

-Petri


> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT
> Matias Elo
> Sent: Thursday, March 17, 2016 9:00 AM
> To: lng-odp@lists.linaro.org
> Subject: [lng-odp] [PATCH] test: l2fwd: change destination mac addresses
> by default
> 
> With the previous default settings only the source addresses
> of forwarded packets were changed. This caused forwarded
> packets' destination and source addresses being the same
> when only one interface was used. Fix this by changing the
> destination mac addresses by default. This change has
> negligible effect to throughput performance.
> 
> Signed-off-by: Matias Elo 
> ---
>  test/performance/odp_l2fwd.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/test/performance/odp_l2fwd.c b/test/performance/odp_l2fwd.c
> index 216e6c6..77ea5e9 100644
> --- a/test/performance/odp_l2fwd.c
> +++ b/test/performance/odp_l2fwd.c
> @@ -1019,8 +1019,8 @@ static void usage(char *progname)
>  "  -t, --time   Time in seconds to run.\n"
>  "  -a, --accuracy  Time in seconds get print
> statistics\n"
>  "  (default is 1 second).\n"
> -"  -d, --dst_change  0: Don't change packets' dst eth
> addresses (default)\n"
> -"1: Change packets' dst eth addresses\n"
> +"  -d, --dst_change  0: Don't change packets' dst eth
> addresses\n"
> +"1: Change packets' dst eth addresses
> (default)\n"
>  "  -s, --src_change  0: Don't change packets' src eth
> addresses\n"
>  "1: Change packets' src eth addresses
> (default)\n"
>  "  -r, --dst_addrDestination addresses (comma-separated,
> no spaces)\n"
> @@ -1068,6 +1068,7 @@ static void parse_args(int argc, char *argv[],
> appl_args_t *appl_args)
> 
>   appl_args->time = 0; /* loop forever if time to run is 0 */
>   appl_args->accuracy = 1; /* get and print pps stats second */
> + appl_args->dst_change = 1; /* change eth dst address by default */
>   appl_args->src_change = 1; /* change eth src address by default */
>   appl_args->error_check = 0; /* don't check packet errors by default
> */
> 
> --
> 1.9.1
> 
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] scripts: add builddpdk

2016-03-19 Thread Maxim Uvarov

On 03/18/16 16:38, Nikolay Nikolaev wrote:

On Fri, Mar 18, 2016 at 1:59 PM, Maxim Uvarov  wrote:

Add script to quickly build odp with dpdk pktio support.

Signed-off-by: Maxim Uvarov 
---
  .gitignore|  1 +
  scripts/builddpdk | 26 ++
  2 files changed, 27 insertions(+)
  create mode 100755 scripts/builddpdk

diff --git a/.gitignore b/.gitignore
index b4c146b..4945d25 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,6 +31,7 @@ core
  cscope.out
  depcomp
  doc/output
+dpdk/
  install-sh
  lib/
  libtool
diff --git a/scripts/builddpdk b/scripts/builddpdk
new file mode 100755
index 000..b178c19
--- /dev/null
+++ b/scripts/builddpdk
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+TARGET="x86_64-native-linuxapp-gcc"

You can use this form to allow setting the target externaly (e.g. if
you need to compile for ARM):

TARGET=${TARGET:-"x86_64-native-linuxapp-gcc"}
echo "Building DPDK with target ${TARGET}"

ok

+
+git clone http://dpdk.org/git/dpdk dpdk

this will result in a terrible output of git status. Maybe you can
clone to ".dpdk" (note the dot),
which will be ignored by git AFAIK.

I added directory to .gitignore which looks like works good.


+cd dpdk

You may use bash's pushd/popd for going back and forth between the
folders instead of cd.


what is the difference?



+git checkout -b bv2.2.0 v2.2.0
+
+#Make and edit DPDK configuration
+make config T=x86_64-native-linuxapp-gcc O=x86_64-native-linuxapp-gcc

Maybe you want:
make config T=${TARGET} O=${TARGET}

yes :)

will send v2.

Maxim.


regards,
Nikolay Nikolaev


+cd x86_64-native-linuxapp-gcc
+sed -ri 's,(CONFIG_RTE_BUILD_COMBINE_LIBS=).*,\1y,' .config
+#To use I/O without DPDK supported NIC's enable pcap pmd:
+sed -ri 's,(CONFIG_RTE_LIBRTE_PMD_PCAP=).*,\1y,' .config
+cd ..
+
+#Build DPDK
+make install T=${TARGET} EXTRA_CFLAGS="-fPIC"
+cd ..
+
+#Build ODP
+./bootstrap;
+./configure  --enable-test-vald  --enable-test-perf --enable-test-cpp \
+--enable-debug --enable-debug-print \
+--with-dpdk-path=`pwd`/dpdk/${TARGET}/include
+make
--
2.7.1.250.gff4ea60

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


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


Re: [lng-odp] [PATCH v2 5/6] linux-generic: dpdk: pass ODP_PLATFORM_PARAMS environment variable to dpdk init

2016-03-19 Thread Maxim Uvarov

On 03/09/16 16:34, Matias Elo wrote:

Pass ODP_PLATFORM_PARAMS environment variable to
rte_eal_init(). This can be used to pass DPDK only
configuration options from command line. E.g. configuring
vdev interfaces.

Signed-off-by: Matias Elo 
---
  platform/linux-generic/pktio/dpdk.c | 11 ---
  1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/platform/linux-generic/pktio/dpdk.c 
b/platform/linux-generic/pktio/dpdk.c
index 5278651..2edba52 100644
--- a/platform/linux-generic/pktio/dpdk.c
+++ b/platform/linux-generic/pktio/dpdk.c
@@ -326,6 +326,7 @@ static int dpdk_pktio_init(void)
int i;
odp_cpumask_t mask;
char mask_str[ODP_CPUMASK_STR_SIZE];
+   const char *cmdline;
int32_t masklen;
int mem_str_len;
int cmd_len;
@@ -365,15 +366,19 @@ static int dpdk_pktio_init(void)
  
  	mem_str_len = snprintf(NULL, 0, "%d", DPDK_MEMORY_MB);
  
+	cmdline = getenv("ODP_PLATFORM_PARAMS");


this might be not really good name for linux-generic. I think it's 
better to name it as:

ODP_PKTIO_DPDK_PARAMS

Maxim.

+   if (cmdline == NULL)
+   cmdline = "";
+
/* masklen includes the terminating null as well */
cmd_len = strlen("odpdpdk -c -m ") + masklen + mem_str_len +
-   strlen(" ");
+   strlen(cmdline) + strlen("  ");
  
  	char full_cmd[cmd_len];
  
  	/* first argument is facility log, simply bind it to odpdpdk for now.*/

-   cmd_len = snprintf(full_cmd, cmd_len, "odpdpdk -c %s -m %d",
-  mask_str, DPDK_MEMORY_MB);
+   cmd_len = snprintf(full_cmd, cmd_len, "odpdpdk -c %s -m %d %s",
+  mask_str, DPDK_MEMORY_MB, cmdline);
  
  	for (i = 0, dpdk_argc = 1; i < cmd_len; ++i) {

if (isspace(full_cmd[i]))


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


[lng-odp] [Bug 2129] CID 158774 CID 158775: Error handling issues: odp_system_info.c:

2016-03-19 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2129

Mike Holmes  changed:

   What|Removed |Added

   Assignee|lng-odp@lists.linaro.org|maxim.uva...@linaro.org

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


Re: [lng-odp] [PATCH] linux-generic: dpdk: add packet classification support

2016-03-19 Thread Elo, Matias (Nokia - FI/Espoo)
Ping.

> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT 
> Matias
> Elo
> Sent: Friday, March 11, 2016 2:48 PM
> To: lng-odp@lists.linaro.org
> Subject: [lng-odp] [PATCH] linux-generic: dpdk: add packet classification 
> support
> 
> Add packet classification support using _odp_packet_cls_enq
> helper function.
> 
> Signed-off-by: Matias Elo 
> ---
>  platform/linux-generic/pktio/dpdk.c | 54 +--
> --
>  1 file changed, 31 insertions(+), 23 deletions(-)
> 
> diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-
> generic/pktio/dpdk.c
> index a39e7dc..3b65d97 100644
> --- a/platform/linux-generic/pktio/dpdk.c
> +++ b/platform/linux-generic/pktio/dpdk.c
> @@ -554,6 +554,7 @@ static inline int mbuf_to_pkt(pktio_entry_t *pktio_entry,
>   struct rte_mbuf *mbuf;
>   void *buf;
>   int i, j;
> + int nb_pkts = 0;
> 
>   for (i = 0; i < num; i++) {
>   mbuf = mbuf_table[i];
> @@ -567,37 +568,44 @@ static inline int mbuf_to_pkt(pktio_entry_t
> *pktio_entry,
> 
>   pkt_len = rte_pktmbuf_pkt_len(mbuf);
> 
> - pkt = packet_alloc(pktio_entry->s.pkt_dpdk.pool, pkt_len, 1);
> - if (pkt == ODP_PACKET_INVALID) {
> - ODP_ERR("packet_alloc failed\n");
> - goto fail;
> - }
> + if (pktio_cls_enabled(pktio_entry)) {
> + if (_odp_packet_cls_enq(pktio_entry,
> + (const uint8_t *)buf, pkt_len,
> + &pkt_table[nb_pkts]))
> + nb_pkts++;
> + } else {
> + pkt = packet_alloc(pktio_entry->s.pkt_dpdk.pool,
> +pkt_len, 1);
> + if (pkt == ODP_PACKET_INVALID) {
> + ODP_ERR("packet_alloc failed\n");
> + goto fail;
> + }
> 
> - pkt_hdr = odp_packet_hdr(pkt);
> + pkt_hdr = odp_packet_hdr(pkt);
> 
> - /* For now copy the data in the mbuf,
> -worry about zero-copy later */
> - if (odp_packet_copydata_in(pkt, 0, pkt_len, buf) != 0) {
> - ODP_ERR("odp_packet_copydata_in failed\n");
> - odp_packet_free(pkt);
> - goto fail;
> - }
> + /* For now copy the data in the mbuf,
> +worry about zero-copy later */
> + if (odp_packet_copydata_in(pkt, 0, pkt_len, buf) != 0) {
> + ODP_ERR("odp_packet_copydata_in failed\n");
> + odp_packet_free(pkt);
> + goto fail;
> + }
> 
> - packet_parse_l2(pkt_hdr);
> + packet_parse_l2(pkt_hdr);
> 
> - pkt_hdr->input = pktio_entry->s.handle;
> + pkt_hdr->input = pktio_entry->s.handle;
> 
> - if (mbuf->ol_flags & PKT_RX_RSS_HASH) {
> - pkt_hdr->has_hash = 1;
> - pkt_hdr->flow_hash = mbuf->hash.rss;
> - }
> -
> - pkt_table[i] = pkt;
> + if (mbuf->ol_flags & PKT_RX_RSS_HASH) {
> + pkt_hdr->has_hash = 1;
> + pkt_hdr->flow_hash = mbuf->hash.rss;
> + }
> 
> + pkt_table[nb_pkts++] = pkt;
> + }
>   rte_pktmbuf_free(mbuf);
>   }
> 
> - return i;
> + return nb_pkts;
> 
>  fail:
>   ODP_ERR("Creating ODP packet failed\n");
> @@ -653,7 +661,7 @@ static int dpdk_recv_queue(pktio_entry_t *pktio_entry,
>  {
>   pkt_dpdk_t *pkt_dpdk = &pktio_entry->s.pkt_dpdk;
>   pkt_cache_t *rx_cache = &pkt_dpdk->rx_cache[index];
> - uint16_t nb_rx;
> + int nb_rx;
>   struct rte_mbuf *rx_mbufs[num];
>   int i;
>   unsigned cache_idx;
> --
> 1.9.1
> 
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [API-NEXT PATCH] api: pktio: add odp_pktin_recv_tmo

2016-03-19 Thread Savolainen, Petri (Nokia - FI/Espoo)
Oops... sent out this too early. I'm going to add couple of patches into this 
set in a while. 


> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT
> Petri Savolainen
> Sent: Thursday, March 17, 2016 4:07 PM
> To: lng-odp@lists.linaro.org
> Subject: [lng-odp] [API-NEXT PATCH] api: pktio: add odp_pktin_recv_tmo
> 
> Added single queue recv function with timeout. In a simple
> configuration each thread polls a single input queue. Timeout
> version of single queue receive allows thread to sleep when
> there are no packets. odp_pktin_recv_mq_tmo would be unnecessary
> complex to use for single input queue.
> 
> Signed-off-by: Petri Savolainen 
> ---
>  include/odp/api/spec/packet_io.h   | 36 ++---
>  platform/linux-generic/odp_packet_io.c | 49
> +-
>  2 files changed, 81 insertions(+), 4 deletions(-)
> 
> diff --git a/include/odp/api/spec/packet_io.h
> b/include/odp/api/spec/packet_io.h
> index 6fe2cac..1860b31 100644
> --- a/include/odp/api/spec/packet_io.h
> +++ b/include/odp/api/spec/packet_io.h
> @@ -522,8 +522,10 @@ odp_pktio_t odp_pktio_lookup(const char *name);
>  /**
>   * Receive packets directly from an interface input queue
>   *
> - * Receives up to 'num' packets from the pktio interface input queue.
> When
> - * input queue parameter 'op_mode' has been set to
> ODP_PKTIO_OP_MT_UNSAFE,
> + * Receives up to 'num' packets from the pktio interface input queue.
> Returns
> + * the number of packets received.
> + *
> + * When input queue parameter 'op_mode' has been set to
> ODP_PKTIO_OP_MT_UNSAFE,
>   * the operation is optimized for single thread operation per queue and
> the same
>   * queue must not be accessed simultaneously from multiple threads.
>   *
> @@ -539,7 +541,35 @@ odp_pktio_t odp_pktio_lookup(const char *name);
>  int odp_pktin_recv(odp_pktin_queue_t queue, odp_packet_t packets[], int
> num);
> 
>  /**
> - * Receive packets directly from multiple interface input queues
> + * Receive packets directly from an interface input queue with timeout
> + *
> + * Receives up to 'num' packets from the pktio interface input queue. If
> there
> + * are no packets available, waits for packets depeding on 'wait'
> parameter
> + * value. Returns the number of packets received.
> + *
> + * When input queue parameter 'op_mode' has been set to
> ODP_PKTIO_OP_MT_UNSAFE,
> + * the operation is optimized for single thread operation per queue and
> the same
> + * queue must not be accessed simultaneously from multiple threads.
> + *
> + * @param  queue  Packet input queue handle for receiving packets
> + * @param[out] packets[]  Packet handle array for output of received
> packets
> + * @param  numMaximum number of packets to receive
> + * @param  wait   Wait time specified as as follows:
> + ** ODP_PKTIN_NO_WAIT: Do not wait
> + ** ODP_PKTIN_WAIT:Wait infinitely
> + ** Other values specify the minimum time to
> wait.
> + *  Use odp_pktin_wait_time() to convert
> nanoseconds
> + *  to a valid parameter value. Wait time may be
> + *  rounded up a small, platform specific amount.
> + *
> + * @return Number of packets received
> + * @retval <0 on failure
> + */
> +int odp_pktin_recv_tmo(odp_pktin_queue_t queue, odp_packet_t packets[],
> +int num, uint64_t wait);
> +
> +/**
> + * Receive packets directly from multiple interface input queues with
> timeout
>   *
>   * Receives up to 'num' packets from one of the specified pktio interface
> input
>   * queues. The index of the source queue is stored into 'from' output
> diff --git a/platform/linux-generic/odp_packet_io.c b/platform/linux-
> generic/odp_packet_io.c
> index aafb3d9..948baa8 100644
> --- a/platform/linux-generic/odp_packet_io.c
> +++ b/platform/linux-generic/odp_packet_io.c
> @@ -21,6 +21,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
> 
>  #include 
>  #include 
> @@ -28,7 +29,12 @@
>  #include 
>  #include 
> 
> -#define SLEEP_NSEC 1000
> +/* Sleep this many nanoseconds between pktin receive calls */
> +#define SLEEP_NSEC  1000
> +
> +/* Check total sleep time about every SLEEP_CHECK * SLEEP_NSEC
> nanoseconds.
> + * Must be power of two. */
> +#define SLEEP_CHECK 32
> 
>  pktio_table_t *pktio_tbl;
> 
> @@ -1387,6 +1393,47 @@ int odp_pktin_recv(odp_pktin_queue_t queue,
> odp_packet_t packets[], int num)
>   return single_recv_queue(entry, queue.index, packets, num);
>  }
> 
> +int odp_pktin_recv_tmo(odp_pktin_queue_t queue, odp_packet_t packets[],
> int num,
> +uint64_t wait)
> +{
> + int ret;
> + odp_time_t t1, t2;
> + struct timespec ts;
> +
> + if (wait != ODP_PKTIN_WAIT) {
> + ts.tv_sec  = 0;
> + ts.tv_nsec = SLEEP_NSEC;
> +
> + t1 = odp_time_sum(odp_time_local

Re: [lng-odp] [PATCH] validation: timer: replace %d by PRIu32

2016-03-19 Thread Maxim Uvarov

Merged,
Maxim.

On 03/02/16 16:20, Mike Holmes wrote:



On 25 February 2016 at 05:31, Maxim Uvarov > wrote:


On 02/23/16 18:47, Nicolas Morey-Chaisemartin wrote:

Signed-off-by: Nicolas Morey-Chaisemartin mailto:nmo...@kalray.eu>>


Reviewed-by: Mike Holmes >


---
  test/validation/timer/timer.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/validation/timer/timer.c
b/test/validation/timer/timer.c
index 004670a..8d3ba47 100644
--- a/test/validation/timer/timer.c
+++ b/test/validation/timer/timer.c
@@ -294,13 +294,13 @@ static void *worker_entrypoint(void *arg
TEST_UNUSED)
for (i = 0; i < NTIMERS; i++) {
tt[i].ev =
odp_timeout_to_event(odp_timeout_alloc(tbp));
if (tt[i].ev == ODP_EVENT_INVALID) {
-   LOG_DBG("Failed to allocate timeout
(%d/%d)\n",
+   LOG_DBG("Failed to allocate timeout
(%" PRIu32 "/%d)\n",
i, NTIMERS);
break;
}
tt[i].tim = odp_timer_alloc(tp, queue, &tt[i]);
if (tt[i].tim == ODP_TIMER_INVALID) {
-   LOG_DBG("Failed to allocate timer
(%d/%d)\n",
+   LOG_DBG("Failed to allocate timer (%"
PRIu32 "/%d)\n",
i, NTIMERS);
odp_timeout_free(tt[i].ev);
break;


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




--
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org ***│ *Open source software for ARM SoCs
"Work should be fun and collborative, the rest follows"



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


Re: [lng-odp] [PATCHv2 0/2] cleanly destroy resources

2016-03-19 Thread Maxim Uvarov

Merged,
Maxim.

On 03/02/16 16:13, Bill Fischofer wrote:

For this series:

Reviewed-by: Bill Fischofer >


On Tue, Mar 1, 2016 at 9:52 AM, Maxim Uvarov > wrote:


ping. Please review.

(Should be simple run and see that there is no ODP_ERR() on ending
term_global() )

Maxim.

On 02/25/16 15:35, Maxim Uvarov wrote:

v2: apply on master, not api-next and correst stop instead of
close.

Maxim Uvarov (2):
   performance: scheduling: cleanly destroy resources
   example: generator: clean up termination progress

  example/generator/odp_generator.c | 61
---
  test/performance/odp_scheduling.c | 52
-
  2 files changed, 89 insertions(+), 24 deletions(-)


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




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


[lng-odp] Change in lng/odp[master]: validation: timer: don't access non-existing timers

2016-03-19 Thread Maxim Uvarov (Code Review)
Maxim Uvarov has uploaded a new change for review.

  https://review.linaro.org/10969

Change subject: validation: timer: don't access non-existing timers
..

validation: timer: don't access non-existing timers

Since e5c85d3f "validation: timer: handle early exhaustion of pool" the
workers can handle if object caches retain packets, but with enough
threads it can happen that a late starting thread won't be able to
allocate any. This for loop should take that into account and not
trying to access tt[0].ev.

Change-Id: I3648cb7c2b7af91276f8aa4d06ee0f26e3236e7d
Signed-off-by: Zoltan Kiss 
Signed-off-by: Maxim Uvarov 
---
M test/validation/timer/timer.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://review.linaro.org:29418/lng/odp refs/changes/69/10969/1

diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c
index 5854b32..7b76dbf 100644
--- a/test/validation/timer/timer.c
+++ b/test/validation/timer/timer.c
@@ -338,7 +338,7 @@
uint32_t ms;
uint64_t prev_tick = odp_timer_current_tick(tp);
 
-   for (ms = 0; ms < 7 * RANGE_MS / 10; ms++) {
+   for (ms = 0; ms < 7 * RANGE_MS / 10 && allocated > 0; ms++) {
odp_event_t ev;
while ((ev = odp_queue_deq(queue)) != ODP_EVENT_INVALID) {
/* Subtract one from prev_tick to allow for timeouts

-- 
To view, visit https://review.linaro.org/10969
To unsubscribe, visit https://review.linaro.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3648cb7c2b7af91276f8aa4d06ee0f26e3236e7d
Gerrit-PatchSet: 1
Gerrit-Project: lng/odp
Gerrit-Branch: master
Gerrit-Owner: Maxim Uvarov 
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


[lng-odp] [PATCH] Provide a path to retrieves the output queues from its odp_pktout_queue_t.

2016-03-19 Thread José Pekkarinen
This change propose a path to retrieve the list of out queues associated
to an odp_pktout_queue_t. This enables ofp to retrieve the context of the
queues associated to the odp_pktout_queue_t in question, being able to
store and retrieve the interface structures on it to use it on demand.

Signed-off-by: José Pekkarinen 
---
 include/odp/api/spec/packet_io.h   | 10 ++
 platform/linux-generic/odp_packet_io.c | 10 ++
 2 files changed, 20 insertions(+)

diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h
index ce3308a..4635239 100644
--- a/include/odp/api/spec/packet_io.h
+++ b/include/odp/api/spec/packet_io.h
@@ -551,6 +551,16 @@ int odp_pktin_recv(odp_pktin_queue_t queue, odp_packet_t 
packets[], int num);
 int odp_pktout_send(odp_pktout_queue_t queue, odp_packet_t packets[], int num);
 
 /**
+ * Provide a pointer to the queues associated with the pktout_queue_t.
+ *
+ * @param output_queue  Output queue handle to retrieve the queues from.
+ *
+ * @return Address of the array of queue structures.
+ * @retval NULL on failure.
+ */
+void *odp_pktout_get_queues(odp_pktout_queue_t output_queue);
+
+/**
  * Return the currently configured MTU value of a packet IO interface.
  *
  * @param[in] pktio  Packet IO handle.
diff --git a/platform/linux-generic/odp_packet_io.c 
b/platform/linux-generic/odp_packet_io.c
index 9192be2..bc00c30 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -1399,6 +1399,16 @@ int odp_pktout_send(odp_pktout_queue_t queue, 
odp_packet_t packets[], int num)
return single_send_queue(entry, queue.index, packets, num);
 }
 
+void *odp_pktout_get_queues(odp_pktout_queue_t output_queue)
+{
+   pktio_entry_t *pktio_entry = get_pktio_entry(output_queue.pktio);
+
+   if (pktio_entry == NULL)
+   return NULL;
+
+   return pktio_entry->s.out_queue;
+}
+
 int single_capability(odp_pktio_capability_t *capa)
 {
memset(capa, 0, sizeof(odp_pktio_capability_t));
-- 
2.4.10

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


[lng-odp] [Bug 2133] New: linux-generic dpdk pktio clang warnings

2016-03-19 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2133

Bug ID: 2133
   Summary: linux-generic dpdk pktio clang warnings
   Product: OpenDataPlane - linux- generic reference
   Version: 1.8
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Packet IO
  Assignee: maxim.uva...@linaro.org
  Reporter: maxim.uva...@linaro.org
CC: lng-odp@lists.linaro.org

make[1]: Entering directory `/opt/Linaro/odp3.git/platform/linux-generic'
  CC   odp_classification.lo
In file included from odp_classification.c:15:
In file included from ./include/odp_packet_io_internal.h:35:
./include/odp_packet_dpdk.h:27:20: error: static_assert expression is not an
integral constant expression
_ODP_STATIC_ASSERT(DPDK_NB_MBUF % DPDK_MEMPOOL_CACHE_SIZE == 0 &&
~~~^~
./include/odp_packet_dpdk.h:21:22: note: expanded from macro 'DPDK_NB_MBUF'
#define DPDK_NB_MBUF 16384
 ^
../../include/odp/api/spec/debug.h:43:55: note: expanded from macro
'_ODP_STATIC_ASSERT'
#define _ODP_STATIC_ASSERT(cond, msg)  _Static_assert(cond, msg)
  ^
1 error generated.

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


[lng-odp] [API-NEXT PATCH 1/3] api: pktio: add odp_pktin_recv_tmo

2016-03-19 Thread Petri Savolainen
Added single queue recv function with timeout. In a simple
configuration each thread polls a single input queue. Timeout
version of single queue receive allows thread to sleep when
there are no packets. odp_pktin_recv_mq_tmo would be unnecessary
complex to use for single input queue.

Signed-off-by: Petri Savolainen 
Suggested-by: Juha-Matti Tilli 
---
 include/odp/api/spec/packet_io.h   | 36 --
 platform/linux-generic/odp_packet_io.c | 55 +-
 2 files changed, 87 insertions(+), 4 deletions(-)

diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h
index 6fe2cac..1860b31 100644
--- a/include/odp/api/spec/packet_io.h
+++ b/include/odp/api/spec/packet_io.h
@@ -522,8 +522,10 @@ odp_pktio_t odp_pktio_lookup(const char *name);
 /**
  * Receive packets directly from an interface input queue
  *
- * Receives up to 'num' packets from the pktio interface input queue. When
- * input queue parameter 'op_mode' has been set to ODP_PKTIO_OP_MT_UNSAFE,
+ * Receives up to 'num' packets from the pktio interface input queue. Returns
+ * the number of packets received.
+ *
+ * When input queue parameter 'op_mode' has been set to ODP_PKTIO_OP_MT_UNSAFE,
  * the operation is optimized for single thread operation per queue and the 
same
  * queue must not be accessed simultaneously from multiple threads.
  *
@@ -539,7 +541,35 @@ odp_pktio_t odp_pktio_lookup(const char *name);
 int odp_pktin_recv(odp_pktin_queue_t queue, odp_packet_t packets[], int num);
 
 /**
- * Receive packets directly from multiple interface input queues
+ * Receive packets directly from an interface input queue with timeout
+ *
+ * Receives up to 'num' packets from the pktio interface input queue. If there
+ * are no packets available, waits for packets depeding on 'wait' parameter
+ * value. Returns the number of packets received.
+ *
+ * When input queue parameter 'op_mode' has been set to ODP_PKTIO_OP_MT_UNSAFE,
+ * the operation is optimized for single thread operation per queue and the 
same
+ * queue must not be accessed simultaneously from multiple threads.
+ *
+ * @param  queue  Packet input queue handle for receiving packets
+ * @param[out] packets[]  Packet handle array for output of received packets
+ * @param  numMaximum number of packets to receive
+ * @param  wait   Wait time specified as as follows:
+ ** ODP_PKTIN_NO_WAIT: Do not wait
+ ** ODP_PKTIN_WAIT:Wait infinitely
+ ** Other values specify the minimum time to wait.
+ *  Use odp_pktin_wait_time() to convert nanoseconds
+ *  to a valid parameter value. Wait time may be
+ *  rounded up a small, platform specific amount.
+ *
+ * @return Number of packets received
+ * @retval <0 on failure
+ */
+int odp_pktin_recv_tmo(odp_pktin_queue_t queue, odp_packet_t packets[],
+  int num, uint64_t wait);
+
+/**
+ * Receive packets directly from multiple interface input queues with timeout
  *
  * Receives up to 'num' packets from one of the specified pktio interface input
  * queues. The index of the source queue is stored into 'from' output
diff --git a/platform/linux-generic/odp_packet_io.c 
b/platform/linux-generic/odp_packet_io.c
index aafb3d9..bf6e923 100644
--- a/platform/linux-generic/odp_packet_io.c
+++ b/platform/linux-generic/odp_packet_io.c
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -28,7 +29,12 @@
 #include 
 #include 
 
-#define SLEEP_NSEC 1000
+/* Sleep this many nanoseconds between pktin receive calls */
+#define SLEEP_NSEC  1000
+
+/* Check total sleep time about every SLEEP_CHECK * SLEEP_NSEC nanoseconds.
+ * Must be power of two. */
+#define SLEEP_CHECK 32
 
 pktio_table_t *pktio_tbl;
 
@@ -1387,6 +1393,53 @@ int odp_pktin_recv(odp_pktin_queue_t queue, odp_packet_t 
packets[], int num)
return single_recv_queue(entry, queue.index, packets, num);
 }
 
+int odp_pktin_recv_tmo(odp_pktin_queue_t queue, odp_packet_t packets[], int 
num,
+  uint64_t wait)
+{
+   int ret;
+   odp_time_t t1, t2;
+   struct timespec ts;
+   int started = 0;
+
+   ts.tv_sec  = 0;
+   ts.tv_nsec = SLEEP_NSEC;
+
+   while (1) {
+   ret = odp_pktin_recv(queue, packets, num);
+
+   if (ret != 0)
+   return ret;
+
+   if (wait == 0)
+   return 0;
+
+   if (wait != ODP_PKTIN_WAIT) {
+   /* Avoid unnecessary system calls. Record the start time
+* only when needed and after the first call to recv. */
+   if (odp_unlikely(!started)) {
+   odp_time_t t;
+
+   t = odp_time_local_from_ns(wait * SLEEP_NSEC);
+   started 

Re: [lng-odp] [PATCH v1 0/2] Build ODP-DPDK on arm/arm64

2016-03-19 Thread Mike Holmes
Hi Nikolay, you need to send these to lng-odp-dpdk.

Thanks Mike

On 16 March 2016 at 01:44, Nikolay Nikolaev <
n.nikol...@virtualopensystems.com> wrote:

> This series enable the compilation of the ODP-DPDK on
> the arm platforms. There are two problems fixed:
>  - deciding when to use -msse4.2
>  - fixing rte_memcpy being a #define on arm
>
> ---
>
> Nikolay Nikolaev (2):
>   configure: use ARCH_X86 conditional and decide when to use sse4.2
>   std_lib: dpdk_memcpy definition for arm/arm64
>
>
>  configure.ac   |1 +
>  platform/linux-dpdk/Makefile.am|6 +-
>  platform/linux-dpdk/odp_std_clib.c |9 +
>  3 files changed, 15 insertions(+), 1 deletion(-)
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
>



-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org  *│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCHv3] linux-generic:release memory during session destory

2016-03-19 Thread Bala Manoharan
Reviewed-by: Balasubramanian Manoharan 

On 15 March 2016 at 18:39, balakrishna.garapati <
balakrishna.garap...@linaro.org> wrote:

> Signed-off-by: balakrishna.garapati 
> ---
>  platform/linux-generic/odp_crypto.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/platform/linux-generic/odp_crypto.c
> b/platform/linux-generic/odp_crypto.c
> index 08b479d..e468677 100644
> --- a/platform/linux-generic/odp_crypto.c
> +++ b/platform/linux-generic/odp_crypto.c
> @@ -704,6 +704,8 @@ int odp_crypto_session_destroy(odp_crypto_session_t
> session)
> odp_crypto_generic_session_t *generic;
>
> generic = (odp_crypto_generic_session_t *)(intptr_t)session;
> +if (generic->cipher.alg == ODP_CIPHER_ALG_AES128_GCM)
> +   EVP_CIPHER_CTX_free(generic->cipher.data.aes_gcm.ctx);
> memset(generic, 0, sizeof(*generic));
> free_session(generic);
> return 0;
> --
> 1.9.1
>
>
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] linux-generic: dpdk: add packet classification support

2016-03-19 Thread Elo, Matias (Nokia - FI/Espoo)
Thanks,
Matias

From: EXT Bala Manoharan [mailto:bala.manoha...@linaro.org]
Sent: Friday, March 18, 2016 12:37 PM
To: Elo, Matias (Nokia - FI/Espoo) 
Cc: lng-odp@lists.linaro.org
Subject: Re: [lng-odp] [PATCH] linux-generic: dpdk: add packet classification 
support

Reviewed-by: Balasubramanian Manoharan 
mailto:bala.manoha...@linaro.org>>

On 18 March 2016 at 14:02, Elo, Matias (Nokia - FI/Espoo) 
mailto:matias@nokia.com>> wrote:
Ping.

> -Original Message-
> From: lng-odp 
> [mailto:lng-odp-boun...@lists.linaro.org]
>  On Behalf Of EXT Matias
> Elo
> Sent: Friday, March 11, 2016 2:48 PM
> To: lng-odp@lists.linaro.org
> Subject: [lng-odp] [PATCH] linux-generic: dpdk: add packet classification 
> support
>
> Add packet classification support using _odp_packet_cls_enq
> helper function.
>
> Signed-off-by: Matias Elo mailto:matias@nokia.com>>
> ---
>  platform/linux-generic/pktio/dpdk.c | 54 +--
> --
>  1 file changed, 31 insertions(+), 23 deletions(-)
>
> diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-
> generic/pktio/dpdk.c
> index a39e7dc..3b65d97 100644
> --- a/platform/linux-generic/pktio/dpdk.c
> +++ b/platform/linux-generic/pktio/dpdk.c
> @@ -554,6 +554,7 @@ static inline int mbuf_to_pkt(pktio_entry_t *pktio_entry,
>   struct rte_mbuf *mbuf;
>   void *buf;
>   int i, j;
> + int nb_pkts = 0;
>
>   for (i = 0; i < num; i++) {
>   mbuf = mbuf_table[i];
> @@ -567,37 +568,44 @@ static inline int mbuf_to_pkt(pktio_entry_t
> *pktio_entry,
>
>   pkt_len = rte_pktmbuf_pkt_len(mbuf);
>
> - pkt = packet_alloc(pktio_entry->s.pkt_dpdk.pool, pkt_len, 1);
> - if (pkt == ODP_PACKET_INVALID) {
> - ODP_ERR("packet_alloc failed\n");
> - goto fail;
> - }
> + if (pktio_cls_enabled(pktio_entry)) {
> + if (_odp_packet_cls_enq(pktio_entry,
> + (const uint8_t *)buf, pkt_len,
> + &pkt_table[nb_pkts]))
> + nb_pkts++;
> + } else {
> + pkt = packet_alloc(pktio_entry->s.pkt_dpdk.pool,
> +pkt_len, 1);
> + if (pkt == ODP_PACKET_INVALID) {
> + ODP_ERR("packet_alloc failed\n");
> + goto fail;
> + }
>
> - pkt_hdr = odp_packet_hdr(pkt);
> + pkt_hdr = odp_packet_hdr(pkt);
>
> - /* For now copy the data in the mbuf,
> -worry about zero-copy later */
> - if (odp_packet_copydata_in(pkt, 0, pkt_len, buf) != 0) {
> - ODP_ERR("odp_packet_copydata_in failed\n");
> - odp_packet_free(pkt);
> - goto fail;
> - }
> + /* For now copy the data in the mbuf,
> +worry about zero-copy later */
> + if (odp_packet_copydata_in(pkt, 0, pkt_len, buf) != 0) {
> + ODP_ERR("odp_packet_copydata_in failed\n");
> + odp_packet_free(pkt);
> + goto fail;
> + }
>
> - packet_parse_l2(pkt_hdr);
> + packet_parse_l2(pkt_hdr);
>
> - pkt_hdr->input = pktio_entry->s.handle;
> + pkt_hdr->input = pktio_entry->s.handle;
>
> - if (mbuf->ol_flags & PKT_RX_RSS_HASH) {
> - pkt_hdr->has_hash = 1;
> - pkt_hdr->flow_hash = mbuf->hash.rss;
> - }
> -
> - pkt_table[i] = pkt;
> + if (mbuf->ol_flags & PKT_RX_RSS_HASH) {
> + pkt_hdr->has_hash = 1;
> + pkt_hdr->flow_hash = mbuf->hash.rss;
> + }
>
> + pkt_table[nb_pkts++] = pkt;
> + }
>   rte_pktmbuf_free(mbuf);
>   }
>
> - return i;
> + return nb_pkts;
>
>  fail:
>   ODP_ERR("Creating ODP packet failed\n");
> @@ -653,7 +661,7 @@ static int dpdk_recv_queue(pktio_entry_t *pktio_entry,
>  {
>   pkt_dpdk_t *pkt_dpdk = &pktio_entry->s.pkt_dpdk;
>   pkt_cache_t *rx_cache = &pkt_dpdk->rx_cache[index];
> - uint16_t nb_rx;
> + int nb_rx;
>   struct rte_mbuf *rx_mbufs[num];
>   int i;
>   unsigned cache_idx;
> --
> 1.9.1
>
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/li

[lng-odp] [PATCH 03/11] rename libodp to libodp-linux

2016-03-19 Thread Anders Roxell
Signed-off-by: Anders Roxell 
---
 configure.ac  |  2 +-
 example/Makefile.inc  |  2 +-
 helper/test/Makefile.am   |  4 ++--
 pkg/debian/control| 14 +++---
 pkg/debian/libodp-dev.install |  4 
 pkg/debian/{libodp-dev.dirs => libodp-linux-dev.dirs} |  0
 pkg/debian/libodp-linux-dev.install   |  5 +
 pkg/debian/{libodp.dirs => libodp-linux.dirs} |  0
 pkg/debian/libodp-linux.install   |  1 +
 pkg/debian/libodp.install |  1 -
 pkg/debian/{odp-bin.dirs => odp-linux-bin.dirs}   |  0
 pkg/debian/{odp-bin.install => odp-linux-bin.install} |  0
 pkg/debian/rules  |  2 +-
 pkgconfig/{libodp.pc.in => libodp-linux.pc.in}|  2 +-
 platform/Makefile.inc |  8 
 platform/linux-generic/Makefile.am|  4 ++--
 scripts/builddeb  |  6 +++---
 test/Makefile.inc |  2 +-
 test/validation/Makefile.inc  |  2 +-
 19 files changed, 30 insertions(+), 29 deletions(-)
 delete mode 100644 pkg/debian/libodp-dev.install
 rename pkg/debian/{libodp-dev.dirs => libodp-linux-dev.dirs} (100%)
 create mode 100644 pkg/debian/libodp-linux-dev.install
 rename pkg/debian/{libodp.dirs => libodp-linux.dirs} (100%)
 create mode 100644 pkg/debian/libodp-linux.install
 delete mode 100644 pkg/debian/libodp.install
 rename pkg/debian/{odp-bin.dirs => odp-linux-bin.dirs} (100%)
 rename pkg/debian/{odp-bin.install => odp-linux-bin.install} (100%)
 rename pkgconfig/{libodp.pc.in => libodp-linux.pc.in} (91%)

diff --git a/configure.ac b/configure.ac
index 989ef13..490e19b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -321,7 +321,7 @@ AM_CXXFLAGS="-std=c++11"
 AC_CONFIG_FILES([Makefile
 helper/Makefile
 helper/test/Makefile
-pkgconfig/libodp.pc
+pkgconfig/libodp-linux.pc
 pkgconfig/libodphelper.pc
 scripts/Makefile
 ])
diff --git a/example/Makefile.inc b/example/Makefile.inc
index 170f32e..f0bf71d 100644
--- a/example/Makefile.inc
+++ b/example/Makefile.inc
@@ -1,6 +1,6 @@
 include $(top_srcdir)/platform/@with_platform@/Makefile.inc
 LIB   = $(top_builddir)/lib
-LDADD = $(LIB)/libodp.la $(LIB)/libodphelper.la
+LDADD = $(LIB)/libodp-linux.la $(LIB)/libodphelper.la
 AM_CFLAGS += \
-I$(srcdir) \
-I$(top_srcdir)/example \
diff --git a/helper/test/Makefile.am b/helper/test/Makefile.am
index 656ec7b..0c374e6 100644
--- a/helper/test/Makefile.am
+++ b/helper/test/Makefile.am
@@ -26,8 +26,8 @@ bin_PROGRAMS = $(EXECUTABLES) $(COMPILE_ONLY)
 
 dist_chksum_SOURCES = chksum.c
 dist_thread_SOURCES = thread.c
-thread_LDADD = $(LIB)/libodphelper.la $(LIB)/libodp.la
+thread_LDADD = $(LIB)/libodphelper.la $(LIB)/libodp-linux.la
 dist_process_SOURCES = process.c
 dist_parse_SOURCES = parse.c
-process_LDADD = $(LIB)/libodphelper.la $(LIB)/libodp.la
+process_LDADD = $(LIB)/libodphelper.la $(LIB)/libodp-linux.la
 dist_table_SOURCES = table.c
diff --git a/pkg/debian/control b/pkg/debian/control
index 40b3842..8a1f679 100644
--- a/pkg/debian/control
+++ b/pkg/debian/control
@@ -10,33 +10,33 @@ Homepage: http://www.opendataplane.org/
 Vcs-Git: git://git.linaro.org/lng/odp.git
 Vcs-Browser: https://git.linaro.org/lng/odp.git
 
-Package: odp-bin
+Package: odp-linux-bin
 Section: libdevel
 Architecture: any
 Multi-Arch: allowed
-Depends: libodp (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
+Depends: libodp-linux (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}
 Description: Example binaries for OpenDataPlane
  These are the executable examples from the reference implementation.
 
-Package: libodp-dbg
+Package: libodp-linux-dbg
 Priority: extra
 Section: debug
 Architecture: any
 Multi-Arch: same
-Depends: libodp (= ${binary:Version}), ${misc:Depends}
+Depends: libodp-linux (= ${binary:Version}), ${misc:Depends}
 Description: Debug symbols for OpenDataPlane
  This is the OpenDataPlane library from the reference implementation
  with debug turned on.
 
-Package: libodp-dev
+Package: libodp-linux-dev
 Section: libdevel
 Architecture: any
 Multi-Arch: same
-Depends: libodp (= ${binary:Version}), ${misc:Depends}, libssl-dev
+Depends: libodp-linux (= ${binary:Version}), ${misc:Depends}, libssl-dev
 Description: Development files for OpenDataPlane
  These are the source file for the OpenDataPlane reference implementation.
 
-Package: libodp
+Package: libodp-linux
 Architecture: any
 Multi-Arch: same
 Depends: ${misc:Depends}, ${shlibs:Depends}
diff --git a/pkg/debian/libodp-dev.install b/pkg/debian/libodp-dev.install
deleted file mode 100644
index b973af4..000
--- a/pkg/debian/libodp-dev.install
+++ 

Re: [lng-odp] [PATCH 1/2] linux-generic: packet_flags: use accessors to modify eth and l2 flag

2016-03-19 Thread Savolainen, Petri (Nokia - FI/Espoo)
Agree, it's confusing if internal functions have odp_ prefix. You could name 
those packet_hdr_has_l2(), etc which is intuitive since input is 
odp_packet_hdr_t. odp_packet_internal.h has also other packet_ or packet_hdr_ 
prefixed functions.

-Petri 


> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of EXT
> Maxim Uvarov
> Sent: Tuesday, March 15, 2016 5:14 PM
> To: lng-odp@lists.linaro.org
> Subject: Re: [lng-odp] [PATCH 1/2] linux-generic: packet_flags: use
> accessors to modify eth and l2 flag
> 
> Zoltan,
> 
> you can not name internal functions with odp_ prefix.
> 
> So 2 options or move that to API:
> odp_packet_hdr_has_l2
> odp_packet_hdr_has_eth
> 
> or rename to
> 
> _odp_
> 
> Best regards,
> Maxim.
> 
> 
> On 03/14/16 09:51, Bala Manoharan wrote:
> > Reviewed-by: Balasubramanian Manoharan  > >
> >
> Please be careful with review.
> 
> > Regards,
> > Bala
> >
> > On 11 March 2016 at 14:03, Zoltan Kiss  > > wrote:
> >
> > Ping
> >
> > On 03/03/16 03:05, Zoltan Kiss wrote:
> >
> > This makes it possible for other implementations like ODP-DPDK
> > to reuse
> > classification code while using a different packet API.
> >
> > Signed-off-by: Zoltan Kiss  > >
> > ---
> > platform/linux-generic/include/odp_classification_inlines.h |
> > 2 +-
> > platform/linux-generic/include/odp_packet_internal.h   |
> > 10 ++
> >   platform/linux-generic/odp_classification.c|  4 ++--
> >   3 files changed, 13 insertions(+), 3 deletions(-)
> >
> > diff --git
> > a/platform/linux-generic/include/odp_classification_inlines.h
> > b/platform/linux-generic/include/odp_classification_inlines.h
> > index 96cf77e..2318349 100644
> > --- a/platform/linux-
> generic/include/odp_classification_inlines.h
> > +++ b/platform/linux-
> generic/include/odp_classification_inlines.h
> > @@ -162,7 +162,7 @@ static inline int verify_pmr_dmac(const
> > uint8_t *pkt_addr,
> > uint64_t dmac_be = 0;
> > const odph_ethhdr_t *eth;
> >   - if (!pkt_hdr->input_flags.eth)
> > +   if (!odp_packet_hdr_has_eth(pkt_hdr))
> > return 0;
> > eth = (const odph_ethhdr_t *)(pkt_addr +
> > pkt_hdr->l2_offset);
> > diff --git
> > a/platform/linux-generic/include/odp_packet_internal.h
> > b/platform/linux-generic/include/odp_packet_internal.h
> > index 85d4924..d9fe544 100644
> > --- a/platform/linux-generic/include/odp_packet_internal.h
> > +++ b/platform/linux-generic/include/odp_packet_internal.h
> > @@ -258,6 +258,16 @@ odp_buffer_t
> > _odp_packet_to_buffer(odp_packet_t pkt);
> >   /* Convert a buffer handle to a packet handle */
> >   odp_packet_t _odp_packet_from_buffer(odp_buffer_t buf);
> >   +static inline int odp_packet_hdr_has_l2(odp_packet_hdr_t
> > *pkt_hdr)
> > +{
> > +   return pkt_hdr->input_flags.l2;
> > +}
> > +
> > +static inline int odp_packet_hdr_has_eth(odp_packet_hdr_t
> > *pkt_hdr)
> > +{
> > +   return pkt_hdr->input_flags.eth;
> > +}
> > +
> >   int _odp_parse_common(odp_packet_hdr_t *pkt_hdr, const
> > uint8_t *parseptr);
> > int _odp_cls_parse(odp_packet_hdr_t *pkt_hdr, const
> > uint8_t *parseptr);
> > diff --git a/platform/linux-generic/odp_classification.c
> > b/platform/linux-generic/odp_classification.c
> > index da195ad..4551951 100644
> > --- a/platform/linux-generic/odp_classification.c
> > +++ b/platform/linux-generic/odp_classification.c
> > @@ -1003,8 +1003,8 @@ cos_t *match_qos_l2_cos(pmr_l2_cos_t
> > *l2_cos, const uint8_t *pkt_addr,
> > const odph_vlanhdr_t *vlan;
> > uint16_t qos;
> >   - if (hdr->input_flags.l2 && hdr->input_flags.vlan &&
> > -   hdr->input_flags.eth) {
> > +   if (odp_packet_hdr_has_l2(hdr) && hdr->input_flags.vlan
> &&
> > +   odp_packet_hdr_has_eth(hdr)) {
> > eth = (const odph_ethhdr_t *)(pkt_addr +
> > hdr->l2_offset);
> > vlan = (const odph_vlanhdr_t *)(ð->type);
> > qos = odp_be_to_cpu_16(vlan->tci);
> >
> >
> >
> >
> >
> > ___
> > lng-odp mailing list
> > lng-odp@lists.linaro.org
> > https://lists.linaro.org/mailman/listinfo/lng-odp
> 
> ___
> lng-odp mailing list
> lng-odp@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-o

Re: [lng-odp] [PATCHv2] scripts: add builddpdk

2016-03-19 Thread Maxim Uvarov

On 03/18/16 17:25, Mike Holmes wrote:



On 18 March 2016 at 10:16, Maxim Uvarov > wrote:


Add script to quickly build odp with dpdk pktio support.

Signed-off-by: Maxim Uvarov mailto:maxim.uva...@linaro.org>>
---
 v2: - make target pass thought env;
 - use vars in 2 more palaces
 - use pushd/popd

 .gitignore|  1 +
 scripts/builddpdk | 26 ++
 2 files changed, 27 insertions(+)
 create mode 100755 scripts/builddpdk

diff --git a/.gitignore b/.gitignore
index b4c146b..4945d25 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,6 +31,7 @@ core
 cscope.out
 depcomp
 doc/output
+dpdk/
 install-sh
 lib/
 libtool
diff --git a/scripts/builddpdk b/scripts/builddpdk


This is going to get confused with odp-dpdk, name it something like 
builddpdkpktio, we also need to put in clear documentation in this 
script on how it is related to odp-dpdk and refer people to the full 
odp-dpdk.


I want to do the same script for netmap.
How about that names?:

scripts/build-pktio-dpdk
scripts/build-pktio-netmap

Maxim


new file mode 100755
index 000..bcc00b0
--- /dev/null
+++ b/scripts/builddpdk
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+TARGET=${TARGET:-"x86_64-native-linuxapp-gcc"}
+
+git clone http://dpdk.org/git/dpdk dpdk
+pushd dpdk
+git checkout -b bv2.2.0 v2.2.0
+
+#Make and edit DPDK configuration
+make config T=${TARGET} O=${TARGET}
+pushd x86_64-native-linuxapp-gcc
+sed -ri 's,(CONFIG_RTE_BUILD_COMBINE_LIBS=).*,\1y,' .config
+#To use I/O without DPDK supported NIC's enable pcap pmd:
+sed -ri 's,(CONFIG_RTE_LIBRTE_PMD_PCAP=).*,\1y,' .config
+popd
+
+#Build DPDK
+make install T=${TARGET} EXTRA_CFLAGS="-fPIC"
+popd
+
+#Build ODP
+./bootstrap;
+./configure  --enable-test-vald  --enable-test-perf
--enable-test-cpp \
+--enable-debug --enable-debug-print \
+--with-dpdk-path=`pwd`/dpdk/${TARGET}
+make
--
2.7.1.250.gff4ea60

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




--
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org ***│ *Open source software for ARM SoCs
"Work should be fun and collaborative, the rest follows"



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


[lng-odp] Change in lng/odp[master]: validation: timer: don't access non-existing timers

2016-03-19 Thread lava-bot (Code Review)
lava-bot has posted comments on this change.

Change subject: validation: timer: don't access non-existing timers
..


Patch Set 1:

"Build Started https://ci.linaro.org/jenkins/job/odp-api-check-gerrit/3/ "

-- 
To view, visit https://review.linaro.org/10969
To unsubscribe, visit https://review.linaro.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3648cb7c2b7af91276f8aa4d06ee0f26e3236e7d
Gerrit-PatchSet: 1
Gerrit-Project: lng/odp
Gerrit-Branch: master
Gerrit-Owner: Maxim Uvarov 
Gerrit-Reviewer: lava-bot 
Gerrit-HasComments: No
___
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp


Re: [lng-odp] [PATCH] validation: timer: don't access non-existing timers

2016-03-19 Thread Zoltan Kiss

Note, this is just a resend with a different set of CC recipients

On 18/03/16 17:25, Zoltan Kiss wrote:

Since e5c85d3f "validation: timer: handle early exhaustion of pool" the
workers can handle if object caches retain packets, but with enough
threads it can happen that a late starting thread won't be able to
allocate any. This for loop should take that into account and not
trying to access tt[0].ev.

Signed-off-by: Zoltan Kiss 
---
  test/validation/timer/timer.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c
index 5854b32..7b76dbf 100644
--- a/test/validation/timer/timer.c
+++ b/test/validation/timer/timer.c
@@ -338,7 +338,7 @@ static void *worker_entrypoint(void *arg TEST_UNUSED)
uint32_t ms;
uint64_t prev_tick = odp_timer_current_tick(tp);

-   for (ms = 0; ms < 7 * RANGE_MS / 10; ms++) {
+   for (ms = 0; ms < 7 * RANGE_MS / 10 && allocated > 0; ms++) {
odp_event_t ev;
while ((ev = odp_queue_deq(queue)) != ODP_EVENT_INVALID) {
/* Subtract one from prev_tick to allow for timeouts


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


[lng-odp] [Bug 2131] New: Traffic Manager introduced valgrind failures

2016-03-19 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2131

Bug ID: 2131
   Summary: Traffic Manager introduced valgrind failures
   Product: OpenDataPlane - linux- generic reference
   Version: 1.8
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: Traffic Manager
  Assignee: lng-odp@lists.linaro.org
  Reporter: mike.hol...@linaro.org
CC: lng-odp@lists.linaro.org

./bootstrap 
./configure --enable-valgrind --enable-test-vald 
make -j
cd platform/linux-generic/test/
make check-valgrind

Shows most tests fail on the the new TM init code

TM its self

cd git/odp/test/validation/traffic_mngr
valgrind ./traffic_mngr_main 

Elapsed time =   69.944 seconds
==22142== 
==22142== HEAP SUMMARY:
==22142== in use at exit: 292,791 bytes in 1,016 blocks
==22142==   total heap usage: 1,143 allocs, 127 frees, 1,732,646 bytes
allocated
==22142== 
==22142== LEAK SUMMARY:
==22142==definitely lost: 18,440 bytes in 2 blocks
==22142==indirectly lost: 0 bytes in 0 blocks
==22142==  possibly lost: 66,240 bytes in 2 blocks
==22142==still reachable: 208,111 bytes in 1,012 blocks
==22142== suppressed: 0 bytes in 0 blocks
==22142== Rerun with --leak-check=full to see details of leaked memory
==22142== 
==22142== For counts of detected and suppressed errors, rerun with: -v
==22142== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

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


[lng-odp] [Bug 2122] CID 158533: Integer handling issues odp_timer_wheel.c

2016-03-19 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2122

Mike Holmes  changed:

   What|Removed |Added

   Assignee|lng-odp@lists.linaro.org|bala.manoha...@linaro.org

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


Re: [lng-odp] [PATCH 2/2] linux-generic: packet: don't look for L2 header if there isn't any

2016-03-19 Thread Zoltan Kiss

Ping, added Bill

On 11/03/16 07:03, Zoltan Kiss wrote:

Ping

On 03/03/16 03:05, Zoltan Kiss wrote:

The L2 offset functions should consider the L2 flag: return negative
answer if there isn't any, and implicitly set it when offset is set.
E.g. user created packets don't have L2 headers immediately.

Signed-off-by: Zoltan Kiss 
---
  platform/linux-generic/include/odp_packet_internal.h | 5 +
  platform/linux-generic/odp_packet.c  | 5 +
  2 files changed, 10 insertions(+)

diff --git a/platform/linux-generic/include/odp_packet_internal.h
b/platform/linux-generic/include/odp_packet_internal.h
index d9fe544..1dc875e 100644
--- a/platform/linux-generic/include/odp_packet_internal.h
+++ b/platform/linux-generic/include/odp_packet_internal.h
@@ -263,6 +263,11 @@ static inline int
odp_packet_hdr_has_l2(odp_packet_hdr_t *pkt_hdr)
  return pkt_hdr->input_flags.l2;
  }
+static inline void odp_packet_hdr_has_l2_set(odp_packet_hdr_t
*pkt_hdr, int val)
+{
+pkt_hdr->input_flags.l2 = val;
+}
+
  static inline int odp_packet_hdr_has_eth(odp_packet_hdr_t *pkt_hdr)
  {
  return pkt_hdr->input_flags.eth;
diff --git a/platform/linux-generic/odp_packet.c
b/platform/linux-generic/odp_packet.c
index db85b5e..94d7f85 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -353,12 +353,16 @@ uint32_t odp_packet_user_area_size(odp_packet_t
pkt)
  void *odp_packet_l2_ptr(odp_packet_t pkt, uint32_t *len)
  {
  odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
+if (!odp_packet_hdr_has_l2(pkt_hdr))
+return NULL;
  return packet_map(pkt_hdr, pkt_hdr->l2_offset, len);
  }
  uint32_t odp_packet_l2_offset(odp_packet_t pkt)
  {
  odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt);
+if (!odp_packet_hdr_has_l2(pkt_hdr))
+return ODP_PACKET_OFFSET_INVALID;
  return pkt_hdr->l2_offset;
  }
@@ -369,6 +373,7 @@ int odp_packet_l2_offset_set(odp_packet_t pkt,
uint32_t offset)
  if (offset >= pkt_hdr->frame_len)
  return -1;
+odp_packet_hdr_has_l2_set(pkt_hdr, 1);
  pkt_hdr->l2_offset = offset;
  return 0;
  }



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


[lng-odp] [Bug 2103] netmap is not tested under CI

2016-03-19 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2103

Mike Holmes  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |CONFIRMED
 CC||mike.hol...@linaro.org

--- Comment #1 from Mike Holmes  ---
Also need to add the dpdk pktio testing when that arrives.

check-odp can be updated to do this, we also need to make sure we do this on
x86 and armV8

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


[lng-odp] [PATCH 02/11] configure: default test-helper to disabled

2016-03-19 Thread Anders Roxell
Make all checking conform to the principle that it is off by default

Signed-off-by: Anders Roxell 
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 6ad1bfc..989ef13 100644
--- a/configure.ac
+++ b/configure.ac
@@ -172,7 +172,7 @@ AM_CONDITIONAL([test_perf], [test x$test_perf = xyes ])
 ##
 # Enable/disable test-helper
 ##
-test_helper=yes
+test_helper=no
 AC_ARG_ENABLE([test-helper],
 [  --enable-test-helper  run test in helper/test],
 [if test "x$enableval" = "xyes"; then
-- 
2.1.4

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


[lng-odp] [PATCH] validation: timer: don't access non-existing timers

2016-03-19 Thread Zoltan Kiss
Since e5c85d3f "validation: timer: handle early exhaustion of pool" the
workers can handle if object caches retain packets, but with enough
threads it can happen that a late starting thread won't be able to
allocate any. This for loop should take that into account and not
trying to access tt[0].ev.

Signed-off-by: Zoltan Kiss 
---
 test/validation/timer/timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/validation/timer/timer.c b/test/validation/timer/timer.c
index 5854b32..7b76dbf 100644
--- a/test/validation/timer/timer.c
+++ b/test/validation/timer/timer.c
@@ -338,7 +338,7 @@ static void *worker_entrypoint(void *arg TEST_UNUSED)
uint32_t ms;
uint64_t prev_tick = odp_timer_current_tick(tp);
 
-   for (ms = 0; ms < 7 * RANGE_MS / 10; ms++) {
+   for (ms = 0; ms < 7 * RANGE_MS / 10 && allocated > 0; ms++) {
odp_event_t ev;
while ((ev = odp_queue_deq(queue)) != ODP_EVENT_INVALID) {
/* Subtract one from prev_tick to allow for timeouts
-- 
1.9.1

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


[lng-odp] [PATCH 08/11] pkg/debian/rules: make sure every package is stripped by default

2016-03-19 Thread Anders Roxell
Signed-off-by: Anders Roxell 
---
 pkg/debian/rules | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pkg/debian/rules b/pkg/debian/rules
index 4f7a057..663bcdd 100755
--- a/pkg/debian/rules
+++ b/pkg/debian/rules
@@ -20,3 +20,4 @@ override_dh_auto_configure:
 override_dh_strip:
dh_strip -p libodp-linux --dbg-package=libodp-linux-dbg
dh_strip -p libodphelper-linux --dbg-package=libodphelper-linux-dbg
+   dh_strip --remaining-packages
-- 
2.1.4

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


[lng-odp] [Bug 2127] memory leak in odp_crypto

2016-03-19 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=2127

--- Comment #1 from Krishna Garapati  ---
The fallowing patch has been sent for this and been reviewed,

http://patches.opendataplane.org/patch/5283/

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


[lng-odp] [PATCH] validation: pktio: add more debug log to pktio_pkt_seq()

2016-03-19 Thread Zoltan Kiss
Signed-off-by: Zoltan Kiss 
---
 test/validation/pktio/pktio.c | 26 +-
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/test/validation/pktio/pktio.c b/test/validation/pktio/pktio.c
index 9443cd2..cb403a6 100644
--- a/test/validation/pktio/pktio.c
+++ b/test/validation/pktio/pktio.c
@@ -176,29 +176,45 @@ static uint32_t pktio_pkt_seq(odp_packet_t pkt)
pkt_head_t head;
pkt_tail_t tail;
 
-   if (pkt == ODP_PACKET_INVALID)
+   if (pkt == ODP_PACKET_INVALID) {
+   fprintf(stderr, "error: pkt invalid\n");
return TEST_SEQ_INVALID;
+   }
 
off = odp_packet_l4_offset(pkt);
-   if (off ==  ODP_PACKET_OFFSET_INVALID)
+   if (off ==  ODP_PACKET_OFFSET_INVALID) {
+   fprintf(stderr, "error: offset invalid\n");
return TEST_SEQ_INVALID;
+   }
 
off += ODPH_UDPHDR_LEN;
-   if (odp_packet_copydata_out(pkt, off, sizeof(head), &head) != 0)
+   if (odp_packet_copydata_out(pkt, off, sizeof(head), &head) != 0) {
+   fprintf(stderr, "error: header copy failed\n");
return TEST_SEQ_INVALID;
+   }
 
-   if (head.magic != TEST_SEQ_MAGIC)
+   if (head.magic != TEST_SEQ_MAGIC) {
+   fprintf(stderr, "error: header magic invalid %u\n", head.magic);
return TEST_SEQ_INVALID;
+   }
 
if (odp_packet_len(pkt) == packet_len) {
off = packet_len - sizeof(tail);
-   if (odp_packet_copydata_out(pkt, off, sizeof(tail), &tail) != 0)
+   if (odp_packet_copydata_out(pkt, off, sizeof(tail), &tail) != 
0) {
+   fprintf(stderr, "error: header copy failed\n");
return TEST_SEQ_INVALID;
+   }
 
if (tail.magic == TEST_SEQ_MAGIC) {
seq = head.seq;
CU_ASSERT(seq != TEST_SEQ_INVALID);
+   } else {
+   fprintf(stderr, "error: tail magic invalid %u\n",
+   tail.magic);
}
+   } else {
+   fprintf(stderr, "error: packet length invalid: %u (%u)\n",
+   odp_packet_len(pkt), packet_len);
}
 
return seq;
-- 
1.9.1

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


[lng-odp] [PATCHv4] linux-generic:release memory during session destroy

2016-03-19 Thread balakrishna.garapati
v2:Added the whitespace after if.
v3:link to the bug that this patch resolves.
   https://bugs.linaro.org/show_bug.cgi?id=2127
v4:formating fixes

Signed-off-by: balakrishna.garapati 
Reviewed-by: Balasubramanian Manoharan 
---
 platform/linux-generic/odp_crypto.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/platform/linux-generic/odp_crypto.c 
b/platform/linux-generic/odp_crypto.c
index 08b479d..7448575 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -704,6 +704,8 @@ int odp_crypto_session_destroy(odp_crypto_session_t session)
odp_crypto_generic_session_t *generic;

generic = (odp_crypto_generic_session_t *)(intptr_t)session;
+   if (generic->cipher.alg == ODP_CIPHER_ALG_AES128_GCM)
+   EVP_CIPHER_CTX_free(generic->cipher.data.aes_gcm.ctx);
memset(generic, 0, sizeof(*generic));
free_session(generic);
return 0;
--
1.9.1

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