[lng-odp] [Bug 3198] example ddf_app link failures with DPDK PMDs

2017-08-08 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=3198

Yi He  changed:

   What|Removed |Added

   Assignee|christophe.mil...@linaro.or |yi...@linaro.org
   |g   |
 Status|CONFIRMED   |IN_PROGRESS

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[lng-odp] [Bug 3198] example ddf_app link failures with DPDK PMDs

2017-08-08 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=3198

Yi He  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |CONFIRMED

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[lng-odp] [Bug 3198] New: example ddf_app link failures with DPDK PMDs

2017-08-08 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=3198

Bug ID: 3198
   Summary: example ddf_app link failures with DPDK PMDs
   Product: OpenDataPlane - linux- generic reference
   Version: v1.15.0.0
  Hardware: Other
OS: Linux
Status: UNCONFIRMED
  Severity: enhancement
  Priority: ---
 Component: driver interface
  Assignee: christophe.mil...@linaro.org
  Reporter: yi...@linaro.org
CC: lng-odp@lists.linaro.org
  Target Milestone: ---

Overview: example ddf_app link failures with DPDK PMDs.

Steps to Reproduce: Minimized, easy-to-follow steps that will trigger the bug.
Include any special setup steps.
1. use below command to configure ODP with dpdk and enable all tests.
   /configure --with-dpdk-path=`pwd`/dpdk/$TARGET --enable-test-example ...
2. run make V=1 check 2>&1 | tee check.log

Actual Results: What happened after performing the above steps.

Making check in ddf_app
make[2]: Entering directory '/home/yihe01/workspace/odp-linux/example/ddf_app'
  CC   odp_ddf_app-odp_ddf_app.o
  CCLD odp_ddf_app
/usr/bin/ld: cannot find -lrte_pmd_af_packet
/usr/bin/ld: cannot find -lrte_pmd_bnxt
/usr/bin/ld: cannot find -lrte_pmd_bond
/usr/bin/ld: cannot find -lrte_pmd_cxgbe
/usr/bin/ld: cannot find -lrte_pmd_e1000
/usr/bin/ld: cannot find -lrte_pmd_ena
/usr/bin/ld: cannot find -lrte_pmd_enic
/usr/bin/ld: cannot find -lrte_pmd_fm10k
/usr/bin/ld: cannot find -lrte_pmd_i40e
/usr/bin/ld: cannot find -lrte_pmd_ixgbe
/usr/bin/ld: cannot find -lrte_pmd_null
/usr/bin/ld: cannot find -lrte_pmd_null_crypto
/usr/bin/ld: cannot find -lrte_pmd_pcap
/usr/bin/ld: cannot find -lrte_pmd_qede
/usr/bin/ld: cannot find -lrte_pmd_ring
/usr/bin/ld: cannot find -lrte_pmd_sfc_efx
/usr/bin/ld: cannot find -lrte_pmd_tap
/usr/bin/ld: cannot find -lrte_pmd_vhost
/usr/bin/ld: cannot find -lrte_pmd_virtio
/usr/bin/ld: cannot find -lrte_pmd_vmxnet3_uio
collect2: error: ld returned 1 exit status
Makefile:509: recipe for target 'odp_ddf_app' failed
make[2]: *** [odp_ddf_app] Error 1
make[2]: Leaving directory '/home/yihe01/workspace/odp-linux/example/ddf_app'
Makefile:470: recipe for target 'check-recursive' failed
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory '/home/yihe01/workspace/odp-linux/example'
Makefile:523: recipe for target 'check-recursive' failed
make: *** [check-recursive] Error 1
...

Expected Results: What should have happened, were the bug not present.

Pass all make check & distcheck

Additional Information:

The analyse is that libtool did not add DPDK_LIBS variable in the LDFLAGS.

A Solution is: /example/ddf_app/Makefile.am

 include $(top_srcdir)/example/Makefile.inc

 bin_PROGRAMS = odp_ddf_app$(EXEEXT)
-odp_ddf_app_LDFLAGS = $(AM_LDFLAGS) -shared
+odp_ddf_app_LDFLAGS = $(AM_LDFLAGS) $(DPDK_LIBS) -shared
 odp_ddf_app_CFLAGS = $(AM_CFLAGS) -I${top_srcdir}/example

 noinst_HEADERS = \

-- 
You are receiving this mail because:
You are on the CC list for the bug.

[lng-odp] [Linaro/odp] d232db: test: traffic_mngr: fix distcheck failure

2017-08-08 Thread GitHub
  Branch: refs/heads/cloud-dev
  Home:   https://github.com/Linaro/odp
  Commit: d232db102fc77e6cb2fd9d62ba387c22f68c042a
  
https://github.com/Linaro/odp/commit/d232db102fc77e6cb2fd9d62ba387c22f68c042a
  Author: Yi He 
  Date:   2017-06-23 (Fri, 23 Jun 2017)

  Changed paths:
M test/common_plat/validation/api/traffic_mngr/Makefile.am

  Log Message:
  ---
  test: traffic_mngr: fix distcheck failure

When configured odp with --enable-test-vald, make
distcheck will fail by not being able to find the
traffic_mngr test binary and script in the distribution.
This patch installs traffic_mngr test_PROGRAMS and
test_SCRIPTS in distribution build.

Signed-off-by: Yi He 
Reviewed-by: Dmitry Eremin-Solenikov 
Signed-off-by: Maxim Uvarov 


  Commit: e5b211403233dda67507f18fd91f9826022fd287
  
https://github.com/Linaro/odp/commit/e5b211403233dda67507f18fd91f9826022fd287
  Author: Yi He 
  Date:   2017-06-23 (Fri, 23 Jun 2017)

  Changed paths:
M test/common_plat/validation/api/time/Makefile.am

  Log Message:
  ---
  test: time: fix distcheck failure

When configured odp with --enable-test-vald, make
distcheck will fail by not being able to find the
test script time.sh in the distribution. This patch
installs time test_SCRIPTS in distribution build.

Signed-off-by: Yi He 
Reviewed-by: Dmitry Eremin-Solenikov 
Signed-off-by: Maxim Uvarov 


  Commit: fdd3df3547c78d81d1244eac3fa65512e9023237
  
https://github.com/Linaro/odp/commit/fdd3df3547c78d81d1244eac3fa65512e9023237
  Author: Yi He 
  Date:   2017-06-23 (Fri, 23 Jun 2017)

  Changed paths:
M Makefile.am

  Log Message:
  ---
  Makefile.am: update distcheck configuration

Update AM_DISTCHECK_CONFIGURE_FLAGS to enable all tests.

Signed-off-by: Yi He 
Reviewed-by: Dmitry Eremin-Solenikov 
Signed-off-by: Maxim Uvarov 


  Commit: 497c339f94e35d5fadeff539cebfbf44d698dc7e
  
https://github.com/Linaro/odp/commit/497c339f94e35d5fadeff539cebfbf44d698dc7e
  Author: Yi He 
  Date:   2017-06-23 (Fri, 23 Jun 2017)

  Changed paths:
M .travis.yml

  Log Message:
  ---
  travis: enable all tests when make distcheck

Make distcheck with all test configurations
to confirm test programs installation in odp
distribution package.

Signed-off-by: Yi He 
Reviewed-by: Dmitry Eremin-Solenikov 
Signed-off-by: Maxim Uvarov 


  Commit: a4add29291572219143dc667db4e8a7832a5692b
  
https://github.com/Linaro/odp/commit/a4add29291572219143dc667db4e8a7832a5692b
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-06-26 (Mon, 26 Jun 2017)

  Changed paths:
M platform/linux-generic/odp_crypto.c

  Log Message:
  ---
  linux-generic: crypto: adapt HMAC code to OpenSSL 1.1.x

OpenSSL 1.1.x has changed HMAC API in an incompatible way. Let's adapt
to it by providing version-dependent wrapper around HMAC calculation.

Signed-off-by: Dmitry Eremin-Solenikov 
Reviewed-and-tested-by: Brian Brooks 
Signed-off-by: Maxim Uvarov 


  Commit: c6a309f00f882fabe70fa535ebe8b765f6e9bd11
  
https://github.com/Linaro/odp/commit/c6a309f00f882fabe70fa535ebe8b765f6e9bd11
  Author: Maxim Uvarov 
  Date:   2017-06-27 (Tue, 27 Jun 2017)

  Changed paths:
M .travis.yml
M DEPENDENCIES
A m4/ax_check_compile_flag.m4

  Log Message:
  ---
  configure: remove dependency of autoconf-archive

autoconf-archive is not available on some build environment
Number of projects simple have local copy of this file.
Do the same thing.

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


  Commit: 689145bcef5ada4304f1d97d6b72e10bf8308ac0
  
https://github.com/Linaro/odp/commit/689145bcef5ada4304f1d97d6b72e10bf8308ac0
  Author: Brian Brooks 
  Date:   2017-06-28 (Wed, 28 Jun 2017)

  Changed paths:
M platform/linux-generic/odp_time.c

  Log Message:
  ---
  linux-gen: time: use true hz

Use true hz value instead of dividing by 10.

The architected timer in ARM SoCs generally have a lower
frequency than IA TSC. It is detrimental to divide the
hertz by ten in this case. This is causing time validation
failures on ARM systems where the architected timer runs
at 50MHz.

Signed-off-by: Brian Brooks 
Reviewed-by: Petri Savolainen 
Signed-off-by: Maxim Uvarov 


  Commit: 9b78da8e2373ab0530cfbbd72b2229059b57ddf1
  

[lng-odp] [Linaro/odp]

2017-08-08 Thread GitHub
  Branch: refs/heads/odp-dpdk-import
  Home:   https://github.com/Linaro/odp


Re: [lng-odp] [EXT] Re: Parser configuration

2017-08-08 Thread Bill Fischofer
On Tue, Aug 8, 2017 at 3:10 PM, Liron Himi  wrote:

> See comments inline in particular the change in RED
>
>
>
> *From:* Bill Fischofer [mailto:bill.fischo...@linaro.org]
> *Sent:* Tuesday, August 08, 2017 22:57
> *To:* Liron Himi 
> *Cc:* lng-odp@lists.linaro.org
> *Subject:* Re: [EXT] Re: [lng-odp] Parser configuration
>
>
>
>
>
>
>
> On Tue, Aug 8, 2017 at 2:29 PM, Liron Himi  wrote:
>
> See comments inline
>
>
>
> Liron
>
>
>
> *From:* Bill Fischofer [mailto:bill.fischo...@linaro.org]
> *Sent:* Tuesday, August 08, 2017 22:07
> *To:* Liron Himi 
> *Cc:* lng-odp@lists.linaro.org
> *Subject:* [EXT] Re: [lng-odp] Parser configuration
>
>
>
> External Email
> --
>
>
>
>
>
> On Tue, Aug 8, 2017 at 1:43 PM, Liron Himi  wrote:
>
> Hi,
>
> I have a query regarding the new parser configuration.
> Let's say application set it to 'ODP_PKTIO_PARSER_LAYER_L2', does it means
> that the platform implementation must parse and recognize all eth-type that
> have ODP API such as ARP,VLAN, etc.? same for ICMP, etc for L3?
>
>
>
> ODP defines the protocols it supports at a given layer and implementations
> that parse at that layer are expected to support those protocols.
> Implementations are free to parse deeper than requested, but must parse to
> at least the configured layer on a per-pktio basis. The parse results are
> accessed by the various odp_packet_has_xxx() APIs, and these are exercised
> by the pktio validation test suite.
>
>
>
> However, while VLAN is a Layer 2 protocol, ARP is a Layer 3 protocol and
> ICMP is a Layer 4 protocol.
>
>
>
>
> I'm asking it as I tried to run the parser validation tests and only the
> ones with ARP and ICMP are failing.
> It seems that the validation tests expect from the platform implementation
> to flag it.
>
>
>
> The validation test sets ODP_PKTIO_PARSER_LAYER_ALL and then tests
> individual packet types on a per-layer basis. Does your platform not parse
> ARP or ICMP?
>
> *[L.H.] Our platform implementation only support the protocols that are
> supported by our HW. We don’t do additional SW parsing as it will have
> performance penalty.*
>
>
>
>
>
> Does the HW signal whether it encountered protocols it didn't recognize?
> That would allow you to do supplemental SW parsing only in such cases,
> which would permit the current validation tests to pass without incurring
> extra overhead for the expected cases.
>
> *[L.H.] I need to check, but even if it is available I will need to
> surround it with ‘unlikely’ to reduce performance hit *
>
>
I'd think you'd need to have something like this. But it's expected that
most ODP implementations even for platforms that have HW acceleration will
involve a combination of both SW and HW since ODP APIs won't match the
native HW exactly. One of the goals of having a stable and rich ODP API set
is that over time SoC HW will more directly support these APIs as the base
of applications that make use of them grows.


>
>
>
> Is that only validation test assumption or this is the real assumption and
> expectation from the platform?
> Maybe it is good to extend the parser with supported protocol per layer in
> the capabilities. Same as we have for checksum support.
>
>
>
> That might be an interesting addition, but may not buy much. The parser
> layer controls were added to allow applications to hint platforms that do
> SW parsing since in such platforms parsing to a depth that isn't needed by
> the application wastes cycles. Platforms that have HW parsers typically
> parse everything at line rate anyway, so these controls are effectively
> ignored.
>
> *[L.H.] Our HW currently do have HW parsing but not all protocols are
> identify by it. E.g. In L4 we only identify UDP and TCP.*
>
> *So the above suggestion will allow us to communicate with the application
> on the supported protocols. *
>
> *I think it is make sense that along with the supported parsing layer the
> platform implementation will also specific the supported protocols.*
>
> *As probably some platform will need sw parsing to support all protocol,
> maybe application will also want to give a hint on the required protocols.*
>
> *e.g. TCP application that only need TCP support and no other protocols.*
>
> *In the future ODP may extend its protocols support, I guess that forcing
> the platform to support them even if require SW parsing is **NOT** a good
> idea.*
>
>
>
> The larger problem is that there are many protocols that ODP currently
> doesn't recognize and when you add to that application-specific shim
> layers, tunneling options, etc. it becomes clear that the current
> predefined protocol set is too restrictive and inflexible to meet
> application needs going forward. For this reason we'd like to explore
> integration with more advanced technologies like P4, which would permit the
> parser definitions to be offloaded from the ODP API specification and

Re: [lng-odp] [EXT] Re: Parser configuration

2017-08-08 Thread Liron Himi
See comments inline in particular the change in RED

From: Bill Fischofer [mailto:bill.fischo...@linaro.org]
Sent: Tuesday, August 08, 2017 22:57
To: Liron Himi 
Cc: lng-odp@lists.linaro.org
Subject: Re: [EXT] Re: [lng-odp] Parser configuration



On Tue, Aug 8, 2017 at 2:29 PM, Liron Himi 
> wrote:
See comments inline

Liron

From: Bill Fischofer 
[mailto:bill.fischo...@linaro.org]
Sent: Tuesday, August 08, 2017 22:07
To: Liron Himi >
Cc: lng-odp@lists.linaro.org
Subject: [EXT] Re: [lng-odp] Parser configuration

External Email



On Tue, Aug 8, 2017 at 1:43 PM, Liron Himi 
> wrote:
Hi,

I have a query regarding the new parser configuration.
Let's say application set it to 'ODP_PKTIO_PARSER_LAYER_L2', does it means that 
the platform implementation must parse and recognize all eth-type that have ODP 
API such as ARP,VLAN, etc.? same for ICMP, etc for L3?

ODP defines the protocols it supports at a given layer and implementations that 
parse at that layer are expected to support those protocols. Implementations 
are free to parse deeper than requested, but must parse to at least the 
configured layer on a per-pktio basis. The parse results are accessed by the 
various odp_packet_has_xxx() APIs, and these are exercised by the pktio 
validation test suite.

However, while VLAN is a Layer 2 protocol, ARP is a Layer 3 protocol and ICMP 
is a Layer 4 protocol.


I'm asking it as I tried to run the parser validation tests and only the ones 
with ARP and ICMP are failing.
It seems that the validation tests expect from the platform implementation to 
flag it.

The validation test sets ODP_PKTIO_PARSER_LAYER_ALL and then tests individual 
packet types on a per-layer basis. Does your platform not parse ARP or ICMP?
[L.H.] Our platform implementation only support the protocols that are 
supported by our HW. We don’t do additional SW parsing as it will have 
performance penalty.


Does the HW signal whether it encountered protocols it didn't recognize? That 
would allow you to do supplemental SW parsing only in such cases, which would 
permit the current validation tests to pass without incurring extra overhead 
for the expected cases.
[L.H.] I need to check, but even if it is available I will need to surround it 
with ‘unlikely’ to reduce performance hit


Is that only validation test assumption or this is the real assumption and 
expectation from the platform?
Maybe it is good to extend the parser with supported protocol per layer in the 
capabilities. Same as we have for checksum support.

That might be an interesting addition, but may not buy much. The parser layer 
controls were added to allow applications to hint platforms that do SW parsing 
since in such platforms parsing to a depth that isn't needed by the application 
wastes cycles. Platforms that have HW parsers typically parse everything at 
line rate anyway, so these controls are effectively ignored.
[L.H.] Our HW currently do have HW parsing but not all protocols are identify 
by it. E.g. In L4 we only identify UDP and TCP.
So the above suggestion will allow us to communicate with the application on 
the supported protocols.
I think it is make sense that along with the supported parsing layer the 
platform implementation will also specific the supported protocols.
As probably some platform will need sw parsing to support all protocol, maybe 
application will also want to give a hint on the required protocols.
e.g. TCP application that only need TCP support and no other protocols.
In the future ODP may extend its protocols support, I guess that forcing the 
platform to support them even if require SW parsing is NOT a good idea.

The larger problem is that there are many protocols that ODP currently doesn't 
recognize and when you add to that application-specific shim layers, tunneling 
options, etc. it becomes clear that the current predefined protocol set is too 
restrictive and inflexible to meet application needs going forward. For this 
reason we'd like to explore integration with more advanced technologies like 
P4, which would permit the parser definitions to be offloaded from the ODP API 
specification and modularized.  Applications would then be free to define their 
own arbitrary packet formats, or to select from a library of predefined packet 
templates that cover these extended parsing needs while still being able to 
take advantage of HW-accelerated parsing.



Regards,
Liron




[lng-odp] [PATCH API-NEXT v3 4/4] linux-gen: scalable queue: mark queue_shm_pool as static

2017-08-08 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 108 (lumag:symbols-cleanup)
 ** https://github.com/Linaro/odp/pull/108
 ** Patch: https://github.com/Linaro/odp/pull/108.patch
 ** Base sha: e420668cd3886f003c8bd6022e210bf08a0ee3b5
 ** Merge commit sha: 4ec4664e462d336f5b34b03ec598531c07ebf235
 **/
 platform/linux-generic/odp_queue_scalable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/platform/linux-generic/odp_queue_scalable.c 
b/platform/linux-generic/odp_queue_scalable.c
index 503b40f5..79148060 100644
--- a/platform/linux-generic/odp_queue_scalable.c
+++ b/platform/linux-generic/odp_queue_scalable.c
@@ -49,7 +49,7 @@ typedef struct queue_table_t {
 } queue_table_t;
 
 static queue_table_t *queue_tbl;
-_odp_ishm_pool_t *queue_shm_pool;
+static _odp_ishm_pool_t *queue_shm_pool;
 
 static inline odp_queue_t queue_from_id(uint32_t queue_id)
 {



[lng-odp] [PATCH API-NEXT v3 2/4] linux-gen: scalable sched: mark several function as static

2017-08-08 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 108 (lumag:symbols-cleanup)
 ** https://github.com/Linaro/odp/pull/108
 ** Patch: https://github.com/Linaro/odp/pull/108.patch
 ** Base sha: e420668cd3886f003c8bd6022e210bf08a0ee3b5
 ** Merge commit sha: 4ec4664e462d336f5b34b03ec598531c07ebf235
 **/
 .../include/odp_schedule_scalable_ordered.h   |  9 -
 .../linux-generic/odp_schedule_scalable_ordered.c | 19 ++-
 2 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/platform/linux-generic/include/odp_schedule_scalable_ordered.h 
b/platform/linux-generic/include/odp_schedule_scalable_ordered.h
index 941304b7..1c365a2b 100644
--- a/platform/linux-generic/include/odp_schedule_scalable_ordered.h
+++ b/platform/linux-generic/include/odp_schedule_scalable_ordered.h
@@ -115,17 +115,8 @@ reorder_window_t *rwin_alloc(_odp_ishm_pool_t *pool,
 unsigned lock_count);
 int rwin_free(_odp_ishm_pool_t *pool, reorder_window_t *rwin);
 bool rwin_reserve(reorder_window_t *rwin, uint32_t *sn);
-void rwin_insert(reorder_window_t *rwin,
-reorder_context_t *rctx,
-uint32_t sn,
-void (*callback)(reorder_context_t *));
 void rctx_init(reorder_context_t *rctx, uint16_t idx,
   reorder_window_t *rwin, uint32_t sn);
-void rctx_free(const reorder_context_t *rctx);
-void olock_unlock(const reorder_context_t *rctx, reorder_window_t *rwin,
- uint32_t lock_index);
-void olock_release(const reorder_context_t *rctx);
-void rctx_retire(reorder_context_t *first);
 void rctx_release(reorder_context_t *rctx);
 int rctx_save(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], int num);
 
diff --git a/platform/linux-generic/odp_schedule_scalable_ordered.c 
b/platform/linux-generic/odp_schedule_scalable_ordered.c
index 90ddb61c..e4468a90 100644
--- a/platform/linux-generic/odp_schedule_scalable_ordered.c
+++ b/platform/linux-generic/odp_schedule_scalable_ordered.c
@@ -71,10 +71,10 @@ bool rwin_reserve(reorder_window_t *rwin, uint32_t *sn)
return true;
 }
 
-void rwin_insert(reorder_window_t *rwin,
-reorder_context_t *rctx,
-uint32_t sn,
-void (*callback)(reorder_context_t *))
+static void rwin_insert(reorder_window_t *rwin,
+   reorder_context_t *rctx,
+   uint32_t sn,
+   void (*callback)(reorder_context_t *))
 {
/* Initialise to silence scan-build */
hc_t old = {0, 0};
@@ -172,7 +172,7 @@ void rctx_init(reorder_context_t *rctx, uint16_t idx,
rctx->numevts = 0;
 }
 
-inline void rctx_free(const reorder_context_t *rctx)
+static inline void rctx_free(const reorder_context_t *rctx)
 {
const reorder_context_t *const base = [-(int)rctx->idx];
const uint32_t first = rctx->idx;
@@ -206,8 +206,9 @@ inline void rctx_free(const reorder_context_t *rctx)
}
 }
 
-inline void olock_unlock(const reorder_context_t *rctx, reorder_window_t *rwin,
-uint32_t lock_index)
+static inline void olock_unlock(const reorder_context_t *rctx,
+   reorder_window_t *rwin,
+   uint32_t lock_index)
 {
if ((rctx->olock_flags & (1U << lock_index)) == 0) {
/* Use relaxed ordering, we are not releasing any updates */
@@ -215,7 +216,7 @@ inline void olock_unlock(const reorder_context_t *rctx, 
reorder_window_t *rwin,
}
 }
 
-void olock_release(const reorder_context_t *rctx)
+static void olock_release(const reorder_context_t *rctx)
 {
reorder_window_t *rwin;
int i;
@@ -246,7 +247,7 @@ static void blocking_enqueue(queue_entry_t *q, 
odp_buffer_hdr_t **evts, int num)
}
 }
 
-void rctx_retire(reorder_context_t *first)
+static void rctx_retire(reorder_context_t *first)
 {
reorder_context_t *rctx;
queue_entry_t *q;



[lng-odp] [PATCH API-NEXT v3 3/4] linux-gen: scalable sched: mark sched_grp_lock as static

2017-08-08 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 108 (lumag:symbols-cleanup)
 ** https://github.com/Linaro/odp/pull/108
 ** Patch: https://github.com/Linaro/odp/pull/108.patch
 ** Base sha: e420668cd3886f003c8bd6022e210bf08a0ee3b5
 ** Merge commit sha: 4ec4664e462d336f5b34b03ec598531c07ebf235
 **/
 platform/linux-generic/odp_schedule_scalable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/platform/linux-generic/odp_schedule_scalable.c 
b/platform/linux-generic/odp_schedule_scalable.c
index 78159b53..a289a7d7 100644
--- a/platform/linux-generic/odp_schedule_scalable.c
+++ b/platform/linux-generic/odp_schedule_scalable.c
@@ -87,7 +87,7 @@ ODP_STATIC_ASSERT(CHECK_IS_POWER2(ODP_CONFIG_QUEUES),
 static sched_group_mask_t sg_free;
 static sched_group_t *sg_vec[MAX_SCHED_GROUP];
 /* Group lock for MT-safe APIs */
-odp_spinlock_t sched_grp_lock;
+static odp_spinlock_t sched_grp_lock;
 
 #define SCHED_GROUP_JOIN 0
 #define SCHED_GROUP_LEAVE 1



[lng-odp] [PATCH API-NEXT v3 1/4] linux-gen: classification: mark several functions as static

2017-08-08 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 108 (lumag:symbols-cleanup)
 ** https://github.com/Linaro/odp/pull/108
 ** Patch: https://github.com/Linaro/odp/pull/108.patch
 ** Base sha: e420668cd3886f003c8bd6022e210bf08a0ee3b5
 ** Merge commit sha: 4ec4664e462d336f5b34b03ec598531c07ebf235
 **/
 .../linux-generic/include/odp_classification_internal.h|  7 ---
 platform/linux-generic/odp_classification.c| 14 +-
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/platform/linux-generic/include/odp_classification_internal.h 
b/platform/linux-generic/include/odp_classification_internal.h
index 208b0f5b..8882a717 100644
--- a/platform/linux-generic/include/odp_classification_internal.h
+++ b/platform/linux-generic/include/odp_classification_internal.h
@@ -49,13 +49,6 @@ This function should be called during pktio initialization.
 **/
 int pktio_classifier_init(pktio_entry_t *pktio);
 
-void _odp_cls_update_hash_proto(cos_t *cos,
-   odp_pktin_hash_proto_t hash_proto);
-
-uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr,
-odp_cls_hash_proto_t hash_proto,
-const uint8_t *base);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/platform/linux-generic/odp_classification.c 
b/platform/linux-generic/odp_classification.c
index f9a82a2e..af8b5862 100644
--- a/platform/linux-generic/odp_classification.c
+++ b/platform/linux-generic/odp_classification.c
@@ -33,7 +33,7 @@ static cos_tbl_t *cos_tbl;
 static pmr_tbl_t   *pmr_tbl;
 static _cls_queue_grp_tbl_t *queue_grp_tbl;
 
-const rss_key default_rss = {
+static const rss_key default_rss = {
.u8 = {
0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
0x41, 0x67, 0x25, 0x3d, 0x43, 0xa3, 0x8f, 0xb0,
@@ -191,7 +191,7 @@ int odp_cls_capability(odp_cls_capability_t *capability)
return 0;
 }
 
-void _odp_cls_update_hash_proto(cos_t *cos, odp_pktin_hash_proto_t hash_proto)
+static void _odp_cls_update_hash_proto(cos_t *cos, odp_pktin_hash_proto_t 
hash_proto)
 {
if (hash_proto.proto.ipv4 || hash_proto.proto.ipv4_tcp ||
hash_proto.proto.ipv4_udp)
@@ -934,6 +934,10 @@ static inline cos_t *cls_select_cos(pktio_entry_t *entry,
return cls->default_cos;
 }
 
+static uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr,
+   odp_cls_hash_proto_t hash_proto,
+   const uint8_t *base);
+
 /**
  * Classify packet
  *
@@ -989,9 +993,9 @@ int cls_classify_packet(pktio_entry_t *entry, const uint8_t 
*base,
return 0;
 }
 
-uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr,
-odp_cls_hash_proto_t hash_proto,
-const uint8_t *base)
+static uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr,
+   odp_cls_hash_proto_t hash_proto,
+   const uint8_t *base)
 {
thash_tuple_t tuple;
const _odp_ipv4hdr_t *ipv4;



[lng-odp] [PATCH API-NEXT v3 0/4] Symbols cleanup

2017-08-08 Thread Github ODP bot
Several low-hanging fruits for https://bugs.linaro.org/show_bug.cgi?id=2988

github
/** Email created from pull request 108 (lumag:symbols-cleanup)
 ** https://github.com/Linaro/odp/pull/108
 ** Patch: https://github.com/Linaro/odp/pull/108.patch
 ** Base sha: e420668cd3886f003c8bd6022e210bf08a0ee3b5
 ** Merge commit sha: 4ec4664e462d336f5b34b03ec598531c07ebf235
 **/
/github

checkpatch.pl
WARNING: line over 80 characters
#56: FILE: platform/linux-generic/odp_classification.c:194:
+static void _odp_cls_update_hash_proto(cos_t *cos, odp_pktin_hash_proto_t 
hash_proto)

total: 0 errors, 1 warnings, 0 checks, 51 lines checked


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

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


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


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


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


Re: [lng-odp] [EXT] Re: Parser configuration

2017-08-08 Thread Bill Fischofer
On Tue, Aug 8, 2017 at 2:29 PM, Liron Himi  wrote:

> See comments inline
>
>
>
> Liron
>
>
>
> *From:* Bill Fischofer [mailto:bill.fischo...@linaro.org]
> *Sent:* Tuesday, August 08, 2017 22:07
> *To:* Liron Himi 
> *Cc:* lng-odp@lists.linaro.org
> *Subject:* [EXT] Re: [lng-odp] Parser configuration
>
>
>
> External Email
> --
>
>
>
>
>
> On Tue, Aug 8, 2017 at 1:43 PM, Liron Himi  wrote:
>
> Hi,
>
> I have a query regarding the new parser configuration.
> Let's say application set it to 'ODP_PKTIO_PARSER_LAYER_L2', does it means
> that the platform implementation must parse and recognize all eth-type that
> have ODP API such as ARP,VLAN, etc.? same for ICMP, etc for L3?
>
>
>
> ODP defines the protocols it supports at a given layer and implementations
> that parse at that layer are expected to support those protocols.
> Implementations are free to parse deeper than requested, but must parse to
> at least the configured layer on a per-pktio basis. The parse results are
> accessed by the various odp_packet_has_xxx() APIs, and these are exercised
> by the pktio validation test suite.
>
>
>
> However, while VLAN is a Layer 2 protocol, ARP is a Layer 3 protocol and
> ICMP is a Layer 4 protocol.
>
>
>
>
> I'm asking it as I tried to run the parser validation tests and only the
> ones with ARP and ICMP are failing.
> It seems that the validation tests expect from the platform implementation
> to flag it.
>
>
>
> The validation test sets ODP_PKTIO_PARSER_LAYER_ALL and then tests
> individual packet types on a per-layer basis. Does your platform not parse
> ARP or ICMP?
>
> *[L.H.] Our platform implementation only support the protocols that are
> supported by our HW. We don’t do additional SW parsing as it will have
> performance penalty.*
>
>
>

Does the HW signal whether it encountered protocols it didn't recognize?
That would allow you to do supplemental SW parsing only in such cases,
which would permit the current validation tests to pass without incurring
extra overhead for the expected cases.


>
> Is that only validation test assumption or this is the real assumption and
> expectation from the platform?
> Maybe it is good to extend the parser with supported protocol per layer in
> the capabilities. Same as we have for checksum support.
>
>
>
> That might be an interesting addition, but may not buy much. The parser
> layer controls were added to allow applications to hint platforms that do
> SW parsing since in such platforms parsing to a depth that isn't needed by
> the application wastes cycles. Platforms that have HW parsers typically
> parse everything at line rate anyway, so these controls are effectively
> ignored.
>
> *[L.H.] Our HW currently do have HW parsing but not all protocols are
> identify by it. E.g. In L4 we only identify UDP and TCP.*
>
> *So the above suggestion will allow us to communicate with the application
> on the supported protocols. *
>
> *I think it is make sense that along with the supported parsing layer the
> platform implementation will also specific the supported protocols.*
>
> *As probably some platform will need sw parsing to support all protocol,
> maybe application will also want to give a hint on the required protocols.*
>
> *e.g. TCP application that only need TCP support and no other protocols.*
>
> *In the future ODP may extend its protocols support, I guess that forcing
> the platform to support them even if require SW parsing is a good idea.*
>

The larger problem is that there are many protocols that ODP currently
doesn't recognize and when you add to that application-specific shim
layers, tunneling options, etc. it becomes clear that the current
predefined protocol set is too restrictive and inflexible to meet
application needs going forward. For this reason we'd like to explore
integration with more advanced technologies like P4, which would permit the
parser definitions to be offloaded from the ODP API specification and
modularized.  Applications would then be free to define their own arbitrary
packet formats, or to select from a library of predefined packet templates
that cover these extended parsing needs while still being able to take
advantage of HW-accelerated parsing.


>
>
>
> Regards,
> Liron
>
>
>


Re: [lng-odp] [EXT] Re: Parser configuration

2017-08-08 Thread Liron Himi
See comments inline

Liron

From: Bill Fischofer [mailto:bill.fischo...@linaro.org]
Sent: Tuesday, August 08, 2017 22:07
To: Liron Himi 
Cc: lng-odp@lists.linaro.org
Subject: [EXT] Re: [lng-odp] Parser configuration

External Email



On Tue, Aug 8, 2017 at 1:43 PM, Liron Himi 
> wrote:
Hi,

I have a query regarding the new parser configuration.
Let's say application set it to 'ODP_PKTIO_PARSER_LAYER_L2', does it means that 
the platform implementation must parse and recognize all eth-type that have ODP 
API such as ARP,VLAN, etc.? same for ICMP, etc for L3?

ODP defines the protocols it supports at a given layer and implementations that 
parse at that layer are expected to support those protocols. Implementations 
are free to parse deeper than requested, but must parse to at least the 
configured layer on a per-pktio basis. The parse results are accessed by the 
various odp_packet_has_xxx() APIs, and these are exercised by the pktio 
validation test suite.

However, while VLAN is a Layer 2 protocol, ARP is a Layer 3 protocol and ICMP 
is a Layer 4 protocol.


I'm asking it as I tried to run the parser validation tests and only the ones 
with ARP and ICMP are failing.
It seems that the validation tests expect from the platform implementation to 
flag it.

The validation test sets ODP_PKTIO_PARSER_LAYER_ALL and then tests individual 
packet types on a per-layer basis. Does your platform not parse ARP or ICMP?
[L.H.] Our platform implementation only support the protocols that are 
supported by our HW. We don’t do additional SW parsing as it will have 
performance penalty.


Is that only validation test assumption or this is the real assumption and 
expectation from the platform?
Maybe it is good to extend the parser with supported protocol per layer in the 
capabilities. Same as we have for checksum support.

That might be an interesting addition, but may not buy much. The parser layer 
controls were added to allow applications to hint platforms that do SW parsing 
since in such platforms parsing to a depth that isn't needed by the application 
wastes cycles. Platforms that have HW parsers typically parse everything at 
line rate anyway, so these controls are effectively ignored.
[L.H.] Our HW currently do have HW parsing but not all protocols are identify 
by it. E.g. In L4 we only identify UDP and TCP.
So the above suggestion will allow us to communicate with the application on 
the supported protocols.
I think it is make sense that along with the supported parsing layer the 
platform implementation will also specific the supported protocols.
As probably some platform will need sw parsing to support all protocol, maybe 
application will also want to give a hint on the required protocols.
e.g. TCP application that only need TCP support and no other protocols.
In the future ODP may extend its protocols support, I guess that forcing the 
platform to support them even if require SW parsing is a good idea.


Regards,
Liron



Re: [lng-odp] Parser configuration

2017-08-08 Thread Bill Fischofer
On Tue, Aug 8, 2017 at 1:43 PM, Liron Himi  wrote:

> Hi,
>
> I have a query regarding the new parser configuration.
> Let's say application set it to 'ODP_PKTIO_PARSER_LAYER_L2', does it means
> that the platform implementation must parse and recognize all eth-type that
> have ODP API such as ARP,VLAN, etc.? same for ICMP, etc for L3?
>

ODP defines the protocols it supports at a given layer and implementations
that parse at that layer are expected to support those protocols.
Implementations are free to parse deeper than requested, but must parse to
at least the configured layer on a per-pktio basis. The parse results are
accessed by the various odp_packet_has_xxx() APIs, and these are exercised
by the pktio validation test suite.

However, while VLAN is a Layer 2 protocol, ARP is a Layer 3 protocol and
ICMP is a Layer 4 protocol.


>
> I'm asking it as I tried to run the parser validation tests and only the
> ones with ARP and ICMP are failing.
> It seems that the validation tests expect from the platform implementation
> to flag it.
>

The validation test sets ODP_PKTIO_PARSER_LAYER_ALL and then tests
individual packet types on a per-layer basis. Does your platform not parse
ARP or ICMP?


>
> Is that only validation test assumption or this is the real assumption and
> expectation from the platform?
> Maybe it is good to extend the parser with supported protocol per layer in
> the capabilities. Same as we have for checksum support.
>

That might be an interesting addition, but may not buy much. The parser
layer controls were added to allow applications to hint platforms that do
SW parsing since in such platforms parsing to a depth that isn't needed by
the application wastes cycles. Platforms that have HW parsers typically
parse everything at line rate anyway, so these controls are effectively
ignored.


>
> Regards,
> Liron
>


[lng-odp] Parser configuration

2017-08-08 Thread Liron Himi
Hi,

I have a query regarding the new parser configuration.
Let's say application set it to 'ODP_PKTIO_PARSER_LAYER_L2', does it means that 
the platform implementation must parse and recognize all eth-type that have ODP 
API such as ARP,VLAN, etc.? same for ICMP, etc for L3?

I'm asking it as I tried to run the parser validation tests and only the ones 
with ARP and ICMP are failing.
It seems that the validation tests expect from the platform implementation to 
flag it.

Is that only validation test assumption or this is the real assumption and 
expectation from the platform?
Maybe it is good to extend the parser with supported protocol per layer in the 
capabilities. Same as we have for checksum support.

Regards,
Liron


Re: [lng-odp] [PATCH API-NEXT v8 1/1] comp: compression spec

2017-08-08 Thread Narayana Prasad Athreya
Can someone explain what is the use-case of #1 and why the use-case 
cannot be met with proposed API?


PRasad

On Tuesday 08 August 2017 10:21 PM, shally verma wrote:

Petri/Berry

As per discussion in today's call, this is what I summarize :

Two new requirements added:

1. Support compression / decompression of multiple ranges with in one
single packet and
2. Operating on multiple packets with in call where each packet may
further carry multiple range.

To meet 1st requirement, current proposal says, calling
odp_packet_compress/decomp() for each packet per range as it allows
easy and clean management of output buffer and also more flexibility
per various possible  application use cases:.
- call can be made in statefull or stateless mode per each range, Or
- Modify  headers according to each range output,
- Application manage output buffers at their end,
- Async notification on out of space condition  will be easily maintained.

Currently , we do support file-based compression using ODP APIs, but
i.e. on stream of data bytes where 1 chunk occupy - 1 packet (which
can be segmented/unsegmented) not on stream of Packets.
Is there a use-case to have a file which consists of stream of
Packets? (where packet is of type HTTP Packet ?)

New proposal says "allow multiple ranges with in one single call". Few
concerns raised for this, key one include:

- How do we know each range be compressed in stateful  or stateless
mode i.e. each range is independent Or dependent?
- How do we handle out_of_space error while operating on individual
range? Especially for the case when Implementation try to use HW
parallelization for better throughput?
- How do we support same design in asynchronous mode ??
- How do we see it  - as performance gain ? Or ease-of-use?  Or it may
end up introducing more overhead to implementation.

Please feedback your inputs to design issues as envisioned.

For now we can focus on requirement #1 as design for requirement # 2
will be based on outcome of #1.

Thanks
Shally

On Tue, Aug 8, 2017 at 6:38 PM, Savolainen, Petri (Nokia - FI/Espoo)
 wrote:



-Original Message-
From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of
Github ODP bot
Sent: Friday, August 04, 2017 4:00 PM
To: lng-odp@lists.linaro.org
Subject: [lng-odp] [PATCH API-NEXT v8 1/1] comp: compression spec

From: Shally Verma 

Signed-off-by: Shally Verma 
Signed-off-by: Mahipal Challa  Cc
prasadathreya.naray...@cavium.com
---
/** Email created from pull request 102 (1234sv:api-next)
  ** https://github.com/Linaro/odp/pull/102
  ** Patch: https://github.com/Linaro/odp/pull/102.patch
  ** Base sha: 8390f890d4bd2babb63a24f7b15d2f4763e44050
  ** Merge commit sha: fbdff8c82a19f5b640ae299204b3bb1bbbefdccb
  **/
  include/odp/api/spec/comp.h | 815

  1 file changed, 815 insertions(+)
  create mode 100644 include/odp/api/spec/comp.h

diff --git a/include/odp/api/spec/comp.h b/include/odp/api/spec/comp.h
new file mode 100644
index ..2956094c
--- /dev/null
+++ b/include/odp/api/spec/comp.h
@@ -0,0 +1,815 @@
+/* Copyright (c) 2013, Linaro Limited

Year 2017


+
+/**
+ * Comp API hash algorithm
+ *
+ */
+typedef enum {
+ /** ODP_COMP_HASH_ALG_NONE*/

This kind of comment is not very helpful. Each enumeration needs explanation - 
like odp_comp_alg_t under.


+ ODP_COMP_HASH_ALG_NONE,
+ /** ODP_COMP_HASH_ALG_SHA1*/
+ ODP_COMP_HASH_ALG_SHA1,
+ /**  ODP_COMP_HASH_ALG_SHA256*/
+ ODP_COMP_HASH_ALG_SHA256
+} odp_comp_hash_alg_t;
+
+/**
+ * Comp API compression algorithm
+ *
+ */
+typedef enum {
+ /** No algorithm specified.
+  * Means no compression, output == input.
+  * if provided, no operation (compression/decompression or
hash)
+  * applied on input. Added for testing purpose.
+  */
+ ODP_COMP_ALG_NULL,
+ /** DEFLATE - RFC1951 */
+ ODP_COMP_ALG_DEFLATE,
+ /** ZLIB - RFC1950 */
+ ODP_COMP_ALG_ZLIB,
+ /** LZS */
+ ODP_COMP_ALG_LZS
+} odp_comp_alg_t;
+
+
+/**
+ * Hash algorithms in a bit field structure
+ *
+ */
+typedef union odp_comp_hash_algos_t {
+ /** hash algorithms */
+ struct {
+ /** SHA-1 */
+ uint32_t sha1  : 1;
+
+ /** SHA with 256 bits of Message Digest */
+ uint32_t sha256 : 1;


Need to be more explicit in algorithm definition: SHA-1, SHA-256, ... algorithm 
(SHA-2 would also do, but we use SHA-256 in crypto API since it seems to be 
used by standards).

Actually, these explanations should go under enum definitions and then just 
refer to those enums here - like odp_comp_algos_t under.



+
+ } bit;
+
+ /** All bits of the bit field structure
+  *
+  * This field can be used to set/clear all flags, or bitwise
+  * operations over the entire structure.
+  */
+ uint32_t all_bits;
+} odp_comp_hash_algos_t;
+
+/**

Re: [lng-odp] [PATCH API-NEXT v8 1/1] comp: compression spec

2017-08-08 Thread shally verma
Just a Resend.

On Tue, Aug 8, 2017 at 10:21 PM, shally verma
 wrote:
> Petri/Berry
>
> As per discussion in today's call, this is what I summarize :
>
> Two new requirements added:
>
> 1. Support compression / decompression of multiple ranges with in one
> single packet and
> 2. Operating on multiple packets with in call where each packet may
> further carry multiple range.
>
> To meet 1st requirement, current proposal says, calling
> odp_packet_compress/decomp() for each packet per range as it allows
> easy and clean management of output buffer and also more flexibility
> per various possible  application use cases:.
> - call can be made in statefull or stateless mode per each range, Or
> - Modify  headers according to each range output,
> - Application manage output buffers at their end,
> - Async notification on out of space condition  will be easily maintained.
>
> Currently , we do support file-based compression using ODP APIs, but
> i.e. on stream of data bytes where 1 chunk occupy - 1 packet (which
> can be segmented/unsegmented) not on stream of Packets.
> Is there a use-case to have a file which consists of stream of
> Packets? (where packet is of type HTTP Packet ?)
>
> New proposal says "allow multiple ranges with in one single call". Few
> concerns raised for this, key one include:
>
> - How do we know each range be compressed in stateful  or stateless
> mode i.e. each range is independent Or dependent?
> - How do we handle out_of_space error while operating on individual
> range? Especially for the case when Implementation try to use HW
> parallelization for better throughput?
> - How do we support same design in asynchronous mode ??
> - How do we see it  - as performance gain ? Or ease-of-use?  Or it may
> end up introducing more overhead to implementation.
>
> Please feedback your inputs to design issues as envisioned.
>
> For now we can focus on requirement #1 as design for requirement # 2
> will be based on outcome of #1.
>
> Thanks
> Shally
>
> On Tue, Aug 8, 2017 at 6:38 PM, Savolainen, Petri (Nokia - FI/Espoo)
>  wrote:
>>
>>
>>> -Original Message-
>>> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of
>>> Github ODP bot
>>> Sent: Friday, August 04, 2017 4:00 PM
>>> To: lng-odp@lists.linaro.org
>>> Subject: [lng-odp] [PATCH API-NEXT v8 1/1] comp: compression spec
>>>
>>> From: Shally Verma 
>>>
>>> Signed-off-by: Shally Verma 
>>> Signed-off-by: Mahipal Challa  Cc
>>> prasadathreya.naray...@cavium.com
>>> ---
>>> /** Email created from pull request 102 (1234sv:api-next)
>>>  ** https://github.com/Linaro/odp/pull/102
>>>  ** Patch: https://github.com/Linaro/odp/pull/102.patch
>>>  ** Base sha: 8390f890d4bd2babb63a24f7b15d2f4763e44050
>>>  ** Merge commit sha: fbdff8c82a19f5b640ae299204b3bb1bbbefdccb
>>>  **/
>>>  include/odp/api/spec/comp.h | 815
>>> 
>>>  1 file changed, 815 insertions(+)
>>>  create mode 100644 include/odp/api/spec/comp.h
>>>
>>> diff --git a/include/odp/api/spec/comp.h b/include/odp/api/spec/comp.h
>>> new file mode 100644
>>> index ..2956094c
>>> --- /dev/null
>>> +++ b/include/odp/api/spec/comp.h
>>> @@ -0,0 +1,815 @@
>>> +/* Copyright (c) 2013, Linaro Limited
>>
>> Year 2017
>>
>>> +
>>> +/**
>>> + * Comp API hash algorithm
>>> + *
>>> + */
>>> +typedef enum {
>>> + /** ODP_COMP_HASH_ALG_NONE*/
>>
>> This kind of comment is not very helpful. Each enumeration needs explanation 
>> - like odp_comp_alg_t under.
>>
>>> + ODP_COMP_HASH_ALG_NONE,
>>> + /** ODP_COMP_HASH_ALG_SHA1*/
>>> + ODP_COMP_HASH_ALG_SHA1,
>>> + /**  ODP_COMP_HASH_ALG_SHA256*/
>>> + ODP_COMP_HASH_ALG_SHA256
>>> +} odp_comp_hash_alg_t;
>>> +
>>> +/**
>>> + * Comp API compression algorithm
>>> + *
>>> + */
>>> +typedef enum {
>>> + /** No algorithm specified.
>>> +  * Means no compression, output == input.
>>> +  * if provided, no operation (compression/decompression or
>>> hash)
>>> +  * applied on input. Added for testing purpose.
>>> +  */
>>> + ODP_COMP_ALG_NULL,
>>> + /** DEFLATE - RFC1951 */
>>> + ODP_COMP_ALG_DEFLATE,
>>> + /** ZLIB - RFC1950 */
>>> + ODP_COMP_ALG_ZLIB,
>>> + /** LZS */
>>> + ODP_COMP_ALG_LZS
>>> +} odp_comp_alg_t;
>>> +
>>> +
>>> +/**
>>> + * Hash algorithms in a bit field structure
>>> + *
>>> + */
>>> +typedef union odp_comp_hash_algos_t {
>>> + /** hash algorithms */
>>> + struct {
>>> + /** SHA-1 */
>>> + uint32_t sha1  : 1;
>>> +
>>> + /** SHA with 256 bits of Message Digest */
>>> + uint32_t sha256 : 1;
>>
>>
>> Need to be more explicit in algorithm definition: SHA-1, SHA-256, ... 
>> algorithm (SHA-2 would also do, but we use SHA-256 in crypto API since it 
>> seems to be used by standards).
>>
>> Actually, these explanations should go 

Re: [lng-odp] [PATCH API-NEXT v8 1/1] comp: compression spec

2017-08-08 Thread shally verma
Petri/Berry

As per discussion in today's call, this is what I summarize :

Two new requirements added:

1. Support compression / decompression of multiple ranges with in one
single packet and
2. Operating on multiple packets with in call where each packet may
further carry multiple range.

To meet 1st requirement, current proposal says, calling
odp_packet_compress/decomp() for each packet per range as it allows
easy and clean management of output buffer and also more flexibility
per various possible  application use cases:.
- call can be made in statefull or stateless mode per each range, Or
- Modify  headers according to each range output,
- Application manage output buffers at their end,
- Async notification on out of space condition  will be easily maintained.

Currently , we do support file-based compression using ODP APIs, but
i.e. on stream of data bytes where 1 chunk occupy - 1 packet (which
can be segmented/unsegmented) not on stream of Packets.
Is there a use-case to have a file which consists of stream of
Packets? (where packet is of type HTTP Packet ?)

New proposal says "allow multiple ranges with in one single call". Few
concerns raised for this, key one include:

- How do we know each range be compressed in stateful  or stateless
mode i.e. each range is independent Or dependent?
- How do we handle out_of_space error while operating on individual
range? Especially for the case when Implementation try to use HW
parallelization for better throughput?
- How do we support same design in asynchronous mode ??
- How do we see it  - as performance gain ? Or ease-of-use?  Or it may
end up introducing more overhead to implementation.

Please feedback your inputs to design issues as envisioned.

For now we can focus on requirement #1 as design for requirement # 2
will be based on outcome of #1.

Thanks
Shally

On Tue, Aug 8, 2017 at 6:38 PM, Savolainen, Petri (Nokia - FI/Espoo)
 wrote:
>
>
>> -Original Message-
>> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of
>> Github ODP bot
>> Sent: Friday, August 04, 2017 4:00 PM
>> To: lng-odp@lists.linaro.org
>> Subject: [lng-odp] [PATCH API-NEXT v8 1/1] comp: compression spec
>>
>> From: Shally Verma 
>>
>> Signed-off-by: Shally Verma 
>> Signed-off-by: Mahipal Challa  Cc
>> prasadathreya.naray...@cavium.com
>> ---
>> /** Email created from pull request 102 (1234sv:api-next)
>>  ** https://github.com/Linaro/odp/pull/102
>>  ** Patch: https://github.com/Linaro/odp/pull/102.patch
>>  ** Base sha: 8390f890d4bd2babb63a24f7b15d2f4763e44050
>>  ** Merge commit sha: fbdff8c82a19f5b640ae299204b3bb1bbbefdccb
>>  **/
>>  include/odp/api/spec/comp.h | 815
>> 
>>  1 file changed, 815 insertions(+)
>>  create mode 100644 include/odp/api/spec/comp.h
>>
>> diff --git a/include/odp/api/spec/comp.h b/include/odp/api/spec/comp.h
>> new file mode 100644
>> index ..2956094c
>> --- /dev/null
>> +++ b/include/odp/api/spec/comp.h
>> @@ -0,0 +1,815 @@
>> +/* Copyright (c) 2013, Linaro Limited
>
> Year 2017
>
>> +
>> +/**
>> + * Comp API hash algorithm
>> + *
>> + */
>> +typedef enum {
>> + /** ODP_COMP_HASH_ALG_NONE*/
>
> This kind of comment is not very helpful. Each enumeration needs explanation 
> - like odp_comp_alg_t under.
>
>> + ODP_COMP_HASH_ALG_NONE,
>> + /** ODP_COMP_HASH_ALG_SHA1*/
>> + ODP_COMP_HASH_ALG_SHA1,
>> + /**  ODP_COMP_HASH_ALG_SHA256*/
>> + ODP_COMP_HASH_ALG_SHA256
>> +} odp_comp_hash_alg_t;
>> +
>> +/**
>> + * Comp API compression algorithm
>> + *
>> + */
>> +typedef enum {
>> + /** No algorithm specified.
>> +  * Means no compression, output == input.
>> +  * if provided, no operation (compression/decompression or
>> hash)
>> +  * applied on input. Added for testing purpose.
>> +  */
>> + ODP_COMP_ALG_NULL,
>> + /** DEFLATE - RFC1951 */
>> + ODP_COMP_ALG_DEFLATE,
>> + /** ZLIB - RFC1950 */
>> + ODP_COMP_ALG_ZLIB,
>> + /** LZS */
>> + ODP_COMP_ALG_LZS
>> +} odp_comp_alg_t;
>> +
>> +
>> +/**
>> + * Hash algorithms in a bit field structure
>> + *
>> + */
>> +typedef union odp_comp_hash_algos_t {
>> + /** hash algorithms */
>> + struct {
>> + /** SHA-1 */
>> + uint32_t sha1  : 1;
>> +
>> + /** SHA with 256 bits of Message Digest */
>> + uint32_t sha256 : 1;
>
>
> Need to be more explicit in algorithm definition: SHA-1, SHA-256, ... 
> algorithm (SHA-2 would also do, but we use SHA-256 in crypto API since it 
> seems to be used by standards).
>
> Actually, these explanations should go under enum definitions and then just 
> refer to those enums here - like odp_comp_algos_t under.
>
>
>> +
>> + } bit;
>> +
>> + /** All bits of the bit field structure
>> +  *
>> +  * This field can be used to set/clear all flags, or bitwise
>> +  * 

[lng-odp] [PATCH API-NEXT v2 4/4] linux-gen: scalable queue: mark queue_shm_pool as static

2017-08-08 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 108 (lumag:symbols-cleanup)
 ** https://github.com/Linaro/odp/pull/108
 ** Patch: https://github.com/Linaro/odp/pull/108.patch
 ** Base sha: e420668cd3886f003c8bd6022e210bf08a0ee3b5
 ** Merge commit sha: 3c45ed0f11246bba34da1ea38de6e2ffc9435299
 **/
 platform/linux-generic/odp_queue_scalable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/platform/linux-generic/odp_queue_scalable.c 
b/platform/linux-generic/odp_queue_scalable.c
index 503b40f5..79148060 100644
--- a/platform/linux-generic/odp_queue_scalable.c
+++ b/platform/linux-generic/odp_queue_scalable.c
@@ -49,7 +49,7 @@ typedef struct queue_table_t {
 } queue_table_t;
 
 static queue_table_t *queue_tbl;
-_odp_ishm_pool_t *queue_shm_pool;
+static _odp_ishm_pool_t *queue_shm_pool;
 
 static inline odp_queue_t queue_from_id(uint32_t queue_id)
 {



[lng-odp] [PATCH API-NEXT v2 2/4] linux-gen: scalable sched: mark several function as static

2017-08-08 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 108 (lumag:symbols-cleanup)
 ** https://github.com/Linaro/odp/pull/108
 ** Patch: https://github.com/Linaro/odp/pull/108.patch
 ** Base sha: e420668cd3886f003c8bd6022e210bf08a0ee3b5
 ** Merge commit sha: 3c45ed0f11246bba34da1ea38de6e2ffc9435299
 **/
 platform/linux-generic/include/odp_schedule_scalable_ordered.h | 9 -
 platform/linux-generic/odp_schedule_scalable_ordered.c | 5 +
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/platform/linux-generic/include/odp_schedule_scalable_ordered.h 
b/platform/linux-generic/include/odp_schedule_scalable_ordered.h
index 941304b7..1c365a2b 100644
--- a/platform/linux-generic/include/odp_schedule_scalable_ordered.h
+++ b/platform/linux-generic/include/odp_schedule_scalable_ordered.h
@@ -115,17 +115,8 @@ reorder_window_t *rwin_alloc(_odp_ishm_pool_t *pool,
 unsigned lock_count);
 int rwin_free(_odp_ishm_pool_t *pool, reorder_window_t *rwin);
 bool rwin_reserve(reorder_window_t *rwin, uint32_t *sn);
-void rwin_insert(reorder_window_t *rwin,
-reorder_context_t *rctx,
-uint32_t sn,
-void (*callback)(reorder_context_t *));
 void rctx_init(reorder_context_t *rctx, uint16_t idx,
   reorder_window_t *rwin, uint32_t sn);
-void rctx_free(const reorder_context_t *rctx);
-void olock_unlock(const reorder_context_t *rctx, reorder_window_t *rwin,
- uint32_t lock_index);
-void olock_release(const reorder_context_t *rctx);
-void rctx_retire(reorder_context_t *first);
 void rctx_release(reorder_context_t *rctx);
 int rctx_save(queue_entry_t *queue, odp_buffer_hdr_t *buf_hdr[], int num);
 
diff --git a/platform/linux-generic/odp_schedule_scalable_ordered.c 
b/platform/linux-generic/odp_schedule_scalable_ordered.c
index 90ddb61c..59f64582 100644
--- a/platform/linux-generic/odp_schedule_scalable_ordered.c
+++ b/platform/linux-generic/odp_schedule_scalable_ordered.c
@@ -71,6 +71,7 @@ bool rwin_reserve(reorder_window_t *rwin, uint32_t *sn)
return true;
 }
 
+static
 void rwin_insert(reorder_window_t *rwin,
 reorder_context_t *rctx,
 uint32_t sn,
@@ -172,6 +173,7 @@ void rctx_init(reorder_context_t *rctx, uint16_t idx,
rctx->numevts = 0;
 }
 
+static
 inline void rctx_free(const reorder_context_t *rctx)
 {
const reorder_context_t *const base = [-(int)rctx->idx];
@@ -206,6 +208,7 @@ inline void rctx_free(const reorder_context_t *rctx)
}
 }
 
+static
 inline void olock_unlock(const reorder_context_t *rctx, reorder_window_t *rwin,
 uint32_t lock_index)
 {
@@ -215,6 +218,7 @@ inline void olock_unlock(const reorder_context_t *rctx, 
reorder_window_t *rwin,
}
 }
 
+static
 void olock_release(const reorder_context_t *rctx)
 {
reorder_window_t *rwin;
@@ -246,6 +250,7 @@ static void blocking_enqueue(queue_entry_t *q, 
odp_buffer_hdr_t **evts, int num)
}
 }
 
+static
 void rctx_retire(reorder_context_t *first)
 {
reorder_context_t *rctx;



[lng-odp] [PATCH API-NEXT v2 3/4] linux-gen: scalable sched: mark sched_grp_lock as static

2017-08-08 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 108 (lumag:symbols-cleanup)
 ** https://github.com/Linaro/odp/pull/108
 ** Patch: https://github.com/Linaro/odp/pull/108.patch
 ** Base sha: e420668cd3886f003c8bd6022e210bf08a0ee3b5
 ** Merge commit sha: 3c45ed0f11246bba34da1ea38de6e2ffc9435299
 **/
 platform/linux-generic/odp_schedule_scalable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/platform/linux-generic/odp_schedule_scalable.c 
b/platform/linux-generic/odp_schedule_scalable.c
index 78159b53..a289a7d7 100644
--- a/platform/linux-generic/odp_schedule_scalable.c
+++ b/platform/linux-generic/odp_schedule_scalable.c
@@ -87,7 +87,7 @@ ODP_STATIC_ASSERT(CHECK_IS_POWER2(ODP_CONFIG_QUEUES),
 static sched_group_mask_t sg_free;
 static sched_group_t *sg_vec[MAX_SCHED_GROUP];
 /* Group lock for MT-safe APIs */
-odp_spinlock_t sched_grp_lock;
+static odp_spinlock_t sched_grp_lock;
 
 #define SCHED_GROUP_JOIN 0
 #define SCHED_GROUP_LEAVE 1



[lng-odp] [PATCH API-NEXT v2 1/4] linux-gen: classification: mark several functions as static

2017-08-08 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 108 (lumag:symbols-cleanup)
 ** https://github.com/Linaro/odp/pull/108
 ** Patch: https://github.com/Linaro/odp/pull/108.patch
 ** Base sha: e420668cd3886f003c8bd6022e210bf08a0ee3b5
 ** Merge commit sha: 3c45ed0f11246bba34da1ea38de6e2ffc9435299
 **/
 platform/linux-generic/include/odp_classification_internal.h | 7 ---
 platform/linux-generic/odp_classification.c  | 8 
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/platform/linux-generic/include/odp_classification_internal.h 
b/platform/linux-generic/include/odp_classification_internal.h
index 208b0f5b..8882a717 100644
--- a/platform/linux-generic/include/odp_classification_internal.h
+++ b/platform/linux-generic/include/odp_classification_internal.h
@@ -49,13 +49,6 @@ This function should be called during pktio initialization.
 **/
 int pktio_classifier_init(pktio_entry_t *pktio);
 
-void _odp_cls_update_hash_proto(cos_t *cos,
-   odp_pktin_hash_proto_t hash_proto);
-
-uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr,
-odp_cls_hash_proto_t hash_proto,
-const uint8_t *base);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/platform/linux-generic/odp_classification.c 
b/platform/linux-generic/odp_classification.c
index f9a82a2e..8f16c8ef 100644
--- a/platform/linux-generic/odp_classification.c
+++ b/platform/linux-generic/odp_classification.c
@@ -33,6 +33,7 @@ static cos_tbl_t *cos_tbl;
 static pmr_tbl_t   *pmr_tbl;
 static _cls_queue_grp_tbl_t *queue_grp_tbl;
 
+static
 const rss_key default_rss = {
.u8 = {
0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2,
@@ -191,6 +192,7 @@ int odp_cls_capability(odp_cls_capability_t *capability)
return 0;
 }
 
+static
 void _odp_cls_update_hash_proto(cos_t *cos, odp_pktin_hash_proto_t hash_proto)
 {
if (hash_proto.proto.ipv4 || hash_proto.proto.ipv4_tcp ||
@@ -934,6 +936,11 @@ static inline cos_t *cls_select_cos(pktio_entry_t *entry,
return cls->default_cos;
 }
 
+static
+uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr,
+odp_cls_hash_proto_t hash_proto,
+const uint8_t *base);
+
 /**
  * Classify packet
  *
@@ -989,6 +996,7 @@ int cls_classify_packet(pktio_entry_t *entry, const uint8_t 
*base,
return 0;
 }
 
+static
 uint32_t packet_rss_hash(odp_packet_hdr_t *pkt_hdr,
 odp_cls_hash_proto_t hash_proto,
 const uint8_t *base)



[lng-odp] [PATCH API-NEXT v2 0/4] Symbols cleanup

2017-08-08 Thread Github ODP bot
Several low-hanging fruits for https://bugs.linaro.org/show_bug.cgi?id=2988

github
/** Email created from pull request 108 (lumag:symbols-cleanup)
 ** https://github.com/Linaro/odp/pull/108
 ** Patch: https://github.com/Linaro/odp/pull/108.patch
 ** Base sha: e420668cd3886f003c8bd6022e210bf08a0ee3b5
 ** Merge commit sha: 3c45ed0f11246bba34da1ea38de6e2ffc9435299
 **/
/github

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


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


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


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


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


[lng-odp] [PATCH API-NEXT v2 1/1] API:IPSEC: IPSEC events may be reported synchronously.

2017-08-08 Thread Github ODP bot
From: Nikhil Agarwal 

IPSEC events may be delivered synchronous or ansynchrous
depending on implementation. Application will know based on
return value of odp_ipsec_sa_disable API.

Signed-off-by: Nikhil Agarwal 
---
/** Email created from pull request 109 (NikhilA-Linaro:disable_event)
 ** https://github.com/Linaro/odp/pull/109
 ** Patch: https://github.com/Linaro/odp/pull/109.patch
 ** Base sha: e420668cd3886f003c8bd6022e210bf08a0ee3b5
 ** Merge commit sha: 60340859600e926a240fbdd6840640c2b8a6
 **/
 include/odp/api/spec/ipsec.h | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h
index 7085bc0d..0a799ff4 100644
--- a/include/odp/api/spec/ipsec.h
+++ b/include/odp/api/spec/ipsec.h
@@ -831,16 +831,17 @@ odp_ipsec_sa_t odp_ipsec_sa_create(const 
odp_ipsec_sa_param_t *param);
  * before calling disable. Packets in progress during the call may still match
  * the SA and be processed successfully.
  *
- * When in synchronous operation mode, the call will return when it's possible
- * to destroy the SA. In asynchronous mode, the same is indicated by an
- * ODP_EVENT_IPSEC_STATUS event sent to the queue specified for the SA. The
- * status event is guaranteed to be the last event for the SA, i.e. all
- * in-progress operations have completed and resulting events (including status
- * events) have been enqueued before it.
+ * When SA is disabled synchronously, the call will return when it's possible
+ * to destroy the SA indicated by return value 0. If the return value is 1,same
+ * is indicated by an ODP_EVENT_IPSEC_STATUS event sent to the queue specified
+ * for the SA. The status event is guaranteed to be the last event for the SA,
+ * i.e. all in-progress operations have completed and resulting events
+ * (including status events) have been enqueued before it.
  *
  * @param sa  IPSEC SA to be disabled
  *
- * @retval 0  On success
+ * @retval 0  When SA is disabled successfully.
+ * @retval 1  Disable event will be posted on SA queue.
  * @retval <0 On failure
  *
  * @see odp_ipsec_sa_destroy()



[lng-odp] [PATCH API-NEXT v2 0/1] API:IPSEC: IPSEC events may be reported synchronously

2017-08-08 Thread Github ODP bot
IPSEC events may be delivered synchronous or ansynchrous
depending on implementation. Application will know based on
return value of odp_ipsec_sa_disable API.
Signed-off-by: Nikhil Agarwal nikhil.agar...@linaro.org

github
/** Email created from pull request 109 (NikhilA-Linaro:disable_event)
 ** https://github.com/Linaro/odp/pull/109
 ** Patch: https://github.com/Linaro/odp/pull/109.patch
 ** Base sha: e420668cd3886f003c8bd6022e210bf08a0ee3b5
 ** Merge commit sha: 60340859600e926a240fbdd6840640c2b8a6
 **/
/github

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


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


[lng-odp] [Linaro/odp] fd2ca1: linux-gen: hide get_qentry

2017-08-08 Thread GitHub
  Branch: refs/heads/api-next
  Home:   https://github.com/Linaro/odp
  Commit: fd2ca1209dc19c8e8199ee556ad2c9a786eabf78
  
https://github.com/Linaro/odp/commit/fd2ca1209dc19c8e8199ee556ad2c9a786eabf78
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
M platform/linux-generic/include/odp_queue_internal.h
M platform/linux-generic/odp_queue.c
M platform/linux-generic/odp_schedule.c
M platform/linux-generic/odp_schedule_iquery.c

  Log Message:
  ---
  linux-gen: hide get_qentry

Replace two last index->qentry lookups with pointers to quentry, thus
making it possible to make get_qentry static in odp_queue.c

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


  Commit: 92ad20c03bf4737558265a1ff942666d7c4ec3d8
  
https://github.com/Linaro/odp/commit/92ad20c03bf4737558265a1ff942666d7c4ec3d8
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
M platform/linux-generic/include/odp_buffer_internal.h
M platform/linux-generic/odp_pool.c

  Log Message:
  ---
  linux-gen: pool: drop two unused functions

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


  Commit: 757439849936bb76885f27677fc8997a67fa2a3c
  
https://github.com/Linaro/odp/commit/757439849936bb76885f27677fc8997a67fa2a3c
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
M platform/linux-generic/_fdserver.c

  Log Message:
  ---
  linux-gen: fdserver: mark client_lock as static

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


  Commit: cd15a2125781f4eefdab1f765999a59504fb2939
  
https://github.com/Linaro/odp/commit/cd15a2125781f4eefdab1f765999a59504fb2939
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
M platform/linux-generic/include/odp_classification_internal.h
M platform/linux-generic/odp_classification.c

  Log Message:
  ---
  linux-gen: classification: mark several functions as static

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


  Commit: 5a6d8798bc436fa3a7e90fcf105362eabb21db0c
  
https://github.com/Linaro/odp/commit/5a6d8798bc436fa3a7e90fcf105362eabb21db0c
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
M platform/linux-generic/include/odp_schedule_if.h
M platform/linux-generic/odp_packet_io.c

  Log Message:
  ---
  linux-gen: scheduler: drop unused callback

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


  Commit: dca4f5bd8218f30a593f6fb37c060de41d1ca9b1
  
https://github.com/Linaro/odp/commit/dca4f5bd8218f30a593f6fb37c060de41d1ca9b1
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
M platform/linux-generic/include/odp_packet_io_internal.h
M platform/linux-generic/odp_packet_io.c

  Log Message:
  ---
  linux-gen: pktio: drop/staticize leftovers from single queue shim

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


  Commit: 03aa7c3572865dc03df1cf8c33b969ca4b17c7e8
  
https://github.com/Linaro/odp/commit/03aa7c3572865dc03df1cf8c33b969ca4b17c7e8
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
M platform/linux-generic/odp_packet_io.c

  Log Message:
  ---
  linux-gen: pktio: mark pktio_tbl as static

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


  Commit: 4ce95649367da9edd140ba9c25daaaf292edf883
  
https://github.com/Linaro/odp/commit/4ce95649367da9edd140ba9c25daaaf292edf883
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
M platform/linux-generic/include/odp_queue_internal.h
M platform/linux-generic/odp_queue.c

  Log 

[lng-odp] [PATCH API-NEXT v3 1/1] linux-gen: timer: control timer pool polling frequency dynamically

2017-08-08 Thread Github ODP bot
From: Joyce Kong 

Adjust frequency of timer pool polling by the duration
of timer. There needs to be 0 timer pool polling when
no timer pool created.

Signed-off-by: Joyce Kong 
---
/** Email created from pull request 107 (JoyceKong-arm:api-next-timer)
 ** https://github.com/Linaro/odp/pull/107
 ** Patch: https://github.com/Linaro/odp/pull/107.patch
 ** Base sha: 2394317ab247fa14b4e239aec512afee7eac4524
 ** Merge commit sha: ef0472e251ca035e6319f4785c16cd72017c5c04
 **/
 platform/linux-generic/include/odp_timer_internal.h |  3 ---
 platform/linux-generic/odp_timer.c  | 13 -
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/platform/linux-generic/include/odp_timer_internal.h 
b/platform/linux-generic/include/odp_timer_internal.h
index 67ee9fef..0759f727 100644
--- a/platform/linux-generic/include/odp_timer_internal.h
+++ b/platform/linux-generic/include/odp_timer_internal.h
@@ -20,9 +20,6 @@
 #include 
 #include 
 
-/* Minimum number of nanoseconds between checking timer pools. */
-#define CONFIG_TIMER_RUN_RATELIMIT_NS 100
-
 /* Minimum number of scheduling rounds between checking timer pools. */
 #define CONFIG_TIMER_RUN_RATELIMIT_ROUNDS 1
 
diff --git a/platform/linux-generic/odp_timer.c 
b/platform/linux-generic/odp_timer.c
index fdb48902..b359f7c6 100644
--- a/platform/linux-generic/odp_timer.c
+++ b/platform/linux-generic/odp_timer.c
@@ -75,6 +75,7 @@ static _odp_atomic_flag_t locks[NUM_LOCKS]; /* Multiple locks 
per cache line! */
 
 /* Max timer resolution in nanoseconds */
 static uint64_t highest_res_ns;
+static uint64_t min_res_ns = INT64_MAX;
 
 /**
  * Translation between timeout buffer and timeout header
@@ -742,6 +743,9 @@ unsigned _timer_run(void)
CONFIG_TIMER_RUN_RATELIMIT_ROUNDS;
odp_time_t now;
 
+   if (odp_atomic_load_u32(_timer_pools) == 0)
+   return 0;
+
/* Rate limit how often this thread checks the timer pools. */
 
if (CONFIG_TIMER_RUN_RATELIMIT_ROUNDS > 1) {
@@ -984,6 +988,13 @@ odp_timer_pool_create(const char *name,
__odp_errno = EINVAL;
return ODP_TIMER_POOL_INVALID;
}
+
+   if (min_res_ns > param->res_ns) {
+   min_res_ns = param->res_ns;
+   time_per_ratelimit_period =
+   odp_time_global_from_ns(min_res_ns / 2);
+   }
+
return odp_timer_pool_new(name, param);
 }
 
@@ -1188,7 +1199,7 @@ int odp_timer_init_global(const odp_init_t *params)
!params->not_used.feat.timer;
 
time_per_ratelimit_period =
-   odp_time_global_from_ns(CONFIG_TIMER_RUN_RATELIMIT_NS);
+   odp_time_global_from_ns(min_res_ns / 2);
 
if (!inline_timers) {
timer_res_init();



[lng-odp] [PATCH API-NEXT v3 0/1] linux-gen: timer: control the timer pool polling frequency dynamically

2017-08-08 Thread Github ODP bot
The frequency of timer pool polling needs to be adjusted according to
the duration of the timer started in the timer module. And there need
to be 0 timer pool polling when no timer pools/timers created.
At the same time, enable inline timers when passing NULL for odp_init_global.
Signed-off-by: Joyce Kong joyce.k...@arm.com

github
/** Email created from pull request 107 (JoyceKong-arm:api-next-timer)
 ** https://github.com/Linaro/odp/pull/107
 ** Patch: https://github.com/Linaro/odp/pull/107.patch
 ** Base sha: 2394317ab247fa14b4e239aec512afee7eac4524
 ** Merge commit sha: ef0472e251ca035e6319f4785c16cd72017c5c04
 **/
/github

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


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


[lng-odp] [Linaro/odp] fd2ca1: linux-gen: hide get_qentry

2017-08-08 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/Linaro/odp
  Commit: fd2ca1209dc19c8e8199ee556ad2c9a786eabf78
  
https://github.com/Linaro/odp/commit/fd2ca1209dc19c8e8199ee556ad2c9a786eabf78
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
M platform/linux-generic/include/odp_queue_internal.h
M platform/linux-generic/odp_queue.c
M platform/linux-generic/odp_schedule.c
M platform/linux-generic/odp_schedule_iquery.c

  Log Message:
  ---
  linux-gen: hide get_qentry

Replace two last index->qentry lookups with pointers to quentry, thus
making it possible to make get_qentry static in odp_queue.c

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


  Commit: 92ad20c03bf4737558265a1ff942666d7c4ec3d8
  
https://github.com/Linaro/odp/commit/92ad20c03bf4737558265a1ff942666d7c4ec3d8
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
M platform/linux-generic/include/odp_buffer_internal.h
M platform/linux-generic/odp_pool.c

  Log Message:
  ---
  linux-gen: pool: drop two unused functions

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


  Commit: 757439849936bb76885f27677fc8997a67fa2a3c
  
https://github.com/Linaro/odp/commit/757439849936bb76885f27677fc8997a67fa2a3c
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
M platform/linux-generic/_fdserver.c

  Log Message:
  ---
  linux-gen: fdserver: mark client_lock as static

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


  Commit: cd15a2125781f4eefdab1f765999a59504fb2939
  
https://github.com/Linaro/odp/commit/cd15a2125781f4eefdab1f765999a59504fb2939
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
M platform/linux-generic/include/odp_classification_internal.h
M platform/linux-generic/odp_classification.c

  Log Message:
  ---
  linux-gen: classification: mark several functions as static

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


  Commit: 5a6d8798bc436fa3a7e90fcf105362eabb21db0c
  
https://github.com/Linaro/odp/commit/5a6d8798bc436fa3a7e90fcf105362eabb21db0c
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
M platform/linux-generic/include/odp_schedule_if.h
M platform/linux-generic/odp_packet_io.c

  Log Message:
  ---
  linux-gen: scheduler: drop unused callback

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


  Commit: dca4f5bd8218f30a593f6fb37c060de41d1ca9b1
  
https://github.com/Linaro/odp/commit/dca4f5bd8218f30a593f6fb37c060de41d1ca9b1
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
M platform/linux-generic/include/odp_packet_io_internal.h
M platform/linux-generic/odp_packet_io.c

  Log Message:
  ---
  linux-gen: pktio: drop/staticize leftovers from single queue shim

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


  Commit: 03aa7c3572865dc03df1cf8c33b969ca4b17c7e8
  
https://github.com/Linaro/odp/commit/03aa7c3572865dc03df1cf8c33b969ca4b17c7e8
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
M platform/linux-generic/odp_packet_io.c

  Log Message:
  ---
  linux-gen: pktio: mark pktio_tbl as static

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


  Commit: 4ce95649367da9edd140ba9c25daaaf292edf883
  
https://github.com/Linaro/odp/commit/4ce95649367da9edd140ba9c25daaaf292edf883
  Author: Dmitry Eremin-Solenikov 
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
M platform/linux-generic/include/odp_queue_internal.h
M platform/linux-generic/odp_queue.c

  Log Message:

Re: [lng-odp] [PATCH API-NEXT v8 1/1] comp: compression spec

2017-08-08 Thread Savolainen, Petri (Nokia - FI/Espoo)


> -Original Message-
> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of
> Github ODP bot
> Sent: Friday, August 04, 2017 4:00 PM
> To: lng-odp@lists.linaro.org
> Subject: [lng-odp] [PATCH API-NEXT v8 1/1] comp: compression spec
> 
> From: Shally Verma 
> 
> Signed-off-by: Shally Verma 
> Signed-off-by: Mahipal Challa  Cc
> prasadathreya.naray...@cavium.com
> ---
> /** Email created from pull request 102 (1234sv:api-next)
>  ** https://github.com/Linaro/odp/pull/102
>  ** Patch: https://github.com/Linaro/odp/pull/102.patch
>  ** Base sha: 8390f890d4bd2babb63a24f7b15d2f4763e44050
>  ** Merge commit sha: fbdff8c82a19f5b640ae299204b3bb1bbbefdccb
>  **/
>  include/odp/api/spec/comp.h | 815
> 
>  1 file changed, 815 insertions(+)
>  create mode 100644 include/odp/api/spec/comp.h
> 
> diff --git a/include/odp/api/spec/comp.h b/include/odp/api/spec/comp.h
> new file mode 100644
> index ..2956094c
> --- /dev/null
> +++ b/include/odp/api/spec/comp.h
> @@ -0,0 +1,815 @@
> +/* Copyright (c) 2013, Linaro Limited

Year 2017

> +
> +/**
> + * Comp API hash algorithm
> + *
> + */
> +typedef enum {
> + /** ODP_COMP_HASH_ALG_NONE*/

This kind of comment is not very helpful. Each enumeration needs explanation - 
like odp_comp_alg_t under.

> + ODP_COMP_HASH_ALG_NONE,
> + /** ODP_COMP_HASH_ALG_SHA1*/
> + ODP_COMP_HASH_ALG_SHA1,
> + /**  ODP_COMP_HASH_ALG_SHA256*/
> + ODP_COMP_HASH_ALG_SHA256
> +} odp_comp_hash_alg_t;
> +
> +/**
> + * Comp API compression algorithm
> + *
> + */
> +typedef enum {
> + /** No algorithm specified.
> +  * Means no compression, output == input.
> +  * if provided, no operation (compression/decompression or
> hash)
> +  * applied on input. Added for testing purpose.
> +  */
> + ODP_COMP_ALG_NULL,
> + /** DEFLATE - RFC1951 */
> + ODP_COMP_ALG_DEFLATE,
> + /** ZLIB - RFC1950 */
> + ODP_COMP_ALG_ZLIB,
> + /** LZS */
> + ODP_COMP_ALG_LZS
> +} odp_comp_alg_t;
> +
> +
> +/**
> + * Hash algorithms in a bit field structure
> + *
> + */
> +typedef union odp_comp_hash_algos_t {
> + /** hash algorithms */
> + struct {
> + /** SHA-1 */
> + uint32_t sha1  : 1;
> +
> + /** SHA with 256 bits of Message Digest */
> + uint32_t sha256 : 1;


Need to be more explicit in algorithm definition: SHA-1, SHA-256, ... algorithm 
(SHA-2 would also do, but we use SHA-256 in crypto API since it seems to be 
used by standards).

Actually, these explanations should go under enum definitions and then just 
refer to those enums here - like odp_comp_algos_t under.


> +
> + } bit;
> +
> + /** All bits of the bit field structure
> +  *
> +  * This field can be used to set/clear all flags, or bitwise
> +  * operations over the entire structure.
> +  */
> + uint32_t all_bits;
> +} odp_comp_hash_algos_t;
> +
> +/**
> + * Comp algorithms in a bit field structure
> + *
> + */
> +typedef union odp_comp_algos_t {
> + /** Compression algorithms */
> + struct {
> + /** ODP_COMP_ALG_NULL */
> + uint32_t null   : 1;
> +
> + /** ODP_COMP_ALG_DEFLATE */
> + uint32_t deflate: 1;
> +
> + /** ODP_COMP_ALG_ZLIB */
> + uint32_t zlib   : 1;
> +
> + /** ODP_COMP_ALG_LZS */
> + uint32_t lzs:1;
> + } bit;
> +
> + /** All bits of the bit field structure
> +  * This field can be used to set/clear all flags, or bitwise
> +  * operations over the entire structure.
> +  */
> + uint32_t all_bits;
> +} odp_comp_algos_t;
> +
> +/**
> + * Compression Interface Capabilities
> + *
> + */
> +typedef struct odp_comp_capability_t {
> + /** Maximum number of  sessions */
> + uint32_t max_sessions;
> +
> + /** Supported compression algorithms */
> + odp_comp_algos_t comp_algs;

No need to save one character => comp_algos

> +
> + /** Supported hash algorithms. */
> + odp_comp_hash_algos_t hash_algs;

hash_algos

> +
> + /* sync/async mode of operation support.
> +  * Implementation should support atleast one of the mode.
> +  */


"mode" field definition missing on this line ?


> +
> + /** Support type for synchronous operation mode
> (ODP_COMP_SYNC).
> +  *  User should set odp_comp_session_param_t:mode based on
> +  *  support level as indicated by this param.
> +  */
> + odp_support_t sync;
> +
> + /** Support type for asynchronous operation mode
> (ODP_COMP_ASYNC).
> +  *  User should set odp_comp_session_param_t:mode param based
> on
> +  *  support level as indicated by this param.
> +  */
> + odp_support_t async;
> +} odp_comp_capability_t;
> +
> +/**
> + * Hash algorithm capabilities
> + *
> + */
> +typedef struct 

Re: [lng-odp] [PATCH API-NEXT v1 1/1] api:pktio: Adds MTU set function.

2017-08-08 Thread Bill Fischofer
On Tue, Aug 8, 2017 at 2:38 AM, Vamsi Attunuru 
wrote:

> Signed-off-by: Vamsi Attunuru 
> Signed-off-by: Shally Verma 
> Signed-off-by: Mahipal Challa 
>
> ---
>  include/odp/api/spec/packet_io.h | 21 +
>  1 file changed, 21 insertions(+)
>
> diff --git a/include/odp/api/spec/packet_io.h
> b/include/odp/api/spec/packet_io.h
> index d42cebf..be81c3d 100644
> --- a/include/odp/api/spec/packet_io.h
> +++ b/include/odp/api/spec/packet_io.h
> @@ -452,6 +452,9 @@ typedef union odp_pktio_set_op_t {
> struct {
> /** Promiscuous mode */
> uint32_t promisc_mode : 1;
> +
> +   /** Allow app to set MTU size */
> +   uint32_t mtu_set : 1;
> } op;
> /** All bits of the bit field structure.
>   * This field can be used to set/clear all flags, or bitwise
> @@ -480,6 +483,9 @@ typedef struct odp_pktio_capability_t {
>
> /** @deprecated Use enable_loop inside odp_pktin_config_t */
> odp_bool_t ODP_DEPRECATE(loop_supported);
> +
> +   /** Maximum MTU size supported */
> +   uint32_t max_mtu_size;
>  } odp_pktio_capability_t;
>
>  /**
> @@ -910,6 +916,21 @@ int odp_pktout_send(odp_pktout_queue_t queue, const
> odp_packet_t packets[],
>  uint32_t odp_pktio_mtu(odp_pktio_t pktio);
>
>  /**
> + * Set MTU value of a packet IO interface.
> + *
> + * Application should pass value upto max_mtu_size as indicated by
> + * odp_pktio_capability_t:max_mtu_size. Any value beyond max_mtu_size
> + * limit will result in failure. mtu value < 68 also results in failure.
>

Seems like it would be better to have an explicit min_mtu_size in the
odp_pktio_capability() than this arbitrary note buried as a comment.


> + *
> + * @param pktio  Packet IO handle.
> + * @param mtuMTU value to be set.
> + *
> + * @return  0 on success
> + * @retval <0 on failure
> + */
> +int odp_pktio_mtu_set(odp_pktio_t pktio, uint32_t mtu);
> +
> +/**
>   * Enable/Disable promiscuous mode on a packet IO interface.
>   *
>   * @param[in] pktioPacket IO handle.
> --
> 1.9.3
>
>


[lng-odp] [PATCH v1 1/1] example: generator : use packet reference API to generate udp and icmp traffic

2017-08-08 Thread Github ODP bot
From: Bogdan Pricope 

Signed-off-by: Bogdan Pricope 
---
/** Email created from pull request 118 (bogdanPricope:pktref_generator_pr)
 ** https://github.com/Linaro/odp/pull/118
 ** Patch: https://github.com/Linaro/odp/pull/118.patch
 ** Base sha: e76b25aa5cafbf96133fcbd83b856090b0e95f33
 ** Merge commit sha: a2a1459eb2047f247e54c2e3476a178c29384326
 **/
 example/generator/odp_generator.c | 165 +++---
 1 file changed, 100 insertions(+), 65 deletions(-)

diff --git a/example/generator/odp_generator.c 
b/example/generator/odp_generator.c
index 9336cec1..f3ec43be 100644
--- a/example/generator/odp_generator.c
+++ b/example/generator/odp_generator.c
@@ -136,6 +136,7 @@ static void millisleep(uint32_t ms,
uint64_t ticks = odp_timer_ns_to_tick(tp, 100ULL * ms);
odp_event_t ev = odp_timeout_to_event(tmo);
int rc = odp_timer_set_rel(tim, ticks, );
+
if (rc != ODP_TIMER_SUCCESS)
EXAMPLE_ABORT("odp_timer_set_rel() failed\n");
/* Spin waiting for timeout event */
@@ -186,12 +187,76 @@ static int scan_ip(char *buf, unsigned int *paddr)
 }
 
 /**
+ * Setup array of reference packets
+ *
+ * @param pool Packet pool
+ * @param pkt_ref_array Packet array
+ * @param pkt_ref_array_size Packet array size
+ * @param setup_ref Packet setup function
+ * @return 0 success, -1 failed
+*/
+static int setup_pkt_ref_array(odp_pool_t pool,
+  odp_packet_t *pkt_ref_array,
+  int pkt_ref_array_size,
+  odp_packet_t (*setup_ref)(odp_pool_t))
+{
+   int i;
+
+   for (i = 0; i < pkt_ref_array_size; i++) {
+   pkt_ref_array[i] = (*setup_ref)(pool);
+   if (pkt_ref_array[i] == ODP_PACKET_INVALID)
+   break;
+   }
+
+   if (i < pkt_ref_array_size) {
+   odp_packet_free_multi(pkt_ref_array, i);
+   return -1;
+   }
+   return 0;
+}
+
+/**
+ * Setup array of packets
+ *
+ * @param pkt_ref_array Reference packet array
+ * @param pkt_array Packet array
+ * @param pkt_array_size Packet array size
+ * @param setup_pkt Packet setup function
+ * @return 0 success, -1 failed
+*/
+static int setup_pkt_array(odp_packet_t *pkt_ref_array,
+  odp_packet_t  *pkt_array,
+  int pkt_array_size,
+  int (*setup_pkt)(odp_packet_t))
+{
+   int i;
+
+   for (i = 0; i < pkt_array_size; i++) {
+   if ((*setup_pkt)(pkt_ref_array[i]))
+   break;
+
+   pkt_array[i] = odp_packet_ref_static(pkt_ref_array[i]);
+   if (pkt_array[i] == ODP_PACKET_INVALID)
+   break;
+   }
+   if (i < pkt_array_size) {
+   if (i)
+   odp_packet_free_multi(pkt_array, i - 1);
+
+   return -1;
+   }
+   return 0;
+}
+
+/**
  * set up an udp packet reference
  *
  * @param pool Buffer pool to create packet in
  *
- * @return Handle of created packet
+ *
+ * @retval Handle of created packet
  * @retval ODP_PACKET_INVALID  Packet could not be created
+ *
  */
 static odp_packet_t setup_udp_pkt_ref(odp_pool_t pool)
 {
@@ -246,37 +311,27 @@ static odp_packet_t setup_udp_pkt_ref(odp_pool_t pool)
 /**
  * set up an udp packet
  *
- * @param pool Buffer pool to create packet in
- * @param pkt_ref Reference UDP packet
+ * @param pkt Reference UDP packet
  *
- * @return Handle of created packet
- * @retval ODP_PACKET_INVALID  Packet could not be created
+ * @return Success/Failed
+ * @retval 0 on success, -1 on fail
  */
-static odp_packet_t pack_udp_pkt(odp_pool_t pool, odp_packet_t pkt_ref)
+static int setup_udp_pkt(odp_packet_t pkt)
 {
-   odp_packet_t pkt;
char *buf;
odph_ipv4hdr_t *ip;
unsigned short seq;
 
-   pkt = odp_packet_alloc(pool, args->appl.payload + ODPH_UDPHDR_LEN +
-  ODPH_IPV4HDR_LEN + ODPH_ETHHDR_LEN);
-
-   if (pkt == ODP_PACKET_INVALID)
-   return pkt;
-
buf = (char *)odp_packet_data(pkt);
-   odp_memcpy(buf, odp_packet_data(pkt_ref),
-  args->appl.payload + ODPH_UDPHDR_LEN +
-  ODPH_IPV4HDR_LEN + ODPH_ETHHDR_LEN);
 
/*Update IP ID and checksum*/
ip = (odph_ipv4hdr_t *)(buf + ODPH_ETHHDR_LEN);
seq = odp_atomic_fetch_add_u64(, 1) % 0x;
ip->id = odp_cpu_to_be_16(seq);
+   ip->chksum = 0;
ip->chksum = odph_chksum(ip, ODPH_IPV4HDR_LEN);
 
-   return pkt;
+   return 0;
 }
 
 /**
@@ -337,15 +392,13 @@ static odp_packet_t setup_icmp_pkt_ref(odp_pool_t pool)
 /**
  * Set up an icmp packet
  *
- * @param pool Buffer pool to create packet in
- * @param pkt_ref Reference ICMP packet
+ * @param pkt Reference ICMP packet
  *
- * @return Handle of created packet
- * @retval ODP_PACKET_INVALID  

[lng-odp] [PATCH v1 0/1] example: generator : use packet reference API

2017-08-08 Thread Github ODP bot
Signed-off-by: Bogdan Pricope bogdan.pric...@linaro.org

github
/** Email created from pull request 118 (bogdanPricope:pktref_generator_pr)
 ** https://github.com/Linaro/odp/pull/118
 ** Patch: https://github.com/Linaro/odp/pull/118.patch
 ** Base sha: e76b25aa5cafbf96133fcbd83b856090b0e95f33
 ** Merge commit sha: a2a1459eb2047f247e54c2e3476a178c29384326
 **/
/github

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


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


[lng-odp] [PATCH CLOUD-DEV v1 2/2] linux-gen: pool: add generic pool module to mempool subsystem

2017-08-08 Thread Github ODP bot
From: Kevin Wang 

---
/** Email created from pull request 117 (kevinwangsk:cloud-dev)
 ** https://github.com/Linaro/odp/pull/117
 ** Patch: https://github.com/Linaro/odp/pull/117.patch
 ** Base sha: 370f93139e16633390cb28acda6296da8fee006d
 ** Merge commit sha: b2fdd36c723fee970da5c3bcd487cfd4b5eb18a9
 **/
 platform/linux-generic/Makefile.am |   4 +-
 platform/linux-generic/include/odp_pool_internal.h |  24 ++
 platform/linux-generic/odp_buffer.c| 251 
 .../linux-generic/{odp_pool.c => pool/generic.c}   | 315 +++--
 platform/linux-generic/pool/subsystem.c| 220 ++
 5 files changed, 532 insertions(+), 282 deletions(-)
 rename platform/linux-generic/{odp_pool.c => pool/generic.c} (70%)

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index dec8a0f4..3360c0f1 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -240,9 +240,9 @@ __LIB__libodp_linux_la_SOURCES = \
   pktio/sysfs.c \
   pktio/tap.c \
   pktio/ring.c \
+  pool/generic.c \
   pool/subsystem.c \
   odp_pkt_queue.c \
-  odp_pool.c \
   odp_queue.c \
   odp_queue_if.c \
   odp_rwlock.c \
@@ -295,6 +295,8 @@ if HAVE_PCAP
 __LIB__libodp_linux_la_SOURCES += pktio/pcap.c
 endif
 
+pool/generic.lo: CFLAGS += -DIM_ACTIVE_MODULE
+
 # Build modular framework into odp-linux library
 modularframeworkdir = $(top_srcdir)/frameworks/modular
 noinst_HEADERS += $(modularframeworkdir)/list.h \
diff --git a/platform/linux-generic/include/odp_pool_internal.h 
b/platform/linux-generic/include/odp_pool_internal.h
index ebb779da..533abefc 100644
--- a/platform/linux-generic/include/odp_pool_internal.h
+++ b/platform/linux-generic/include/odp_pool_internal.h
@@ -21,11 +21,14 @@ extern "C" {
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
 #include 
 
+#define CACHE_BURST32
+
 typedef struct pool_cache_t {
uint32_t num;
 
@@ -82,6 +85,14 @@ typedef struct pool_table_t {
 
 extern pool_table_t *pool_tbl;
 
+/* Thread local variables */
+typedef struct pool_local_t {
+   pool_cache_t *cache[ODP_CONFIG_POOLS];
+   int thr_id;
+} pool_local_t;
+
+extern __thread pool_local_t local;
+
 static inline pool_t *pool_entry(uint32_t pool_idx)
 {
return _tbl->pool[pool_idx];
@@ -109,6 +120,19 @@ static inline odp_buffer_hdr_t *pool_buf_hdl_to_hdr(pool_t 
*pool,
return buf_hdr;
 }
 
+static inline odp_pool_t pool_index_to_handle(uint32_t pool_idx)
+{
+   return _odp_cast_scalar(odp_pool_t, pool_idx);
+}
+
+static inline uint32_t pool_id_from_buf(odp_buffer_t buf)
+{
+   odp_buffer_bits_t handle;
+
+   handle.handle = buf;
+   return handle.pool_id;
+}
+
 static inline odp_buffer_hdr_t *buf_hdl_to_hdr(odp_buffer_t buf)
 {
odp_buffer_bits_t handle;
diff --git a/platform/linux-generic/odp_buffer.c 
b/platform/linux-generic/odp_buffer.c
index 88c8140b..d44ada6f 100644
--- a/platform/linux-generic/odp_buffer.c
+++ b/platform/linux-generic/odp_buffer.c
@@ -81,3 +81,254 @@ uint64_t odp_buffer_to_u64(odp_buffer_t hdl)
 {
return _odp_pri(hdl);
 }
+
+odp_event_type_t _odp_buffer_event_type(odp_buffer_t buf)
+{
+   return buf_hdl_to_hdr(buf)->event_type;
+}
+
+void _odp_buffer_event_type_set(odp_buffer_t buf, int ev)
+{
+   buf_hdl_to_hdr(buf)->event_type = ev;
+}
+
+int buffer_alloc_multi(pool_t *pool, odp_buffer_t buf[],
+  odp_buffer_hdr_t *buf_hdr[], int max_num)
+{
+   ring_t *ring;
+   uint32_t mask, i;
+   pool_cache_t *cache;
+   uint32_t cache_num, num_ch, num_deq, burst;
+   odp_buffer_hdr_t *hdr;
+
+   cache = local.cache[pool->pool_idx];
+
+   cache_num = cache->num;
+   num_ch= max_num;
+   num_deq   = 0;
+   burst = CACHE_BURST;
+
+   if (odp_unlikely(cache_num < (uint32_t)max_num)) {
+   /* Cache does not have enough buffers */
+   num_ch  = cache_num;
+   num_deq = max_num - cache_num;
+
+   if (odp_unlikely(num_deq > CACHE_BURST))
+   burst = num_deq;
+   }
+
+   /* Get buffers from the cache */
+   for (i = 0; i < num_ch; i++) {
+   buf[i] = cache->buf[cache_num - num_ch + i];
+
+   if (odp_likely(buf_hdr != NULL))
+   buf_hdr[i] = pool_buf_hdl_to_hdr(pool, buf[i]);
+   }
+
+   /* If needed, get more from the global pool */
+   if (odp_unlikely(num_deq)) {
+   /* Temporary copy needed since odp_buffer_t is uintptr_t
+* and not uint32_t. */
+   uint32_t data[burst];
+
+   ring  = >ring->hdr;
+   

[lng-odp] [PATCH CLOUD-DEV v1 1/2] linux-gen: pool: apply modular framework and create subsystem

2017-08-08 Thread Github ODP bot
From: Kevin Wang 

---
/** Email created from pull request 117 (kevinwangsk:cloud-dev)
 ** https://github.com/Linaro/odp/pull/117
 ** Patch: https://github.com/Linaro/odp/pull/117.patch
 ** Base sha: 370f93139e16633390cb28acda6296da8fee006d
 ** Merge commit sha: b2fdd36c723fee970da5c3bcd487cfd4b5eb18a9
 **/
 platform/linux-generic/Makefile.am |  2 +
 .../linux-generic/include/odp_pool_subsystem.h | 50 ++
 platform/linux-generic/pool/subsystem.c| 16 +++
 3 files changed, 68 insertions(+)
 create mode 100644 platform/linux-generic/include/odp_pool_subsystem.h
 create mode 100644 platform/linux-generic/pool/subsystem.c

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 4a7b77b8..dec8a0f4 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -183,6 +183,7 @@ noinst_HEADERS = \
  ${srcdir}/include/odp_packet_tap.h \
  ${srcdir}/include/odp_pkt_queue_internal.h \
  ${srcdir}/include/odp_pool_internal.h \
+ ${srcdir}/include/odp_pool_subsystem.h \
  ${srcdir}/include/odp_posix_extensions.h \
  ${srcdir}/include/odp_queue_internal.h \
  ${srcdir}/include/odp_ring_internal.h \
@@ -239,6 +240,7 @@ __LIB__libodp_linux_la_SOURCES = \
   pktio/sysfs.c \
   pktio/tap.c \
   pktio/ring.c \
+  pool/subsystem.c \
   odp_pkt_queue.c \
   odp_pool.c \
   odp_queue.c \
diff --git a/platform/linux-generic/include/odp_pool_subsystem.h 
b/platform/linux-generic/include/odp_pool_subsystem.h
new file mode 100644
index ..45537a86
--- /dev/null
+++ b/platform/linux-generic/include/odp_pool_subsystem.h
@@ -0,0 +1,50 @@
+/* Copyright (c) 2017, ARM Limited. All rights reserved.
+ *
+ * Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef ODP_POOL_SUBSYSTEM_H_
+#define ODP_POOL_SUBSYSTEM_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+#include 
+
+/* ODP pool public APIs subsystem */
+ODP_SUBSYSTEM_DECLARE(pool);
+
+/* Subsystem APIs declarations */
+ODP_SUBSYSTEM_API(pool, int, capability, odp_pool_capability_t *capa);
+ODP_SUBSYSTEM_API(pool, odp_pool_t, create, const char *name,
+ odp_pool_param_t *params);
+ODP_SUBSYSTEM_API(pool, int, destroy, odp_pool_t pool);
+ODP_SUBSYSTEM_API(pool, odp_pool_t, lookup, const char *name);
+ODP_SUBSYSTEM_API(pool, int, info, odp_pool_t pool, odp_pool_info_t *info);
+ODP_SUBSYSTEM_API(pool, void, print, odp_pool_t pool);
+ODP_SUBSYSTEM_API(pool, uint64_t, to_u64, odp_pool_t pool);
+ODP_SUBSYSTEM_API(pool, void, param_init, odp_pool_param_t *params);
+
+typedef ODP_MODULE_CLASS(pool) {
+   odp_module_base_t base;
+
+   odp_api_proto(pool, capability) capability;
+   odp_api_proto(pool, create) create;
+   odp_api_proto(pool, destroy) destroy;
+   odp_api_proto(pool, lookup) lookup;
+   odp_api_proto(pool, info) info;
+   odp_api_proto(pool, print) print;
+   odp_api_proto(pool, to_u64) to_u64;
+   odp_api_proto(pool, param_init) param_init;
+} pool_module_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/pool/subsystem.c 
b/platform/linux-generic/pool/subsystem.c
new file mode 100644
index ..35600399
--- /dev/null
+++ b/platform/linux-generic/pool/subsystem.c
@@ -0,0 +1,16 @@
+/* Copyright (c) 2017, ARM Limited. All rights reserved.
+ *
+ * Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+#include 
+
+#define SUBSYSTEM_VERSION 0x0001UL
+ODP_SUBSYSTEM_DEFINE(pool, "memory pool public APIs", SUBSYSTEM_VERSION);
+
+ODP_SUBSYSTEM_CONSTRUCTOR(pool)
+{
+   odp_subsystem_constructor(pool);
+}



[lng-odp] [PATCH CLOUD-DEV v1 0/2] Move pool to modular framework

2017-08-08 Thread Github ODP bot
Includes two commits, first one is to apply pool to modular framework. Second 
one is to move the pool implementation of linux-generic to pool subsystem.

github
/** Email created from pull request 117 (kevinwangsk:cloud-dev)
 ** https://github.com/Linaro/odp/pull/117
 ** Patch: https://github.com/Linaro/odp/pull/117.patch
 ** Base sha: 370f93139e16633390cb28acda6296da8fee006d
 ** Merge commit sha: b2fdd36c723fee970da5c3bcd487cfd4b5eb18a9
 **/
/github

checkpatch.pl
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per 
line)
#16: 
 .../linux-generic/include/odp_pool_subsystem.h | 50 ++

ERROR: Missing Signed-off-by: line(s)

total: 1 errors, 1 warnings, 0 checks, 80 lines checked


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

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per 
line)
#18: 
 .../linux-generic/{odp_pool.c => pool/generic.c}   | 315 +++--

ERROR: Missing Signed-off-by: line(s)

total: 1 errors, 1 warnings, 0 checks, 943 lines checked


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

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
/checkpatch.pl


[lng-odp] [PATCH API-NEXT v1 1/1] api:pktio: Adds MTU set function.

2017-08-08 Thread Vamsi Attunuru
Signed-off-by: Vamsi Attunuru 
Signed-off-by: Shally Verma 
Signed-off-by: Mahipal Challa 

---
 include/odp/api/spec/packet_io.h | 21 +
 1 file changed, 21 insertions(+)

diff --git a/include/odp/api/spec/packet_io.h b/include/odp/api/spec/packet_io.h
index d42cebf..be81c3d 100644
--- a/include/odp/api/spec/packet_io.h
+++ b/include/odp/api/spec/packet_io.h
@@ -452,6 +452,9 @@ typedef union odp_pktio_set_op_t {
struct {
/** Promiscuous mode */
uint32_t promisc_mode : 1;
+
+   /** Allow app to set MTU size */
+   uint32_t mtu_set : 1;
} op;
/** All bits of the bit field structure.
  * This field can be used to set/clear all flags, or bitwise
@@ -480,6 +483,9 @@ typedef struct odp_pktio_capability_t {
 
/** @deprecated Use enable_loop inside odp_pktin_config_t */
odp_bool_t ODP_DEPRECATE(loop_supported);
+
+   /** Maximum MTU size supported */
+   uint32_t max_mtu_size;
 } odp_pktio_capability_t;
 
 /**
@@ -910,6 +916,21 @@ int odp_pktout_send(odp_pktout_queue_t queue, const 
odp_packet_t packets[],
 uint32_t odp_pktio_mtu(odp_pktio_t pktio);
 
 /**
+ * Set MTU value of a packet IO interface.
+ *
+ * Application should pass value upto max_mtu_size as indicated by
+ * odp_pktio_capability_t:max_mtu_size. Any value beyond max_mtu_size
+ * limit will result in failure. mtu value < 68 also results in failure.
+ *
+ * @param pktio  Packet IO handle.
+ * @param mtuMTU value to be set.
+ *
+ * @return  0 on success
+ * @retval <0 on failure
+ */
+int odp_pktio_mtu_set(odp_pktio_t pktio, uint32_t mtu);
+
+/**
  * Enable/Disable promiscuous mode on a packet IO interface.
  *
  * @param[in] pktioPacket IO handle.
-- 
1.9.3



[lng-odp] [PATCH API-NEXT v1 0/1] api:pktio: Adds MTU set function.

2017-08-08 Thread Vamsi Attunuru
Existing pktio API has only support of querying MTU values.
Adds new pktio API to set MTU on pktio interface. Implementation can
indicate it's supported maximum MTU size in its pktio capabilities.
User can call set API to set value within allowed range as indicated
by pktio capabilities.

As per the review comments on patch "[PATCH API-NEXT v1 1/1] api:pktio:
add MAC address and MTU set functions." 

MTU set changes are separated out and versioned as v1.

MAC address set changes will be the incremental patch on previous patches. 

Vamsi Attunuru (1):
  pktio API to set MTU size.

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

-- 
1.9.3



Re: [lng-odp] ODP1.15 buffer alignment issue

2017-08-08 Thread Liron Himi
Hi,

See comments inline

Regards,
Liron

-Original Message-
From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of Maxim 
Uvarov
Sent: Monday, August 07, 2017 23:21
To: lng-odp@lists.linaro.org
Subject: Re: [lng-odp] ODP1.15 buffer alignment issue

it's implementation specific.

Full code is:

+   offset = pool->headroom;
+
+   /* move to correct align */
+   while (((uintptr_t)[offset]) % pool->align != 0)
+   offset++;

+
+   /* Pointer to data start (of the first segment) */
+   buf_hdr->addr[0] = [offset];
+   /* Store buffer into the global pool */
+   ring_enq(ring, mask, (uint32_t)(uintptr_t)buf_hdl);

If I understood idea right there should be odp specific packet header with odp 
fields which is needed to implement api but missing in hardware buffer field. 
Then hw buffer which is aligned by default with pointer to data. Everything 
depends on implementation and it's not mandatory.
[L.H.] As part of the linux-generic there is a 'ODP_CONFIG_BUFFER_ALIGN_MIN' 
which should be used for the buffer alignment.
However, the code above use this value for the data section alignment in the 
buffer and not the buffer address alignment.
On ODP1.11 the 'ODP_CONFIG_BUFFER_ALIGN_MIN' was used correctly for buffer 
alignment.
In order to continue we need to understand what was the real intention here:
1. To make sure the data section is aligned?
2. To make sure the buffer address is aligned? If so, there is a bug in this 
code. A possible fix is as follow:
-   offset = pool->headroom;
+   offset = 0;

/* move to correct align */
   while (((uintptr_t)[offset]) % pool->align != 0)
   offset++;
+   offset += pool->headroom

/* Pointer to data start (of the first segment) */
   buf_hdr->addr[0] = [offset];

If 1# is required than maybe a 'ODP_CONFIG_DATA_ALIGN_MIN' should be define.
 
If your platform reuses this linux-generic file and that alignment does not 
work for you then we rework it somehow.

Bet regards.
Maxim.


On 08/07/17 21:58, Bill Fischofer wrote:
> This is part of the latest pool restructure code contributed by Nokia. 
> If you'd like to join the ODP public call tomorrow at 15:00 UTC we can 
> discuss this then.
> 
> On Mon, Aug 7, 2017 at 8:57 AM, Liron Himi  wrote:
> 
>> Hi,
>>
>> I'm trying to move to odp1.15 and encounter with an buffer alignment issue.
>> It seems that linux-generic implementation make sure that the data 
>> address is align with the requested alignment and not the buffer 
>> address itself (look at the code sniped below).
>> On ODP1.11 (the current version we use) the buffer was aligned correctly.
>>
>> Is the current behavior is the expected one?
>> Our HW (and probably other HWs) rely on the fact that the buffers are 
>> aligned.
>>
>> From odp_pool.c, init_buffers:
>>
>> offset = pool->headroom;
>>
>> /* move to correct align */
>> while (((uintptr_t)[offset]) %
>> pool->align != 0)
>> offset++;
>>
>>
>> Regards,
>> Liron
>>