[lng-odp] [Bug 3043] user guide error

2017-07-21 Thread bugzilla-daemon
https://bugs.linaro.org/show_bug.cgi?id=3043

Bill Fischofer  changed:

   What|Removed |Added

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

--- Comment #5 from Bill Fischofer  ---
I'm not sure what the reported bug is here. The comment describes a diagram in
the User Guide but doesn't say what is supposedly incorrect about it.

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

[lng-odp] [Linaro/odp] 063d71: linux-gen: ishm fix defining directory for shm fil...

2017-07-21 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/Linaro/odp
  Commit: 063d713d0c167c56b4497be566b2310a5a2daf42
  
https://github.com/Linaro/odp/commit/063d713d0c167c56b4497be566b2310a5a2daf42
  Author: Maxim Uvarov 
  Date:   2017-07-21 (Fri, 21 Jul 2017)

  Changed paths:
M platform/linux-generic/_ishm.c
M platform/linux-generic/include/odp_internal.h

  Log Message:
  ---
  linux-gen: ishm fix defining directory for shm files

Code missed getenv() return code check and did not use
value of env variable to change default derection.

Signed-off-by: Maxim Uvarov 
Reviewed-by: Bill Fischofer 


  Commit: fa9550ca8f4f0a77baf6d156b441fa2d703bbdf8
  
https://github.com/Linaro/odp/commit/fa9550ca8f4f0a77baf6d156b441fa2d703bbdf8
  Author: Maxim Uvarov 
  Date:   2017-07-21 (Fri, 21 Jul 2017)

  Changed paths:
M helper/cuckootable.c
M helper/iplookuptable.c

  Log Message:
  ---
  helper: add missing pool param inits

Signed-off-by: Maxim Uvarov 
Reviewed-by: Bill Fischofer 


Compare: https://github.com/Linaro/odp/compare/3eeb249a4774...fa9550ca8f4f


Re: [lng-odp] ODP traffic manager and comparison with DPDK

2017-07-21 Thread Puneet Gupta
Thanks Bill for your replies. ☺

I have subscribed and got the following message :

“Your subscription request has been received, and will soon be acted upon. 
Depending on the configuration of this mailing list, your subscription request 
may have to be first confirmed by you via email, or approved by the list 
moderator. If confirmation is required, you will soon get a confirmation email 
which contains further instructions.”

Thanks,
Puneet


From: Bill Fischofer [mailto:bill.fischo...@linaro.org]
Sent: Thursday, July 20, 2017 8:06 PM
To: Puneet Gupta 
Cc: lng-odp@lists.linaro.org
Subject: Re: [lng-odp] ODP traffic manager and comparison with DPDK



On Thu, Jul 20, 2017 at 8:10 AM, Puneet Gupta 
> wrote:
Hi,

Thanks Bill for your answers. It’s very much helpful!
As I am beginner, so some more initial dumb queries! ☺


-  What do meant by “ODP applications write to TM input queues and TM 
output queues”?
So if we are having only one TM stage, so therefore we have only input queues 
which are connected to TM node and based upon the shaper/Wred profile they are 
sent to the Pktout interface?

Please see the Traffic Manager section of the ODP User Guide: 
https://docs.opendataplane.org/snapshots/odp-publish/generic/usr_html/master/latest/linux-generic/output/users-guide.html#_traffic_manager_tm

The TM is organized into a hierarchy of TM Nodes that are fed by TM Queues and 
that output to either other TM Nodes or else to Pktios.


My requirement is , I need to offload the classification and packet queueing 
functionality to the hardware.

-  For offloading packet queuing  , I can see that ODP gives a 
mechanism by which we can create a new file in the following directory : 
platform/linux-generic/pktio//.c and then can assign 
the function pointers for the following ops: input_queues_config and 
output_queues_config. These operations will be called by the 
odp_pktin_queue_config and odp_pktout_queue_config, which are further called by 
our ODP application.
Let me know if my above statement is correct or not? ☺

From these questions I assume you're looking at creating your own ODP 
implementation. That's a larger question and may be better handled in a 
conversation.

The classifier is a separate module from the traffic manager, and queues are 
also separate from both. We're actually in the process of developing and 
testing a modular framework that will make it easier to do "pluggable" 
replacements of these various components in a more flexible and dynamic manner. 
The cloud-dev branch of the ODP git repo is where this work is being done. We 
hope to have the first stage of these structures in place there in the coming 
weeks, but an official ODP release with these capabilities is probably sometime 
next year.

In the meantime, you'd use platform/myplatform to contain replacement files for 
those that are currently in platform/linux-generic. If you look at how the 
odp-dpdk repository is organized, you can see how that works as there is a 
platform/linux-dpdk that contains modules that "override" the base modules in 
platform/linux-generic.

You can see the current list of available ODP implementations at 
https://www.opendataplane.org/downloads/



-  For offloading packet classification , Can I modify the following 
ODP functions: odp_cls_pmr_create and odp_pmr_create_term ( implemented in 
platform/linux-generic/odp_classifier.c) to suite my own needs? Or is there any 
other way to offload classification?

Yes, that's what you'd do--replace the SW implementations of various ODP APIs 
with those that interface directly with your HW.




-  For setting a classification rule , we have to give src_cos and 
dst_cos.  Queue and buffer pool are associated with each CoS. I understand that 
dst_cos associated with the PMR is the  one where the packets matching that 
rule will land into that CoS queue.
Correct. It's a cascade where packets get filtered through PMRs and eventually 
land in a CoS that defines the pool and queue that the packets should be sent 
to.

Packet comes from the Pktin interface , then goes to the classifier and then 
goes the queues ( which we have associated with the dst_cos) and not from any 
CoS. Then what does src_Cos means? In many examples of ODP , I can see , they 
are using default_cos as the src_cos argument for classification setup. What 
does that default_Cos means?

The default CoS is the output from a PktIO in the absence of any further 
filtering rules. The src_cos is how rules are chained together. The 
odp_cls_pmr_create() API says to take packets assigned to the src_cos and 
further filter them to try to put them in a more specific CoS (the dst_cos). So 
the progression is from coarse filtering to finer-grained filtering. When a CoS 
is reached that isn't the src_cos to any other matching PMR, then that CoS is 
the one that's used to determine which pool/queue the 

Re: [lng-odp] ODP traffic manager and comparison with DPDK

2017-07-21 Thread Puneet Gupta
Hi,

Thanks Bill for your answers. It’s very much helpful!
As I am beginner, so some more initial dumb queries! ☺


-  What do meant by “ODP applications write to TM input queues and TM 
output queues”?
So if we are having only one TM stage, so therefore we have only input queues 
which are connected to TM node and based upon the shaper/Wred profile they are 
sent to the Pktout interface?


My requirement is , I need to offload the classification and packet queueing 
functionality to the hardware.

-  For offloading packet queuing  , I can see that ODP gives a 
mechanism by which we can create a new file in the following directory : 
platform/linux-generic/pktio//.c and then can assign 
the function pointers for the following ops: input_queues_config and 
output_queues_config. These operations will be called by the 
odp_pktin_queue_config and odp_pktout_queue_config, which are further called by 
our ODP application.
Let me know if my above statement is correct or not? ☺


-  For offloading packet classification , Can I modify the following 
ODP functions: odp_cls_pmr_create and odp_pmr_create_term ( implemented in 
platform/linux-generic/odp_classifier.c) to suite my own needs? Or is there any 
other way to offload classification?



-  For setting a classification rule , we have to give src_cos and 
dst_cos.  Queue and buffer pool are associated with each CoS. I understand that 
dst_cos associated with the PMR is the  one where the packets matching that 
rule will land into that CoS queue.
Packet comes from the Pktin interface , then goes to the classifier and then 
goes the queues ( which we have associated with the dst_cos) and not from any 
CoS. Then what does src_Cos means? In many examples of ODP , I can see , they 
are using default_cos as the src_cos argument for classification setup. What 
does that default_Cos means?



I tried subscribing to the list but its giving the following message,
“The form is too old. Please GET it again.” So that’s why directly written the 
mail to the list


Thanks
Puneet



From: Bill Fischofer [mailto:bill.fischo...@linaro.org]
Sent: Thursday, July 20, 2017 6:00 PM
To: Puneet Gupta 
Cc: lng-odp@lists.linaro.org
Subject: Re: [lng-odp] ODP traffic manager and comparison with DPDK

Hi Puneet, and thanks for your post. Please subscribe to the ODP mailing list 
if you wish to post as otherwise your posts will be delayed as they require 
manual approval to make it to the list.



On Thu, Jul 20, 2017 at 3:44 AM, Puneet Gupta 
> wrote:
Hi all,

I am understanding the ODP framework for last few days. I am have some queries 
related to it.



1.   There is a traffic manager block in the egress direction . In the 
diagram (section 5.3 in 
https://docs.opendataplane.org/snapshots/odp-publish/generic/usr_html/master/latest/linux-generic/output/users-guide.html
 ), it is shown that it has TM input queues and TM output queues. What does 
that mean?? How these input queues are different from the ones which are there 
in the ingress direction ( that are after the classifier)

ODP applications can send output directly to pktio via odp_pktout_queue_t 
objects, which are the output ports associated with a logical interface, or 
they can have output shaped via the traffic manager by sending them to 
odp_tm_queue_t objects instead. This is similar to the receive side where 
applications can choose to read odp_pktin_queue_t objects directly or else 
receive input via the classifier / scheduler. It's really a question of how the 
application wishes to work.

TM input and output queues are from the perspective of the traffic manager 
itself. ODP applications write to TM input queues and TM output queues then 
connect either to other TM input stages (in more complex configurations) or 
else directly to Pktio output ports.


2.   The queues which are created through the API odp_tm_queue_create ( in 
which we associate shaper/wred profile), whether they are input queues or 
output queues or both?

Both. A TM queue is fed by the application (or by a higher TM stage), performs 
it's shaping / weighting functions as configured, and outputs to either the 
next stage or to the target pktio object.


3.   How it is different from DPDK. I heard that it supports hardware 
offload features such as classification , buffering , queueing etc wherease 
dpdk doesn't. But is there any other reason why we should go with ODP and not 
DDK?

ODP makes a distinction between the API definitions, which are abstract, and 
the implementation of those APIs, which can be in hardware, software, or any 
combination of these as defined by an ODP implementer. As part of the project, 
ODP offers reference implementations of the ODP API set that can either be used 
directly or as a starting point by SoC vendors for creating an implementation 
tailored to their platform.

In addition to offering an API 

Re: [lng-odp] Monarch_lts tagging

2017-07-21 Thread Maxim Uvarov
thanks, applied.

Maxim.

On 21 July 2017 at 10:36, Elo, Matias (Nokia - FI/Espoo) <
matias@nokia.com> wrote:

> Hi Bill,
>
> I took a look at the patches in monarch_lts and as far as I can see the
> only fix missing, from the issues our guys have reported, is the
> "linux-gen: pktio: fix valgrind warnings" patch. This patch applies without
> conflicts on top the current monarch_lts branch.
>
> -Matias
>
>


[lng-odp] [Linaro/odp] a28e0d: linux-gen: pktio: fix valgrind warnings

2017-07-21 Thread GitHub
  Branch: refs/heads/monarch_lts
  Home:   https://github.com/Linaro/odp
  Commit: a28e0db6cdae7eb4f047cd79698ceadf96feff7f
  
https://github.com/Linaro/odp/commit/a28e0db6cdae7eb4f047cd79698ceadf96feff7f
  Author: Matias Elo 
  Date:   2017-07-21 (Fri, 21 Jul 2017)

  Changed paths:
M platform/linux-generic/pktio/ethtool.c
M platform/linux-generic/pktio/socket.c

  Log Message:
  ---
  linux-gen: pktio: fix valgrind warnings

Fix valgrind warnings about syscall params pointing to uninitialised bytes.

Signed-off-by: Matias Elo 
Reviewed-by: Bill Fischofer 
Signed-off-by: Maxim Uvarov 




[lng-odp] [PATCH v1 0/1] travis: cache dpdk directory

2017-07-21 Thread Github ODP bot
Cache DPDK directory so each individual test doesn't have to download and
build the code. Speeds up each tests which require DPDK by ~3 minutes.
Signed-off-by: Matias Elo matias@nokia.com

github
/** Email created from pull request 84 (matiaselo:dev/travis_caching)
 ** https://github.com/Linaro/odp/pull/84
 ** Patch: https://github.com/Linaro/odp/pull/84.patch
 ** Base sha: 3eeb249a4774f12d2d16ca349a591654eae620ae
 ** Merge commit sha: 7ed0e1dac9782ec8d154d478b6a3e75b4c3af9a4
 **/
/github

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


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


[lng-odp] [PATCH v1 1/1] travis: cache dpdk directory

2017-07-21 Thread Github ODP bot
From: Matias Elo 

Cache DPDK directory so each individual test doesn't have to download and
build the code. Speeds up each tests which require dpdk by ~3 minutes.

Signed-off-by: Matias Elo 
---
/** Email created from pull request 84 (matiaselo:dev/travis_caching)
 ** https://github.com/Linaro/odp/pull/84
 ** Patch: https://github.com/Linaro/odp/pull/84.patch
 ** Base sha: 3eeb249a4774f12d2d16ca349a591654eae620ae
 ** Merge commit sha: 7ed0e1dac9782ec8d154d478b6a3e75b4c3af9a4
 **/
 .travis.yml | 27 +--
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 42c2c963..e3d74882 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,6 +8,9 @@
 # See https://scan.coverity.com/travis_ci
 
 language: c
+cache:
+  directories:
+  - dpdk
 sudo: required
 dist: trusty
 group: deprecated-2017Q2
@@ -108,17 +111,21 @@ install:
 - gem install asciidoctor
 - PATH=${PATH//:\.\/node_modules\/\.bin/}
 
-#  DPDK pktio
+#  DPDK pktio. Note that cache must be purged if dpdk version changes.
 - TARGET=${TARGET:-"x86_64-native-linuxapp-gcc"}
-- git -c advice.detachedHead=false clone -q --depth=1 --single-branch 
--branch=v17.02 http://dpdk.org/git/dpdk dpdk
-- pushd dpdk
-- git log --oneline --decorate
-- make config T=${TARGET} O=${TARGET}
-- pushd ${TARGET}
-- sed -ri 's,(CONFIG_RTE_LIBRTE_PMD_PCAP=).*,\1y,' .config
-- popd
-- make install T=${TARGET} EXTRA_CFLAGS="-fPIC"
-- popd
+- |
+  if [ ! -f "dpdk/${TARGET}/lib/libdpdk.a" ]; then
+git -c advice.detachedHead=false clone -q --depth=1 
--single-branch --branch=v17.02 http://dpdk.org/git/dpdk dpdk
+pushd dpdk
+git log --oneline --decorate
+make config T=${TARGET} O=${TARGET}
+pushd ${TARGET}
+sed -ri 's,(CONFIG_RTE_LIBRTE_PMD_PCAP=).*,\1y,' .config
+popd
+make install T=${TARGET} EXTRA_CFLAGS="-fPIC"
+rm -r ./doc ./${TARGET}/app ./${TARGET}/build
+popd
+  fi
 
 #  Netmap pktio
 - git -c advice.detachedHead=false clone -q --depth=1 --single-branch 
--branch=v11.2 https://github.com/luigirizzo/netmap.git



Re: [lng-odp] [PATCH 0/6] dpdk pktio: enable hardware checksum support

2017-07-21 Thread Elo, Matias (Nokia - FI/Espoo)
Thanks! This patch set is probably going to require rebasing since the dpdk 
zero-copy patch set is now merged.

-Matias

> On 21 Jul 2017, at 10:54, Bogdan Pricope  wrote:
> 
> Have a nice vacation, Matias!!
> We will have time for this in the autumn...
> 
> On 21 July 2017 at 10:36, Maxim Uvarov  wrote:
>> ok, don't worry, have a good time!
>> 
>> On 21 July 2017 at 08:53, Elo, Matias (Nokia - FI/Espoo) <
>> matias@nokia.com> wrote:
>> 
>>> I'm starting my vacation today and have more acute things on my plate, so
>>> I don't unfortunately have time to review the patch for a couple of weeks.
>>> 
>>> -Matias
>>> 
 On 20 Jul 2017, at 23:16, Maxim Uvarov  wrote:
 
 Krishna, Matias, please review dpdk changes.
 
 Maxim.
 
 On 07/19/17 16:35, Bogdan Pricope wrote:
> Ping?
> 
> We still want this for odp-linux or we should implement it on odp-dpdk
> only (as soon as repository is updated)?
> 
> /B
> 
> On 20 June 2017 at 12:20, Bogdan Pricope 
>>> wrote:
>> Ping?
>> 
>> On 31 May 2017 at 17:40, Bogdan Pricope 
>>> wrote:
>>> Add HW checksum calculation/validation support for dpdk pktio.
>>> No UDP/TCP HW checksum calculation/validation support for:
>>> - IPv4 fragments
>>> - IPv6 packets with extension headers (including fragments)
>>> 
>>> Bogdan Pricope (6):
>>> Initialize pktio configuration structure
>>> dpdk: retrieve offload capabilities
>>> dpdk: enable per pktio RX IP/UDP/TCP checksum offload
>>> dpdk: RX - process checksum validation offload flags
>>> dpdk: TX - set checksum calculation offload flags
>>> examples: generator: update odp_generator to use HW checksum
>>>   capabilities
>>> 
>>> example/generator/odp_generator.c  | 107 ++---
>>> platform/linux-generic/odp_packet_io.c |   2 +
>>> platform/linux-generic/pktio/dpdk.c| 203
>>> -
>>> 3 files changed, 293 insertions(+), 19 deletions(-)
>>> 
>>> --
>>> 1.9.1
>>> 
 
>>> 
>>> 



Re: [lng-odp] [PATCH 0/6] dpdk pktio: enable hardware checksum support

2017-07-21 Thread Bogdan Pricope
Have a nice vacation, Matias!!
We will have time for this in the autumn...

On 21 July 2017 at 10:36, Maxim Uvarov  wrote:
> ok, don't worry, have a good time!
>
> On 21 July 2017 at 08:53, Elo, Matias (Nokia - FI/Espoo) <
> matias@nokia.com> wrote:
>
>> I'm starting my vacation today and have more acute things on my plate, so
>> I don't unfortunately have time to review the patch for a couple of weeks.
>>
>> -Matias
>>
>> > On 20 Jul 2017, at 23:16, Maxim Uvarov  wrote:
>> >
>> > Krishna, Matias, please review dpdk changes.
>> >
>> > Maxim.
>> >
>> > On 07/19/17 16:35, Bogdan Pricope wrote:
>> >> Ping?
>> >>
>> >> We still want this for odp-linux or we should implement it on odp-dpdk
>> >> only (as soon as repository is updated)?
>> >>
>> >> /B
>> >>
>> >> On 20 June 2017 at 12:20, Bogdan Pricope 
>> wrote:
>> >>> Ping?
>> >>>
>> >>> On 31 May 2017 at 17:40, Bogdan Pricope 
>> wrote:
>>  Add HW checksum calculation/validation support for dpdk pktio.
>>  No UDP/TCP HW checksum calculation/validation support for:
>>  - IPv4 fragments
>>  - IPv6 packets with extension headers (including fragments)
>> 
>>  Bogdan Pricope (6):
>>   Initialize pktio configuration structure
>>   dpdk: retrieve offload capabilities
>>   dpdk: enable per pktio RX IP/UDP/TCP checksum offload
>>   dpdk: RX - process checksum validation offload flags
>>   dpdk: TX - set checksum calculation offload flags
>>   examples: generator: update odp_generator to use HW checksum
>> capabilities
>> 
>>  example/generator/odp_generator.c  | 107 ++---
>>  platform/linux-generic/odp_packet_io.c |   2 +
>>  platform/linux-generic/pktio/dpdk.c| 203
>> -
>>  3 files changed, 293 insertions(+), 19 deletions(-)
>> 
>>  --
>>  1.9.1
>> 
>> >
>>
>>


Re: [lng-odp] [PATCH 0/6] dpdk pktio: enable hardware checksum support

2017-07-21 Thread Maxim Uvarov
ok, don't worry, have a good time!

On 21 July 2017 at 08:53, Elo, Matias (Nokia - FI/Espoo) <
matias@nokia.com> wrote:

> I'm starting my vacation today and have more acute things on my plate, so
> I don't unfortunately have time to review the patch for a couple of weeks.
>
> -Matias
>
> > On 20 Jul 2017, at 23:16, Maxim Uvarov  wrote:
> >
> > Krishna, Matias, please review dpdk changes.
> >
> > Maxim.
> >
> > On 07/19/17 16:35, Bogdan Pricope wrote:
> >> Ping?
> >>
> >> We still want this for odp-linux or we should implement it on odp-dpdk
> >> only (as soon as repository is updated)?
> >>
> >> /B
> >>
> >> On 20 June 2017 at 12:20, Bogdan Pricope 
> wrote:
> >>> Ping?
> >>>
> >>> On 31 May 2017 at 17:40, Bogdan Pricope 
> wrote:
>  Add HW checksum calculation/validation support for dpdk pktio.
>  No UDP/TCP HW checksum calculation/validation support for:
>  - IPv4 fragments
>  - IPv6 packets with extension headers (including fragments)
> 
>  Bogdan Pricope (6):
>   Initialize pktio configuration structure
>   dpdk: retrieve offload capabilities
>   dpdk: enable per pktio RX IP/UDP/TCP checksum offload
>   dpdk: RX - process checksum validation offload flags
>   dpdk: TX - set checksum calculation offload flags
>   examples: generator: update odp_generator to use HW checksum
> capabilities
> 
>  example/generator/odp_generator.c  | 107 ++---
>  platform/linux-generic/odp_packet_io.c |   2 +
>  platform/linux-generic/pktio/dpdk.c| 203
> -
>  3 files changed, 293 insertions(+), 19 deletions(-)
> 
>  --
>  1.9.1
> 
> >
>
>


[lng-odp] Monarch_lts tagging

2017-07-21 Thread Elo, Matias (Nokia - FI/Espoo)
Hi Bill,

I took a look at the patches in monarch_lts and as far as I can see the only 
fix missing, from the issues our guys have reported, is the "linux-gen: pktio: 
fix valgrind warnings" patch. This patch applies without conflicts on top the 
current monarch_lts branch.

-Matias



[lng-odp] [PATCH API-NEXT v3 2/5] test: validation: add IPsec API testsuite

2017-07-21 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Add several basic tests for IPsec API.

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 81 (lumag:ipsec-packet-impl-2)
 ** https://github.com/Linaro/odp/pull/81
 ** Patch: https://github.com/Linaro/odp/pull/81.patch
 ** Base sha: db7cc41aeb559dd296f3a6d8570aa10326a31d5e
 ** Merge commit sha: 60078606ee29afb03fa38c61b6240b5b500cf687
 **/
 test/common_plat/validation/api/ipsec/Makefile.am  |  11 +-
 test/common_plat/validation/api/ipsec/ipsec.c  | 810 +++-
 test/common_plat/validation/api/ipsec/ipsec.h  |  68 +-
 .../validation/api/ipsec/ipsec_test_in.c   | 821 +
 .../validation/api/ipsec/ipsec_test_out.c  | 347 +
 .../validation/api/ipsec/test_vectors.h| 696 +
 6 files changed, 2742 insertions(+), 11 deletions(-)
 create mode 100644 test/common_plat/validation/api/ipsec/ipsec_test_in.c
 create mode 100644 test/common_plat/validation/api/ipsec/ipsec_test_out.c
 create mode 100644 test/common_plat/validation/api/ipsec/test_vectors.h

diff --git a/test/common_plat/validation/api/ipsec/Makefile.am 
b/test/common_plat/validation/api/ipsec/Makefile.am
index 106b8dce..9dba31fd 100644
--- a/test/common_plat/validation/api/ipsec/Makefile.am
+++ b/test/common_plat/validation/api/ipsec/Makefile.am
@@ -1,10 +1,15 @@
 include ../Makefile.inc
 
+AM_CPPFLAGS += -Wno-error=missing-field-initializers
+
 noinst_LTLIBRARIES = libtestipsec.la
-libtestipsec_la_SOURCES = ipsec.c
+libtestipsec_la_SOURCES = \
+   test_vectors.h \
+   ipsec_test_in.c \
+   ipsec_test_out.c \
+   ipsec.h \
+   ipsec.c
 
 test_PROGRAMS = ipsec_main$(EXEEXT)
 dist_ipsec_main_SOURCES = ipsec_main.c
 ipsec_main_LDADD = libtestipsec.la $(LIBCUNIT_COMMON) $(LIBODP)
-
-EXTRA_DIST = ipsec.h
diff --git a/test/common_plat/validation/api/ipsec/ipsec.c 
b/test/common_plat/validation/api/ipsec/ipsec.c
index 78348032..a3afcb0a 100644
--- a/test/common_plat/validation/api/ipsec/ipsec.c
+++ b/test/common_plat/validation/api/ipsec/ipsec.c
@@ -10,6 +10,518 @@
 
 #include "ipsec.h"
 
+#include "test_vectors.h"
+
+struct suite_context_s suite_context;
+
+#define PKT_POOL_NUM  64
+#define PKT_POOL_LEN  (1 * 1024)
+
+int ipsec_check(odp_bool_t ah,
+   odp_cipher_alg_t cipher,
+   odp_auth_alg_t auth)
+{
+   odp_ipsec_capability_t capa;
+   odp_crypto_cipher_capability_t cipher_capa;
+   odp_crypto_auth_capability_t auth_capa;
+
+   if (odp_ipsec_capability() < 0)
+   return ODP_TEST_INACTIVE;
+
+   if ((ODP_IPSEC_OP_MODE_SYNC == suite_context.inbound_op_mode &&
+ODP_SUPPORT_NO == capa.op_mode_sync) ||
+   (ODP_IPSEC_OP_MODE_ASYNC == suite_context.outbound_op_mode &&
+ODP_SUPPORT_NO == capa.op_mode_sync) ||
+   (ODP_IPSEC_OP_MODE_ASYNC == suite_context.inbound_op_mode &&
+ODP_SUPPORT_NO == capa.op_mode_async) ||
+   (ODP_IPSEC_OP_MODE_ASYNC == suite_context.outbound_op_mode &&
+ODP_SUPPORT_NO == capa.op_mode_async) ||
+   (ODP_IPSEC_OP_MODE_INLINE == suite_context.inbound_op_mode &&
+ODP_SUPPORT_NO == capa.op_mode_inline_in) ||
+   (ODP_IPSEC_OP_MODE_INLINE == suite_context.outbound_op_mode &&
+ODP_SUPPORT_NO == capa.op_mode_inline_out))
+   return ODP_TEST_INACTIVE;
+
+   if (ah && (ODP_SUPPORT_NO == capa.proto_ah))
+   return ODP_TEST_INACTIVE;
+
+   /* Cipher algorithms */
+   switch (cipher) {
+   case ODP_CIPHER_ALG_NULL:
+   if (!capa.ciphers.bit.null)
+   return ODP_TEST_INACTIVE;
+   break;
+   case ODP_CIPHER_ALG_DES:
+   if (!capa.ciphers.bit.des)
+   return ODP_TEST_INACTIVE;
+   break;
+   case ODP_CIPHER_ALG_3DES_CBC:
+   if (!capa.ciphers.bit.trides_cbc)
+   return ODP_TEST_INACTIVE;
+   break;
+   case ODP_CIPHER_ALG_AES_CBC:
+   if (!capa.ciphers.bit.aes_cbc)
+   return ODP_TEST_INACTIVE;
+   break;
+   case ODP_CIPHER_ALG_AES_GCM:
+   if (!capa.ciphers.bit.aes_gcm)
+   return ODP_TEST_INACTIVE;
+   break;
+   default:
+   fprintf(stderr, "Unsupported cipher algorithm\n");
+   return ODP_TEST_INACTIVE;
+   }
+
+   /* Authentication algorithms */
+   switch (auth) {
+   case ODP_AUTH_ALG_NULL:
+   if (!capa.auths.bit.null)
+   return ODP_TEST_INACTIVE;
+   break;
+   case ODP_AUTH_ALG_MD5_HMAC:
+   if (!capa.auths.bit.md5_hmac)
+   return ODP_TEST_INACTIVE;
+   break;
+   case ODP_AUTH_ALG_SHA1_HMAC:
+   if 

[lng-odp] [PATCH API-NEXT v3 5/5] linux-generic: ipsec: draft IPsec implementation

2017-07-21 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

For now it's only a preview with the following limitation:
 - No inbound inline processing support
 - Only IPv4 support
 - No zeroing of mutable IPv4 options for AH ICV calculation
 - No replay protection
 - No ESN support
 - No UDP encapsulation support

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 81 (lumag:ipsec-packet-impl-2)
 ** https://github.com/Linaro/odp/pull/81
 ** Patch: https://github.com/Linaro/odp/pull/81.patch
 ** Base sha: db7cc41aeb559dd296f3a6d8570aa10326a31d5e
 ** Merge commit sha: 60078606ee29afb03fa38c61b6240b5b500cf687
 **/
 .../linux-generic/include/odp_packet_internal.h|4 +
 platform/linux-generic/odp_ipsec.c | 1093 +++-
 2 files changed, 1048 insertions(+), 49 deletions(-)

diff --git a/platform/linux-generic/include/odp_packet_internal.h 
b/platform/linux-generic/include/odp_packet_internal.h
index 5e0f3204..12de33f8 100644
--- a/platform/linux-generic/include/odp_packet_internal.h
+++ b/platform/linux-generic/include/odp_packet_internal.h
@@ -26,6 +26,7 @@ extern "C" {
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -132,6 +133,9 @@ typedef struct {
/* Result for crypto packet op */
odp_crypto_packet_result_t crypto_op_result;
 
+   /* Context for IPsec */
+   odp_ipsec_packet_result_t ipsec_ctx;
+
/* Packet data storage */
uint8_t data[0];
 } odp_packet_hdr_t;
diff --git a/platform/linux-generic/odp_ipsec.c 
b/platform/linux-generic/odp_ipsec.c
index d0ca027c..9eef68a9 100644
--- a/platform/linux-generic/odp_ipsec.c
+++ b/platform/linux-generic/odp_ipsec.c
@@ -6,125 +6,1120 @@
 
 #include 
 
+#include 
+#include 
 #include 
 
+#include 
+#include 
+
 #include 
 
 int odp_ipsec_capability(odp_ipsec_capability_t *capa)
 {
+   int rc;
+   odp_crypto_capability_t crypto_capa;
+
memset(capa, 0, sizeof(odp_ipsec_capability_t));
 
+   capa->op_mode_sync = ODP_SUPPORT_PREFERRED;
+   capa->op_mode_async = ODP_SUPPORT_PREFERRED;
+   capa->op_mode_inline_out = ODP_SUPPORT_YES;
+
+   capa->proto_ah = ODP_SUPPORT_YES;
+
+   capa->max_num_sa = ODP_CONFIG_IPSEC_SAS;
+
+   rc = odp_crypto_capability(_capa);
+   if (rc < 0)
+   return rc;
+
+   capa->ciphers = crypto_capa.ciphers;
+   capa->auths = crypto_capa.auths;
+
return 0;
 }
 
 int odp_ipsec_cipher_capability(odp_cipher_alg_t cipher,
odp_crypto_cipher_capability_t capa[], int num)
 {
-   (void)cipher;
-   (void)capa;
-   (void)num;
-
-   return -1;
+   return odp_crypto_cipher_capability(cipher, capa, num);
 }
 
 int odp_ipsec_auth_capability(odp_auth_alg_t auth,
  odp_crypto_auth_capability_t capa[], int num)
 {
-   (void)auth;
-   (void)capa;
-   (void)num;
-
-   return -1;
+   return odp_crypto_auth_capability(auth, capa, num);
 }
 
 void odp_ipsec_config_init(odp_ipsec_config_t *config)
 {
memset(config, 0, sizeof(odp_ipsec_config_t));
+   config->inbound_mode = ODP_IPSEC_OP_MODE_SYNC;
+   config->outbound_mode = ODP_IPSEC_OP_MODE_SYNC;
+   config->max_num_sa = ODP_CONFIG_IPSEC_SAS;
+   config->inbound.default_queue = ODP_QUEUE_INVALID;
+   config->inbound.lookup.min_spi = 0;
+   config->inbound.lookup.max_spi = UINT32_MAX;
 }
 
+static odp_ipsec_config_t ipsec_config;
+
 int odp_ipsec_config(const odp_ipsec_config_t *config)
 {
-   (void)config;
+   /* FIXME: unsupported for now */
+   if (ODP_IPSEC_OP_MODE_INLINE == config->inbound_mode)
+   return -1;
+
+   if (ODP_CONFIG_IPSEC_SAS > config->max_num_sa)
+   return -1;
+
+   ipsec_config = *config;
+
+   return 0;
+}
+
+static odp_ipsec_packet_result_t *ipsec_pkt_result(odp_packet_t packet)
+{
+   ODP_ASSERT(ODP_EVENT_PACKET_IPSEC ==
+  odp_event_subtype(odp_packet_to_event(packet)));
+
+   return _packet_hdr(packet)->ipsec_ctx;
+}
+
+/**
+ * Checksum
+ *
+ * @param buffer calculate chksum for buffer
+ * @param lenbuffer length
+ *
+ * @return checksum value in host cpu order
+ */
+static inline
+odp_u16sum_t _odp_chksum(void *buffer, int len)
+{
+   uint16_t *buf = (uint16_t *)buffer;
+   uint32_t sum = 0;
+   uint16_t result;
+
+   for (sum = 0; len > 1; len -= 2)
+   sum += *buf++;
+
+   if (len == 1)
+   sum += *(unsigned char *)buf;
+
+   sum = (sum >> 16) + (sum & 0x);
+   sum += (sum >> 16);
+   result = ~sum;
+
+   return  (__odp_force odp_u16sum_t) result;
+}
+
+/**
+ * Calculate and fill in IPv4 checksum
+ *
+ * @note when using this api to populate data destined for the wire
+ * odp_cpu_to_be_16() can be used to remove sparse warnings
+ *
+ * @param pkt  ODP packet
+ *
+ * @return IPv4 checksum in 

[lng-odp] [PATCH API-NEXT v3 3/5] linux-generic: ipsec: implement events handling

2017-07-21 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Add functions implementing IPsec events support.

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 81 (lumag:ipsec-packet-impl-2)
 ** https://github.com/Linaro/odp/pull/81
 ** Patch: https://github.com/Linaro/odp/pull/81.patch
 ** Base sha: db7cc41aeb559dd296f3a6d8570aa10326a31d5e
 ** Merge commit sha: 60078606ee29afb03fa38c61b6240b5b500cf687
 **/
 platform/linux-generic/Makefile.am |   2 +
 platform/linux-generic/include/odp_internal.h  |   4 +
 .../linux-generic/include/odp_ipsec_internal.h |  84 +++
 platform/linux-generic/odp_event.c |   4 +
 platform/linux-generic/odp_init.c  |  13 ++
 platform/linux-generic/odp_ipsec.c |  10 +-
 platform/linux-generic/odp_ipsec_events.c  | 158 +
 7 files changed, 267 insertions(+), 8 deletions(-)
 create mode 100644 platform/linux-generic/include/odp_ipsec_internal.h
 create mode 100644 platform/linux-generic/odp_ipsec_events.c

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index b46c6501..1e7cafe9 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -170,6 +170,7 @@ noinst_HEADERS = \
  ${srcdir}/include/odp_errno_define.h \
  ${srcdir}/include/odp_forward_typedefs_internal.h \
  ${srcdir}/include/odp_internal.h \
+ ${srcdir}/include/odp_ipsec_internal.h \
  ${srcdir}/include/odp_llqueue.h \
  ${srcdir}/include/odp_name_table_internal.h \
  ${srcdir}/include/odp_packet_internal.h \
@@ -242,6 +243,7 @@ __LIB__libodp_linux_la_SOURCES = \
   odp_init.c \
   odp_impl.c \
   odp_ipsec.c \
+  odp_ipsec_events.c \
   odp_name_table.c \
   odp_packet.c \
   odp_packet_flags.c \
diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index 404792cf..62a1ea8a 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -70,6 +70,7 @@ enum init_stage {
CLASSIFICATION_INIT,
TRAFFIC_MNGR_INIT,
NAME_TABLE_INIT,
+   IPSEC_EVENTS_INIT,
MODULES_INIT,
ALL_INIT  /* All init stages completed */
 };
@@ -129,6 +130,9 @@ int _odp_ishm_init_local(void);
 int _odp_ishm_term_global(void);
 int _odp_ishm_term_local(void);
 
+int _odp_ipsec_events_init_global(void);
+int _odp_ipsec_events_term_global(void);
+
 int _odp_modules_init_global(void);
 
 int cpuinfo_parser(FILE *file, system_info_t *sysinfo);
diff --git a/platform/linux-generic/include/odp_ipsec_internal.h 
b/platform/linux-generic/include/odp_ipsec_internal.h
new file mode 100644
index ..b31f048f
--- /dev/null
+++ b/platform/linux-generic/include/odp_ipsec_internal.h
@@ -0,0 +1,84 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier:BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP internal IPsec routines
+ */
+
+#ifndef ODP_IPSEC_INTERNAL_H_
+#define ODP_IPSEC_INTERNAL_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+#include 
+
+#include 
+
+/** @ingroup odp_ipsec
+ *  @{
+ */
+
+typedef ODP_HANDLE_T(ipsec_status_t);
+
+#define ODP_IPSEC_STATUS_INVALID \
+   _odp_cast_scalar(ipsec_status_t, 0x)
+
+/**
+ * @internal Get ipsec_status handle from event
+ *
+ * Converts an ODP_EVENT_IPSEC_STATUS type event to an IPsec status event.
+ *
+ * @param ev   Event handle
+ *
+ * @return IPsec status handle
+ *
+ * @see odp_event_type()
+ */
+ipsec_status_t _odp_ipsec_status_from_event(odp_event_t ev);
+
+/**
+ * @internal Free IPsec status event
+ *
+ * Frees the ipsec_status into the ipsec_status pool it was allocated from.
+ *
+ * @param res   IPsec status handle
+ */
+void _odp_ipsec_status_free(ipsec_status_t status);
+
+/**
+ * @internal Send ODP_IPSEC_STATUS event
+ *
+ * Sends the ipsec_status event using provided information
+ *
+ * @param queue destination queue
+ * @param idstatus id
+ * @param saSA respective to the operation
+ * @param resultstatus value
+ * @param warn  generated warning
+ *
+ * @retval 0 on success
+ * @retval <0 on failure
+ */
+int _odp_ipsec_status_send(odp_queue_t queue,
+  odp_ipsec_status_id_t id,
+  odp_ipsec_sa_t sa,
+  int result,
+  odp_ipsec_warn_t warn);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/odp_event.c 
b/platform/linux-generic/odp_event.c
index 23b410d8..f03faa64 100644

[lng-odp] [PATCH API-NEXT v3 4/5] linux-generic: ipsec: implement IPsec SAD

2017-07-21 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Implement SA database and SA handling.

- only IPv4 is supported for now
- no support for time-based limits

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 81 (lumag:ipsec-packet-impl-2)
 ** https://github.com/Linaro/odp/pull/81
 ** Patch: https://github.com/Linaro/odp/pull/81.patch
 ** Base sha: db7cc41aeb559dd296f3a6d8570aa10326a31d5e
 ** Merge commit sha: 60078606ee29afb03fa38c61b6240b5b500cf687
 **/
 platform/linux-generic/Makefile.am |   1 +
 platform/linux-generic/include/odp_internal.h  |   4 +
 .../linux-generic/include/odp_ipsec_internal.h | 104 +
 platform/linux-generic/odp_init.c  |  13 +
 platform/linux-generic/odp_ipsec.c |  46 --
 platform/linux-generic/odp_ipsec_sad.c | 488 +
 6 files changed, 610 insertions(+), 46 deletions(-)
 create mode 100644 platform/linux-generic/odp_ipsec_sad.c

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 1e7cafe9..329c76a9 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -244,6 +244,7 @@ __LIB__libodp_linux_la_SOURCES = \
   odp_impl.c \
   odp_ipsec.c \
   odp_ipsec_events.c \
+  odp_ipsec_sad.c \
   odp_name_table.c \
   odp_packet.c \
   odp_packet_flags.c \
diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index 62a1ea8a..0c97875c 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -71,6 +71,7 @@ enum init_stage {
TRAFFIC_MNGR_INIT,
NAME_TABLE_INIT,
IPSEC_EVENTS_INIT,
+   IPSEC_SAD_INIT,
MODULES_INIT,
ALL_INIT  /* All init stages completed */
 };
@@ -130,6 +131,9 @@ int _odp_ishm_init_local(void);
 int _odp_ishm_term_global(void);
 int _odp_ishm_term_local(void);
 
+int _odp_ipsec_sad_init_global(void);
+int _odp_ipsec_sad_term_global(void);
+
 int _odp_ipsec_events_init_global(void);
 int _odp_ipsec_events_term_global(void);
 
diff --git a/platform/linux-generic/include/odp_ipsec_internal.h 
b/platform/linux-generic/include/odp_ipsec_internal.h
index b31f048f..d2f69e97 100644
--- a/platform/linux-generic/include/odp_ipsec_internal.h
+++ b/platform/linux-generic/include/odp_ipsec_internal.h
@@ -20,7 +20,9 @@ extern "C" {
 #include 
 #include 
 
+#include 
 #include 
+#include 
 
 /** @ingroup odp_ipsec
  *  @{
@@ -31,6 +33,8 @@ typedef ODP_HANDLE_T(ipsec_status_t);
 #define ODP_IPSEC_STATUS_INVALID \
_odp_cast_scalar(ipsec_status_t, 0x)
 
+typedef struct ipsec_sa_s ipsec_sa_t;
+
 /**
  * @internal Get ipsec_status handle from event
  *
@@ -73,6 +77,106 @@ int _odp_ipsec_status_send(odp_queue_t queue,
   int result,
   odp_ipsec_warn_t warn);
 
+#define IPSEC_MAX_IV_LEN   32   /**< Maximum IV length in bytes */
+
+/**
+ * Maximum number of available SAs
+ */
+#define ODP_CONFIG_IPSEC_SAS   8
+
+struct ipsec_sa_s {
+   odp_atomic_u32_t state ODP_ALIGNED_CACHE;
+
+   uint32_tipsec_sa_idx;
+   odp_ipsec_sa_t  ipsec_sa_hdl;
+
+   odp_ipsec_protocol_t proto;
+   uint32_tspi;
+
+   odp_ipsec_mode_t mode;
+
+   /* Limits */
+   uint64_t soft_limit_bytes;
+   uint64_t soft_limit_packets;
+   uint64_t hard_limit_bytes;
+   uint64_t hard_limit_packets;
+
+   /* Statistics for soft/hard expiration */
+   odp_atomic_u64_t bytes;
+   odp_atomic_u64_t packets;
+
+   odp_crypto_session_t session;
+   void*context;
+   odp_queue_t queue;
+
+   uint32_ticv_len;
+   uint32_tesp_iv_len;
+   uint32_tesp_block_len;
+
+   unsigneddec_ttl : 1;
+   unsignedcopy_dscp : 1;
+   unsignedcopy_df : 1;
+
+   union {
+   struct {
+   odp_ipsec_lookup_mode_t lookup_mode;
+   odp_u32be_t lookup_dst_ip;
+   } in;
+
+   struct {
+   odp_u32be_t tun_src_ip;
+   odp_u32be_t tun_dst_ip;
+
+   /* 32-bit from which low 16 are used */
+   odp_atomic_u32_t tun_hdr_id;
+   odp_atomic_u32_t seq;
+
+   uint8_t tun_ttl;
+   uint8_t tun_dscp;
+   uint8_t tun_df;
+   } out;
+   };
+};
+
+/**
+ * IPSEC Security Association (SA) lookup parameters
+ */
+typedef struct odp_ipsec_sa_lookup_s {
+   /** IPSEC protocol: ESP or AH */
+   

[lng-odp] [PATCH API-NEXT v6 1/1] linux-gen: pktio: loop: support IPsec outbound inline

2017-07-21 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Add support for outbound inline IPsec packet processing on loop
interface.

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 68 (lumag:packet-loop)
 ** https://github.com/Linaro/odp/pull/68
 ** Patch: https://github.com/Linaro/odp/pull/68.patch
 ** Base sha: db7cc41aeb559dd296f3a6d8570aa10326a31d5e
 ** Merge commit sha: 6a70a500faf4645366c07567d58d3253a31a5efa
 **/
 platform/linux-generic/pktio/loop.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/platform/linux-generic/pktio/loop.c 
b/platform/linux-generic/pktio/loop.c
index c825393a..5b7a9692 100644
--- a/platform/linux-generic/pktio/loop.c
+++ b/platform/linux-generic/pktio/loop.c
@@ -166,6 +166,18 @@ static int loopback_send(pktio_entry_t *pktio_entry, int 
index ODP_UNUSED,
for (i = 0; i < len; ++i) {
hdr_tbl[i] = packet_to_buf_hdr(pkt_tbl[i]);
bytes += odp_packet_len(pkt_tbl[i]);
+
+   if (pktio_entry->s.config.outbound_ipsec &&
+   _odp_buffer_event_subtype(hdr_tbl[i]->handle.handle) ==
+   ODP_EVENT_PACKET_IPSEC) {
+   odp_ipsec_packet_result_t result;
+
+   /* Possibly postprocessing packet */
+   odp_ipsec_result(, pkt_tbl[i]);
+
+   _odp_buffer_event_subtype_set(hdr_tbl[i]->handle.handle,
+ ODP_EVENT_PACKET_BASIC);
+   }
}
 
odp_ticketlock_lock(_entry->s.txl);
@@ -217,6 +229,8 @@ static int loopback_capability(pktio_entry_t *pktio_entry 
ODP_UNUSED,
odp_pktio_config_init(>config);
capa->config.pktin.bit.ts_all = 1;
capa->config.pktin.bit.ts_ptp = 1;
+   capa->config.outbound_ipsec = 1;
+
return 0;
 }
 



[lng-odp] [PATCH API-NEXT v3 0/5] IPsec implementation based on packet interface

2017-07-21 Thread Github ODP bot
This PR replaces #28 by providing new IPsec implementation based on latest API 
additions.

github
/** Email created from pull request 81 (lumag:ipsec-packet-impl-2)
 ** https://github.com/Linaro/odp/pull/81
 ** Patch: https://github.com/Linaro/odp/pull/81.patch
 ** Base sha: db7cc41aeb559dd296f3a6d8570aa10326a31d5e
 ** Merge commit sha: 60078606ee29afb03fa38c61b6240b5b500cf687
 **/
/github

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


to_send-p-000.patch has no obvious style problems and is ready for submission.
CHECK: Avoid CamelCase: 
#654: FILE: test/common_plat/validation/api/ipsec/ipsec.c:613:
+   for (i = 0; suite[i].pName; i++) {

CHECK: Alignment should match open parenthesis
#2177: FILE: test/common_plat/validation/api/ipsec/test_vectors.h:18:
+KEY(key_a5_128, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5,
+   0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5);

CHECK: Alignment should match open parenthesis
#2179: FILE: test/common_plat/validation/api/ipsec/test_vectors.h:20:
+KEY(key_5a_128, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a,
+   0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a);

CHECK: Alignment should match open parenthesis
#2181: FILE: test/common_plat/validation/api/ipsec/test_vectors.h:22:
+KEY(key_a5_256, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5,
+   0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5,

CHECK: Alignment should match open parenthesis
#2185: FILE: test/common_plat/validation/api/ipsec/test_vectors.h:26:
+KEY(key_5a_256, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a,
+   0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a, 0x5a,

CHECK: Alignment should match open parenthesis
#2190: FILE: test/common_plat/validation/api/ipsec/test_vectors.h:31:
+KEY(key_rfc3602, 0x90, 0xd3, 0x82, 0xb4, 0x10, 0xee, 0xba, 0x7a,
+0xd9, 0x38, 0xc4, 0x6c, 0xec, 0x1a, 0x82, 0xbf);

CHECK: Alignment should match open parenthesis
#2192: FILE: test/common_plat/validation/api/ipsec/test_vectors.h:33:
+KEY(key_rfc3602_2, 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef,
+  0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef);

total: 0 errors, 0 warnings, 7 checks, 2791 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.
total: 0 errors, 0 warnings, 0 checks, 335 lines checked


to_send-p-002.patch has no obvious style problems and is ready for submission.
ERROR: space prohibited after that '&' (ctx:WxW)
#434: FILE: platform/linux-generic/odp_ipsec_sad.c:137:
+   if (state & IPSEC_SA_STATE_DISABLE)
  ^

ERROR: space prohibited after that '-' (ctx:WxW)
#453: FILE: platform/linux-generic/odp_ipsec_sad.c:156:
+state - 1);
   ^

ERROR: space prohibited after that '&' (ctx:WxW)
#650: FILE: platform/linux-generic/odp_ipsec_sad.c:353:
+   if (state & IPSEC_SA_STATE_DISABLE)
  ^

total: 3 errors, 0 warnings, 0 checks, 715 lines checked


to_send-p-003.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, 1185 lines checked


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


[lng-odp] [PATCH API-NEXT v6 0/1] linux-gen: pktio: loop: reset packet subtype on loopback

2017-07-21 Thread Github ODP bot
loop interface can get any kind of packets, but should output only basic
packets. Reset packet subtype on loopback.
Signed-off-by: Dmitry Eremin-Solenikov dmitry.ereminsoleni...@linaro.org

github
/** Email created from pull request 68 (lumag:packet-loop)
 ** https://github.com/Linaro/odp/pull/68
 ** Patch: https://github.com/Linaro/odp/pull/68.patch
 ** Base sha: db7cc41aeb559dd296f3a6d8570aa10326a31d5e
 ** Merge commit sha: 6a70a500faf4645366c07567d58d3253a31a5efa
 **/
/github

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


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


[lng-odp] [PATCH API-NEXT v3 1/5] linux-gen: pktio: loop: support IPsec outbound inline

2017-07-21 Thread Github ODP bot
From: Dmitry Eremin-Solenikov 

Add support for outbound inline IPsec packet processing on loop
interface.

Signed-off-by: Dmitry Eremin-Solenikov 
---
/** Email created from pull request 81 (lumag:ipsec-packet-impl-2)
 ** https://github.com/Linaro/odp/pull/81
 ** Patch: https://github.com/Linaro/odp/pull/81.patch
 ** Base sha: db7cc41aeb559dd296f3a6d8570aa10326a31d5e
 ** Merge commit sha: 60078606ee29afb03fa38c61b6240b5b500cf687
 **/
 platform/linux-generic/pktio/loop.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/platform/linux-generic/pktio/loop.c 
b/platform/linux-generic/pktio/loop.c
index c825393a..5b7a9692 100644
--- a/platform/linux-generic/pktio/loop.c
+++ b/platform/linux-generic/pktio/loop.c
@@ -166,6 +166,18 @@ static int loopback_send(pktio_entry_t *pktio_entry, int 
index ODP_UNUSED,
for (i = 0; i < len; ++i) {
hdr_tbl[i] = packet_to_buf_hdr(pkt_tbl[i]);
bytes += odp_packet_len(pkt_tbl[i]);
+
+   if (pktio_entry->s.config.outbound_ipsec &&
+   _odp_buffer_event_subtype(hdr_tbl[i]->handle.handle) ==
+   ODP_EVENT_PACKET_IPSEC) {
+   odp_ipsec_packet_result_t result;
+
+   /* Possibly postprocessing packet */
+   odp_ipsec_result(, pkt_tbl[i]);
+
+   _odp_buffer_event_subtype_set(hdr_tbl[i]->handle.handle,
+ ODP_EVENT_PACKET_BASIC);
+   }
}
 
odp_ticketlock_lock(_entry->s.txl);
@@ -217,6 +229,8 @@ static int loopback_capability(pktio_entry_t *pktio_entry 
ODP_UNUSED,
odp_pktio_config_init(>config);
capa->config.pktin.bit.ts_all = 1;
capa->config.pktin.bit.ts_ptp = 1;
+   capa->config.outbound_ipsec = 1;
+
return 0;
 }