[lng-odp] IPsec limits support

2017-05-04 Thread Dmitry Eremin-Solenikov
Hello,

I have been working on limits support in IPsec. Now I have several
questions:

 - Is hard limit crossing fatal? IOW, should I start returning
unprocessed packets after crossing it?

 - Does 'bytes' limit count packet bytes before or IPsec operation? Does
it count 'usefull' payload or the whole odp_packet_len()?

-- 
With best wishes
Dmitry


Re: [lng-odp] IPsec limits support

2017-05-04 Thread Dmitry Eremin-Solenikov
On 04.05.2017 19:35, Bill Fischofer wrote:
> 
> 
> On Thu, May 4, 2017 at 11:25 AM, Dmitry Eremin-Solenikov
> <dmitry.ereminsoleni...@linaro.org
> <mailto:dmitry.ereminsoleni...@linaro.org>> wrote:
> 
> Hello,
> 
> I have been working on limits support in IPsec. Now I have several
> questions:
> 
>  - Is hard limit crossing fatal? IOW, should I start returning
> unprocessed packets after crossing it?
> 
> 
> The reason for having soft and hard limits is this distinction. When a
> soft limit is reached a notification event should be issued. When a hard
> limit is reached the SA is treated as disabled. So an operation against
> an SA that's reached it's hard limit should be treated the same as an
> operation against a disabled SA.

Argh. There is no 'event' for soft limits, just a status in the error
flags. BTW: should we move soft_exp_* to flags instead of errors?

And also there is no way to treat hard-expired SA as disabled. We should
report hard_exp_* through result errors.

>  - Does 'bytes' limit count packet bytes before or IPsec operation? Does
> it count 'usefull' payload or the whole odp_packet_len()?
> 
> 
> It's typically easier to just count packets and not be overly concerned
> about trying to cut off packets mid-stream on byte limits. For byte
> counting the SA would simply count the number of bytes processed for
> each operation and compare that to the limits as the operation finishes
> up. Limits are statistical in nature and as such if the odd in-flight
> packet or byte slips past it's not something to worry about.

Ack. I'll count odp_packet_len() then.

-- 
With best wishes
Dmitry


[lng-odp] [PATCH] api: ipsec: change semantics of odp_ipsec_result function

2017-05-08 Thread Dmitry Eremin-Solenikov
 - Move packets from the event instead of copying them. This simplifies
   event handling/freeing code, which now does not have to track, which
   packets were copied from the event and which packets should be freed.

 - Do not require to free the event before processing packets. This
   allows one to copy packets from the event in small batches and
   process them accordingly.

 - Freeing the event in odp_ipsec_result() leaves space for optimized
   implementations, where an event is actually a packet with additional
   metadata.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/odp/api/spec/ipsec.h | 22 ++
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h
index a0ceb11a..78645567 100644
--- a/include/odp/api/spec/ipsec.h
+++ b/include/odp/api/spec/ipsec.h
@@ -1278,17 +1278,23 @@ int odp_ipsec_out_inline(const odp_ipsec_op_param_t 
*op_param,
  * Get IPSEC results from an ODP_EVENT_IPSEC_RESULT event
  *
  * Copies IPSEC operation results from an event. The event must be of
- * type ODP_EVENT_IPSEC_RESULT. It must be freed before the application passes
- * any resulting packet handles to other ODP calls.
+ * type ODP_EVENT_IPSEC_RESULT. The event will be freed automatically if
+ * odp_ipsec_result() returns 0.  In all other case it must be freed via
+ * odp_event_free().
  *
- * @param[out]result  Pointer to operation result for output. Maybe NULL, 
if
- *application is interested only on the number of
- *packets.
+ * @param[out]result  Pointer to operation result for output. May be
+ *NULL, if application is interested only on the
+ *number of packets.
  * @param event   An ODP_EVENT_IPSEC_RESULT event
  *
- * @return Number of packets in the event. If this is larger than
- * 'result.num_pkt', all packets did not fit into result struct and
- * application must call the function again with a larger result 
struct.
+ * @return Number of packets remaining in the event.
+ * @retval > 0All packets did not fit into result struct and
+ *application must call the function again. Packets
+ *returned during previous calls will not be returned
+ *again in subsequent calls.
+ * @retval 0  All packets were returned. The event was freed during
+ *this call. Application should not access the event
+ *afterwards.
  * @retval <0 On failure
  *
  * @see odp_ipsec_in_enq(), odp_ipsec_out_enq()
-- 
2.11.0



Re: [lng-odp] [PATCH API-NEXT v2 16/20] linux-generic: packet: add functions to optimize memset and memcmp paths

2017-05-31 Thread Dmitry Eremin-Solenikov
On 31.05.2017 15:08, Savolainen, Petri (Nokia - FI/Espoo) wrote:
> 
>> diff --git a/platform/linux-generic/include/odp_packet_internal.h
>> b/platform/linux-generic/include/odp_packet_internal.h
>> index d0db7008..a480a748 100644
>> --- a/platform/linux-generic/include/odp_packet_internal.h
>> +++ b/platform/linux-generic/include/odp_packet_internal.h
>> @@ -237,6 +237,12 @@ int packet_parse_common(packet_parser_t *pkt_hdr,
>> const uint8_t *ptr,
>>
>>  int _odp_cls_parse(odp_packet_hdr_t *pkt_hdr, const uint8_t *parseptr);
>>
>> +int _odp_packet_set_data(odp_packet_t pkt, uint32_t offset,
>> + uint8_t c, uint32_t len);
>> +
>> +int _odp_packet_cmp_data(odp_packet_t pkt, uint32_t offset,
>> + const void *s, uint32_t len);
>> +
> 
> Since packet_internal.h is internal header and should not be visible to 
> application, _odp prefix is not needed. Most (all recent) functions in the 
> file do not have prefix. So, change to packet_set_data() and packet_cmp_data()


These symbols still leak into static library poisoning global name. Thus
in my opinion we should limit non-static symbols to odp_ and _odp_
namespaces.


-- 
With best wishes
Dmitry


[lng-odp] api-next branch broken?

2017-05-19 Thread Dmitry Eremin-Solenikov
Since one of last updates I'm receiving timeouts from Travis CI because
some tests run silently taking too much time to complete.

-- 
With best wishes
Dmitry


Re: [lng-odp] [PATCH v1 2/2] travis: add cross-compilation checks

2017-06-27 Thread Dmitry Eremin-Solenikov
On 27.06.2017 16:15, Maxim Uvarov wrote:
> On 06/27/17 16:00, Github ODP bot wrote:
>> +  - env echo -e 'Provides\x3a multiarch-support, 
>> debconf, debconf-2.0' > dummy
> typo

Where?

-- 
With best wishes
Dmitry


Re: [lng-odp] [PATCH v1 2/2] travis: add cross-compilation checks

2017-06-27 Thread Dmitry Eremin-Solenikov
On 27.06.2017 16:13, Maxim Uvarov wrote:
> On 06/27/17 16:00, Github ODP bot wrote:
>> -- ./bootstrap
>> -- ./configure --enable-debug --enable-automated --enable-basic 
>> --enable-console --enable-examples --enable-test
>> +- libtoolize --force --copy
>> +- aclocal
>> +- autoheader
>> +- automake --add-missing --include-deps --copy
>> +- autoconf
>> +- ./configure --enable-debug --enable-automated --enable-basic 
>> --enable-console --enable-examples --enable-test $CROSS || cat config.log
>>  - make
>>  - sudo make install
>>  - popd
>>  - export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
> 
> I really would like that these lines match documentation. If in README
> we say to run ./bootstrap it has to be here also.

It won't work, because bootstrap calls configure with improper
arguments. E.g. I did not find a way to pass --host to it. So
compilation of CUnit fails.

-- 
With best wishes
Dmitry


[lng-odp] Future of per-arch-platform ABI spec files

2017-09-19 Thread Dmitry Eremin-Solenikov
Hello,

I have been poking around per-arch-platform ABI spec files.
Currently all architectures just include default specs. Do we have any
particular use case for these separate files? Otherwise I'd suggest to
drop them completely and just leave 'default' in place.

-- 
With best wishes
Dmitry


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

2017-08-29 Thread Dmitry Eremin-Solenikov
On 29/08/17 19:18, shally verma wrote:
> Alongside a question of retrieving results for synchronous operations,
> have one more questions - in crypto, I dont see separate output packet
> data range. So, does it mean it writes to same offset and uses same
> length as mentioned for input packet?

Yes. Aside of padding, encryption does not change data length (and we do
not support padding ATM). Hash is written at hash_result_offset offset.

-- 
With best wishes
Dmitry


Re: [lng-odp] Fwd: Cunit configuration error

2017-09-05 Thread Dmitry Eremin-Solenikov
On 05/09/17 19:31, Maxim Uvarov wrote:
> I got this error from latest api-next in github.
> Anything I am missing? I have installed libcunit1-dev
> 
> checking for asciidoctor... asciidoctor
> checking for mscgen... no
> configure: WARNING: mscgen not found - continuing without sequence
> message support
> checking for CUNIT... no
> configure: error: Package requirements (cunit) were not met:
> 
> Package 'cunit' has no Version: field
> 
> Consider adjusting the PKG_CONFIG_PATH environment variable if you
> installed software in a non-standard prefix.

Please see https://github.com/Linaro/odp/pull/162 .

CUnit before 2.1-3 contained invalid cunit.pc file.

Try calling /configure CUNIT_CFLAGS="-I/usr/include"
CUNIT_LIBS="-lcunit" .



-- 
With best wishes
Dmitry


Re: [lng-odp] api-next broken?

2017-08-31 Thread Dmitry Eremin-Solenikov
On 31/08/17 13:25, shally verma wrote:
> I was trying api-next from linaro/odp as of today and am seeing this
> error. Am I missing anything here?
> 
> I simply use
> ./bootstrap
> ./configure
> ./make
> 
> make[2]: Entering directory
> `/home/shrutika/zip/zip-linux/83xx/odp/odp/example/ipfragreass'
>   CC   odp_ipfragreass-odp_ipfragreass.o
>   CC   odp_ipfragreass-odp_ipfragreass_fragment.o
>   CC   odp_ipfragreass-odp_ipfragreass_helpers.o
>   CC   odp_ipfragreass-odp_ipfragreass_reassemble.o
>   CCLD odp_ipfragreass
> odp_ipfragreass-odp_ipfragreass_reassemble.o: In function
> `atomic_strong_cas_dblptr':
> /home/shrutika/zip/zip-linux/83xx/odp/odp/example/ipfragreass/odp_ipfragreass_atomics.h:51:
> undefined reference to `__atomic_compare_exchange_16'
> /home/shrutika/zip/zip-linux/83xx/odp/odp/example/ipfragreass/odp_ipfragreass_atomics.h:51:
> undefined reference to `__atomic_compare_exchange_16'
> /home/shrutika/zip/zip-linux/83xx/odp/odp/example/ipfragreass/odp_ipfragreass_atomics.h:51:
> undefined reference to `__atomic_compare_exchange_16'
> collect2: error: ld returned 1 exit status
> make[2]: *** [odp_ipfragreass] Error 1

Please provide config.log and make V=1 log. Thanks.


-- 
With best wishes
Dmitry


Re: [lng-odp] generic core + HW specific drivers

2017-10-03 Thread Dmitry Eremin-Solenikov
On 03/10/17 11:12, Savolainen, Petri (Nokia - FI/Espoo) wrote:
>> -Original Message-
>> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of Ola
>> Liljedahl
>> Sent: Friday, September 29, 2017 8:47 PM
>> To: lng-odp@lists.linaro.org
>> Subject: [lng-odp] generic core + HW specific drivers
>>
>> olli@vubuntu:~$ dpkg --get-selections | grep xorg
>> xorg install
>> xorg-docs-core install
>> xserver-xorg install
>> xserver-xorg-core install
>> xserver-xorg-input-all install
>> xserver-xorg-input-evdev install
>> xserver-xorg-input-libinput install
>> xserver-xorg-input-synaptics install
>> xserver-xorg-input-wacom install
>> xserver-xorg-video-all install
>> xserver-xorg-video-amdgpu install
>> xserver-xorg-video-ati install
>> xserver-xorg-video-fbdev install
>> xserver-xorg-video-intel install
>> xserver-xorg-video-mach64 install
>> xserver-xorg-video-neomagic install
>> xserver-xorg-video-nouveau install<<> xserver-xorg-video-openchrome install
>> xserver-xorg-video-qxl install
>> xserver-xorg-video-r128 install
>> xserver-xorg-video-radeon install .   <<> xserver-xorg-video-savage install
>> xserver-xorg-video-siliconmotion install
>> xserver-xorg-video-sisusb install
>> xserver-xorg-video-tdfx install
>> xserver-xorg-video-trident install
>> xserver-xorg-video-vesa install
>> xserver-xorg-video-vmware install .   <<>
>> So let's rename ODP Cloud to ODP Core.
>>
>> -- Ola
> 
> 
> DPDK packages in Ubuntu 17.05 (https://packages.ubuntu.com/artful/dpdk) 
> include many HW dependent packages 
> 
> ...
> librte-pmd-fm10k17.05 (= 17.05.2-0ubuntu1) [amd64, i386]  <<< Intel Red Rock 
> Canyon net driver, provided only for x86
> librte-pmd-i40e17.05 (= 17.05.2-0ubuntu1)
> librte-pmd-ixgbe17.05 (= 17.05.2-0ubuntu1) [not ppc64el]
> librte-pmd-kni17.05 (= 17.05.2-0ubuntu1) [not i386]
> librte-pmd-lio17.05 (= 17.05.2-0ubuntu1)
> librte-pmd-nfp17.05 (= 17.05.2-0ubuntu1)
> librte-pmd-null-crypto17.05 (= 17.05.2-0ubuntu1)
> librte-pmd-null17.05 (= 17.05.2-0ubuntu1)
> librte-pmd-octeontx-ssovf17.05 (= 17.05.2-0ubuntu1)   <<< OcteonTX SSO 
> eventdev driver files as a package
> librte-pmd-pcap17.05 (= 17.05.2-0ubuntu1)
> librte-pmd-qede17.05 (= 17.05.2-0ubuntu1)
> librte-pmd-ring17.05 (= 17.05.2-0ubuntu1)
> librte-pmd-sfc-efx17.05 (= 17.05.2-0ubuntu1) [amd64]
> librte-pmd-skeleton-event17.05 (= 17.05.2-0ubuntu1)
> librte-pmd-sw-event17.05 (= 17.05.2-0ubuntu1)
> librte-pmd-tap17.05 (= 17.05.2-0ubuntu1)
> librte-pmd-thunderx-nicvf17.05 (= 17.05.2-0ubuntu1)  <<< ThunderX net driver 
> files as a package
> ...
> 
> 
> So, we should be able to deliver ODP as a set of HW independent and HW 
> specific packages (libraries). For example, minimal install would include 
> only odp, odp-linux and odp-test-suite, but when on arm64 (and especially 
> when on ThunderX) odp-thunderx would be installed also. The trick would be 
> how to select odp-thunderx installed files (also headers) as default when 
> application is built or run on ThunderX (and not on another arm64).
> 
> Package:
> * odp (only generic folders and documentation, no implementation)
>   * depends on: odp-linux, odp-test-suite
>   * recommends: odp-linux, odp-dpdk, odp-thunderx, odp-dpaa2, ...
> * odp-linux
>   * depends on: odp, openssl
>   * recommends: dpdk, netmap, ...
> * odp-dpdk
>   * depends on: odp, dpdk
> * odp-thunderx [arm64]
>   * depends on: odp, ...
> * odp-test-suite
>   * depends on: odp

I suppose this would satisfy distribution requirements. Especially if we
can merge all platforms to the same repo. It might be reasonable to
optionally follow the model of OpenCL ICD (installable client drivers),
when there is a frontend library moderating access to several backend
libraries. Each driver can be built as a stand-along libopencl or as
ICD, being picked up by frontend libopencl1. Modular ODP might well be
just one of these drivers, serving the case when single platform
combines different hardware instances.

-- 
With best wishes
Dmitry


[lng-odp] DPDK pktio tests failure

2017-10-04 Thread Dmitry Eremin-Solenikov
Hello,

I'm observing occasional test failures on pktio_dpdk tests, with the
following lines in the log:

ERROR: This system does not support "RDRAND".
Please check that RTE_MACHINE is set correctly.

Does anyone know how to fix or workaround that?

-- 
With best wishes
Dmitry


Re: [lng-odp] Moving scalable scheduler to master

2017-10-12 Thread Dmitry Eremin-Solenikov
On 12 October 2017 at 16:33, Brian Brooks  wrote:
> This code is primarily contained within its own files, so I don't see
> how this mitigates any issues (merge conflicts) with merging it to
> master.

Problem lies in code quality, not in (possible) merge conflicts.

-- 
With best wishes
Dmitry


[lng-odp] [PATCH 03/29] linux-gen: ipsec: don't use __odp_force

2017-10-23 Thread Dmitry Eremin-Solenikov
__odp_force is not part of ODP API, so it should not be used directly.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 platform/linux-generic/odp_ipsec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/platform/linux-generic/odp_ipsec.c 
b/platform/linux-generic/odp_ipsec.c
index e57736c2a792..7e833adee0a8 100644
--- a/platform/linux-generic/odp_ipsec.c
+++ b/platform/linux-generic/odp_ipsec.c
@@ -126,7 +126,7 @@ odp_u16sum_t _odp_chksum(void *buffer, int len)
sum += (sum >> 16);
result = ~sum;
 
-   return  (__odp_force odp_u16sum_t) result;
+   return  (odp_u16sum_t)result;
 }
 
 static inline int _odp_ipv4_csum(odp_packet_t pkt,
-- 
2.14.2



[lng-odp] [PATCH 07/29] build: move ODP include path to common Makefile.inc

2017-10-23 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 Makefile.inc   | 12 
 example/Makefile.inc   | 12 
 helper/Makefile.am | 12 
 helper/test/Makefile.am| 18 +-
 platform/Makefile.inc  |  2 +-
 platform/linux-generic/Makefile.am |  8 +---
 platform/linux-generic/test/Makefile.inc   | 12 ++--
 platform/linux-generic/test/ring/Makefile.am   |  2 +-
 .../test/validation/api/shmem/Makefile.am  |  4 ++--
 test/Makefile.inc  | 17 +
 10 files changed, 37 insertions(+), 62 deletions(-)
 create mode 100644 Makefile.inc

diff --git a/Makefile.inc b/Makefile.inc
new file mode 100644
index ..10e4041fe662
--- /dev/null
+++ b/Makefile.inc
@@ -0,0 +1,12 @@
+ODP_INCLUDES = \
+   -I$(top_builddir)/platform/@with_platform@/include \
+   -I$(top_srcdir)/platform/@with_platform@/include \
+   -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
+   -I$(top_builddir)/include \
+   -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
+   -I$(top_srcdir)/include
+
+HELPER_INCLUDES = \
+   -I$(top_srcdir)/helper/include
+
+LIB   = $(top_builddir)/lib
diff --git a/example/Makefile.inc b/example/Makefile.inc
index 1609066e64c2..498f656faa66 100644
--- a/example/Makefile.inc
+++ b/example/Makefile.inc
@@ -1,16 +1,12 @@
+include $(top_srcdir)/Makefile.inc
+
 TESTS_ENVIRONMENT = EXEEXT=${EXEEXT}
 
-LIB   = $(top_builddir)/lib
 LDADD = $(LIB)/libodp-linux.la $(LIB)/libodphelper.la $(DPDK_PMDS)
 AM_CFLAGS = \
-I$(srcdir) \
-I$(top_srcdir)/example \
-   -I$(top_srcdir)/platform/@with_platform@/include \
-   -I$(top_srcdir)/include/ \
-   -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
-   -I$(top_srcdir)/helper/include \
-   -I$(top_builddir)/platform/@with_platform@/include \
-   -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
-   -I$(top_builddir)/include
+   $(ODP_INCLUDES) \
+   $(HELPER_INCLUDES)
 
 AM_LDFLAGS = -L$(LIB) -static
diff --git a/helper/Makefile.am b/helper/Makefile.am
index ee1c17d6d0a3..2321a2d4f24c 100644
--- a/helper/Makefile.am
+++ b/helper/Makefile.am
@@ -1,15 +1,11 @@
+include $(top_srcdir)/Makefile.inc
+
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libodphelper.pc
 
-LIB   = $(top_builddir)/lib
 AM_CPPFLAGS = \
-   -I$(top_builddir)/platform/@with_platform@/include \
-   -I$(top_srcdir)/helper/include \
-   -I$(top_srcdir)/include \
-   -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
-   -I$(top_srcdir)/platform/@with_platform@/include \
-   -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
-   -I$(top_builddir)/include
+   $(ODP_INCLUDES) \
+   $(HELPER_INCLUDES)
 
 AM_LDFLAGS = -version-number '$(ODPHELPER_LIBSO_VERSION)'
 
diff --git a/helper/test/Makefile.am b/helper/test/Makefile.am
index 8eee643bee39..27c414aa7461 100644
--- a/helper/test/Makefile.am
+++ b/helper/test/Makefile.am
@@ -1,25 +1,17 @@
-TESTS_ENVIRONMENT = EXEEXT=${EXEEXT}
+include $(top_srcdir)/Makefile.inc
 
-LIB   = $(top_builddir)/lib
+TESTS_ENVIRONMENT = EXEEXT=${EXEEXT}
 
 #in the following line, the libs using the symbols should come before
 #the libs containing them! The includer is given a chance to add things
 #before libodp by setting PRE_LDADD before the inclusion.
 LDADD = $(PRE_LDADD) $(LIB)/libodphelper.la $(LIB)/libodp-linux.la
 
-INCFLAGS = \
-   -I$(top_builddir)/platform/@with_platform@/include \
-   -I$(top_srcdir)/helper/include \
-   -I$(top_srcdir)/include \
-   -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
-   -I$(top_srcdir)/platform/@with_platform@/include \
-   -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
-   -I$(top_builddir)/include \
-   -I$(top_srcdir)/helper
-
 ODP_PLATFORM=${with_platform}
 
-AM_CPPFLAGS = $(INCFLAGS)
+AM_CPPFLAGS = \
+   $(ODP_INCLUDES) \
+   $(HELPER_INCLUDES)
 AM_LDFLAGS = -static
 
 EXECUTABLES = chksum \
diff --git a/platform/Makefile.inc b/platform/Makefile.inc
index 0086db779897..4714de0ee805 100644
--- a/platform/Makefile.inc
+++ b/platform/Makefile.inc
@@ -1,4 +1,4 @@
-LIB   = $(top_builddir)/lib
+include $(top_srcdir)/Makefile.inc
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libodp-linux.pc
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index c5406760935e..703b12c702ea 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -3,14 +3,8 @@
 
 include $(top_srcdir)/platform/Makefile.inc
 
-AM_CPPFLAGS =  -I$(srcdir)/include
-AM_CPPFLAGS +=  -I$(top_srcdir)/include
-AM_CPPFLAGS +=  -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@
-AM_CP

[lng-odp] [PATCH 06/29] configure: provide conditional for ABI-compat mode

2017-10-23 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 configure.ac | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.ac b/configure.ac
index 4bc77500c279..255de960c180 100644
--- a/configure.ac
+++ b/configure.ac
@@ -271,6 +271,7 @@ AC_ARG_ENABLE([abi-compat],
ODP_LIBSO_VERSION=0:0:0
 fi])
 AC_SUBST(ODP_ABI_COMPAT)
+AM_CONDITIONAL(ODP_ABI_COMPAT, [test "x$ODP_ABI_COMPAT" = "x1"])
 
 ##
 # Enable/disable deprecated API definitions
-- 
2.14.2



[lng-odp] [PATCH 12/29] abi: classification: drop two unused types

2017-10-23 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/odp/api/spec/classification.h   | 11 ---
 platform/linux-generic/include/odp/api/classification.h | 13 -
 2 files changed, 24 deletions(-)

diff --git a/include/odp/api/spec/classification.h 
b/include/odp/api/spec/classification.h
index 0c4a95c5f6e7..d0d51d1fb2b8 100644
--- a/include/odp/api/spec/classification.h
+++ b/include/odp/api/spec/classification.h
@@ -30,11 +30,6 @@ extern "C" {
  * ODP Class of service handle
  */
 
-/**
- * @typedef odp_flowsig_t
- * flow signature type, only used for packet metadata field.
- */
-
 /**
  * @def ODP_COS_INVALID
  * This value is returned from odp_cls_cos_create() on failure,
@@ -389,12 +384,6 @@ int odp_cos_with_l3_qos(odp_pktio_t pktio_in,
odp_bool_t l3_preference);
 
 
-/**
- * @typedef odp_cos_flow_set_t
- * Set of header fields that take part in flow signature hash calculation:
- * bit positions per odp_cos_hdr_flow_fields_t enumeration.
- */
-
 /**
  * @typedef odp_pmr_t
  * PMR - Packet Matching Rule
diff --git a/platform/linux-generic/include/odp/api/classification.h 
b/platform/linux-generic/include/odp/api/classification.h
index 2ba6eb0eb6b0..377d1a02f7e8 100644
--- a/platform/linux-generic/include/odp/api/classification.h
+++ b/platform/linux-generic/include/odp/api/classification.h
@@ -24,19 +24,6 @@ extern "C" {
 #include 
 #include 
 
-/** @ingroup odp_classification
- *  @{
- */
-
-/* REMOVE THESE FROM API SPEC. Typedefs needed only for suppressing Doxygen
- * warning. */
-typedef void odp_flowsig_t;
-typedef void odp_cos_flow_set_t;
-
-/**
- * @}
- */
-
 #include 
 
 #ifdef __cplusplus
-- 
2.14.2



[lng-odp] [PATCH 05/29] api: abi: provide the the rest of abi files

2017-10-23 Thread Dmitry Eremin-Solenikov
Provide a set of platform-neutral ABI files. They are mostly modified
versions of linux-generic api files.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am| 188 -
 include/odp/arch/arm32-linux/odp/api/abi/atomic.h  |   7 +
 include/odp/arch/arm32-linux/odp/api/abi/barrier.h |   7 +
 .../odp/arch/arm32-linux/odp/api/abi/byteorder.h   |   7 +
 include/odp/arch/arm32-linux/odp/api/abi/cpumask.h |   7 +
 include/odp/arch/arm32-linux/odp/api/abi/init.h|   7 +
 include/odp/arch/arm32-linux/odp/api/abi/ipsec.h   |   7 +
 .../arch/arm32-linux/odp/api/abi/packet_flags.h|   7 +
 .../odp/arch/arm32-linux/odp/api/abi/packet_io.h   |   7 +
 include/odp/arch/arm32-linux/odp/api/abi/rwlock.h  |   7 +
 .../arm32-linux/odp/api/abi/rwlock_recursive.h |   7 +
 .../odp/arch/arm32-linux/odp/api/abi/schedule.h|   7 +
 .../arch/arm32-linux/odp/api/abi/schedule_types.h  |   7 +
 .../odp/arch/arm32-linux/odp/api/abi/spinlock.h|   7 +
 .../arm32-linux/odp/api/abi/spinlock_recursive.h   |   7 +
 .../odp/arch/arm32-linux/odp/api/abi/std_clib.h|   7 +
 .../odp/arch/arm32-linux/odp/api/abi/std_types.h   |   7 +
 include/odp/arch/arm32-linux/odp/api/abi/sync.h|   7 +
 include/odp/arch/arm32-linux/odp/api/abi/thread.h  |   7 +
 include/odp/arch/arm32-linux/odp/api/abi/thrmask.h |   7 +
 .../odp/arch/arm32-linux/odp/api/abi/ticketlock.h  |   7 +
 include/odp/arch/arm32-linux/odp/api/abi/time.h|   7 +
 include/odp/arch/arm32-linux/odp/api/abi/timer.h   |   7 +
 .../arch/arm32-linux/odp/api/abi/traffic_mngr.h|   7 +
 include/odp/arch/arm32-linux/odp/api/abi/version.h |   7 +
 include/odp/arch/arm64-linux/odp/api/abi/atomic.h  |   7 +
 include/odp/arch/arm64-linux/odp/api/abi/barrier.h |   7 +
 .../odp/arch/arm64-linux/odp/api/abi/byteorder.h   |   7 +
 include/odp/arch/arm64-linux/odp/api/abi/cpumask.h |   7 +
 include/odp/arch/arm64-linux/odp/api/abi/init.h|   7 +
 include/odp/arch/arm64-linux/odp/api/abi/ipsec.h   |   7 +
 .../arch/arm64-linux/odp/api/abi/packet_flags.h|   7 +
 .../odp/arch/arm64-linux/odp/api/abi/packet_io.h   |   7 +
 include/odp/arch/arm64-linux/odp/api/abi/rwlock.h  |   7 +
 .../arm64-linux/odp/api/abi/rwlock_recursive.h |   7 +
 .../odp/arch/arm64-linux/odp/api/abi/schedule.h|   7 +
 .../arch/arm64-linux/odp/api/abi/schedule_types.h  |   7 +
 .../odp/arch/arm64-linux/odp/api/abi/spinlock.h|   7 +
 .../arm64-linux/odp/api/abi/spinlock_recursive.h   |   7 +
 .../odp/arch/arm64-linux/odp/api/abi/std_clib.h|   7 +
 .../odp/arch/arm64-linux/odp/api/abi/std_types.h   |   7 +
 include/odp/arch/arm64-linux/odp/api/abi/sync.h|   7 +
 include/odp/arch/arm64-linux/odp/api/abi/thread.h  |   7 +
 include/odp/arch/arm64-linux/odp/api/abi/thrmask.h |   7 +
 .../odp/arch/arm64-linux/odp/api/abi/ticketlock.h  |   7 +
 include/odp/arch/arm64-linux/odp/api/abi/time.h|   7 +
 include/odp/arch/arm64-linux/odp/api/abi/timer.h   |   7 +
 .../arch/arm64-linux/odp/api/abi/traffic_mngr.h|   7 +
 include/odp/arch/arm64-linux/odp/api/abi/version.h |   7 +
 include/odp/arch/default/api/abi/atomic.h  |  65 +++
 include/odp/arch/default/api/abi/barrier.h |  38 +
 include/odp/arch/default/api/abi/byteorder.h   |  73 
 include/odp/arch/default/api/abi/cpumask.h |  54 ++
 include/odp/arch/default/api/abi/init.h|  35 
 include/odp/arch/default/api/abi/ipsec.h   |  41 +
 include/odp/arch/default/api/abi/packet_flags.h|  25 +++
 include/odp/arch/default/api/abi/packet_io.h   |  60 +++
 include/odp/arch/default/api/abi/rwlock.h  |  35 
 .../odp/arch/default/api/abi/rwlock_recursive.h|  36 
 include/odp/arch/default/api/abi/schedule.h|  48 ++
 include/odp/arch/default/api/abi/schedule_types.h  |  49 ++
 include/odp/arch/default/api/abi/spinlock.h|  30 
 .../odp/arch/default/api/abi/spinlock_recursive.h  |  34 
 include/odp/arch/default/api/abi/std_clib.h|  24 +++
 include/odp/arch/default/api/abi/std_types.h   |  43 +
 include/odp/arch/default/api/abi/sync.h|  24 +++
 include/odp/arch/default/api/abi/thread.h  |  34 
 include/odp/arch/default/api/abi/thrmask.h |  48 ++
 include/odp/arch/default/api/abi/ticketlock.h  |  33 
 include/odp/arch/default/api/abi/time.h|  53 ++
 include/odp/arch/default/api/abi/timer.h   |  55 ++
 include/odp/arch/default/api/abi/traffic_mngr.h| 178 +++
 include/odp/arch/default/api/abi/version.h |  30 
 include/odp/arch/mips64-linux/odp/api/abi/atomic.h |   7 +
 .../odp/arch/mips64-linux/odp/api/abi/barrier.h|   7 +
 .../odp/arch/mips64-linux/odp/api/abi/byteorder.h  |   7 +
 .../odp/arch/mips64-linux/odp/api/abi/cpumask.h|   7 +
 include/odp/arch/mips64-linux/odp/api/abi/init.h  

[lng-odp] [PATCH 08/29] include: move default ABI headers

2017-10-23 Thread Dmitry Eremin-Solenikov
Reduce amount of directory levels by moving default ABI headers to
odp/api/abi-default.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am| 82 +++---
 .../default/api/abi => api/abi-default}/atomic.h   |  0
 .../default/api/abi => api/abi-default}/barrier.h  |  0
 .../default/api/abi => api/abi-default}/buffer.h   |  0
 .../api/abi => api/abi-default}/byteorder.h|  0
 .../api/abi => api/abi-default}/classification.h   |  0
 .../default/api/abi => api/abi-default}/cpumask.h  |  0
 .../default/api/abi => api/abi-default}/crypto.h   |  0
 .../default/api/abi => api/abi-default}/event.h|  0
 .../default/api/abi => api/abi-default}/init.h |  0
 .../default/api/abi => api/abi-default}/ipsec.h|  0
 .../default/api/abi => api/abi-default}/packet.h   |  0
 .../api/abi => api/abi-default}/packet_flags.h |  0
 .../api/abi => api/abi-default}/packet_io.h|  0
 .../default/api/abi => api/abi-default}/pool.h |  0
 .../default/api/abi => api/abi-default}/queue.h|  0
 .../default/api/abi => api/abi-default}/rwlock.h   |  0
 .../api/abi => api/abi-default}/rwlock_recursive.h |  0
 .../default/api/abi => api/abi-default}/schedule.h |  0
 .../api/abi => api/abi-default}/schedule_types.h   |  0
 .../api/abi => api/abi-default}/shared_memory.h|  0
 .../default/api/abi => api/abi-default}/spinlock.h |  0
 .../abi => api/abi-default}/spinlock_recursive.h   |  0
 .../default/api/abi => api/abi-default}/std_clib.h |  0
 .../api/abi => api/abi-default}/std_types.h|  0
 .../default/api/abi => api/abi-default}/sync.h |  0
 .../default/api/abi => api/abi-default}/thread.h   |  0
 .../default/api/abi => api/abi-default}/thrmask.h  |  0
 .../api/abi => api/abi-default}/ticketlock.h   |  0
 .../default/api/abi => api/abi-default}/time.h |  0
 .../default/api/abi => api/abi-default}/timer.h|  0
 .../api/abi => api/abi-default}/traffic_mngr.h |  0
 .../default/api/abi => api/abi-default}/version.h  |  0
 include/odp/arch/arm32-linux/odp/api/abi/atomic.h  |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/barrier.h |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/buffer.h  |  2 +-
 .../odp/arch/arm32-linux/odp/api/abi/byteorder.h   |  2 +-
 .../arch/arm32-linux/odp/api/abi/classification.h  |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/cpumask.h |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/crypto.h  |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/event.h   |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/init.h|  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/ipsec.h   |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/packet.h  |  2 +-
 .../arch/arm32-linux/odp/api/abi/packet_flags.h|  2 +-
 .../odp/arch/arm32-linux/odp/api/abi/packet_io.h   |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/pool.h|  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/queue.h   |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/rwlock.h  |  2 +-
 .../arm32-linux/odp/api/abi/rwlock_recursive.h |  2 +-
 .../odp/arch/arm32-linux/odp/api/abi/schedule.h|  2 +-
 .../arch/arm32-linux/odp/api/abi/schedule_types.h  |  2 +-
 .../arch/arm32-linux/odp/api/abi/shared_memory.h   |  2 +-
 .../odp/arch/arm32-linux/odp/api/abi/spinlock.h|  2 +-
 .../arm32-linux/odp/api/abi/spinlock_recursive.h   |  2 +-
 .../odp/arch/arm32-linux/odp/api/abi/std_clib.h|  2 +-
 .../odp/arch/arm32-linux/odp/api/abi/std_types.h   |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/sync.h|  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/thread.h  |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/thrmask.h |  2 +-
 .../odp/arch/arm32-linux/odp/api/abi/ticketlock.h  |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/time.h|  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/timer.h   |  2 +-
 .../arch/arm32-linux/odp/api/abi/traffic_mngr.h|  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/version.h |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/atomic.h  |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/barrier.h |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/buffer.h  |  2 +-
 .../odp/arch/arm64-linux/odp/api/abi/byteorder.h   |  2 +-
 .../arch/arm64-linux/odp/api/abi/classification.h  |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/cpumask.h |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/crypto.h  |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/event.h   |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/init.h|  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/ipsec.h   |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/packet.h  |  2 +-
 .../arch/arm64-linux/odp/api/abi/packet_flags.h|  2 +-
 .../odp/arch/arm64-linux/odp/api/abi/packet_io.h   |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/pool.h|  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/queu

[lng-odp] [PATCH 13/29] include: change spec guarding define from ODP_API to ODP_API_SPEC

2017-10-23 Thread Dmitry Eremin-Solenikov
Change defines guarding inclusion of ODP API spec files from ODP_API_FOO
to ODP_API_SPEC_FOO, as they are placed in odp/api/spec/foo.h path.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/odp/api/spec/align.h  | 4 ++--
 include/odp/api/spec/atomic.h | 4 ++--
 include/odp/api/spec/barrier.h| 4 ++--
 include/odp/api/spec/buffer.h | 4 ++--
 include/odp/api/spec/byteorder.h  | 4 ++--
 include/odp/api/spec/chksum.h | 4 ++--
 include/odp/api/spec/classification.h | 4 ++--
 include/odp/api/spec/compiler.h   | 4 ++--
 include/odp/api/spec/cpu.h| 4 ++--
 include/odp/api/spec/cpumask.h| 4 ++--
 include/odp/api/spec/crypto.h | 4 ++--
 include/odp/api/spec/debug.h  | 4 ++--
 include/odp/api/spec/deprecated.h.in  | 4 ++--
 include/odp/api/spec/errno.h  | 4 ++--
 include/odp/api/spec/event.h  | 4 ++--
 include/odp/api/spec/feature.h| 4 ++--
 include/odp/api/spec/hash.h   | 4 ++--
 include/odp/api/spec/hints.h  | 4 ++--
 include/odp/api/spec/init.h   | 4 ++--
 include/odp/api/spec/ipsec.h  | 4 ++--
 include/odp/api/spec/packet.h | 4 ++--
 include/odp/api/spec/packet_flags.h   | 4 ++--
 include/odp/api/spec/packet_io.h  | 4 ++--
 include/odp/api/spec/packet_io_stats.h| 4 ++--
 include/odp/api/spec/pool.h   | 4 ++--
 include/odp/api/spec/queue.h  | 4 ++--
 include/odp/api/spec/random.h | 4 ++--
 include/odp/api/spec/rwlock.h | 4 ++--
 include/odp/api/spec/rwlock_recursive.h   | 4 ++--
 include/odp/api/spec/schedule.h   | 4 ++--
 include/odp/api/spec/schedule_types.h | 4 ++--
 include/odp/api/spec/shared_memory.h  | 4 ++--
 include/odp/api/spec/spinlock.h   | 4 ++--
 include/odp/api/spec/spinlock_recursive.h | 4 ++--
 include/odp/api/spec/std_clib.h   | 4 ++--
 include/odp/api/spec/std_types.h  | 4 ++--
 include/odp/api/spec/support.h| 4 ++--
 include/odp/api/spec/sync.h   | 4 ++--
 include/odp/api/spec/system_info.h| 4 ++--
 include/odp/api/spec/thread.h | 4 ++--
 include/odp/api/spec/thrmask.h| 4 ++--
 include/odp/api/spec/ticketlock.h | 4 ++--
 include/odp/api/spec/time.h   | 4 ++--
 include/odp/api/spec/timer.h  | 4 ++--
 include/odp/api/spec/traffic_mngr.h   | 4 ++--
 include/odp/api/spec/version.h.in | 4 ++--
 46 files changed, 92 insertions(+), 92 deletions(-)

diff --git a/include/odp/api/spec/align.h b/include/odp/api/spec/align.h
index fdf8c29e14e4..0a9db3488232 100644
--- a/include/odp/api/spec/align.h
+++ b/include/odp/api/spec/align.h
@@ -11,8 +11,8 @@
  * ODP alignments
  */
 
-#ifndef ODP_API_ALIGN_H_
-#define ODP_API_ALIGN_H_
+#ifndef ODP_API_SPEC_ALIGN_H_
+#define ODP_API_SPEC_ALIGN_H_
 #include 
 
 #ifdef __cplusplus
diff --git a/include/odp/api/spec/atomic.h b/include/odp/api/spec/atomic.h
index 408829df299f..d828ea47da3b 100644
--- a/include/odp/api/spec/atomic.h
+++ b/include/odp/api/spec/atomic.h
@@ -10,8 +10,8 @@
  * ODP atomic operations
  */
 
-#ifndef ODP_API_ATOMIC_H_
-#define ODP_API_ATOMIC_H_
+#ifndef ODP_API_SPEC_ATOMIC_H_
+#define ODP_API_SPEC_ATOMIC_H_
 #include 
 
 #ifdef __cplusplus
diff --git a/include/odp/api/spec/barrier.h b/include/odp/api/spec/barrier.h
index 6de683c73e0c..8351ef8864b7 100644
--- a/include/odp/api/spec/barrier.h
+++ b/include/odp/api/spec/barrier.h
@@ -10,8 +10,8 @@
  * ODP execution barriers
  */
 
-#ifndef ODP_API_BARRIER_H_
-#define ODP_API_BARRIER_H_
+#ifndef ODP_API_SPEC_BARRIER_H_
+#define ODP_API_SPEC_BARRIER_H_
 #include 
 
 #ifdef __cplusplus
diff --git a/include/odp/api/spec/buffer.h b/include/odp/api/spec/buffer.h
index 94829b324dd9..b2f90f949864 100644
--- a/include/odp/api/spec/buffer.h
+++ b/include/odp/api/spec/buffer.h
@@ -11,8 +11,8 @@
  * ODP buffer descriptor
  */
 
-#ifndef ODP_API_BUFFER_H_
-#define ODP_API_BUFFER_H_
+#ifndef ODP_API_SPEC_BUFFER_H_
+#define ODP_API_SPEC_BUFFER_H_
 #include 
 
 #ifdef __cplusplus
diff --git a/include/odp/api/spec/byteorder.h b/include/odp/api/spec/byteorder.h
index 38c0bdbf7a3d..814438d3f803 100644
--- a/include/odp/api/spec/byteorder.h
+++ b/include/odp/api/spec/byteorder.h
@@ -10,8 +10,8 @@
  * ODP byteorder
  */
 
-#ifndef ODP_API_BYTEORDER_H_
-#define ODP_API_BYTEORDER_H_
+#ifndef ODP_API_SPEC_BYTEORDER_H_
+#define ODP_API_SPEC_BYTEORDER_H_
 #include 
 
 #ifdef __cplusplus
diff --git a/include/odp/api/spec/chksum.h b/include/odp/api/spec/chksum.h
index e523ac286528..8f35e253fe91 100644
--- a/include/odp/api/spec/chksum.h
+++ b/include/odp/api/spec/chksum.h
@@ -10,8 +10,8 @@
  * ODP Hash functions
  */
 
-#ifndef ODP_API_CHKSUM_H_
-#define ODP_API_CHKSUM_H_
+#ifndef ODP_API_SPEC_CHKSUM_H_
+#define ODP_API_SPEC_CHKSUM_H_
 #include 
 
 

[lng-odp] [PATCH 14/29] api: schedule: remove duplication between schedule and schedule_types

2017-10-23 Thread Dmitry Eremin-Solenikov
Move the rest of ODP_SCHED_GROUP_* defines to schedule_types.h to remove
duplication between headers.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/odp/api/abi-default/schedule.h   |  8 
 include/odp/api/abi-default/schedule_types.h |  8 
 include/odp/api/spec/schedule.h  | 20 
 include/odp/api/spec/schedule_types.h| 10 ++
 4 files changed, 18 insertions(+), 28 deletions(-)

diff --git a/include/odp/api/abi-default/schedule.h 
b/include/odp/api/abi-default/schedule.h
index 9615cb012653..95f23c8134f4 100644
--- a/include/odp/api/abi-default/schedule.h
+++ b/include/odp/api/abi-default/schedule.h
@@ -27,14 +27,6 @@ extern "C" {
 #define ODP_SCHED_WAIT UINT64_MAX
 #define ODP_SCHED_NO_WAIT  0
 
-typedef int odp_schedule_group_t;
-
-/* These must be kept in sync with thread_globals_t in odp_thread.c */
-#define ODP_SCHED_GROUP_INVALID ((odp_schedule_group_t)-1)
-#define ODP_SCHED_GROUP_ALL 0
-#define ODP_SCHED_GROUP_WORKER  1
-#define ODP_SCHED_GROUP_CONTROL 2
-
 #define ODP_SCHED_GROUP_NAME_LEN 32
 
 /**
diff --git a/include/odp/api/abi-default/schedule_types.h 
b/include/odp/api/abi-default/schedule_types.h
index 21ad4db7617b..badc4ca09eb7 100644
--- a/include/odp/api/abi-default/schedule_types.h
+++ b/include/odp/api/abi-default/schedule_types.h
@@ -38,6 +38,14 @@ typedef int odp_schedule_sync_t;
 #define ODP_SCHED_SYNC_ATOMIC   1
 #define ODP_SCHED_SYNC_ORDERED  2
 
+typedef int odp_schedule_group_t;
+
+/* These must be kept in sync with thread_globals_t in odp_thread.c */
+#define ODP_SCHED_GROUP_INVALID ((odp_schedule_group_t)-1)
+#define ODP_SCHED_GROUP_ALL 0
+#define ODP_SCHED_GROUP_WORKER  1
+#define ODP_SCHED_GROUP_CONTROL 2
+
 /**
  * @}
  */
diff --git a/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h
index 524449647b0c..8c55b4ec2ba5 100644
--- a/include/odp/api/spec/schedule.h
+++ b/include/odp/api/spec/schedule.h
@@ -45,26 +45,6 @@ extern "C" {
  * Maximum schedule group name length in chars including null char
  */
 
-/**
- * @def ODP_SCHED_GROUP_INVALID
- * Invalid scheduler group
- */
-
-/**
- * @def ODP_SCHED_GROUP_ALL
- * Predefined scheduler group of all threads
- */
-
-/**
- * @def ODP_SCHED_GROUP_WORKER
- * Predefined scheduler group of all worker threads
- */
-
-/**
- * @def ODP_SCHED_GROUP_CONTROL
- * Predefined scheduler group of all control threads
- */
-
 /**
  * Schedule wait time
  *
diff --git a/include/odp/api/spec/schedule_types.h 
b/include/odp/api/spec/schedule_types.h
index e0dc4027b91b..a13cc4f13317 100644
--- a/include/odp/api/spec/schedule_types.h
+++ b/include/odp/api/spec/schedule_types.h
@@ -112,6 +112,11 @@ extern "C" {
  * Scheduler thread group
  */
 
+/**
+ * @def ODP_SCHED_GROUP_INVALID
+ * Invalid scheduler group
+ */
+
 /**
  * @def ODP_SCHED_GROUP_ALL
  * Group of all threads. All active worker and control threads belong to this
@@ -126,6 +131,11 @@ extern "C" {
  * old threads exit ODP.
  */
 
+/**
+ * @def ODP_SCHED_GROUP_CONTROL
+ * Predefined scheduler group of all control threads
+ */
+
 /** Scheduler parameters */
 typedefstruct odp_schedule_param_t {
/** Priority level
-- 
2.14.2



[lng-odp] [PATCH 04/29] helper: don't use __odp_force

2017-10-23 Thread Dmitry Eremin-Solenikov
__odp_force is not part of ODP API, so it should not be used directly.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 helper/include/odp/helper/chksum.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/helper/include/odp/helper/chksum.h 
b/helper/include/odp/helper/chksum.h
index 1bf950c8bed0..a80e8be5d7e6 100644
--- a/helper/include/odp/helper/chksum.h
+++ b/helper/include/odp/helper/chksum.h
@@ -58,7 +58,7 @@ static inline odp_u16sum_t odph_chksum(void *buffer, int len)
sum += (sum >> 16);
result = ~sum;
 
-   return  (__odp_force odp_u16sum_t) result;
+   return (odp_u16sum_t)result;
 }
 
 /**
-- 
2.14.2



[lng-odp] [PATCH 01/29] travis: also run make distcheck in non-ABI-compat mode

2017-10-23 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 .travis.yml | 8 
 1 file changed, 8 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index 49b922e3cdba..fdeeefd113ea 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -244,6 +244,14 @@ jobs:
   - ./configure --prefix=$HOME/odp-install
 --enable-user-guides
   - sudo PATH="$PATH" 
LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" make 
distcheck
+- stage: test
+  env: TEST=distcheck-non-abi
+  compiler: gcc
+  script:
+  - ./bootstrap
+  - ./configure --prefix=$HOME/odp-install
+--enable-user-guides
+  - sudo PATH="$PATH" 
LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" make 
distcheck DISTCHECK__CONFIGURE_FLAGS=--disable-abi-compat
 - stage: test
   env: TEST=doxygen
   compiler: gcc
-- 
2.14.2



[lng-odp] [PATCH 02/29] travis: add cross-compiling tests with ABI compatibility disabled

2017-10-23 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 .travis.yml | 4 
 1 file changed, 4 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index fdeeefd113ea..6196f91d41de 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -74,6 +74,10 @@ env:
 - CROSS_ARCH="armhf" CFLAGS="-march=armv7-a"
 - CROSS_ARCH="powerpc"
 - CROSS_ARCH="i386"
+- CROSS_ARCH="arm64" CONF="--disable-abi-compat"
+- CROSS_ARCH="armhf" CFLAGS="-march=armv7-a" 
CONF="--disable-abi-compat"
+- CROSS_ARCH="powerpc" CONF="--disable-abi-compat"
+- CROSS_ARCH="i386" CONF="--disable-abi-compat"
 
 before_install:
 
-- 
2.14.2



[lng-odp] [PATCH API-NEXT 00/29] restructure headers for ABI-compat/platform-optimized modes

2017-10-23 Thread Dmitry Eremin-Solenikov
This is a copy of https://github.com/Linaro/odp/pull/250 (currently at
v5), since mailer scripts won't send huge patch series.

This patch serie is based on discussions during SFO17 with Petri and
other colleagues.

My main goals were:
 - providing full set of ABI headers to be used by other implementations
 - restructuring existing headers, to provide cleaner separation between
   ABI-compat and non-ABI-compat headers
 - allow headers to be selected via compiler flags, rather than by
   preprocessor
 - install only necessary (used) headers instead of a mixture of ABI and
   non-ABI headers

With this patchset these goals are mostly accomplished. Remaining
headers to be reworked:
 - align.h: gcc/platform-specific implementation
 - debug.h: again, gcc-specific code
 - cpu.h: platform-specific code, needs additional discussion

Dmitry Eremin-Solenikov (29):
  travis: also run make distcheck in non-ABI-compat mode
  travis: add cross-compiling tests with ABI compatibility disabled
  linux-gen: ipsec: don't use __odp_force
  helper: don't use __odp_force
  api: abi: provide the the rest of abi files
  configure: provide conditional for ABI-compat mode
  build: move ODP include path to common Makefile.inc
  include: move default ABI headers
  include: install ABI headers without additional ARCH_ABI level
  include: install and use ABI headers only in ABI-compat mode
  abi: queue: drop unused odp_queue_group_t
  abi: classification: drop two unused types
  include: change spec guarding define from ODP_API to ODP_API_SPEC
  api: schedule: remove duplication between schedule and schedule_types
  linux-gen, include: for several simple headers switch to api+abi
pattern
  linux-gen, include: progress in switching headers to api+abi pattern
  linux-gen: atomic: simplify locked 64-bit support
  linux-gen, include: switch atomic.h to api+abi
  linux-gen, include: switch byteorder.h to api+abi
  linux-gen, include: switch std_clib.h to api+abi
  linux-gen, include: switch sync.h to api+abi
  linux-gen, include: switch ticketlock.h to api+abi
  linux-gen, include: move more headers from platform to generic
  linux-gen, include: switch packet headers to api+abi
  linux-gen: move several files under ODP_ABI_COMPAT condition
  linux-gen: split odp_packet/odp_packet_flags
  linux-gen: remove static_inline.h header
  linux-gen: don't install inline headers in non-ABI-compat mode
  configure: stop AC_SUBST'ing ODP_ABI_COMPAT

 .travis.yml|  12 +
 Makefile.inc   |  18 ++
 configure.ac   |   2 +-
 example/Makefile.inc   |  12 +-
 example/traffic_mgmt/odp_traffic_mgmt.c|   1 +
 helper/Makefile.am |  12 +-
 helper/include/odp/helper/chksum.h |   2 +-
 helper/test/Makefile.am|  18 +-
 helper/test/linux/process.c|   2 +
 helper/test/linux/pthread.c|   2 +
 helper/threads.c   |   1 +
 include/Makefile.am| 268 --
 include/odp/api/abi-default/atomic.h   |  65 +
 .../odp/api/abi-default/barrier.h  |   4 +-
 .../default/api/abi => api/abi-default}/buffer.h   |   0
 include/odp/api/abi-default/byteorder.h|  73 +
 .../api/abi => api/abi-default}/classification.h   |   0
 .../odp/api/abi-default/cpumask.h  |   4 +-
 .../default/api/abi => api/abi-default}/crypto.h   |   0
 .../default/api/abi => api/abi-default}/event.h|   0
 .../odp/api/abi-default/init.h |   6 +-
 include/odp/api/abi-default/ipsec.h|  41 +++
 .../default/api/abi => api/abi-default}/packet.h   |   0
 include/odp/api/abi-default/packet_flags.h |  25 ++
 include/odp/api/abi-default/packet_io.h|  60 
 .../default/api/abi => api/abi-default}/pool.h |   0
 .../default/api/abi => api/abi-default}/queue.h|   0
 .../odp/api/abi-default/rwlock.h   |  10 +-
 .../odp/api/abi-default/rwlock_recursive.h |  10 +-
 include/odp/api/abi-default/schedule.h |  40 +++
 .../odp/api/abi-default}/schedule_types.h  |  11 +-
 .../api/abi => api/abi-default}/shared_memory.h|   0
 .../odp/api/abi-default/spinlock.h |  12 +-
 .../odp/api/abi-default/spinlock_recursive.h   |  10 +-
 include/odp/api/abi-default/std_clib.h |  24 ++
 .../odp/api/abi-default}/std_types.h   |   9 +-
 include/odp/api/abi-default/sync.h |  24 ++
 .../odp/api/abi-default/thread.h   |   4 +-
 .../odp/api/abi-default/thrmask.h  |   4 +-
 .../odp/api/abi-default/ticketlock.h   |  10 +-
 .../odp/api/abi-default/time.h |   4 +-
 include/odp

[lng-odp] [PATCH 11/29] abi: queue: drop unused odp_queue_group_t

2017-10-23 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/odp/api/spec/queue.h   |  5 -
 platform/linux-generic/include/odp/api/queue.h | 12 
 2 files changed, 17 deletions(-)

diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h
index 73598be06d93..3cd99a9f3035 100644
--- a/include/odp/api/spec/queue.h
+++ b/include/odp/api/spec/queue.h
@@ -32,11 +32,6 @@ extern "C" {
  * ODP queue
  */
 
-/**
- * @typedef odp_queue_group_t
- * Queue group instance type
- */
-
 /**
  * @def ODP_QUEUE_INVALID
  * Invalid queue
diff --git a/platform/linux-generic/include/odp/api/queue.h 
b/platform/linux-generic/include/odp/api/queue.h
index adceafbd1c3b..f958ff5140c8 100644
--- a/platform/linux-generic/include/odp/api/queue.h
+++ b/platform/linux-generic/include/odp/api/queue.h
@@ -23,18 +23,6 @@ extern "C" {
 #include 
 #include 
 
-/** @ingroup odp_queue
- *  @{
- */
-
-/* REMOVE FROM API SPEC. Typedef needed only for suppressing Doxygen
- * warning. */
-typedef void odp_queue_group_t;
-
-/**
- * @}
- */
-
 #include 
 
 #ifdef __cplusplus
-- 
2.14.2



[lng-odp] [PATCH 09/29] include: install ABI headers without additional ARCH_ABI level

2017-10-23 Thread Dmitry Eremin-Solenikov
Install ABI headers directly to odp/api/abi, removing the need for extra
symlink.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am | 12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/include/Makefile.am b/include/Makefile.am
index 5328133dd4e4..d841e65b8795 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -110,7 +110,7 @@ odpapiabidefaultinclude_HEADERS = \
odp/api/abi-default/queue.h \
odp/api/abi-default/shared_memory.h
 
-odpapiabiarchincludedir= $(includedir)/odp/arch/@ARCH_ABI@/odp/api/abi
+odpapiabiarchincludedir= $(includedir)/odp/api/abi
 if ARCH_IS_ARM
 odpapiabiarchinclude_HEADERS = \
odp/arch/arm32-linux/odp/api/abi/atomic.h \
@@ -322,16 +322,6 @@ odpapiabiarchinclude_HEADERS = \
odp/arch/x86_64-linux/odp/api/abi/version.h
 endif
 
-# Create symlink for ABI header files. Application does not need to use the 
arch
-# specific include path for installed files.
-install-data-hook:
-   if [ -h $(DESTDIR)$(prefix)/include/odp/api/abi ]; then \
-   : ; \
-   else \
-   $(LN_S) -rf 
$(DESTDIR)$(prefix)/include/odp/arch/@ARCH_ABI@/odp/api/abi \
-   $(DESTDIR)$(prefix)/include/odp/api/abi; \
-   fi
-
 # Rerefence all nodist_*_HEADERS here
 .PHONY: $(nodist_odpapispecinclude_HEADERS)
 $(nodist_odpapispecinclude_HEADERS):
-- 
2.14.2



[lng-odp] [PATCH 10/29] include: install and use ABI headers only in ABI-compat mode

2017-10-23 Thread Dmitry Eremin-Solenikov
There is no need to install ABI headers (or to have them in include
path) in non-ABI-compat mode, they should not be used at all. Still
provide default ABI headers, because platform may depend on them.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 Makefile.inc| 6 +-
 include/Makefile.am | 4 
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Makefile.inc b/Makefile.inc
index 10e4041fe662..11fc7c759c85 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -3,9 +3,13 @@ ODP_INCLUDES = \
-I$(top_srcdir)/platform/@with_platform@/include \
-I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
-I$(top_builddir)/include \
-   -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
-I$(top_srcdir)/include
 
+if ODP_ABI_COMPAT
+ODP_INCLUDES += \
+   -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@
+endif
+
 HELPER_INCLUDES = \
-I$(top_srcdir)/helper/include
 
diff --git a/include/Makefile.am b/include/Makefile.am
index d841e65b8795..9437f5f68d5a 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -110,6 +110,9 @@ odpapiabidefaultinclude_HEADERS = \
odp/api/abi-default/queue.h \
odp/api/abi-default/shared_memory.h
 
+# Insall ABI headers only if required
+if ODP_ABI_COMPAT
+
 odpapiabiarchincludedir= $(includedir)/odp/api/abi
 if ARCH_IS_ARM
 odpapiabiarchinclude_HEADERS = \
@@ -321,6 +324,7 @@ odpapiabiarchinclude_HEADERS = \
odp/arch/x86_64-linux/odp/api/abi/traffic_mngr.h \
odp/arch/x86_64-linux/odp/api/abi/version.h
 endif
+endif # ODP_ABI_COMPAT
 
 # Rerefence all nodist_*_HEADERS here
 .PHONY: $(nodist_odpapispecinclude_HEADERS)
-- 
2.14.2



[lng-odp] [PATCH 16/29] linux-gen, include: progress in switching headers to api+abi pattern

2017-10-23 Thread Dmitry Eremin-Solenikov
Rework more platform headers to use odp/api/abi/ subdir instead of
odp/api/plat/.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am|  8 +
 .../include => include}/odp/api/barrier.h  |  6 ++--
 .../include => include}/odp/api/buffer.h   | 18 
 .../include => include}/odp/api/event.h| 14 ++---
 .../include => include}/odp/api/ipsec.h| 14 ++---
 .../include => include}/odp/api/pool.h | 17 ---
 .../include => include}/odp/api/queue.h| 12 
 .../include => include}/odp/api/shared_memory.h| 14 ++---
 .../include => include}/odp/api/timer.h| 20 -
 platform/linux-generic/Makefile.am | 34 +-
 .../odp/api/abi/buffer.h}  | 11 ++-
 .../odp/api/abi/classification.h}  | 11 ++-
 .../odp/api/abi/crypto.h}  | 11 ++-
 .../odp/api/abi/event.h}   | 12 ++--
 .../odp/api/abi/ipsec.h}   |  4 +--
 .../odp/api/abi/packet_io.h}   | 10 ++-
 .../odp/api/abi/pool.h}| 13 ++---
 .../odp/api/abi/queue.h}   | 11 ++-
 .../odp/api/abi/shared_memory.h}   | 11 ++-
 .../odp/api/abi/timer.h}   |  4 +--
 .../linux-generic/include/odp/api/classification.h | 12 
 platform/linux-generic/include/odp/api/crypto.h| 10 +++
 platform/linux-generic/include/odp/api/packet.h|  8 ++---
 platform/linux-generic/include/odp/api/packet_io.h |  8 ++---
 .../include/odp/api/plat/packet_inlines.h  |  1 +
 .../include/odp/api/plat/strong_types.h|  2 ++
 .../linux-generic/include/odp_queue_internal.h |  1 +
 .../include/odp_queue_scalable_internal.h  |  1 +
 platform/linux-generic/odp_packet_io.c |  6 
 29 files changed, 106 insertions(+), 198 deletions(-)
 rename {platform/linux-generic/include => include}/odp/api/barrier.h (78%)
 rename {platform/linux-generic/include => include}/odp/api/buffer.h (58%)
 rename {platform/linux-generic/include => include}/odp/api/event.h (65%)
 rename {platform/linux-generic/include => include}/odp/api/ipsec.h (67%)
 rename {platform/linux-generic/include => include}/odp/api/pool.h (53%)
 rename {platform/linux-generic/include => include}/odp/api/queue.h (58%)
 rename {platform/linux-generic/include => include}/odp/api/shared_memory.h 
(62%)
 rename {platform/linux-generic/include => include}/odp/api/timer.h (54%)
 rename platform/linux-generic/{include/odp/api/plat/buffer_types.h => 
include-abi/odp/api/abi/buffer.h} (73%)
 rename platform/linux-generic/{include/odp/api/plat/classification_types.h => 
include-abi/odp/api/abi/classification.h} (74%)
 rename platform/linux-generic/{include/odp/api/plat/crypto_types.h => 
include-abi/odp/api/abi/crypto.h} (71%)
 rename platform/linux-generic/{include/odp/api/plat/event_types.h => 
include-abi/odp/api/abi/event.h} (80%)
 rename platform/linux-generic/{include/odp/api/plat/ipsec_types.h => 
include-abi/odp/api/abi/ipsec.h} (88%)
 rename platform/linux-generic/{include/odp/api/plat/packet_io_types.h => 
include-abi/odp/api/abi/packet_io.h} (83%)
 rename platform/linux-generic/{include/odp/api/plat/pool_types.h => 
include-abi/odp/api/abi/pool.h} (76%)
 rename platform/linux-generic/{include/odp/api/plat/queue_types.h => 
include-abi/odp/api/abi/queue.h} (74%)
 rename platform/linux-generic/{include/odp/api/plat/shared_memory_types.h => 
include-abi/odp/api/abi/shared_memory.h} (73%)
 rename platform/linux-generic/{include/odp/api/plat/timer_types.h => 
include-abi/odp/api/abi/timer.h} (92%)

diff --git a/include/Makefile.am b/include/Makefile.am
index 0e39a0d8db5f..946b7c07cf73 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -5,18 +5,26 @@ include_HEADERS = \
 
 odpapiincludedir= $(includedir)/odp/api/
 odpapiinclude_HEADERS = \
+   odp/api/barrier.h \
+   odp/api/buffer.h \
odp/api/cpumask.h \
+   odp/api/event.h \
odp/api/init.h \
+   odp/api/ipsec.h \
+   odp/api/pool.h \
+   odp/api/queue.h \
odp/api/rwlock.h \
odp/api/rwlock_recursive.h \
odp/api/schedule.h \
odp/api/schedule_types.h \
+   odp/api/shared_memory.h \
odp/api/spinlock.h \
odp/api/spinlock_recursive.h \
odp/api/std_types.h \
odp/api/thread.h \
odp/api/thrmask.h \
odp/api/time.h \
+   odp/api/timer.h \
odp/api/traffic_mngr.h \
odp/api/version.h
 
diff --git a/platform/linux-generic/include/odp/api/barrier.h 
b/include/odp/api/barrier.h
similarity index 78%
rename from platform/linux-generic/include/odp/api/b

[lng-odp] [PATCH 17/29] linux-gen: atomic: simplify locked 64-bit support

2017-10-23 Thread Dmitry Eremin-Solenikov
Rewrite atomic_types.h/atomic_inlines.h to clearly separate simple
(common) and locked 64-bit cases. This is allows us to ease switching of
atomic header to abi setup.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 .../include/odp/api/plat/atomic_inlines.h  | 315 +
 .../include/odp/api/plat/atomic_types.h|  58 ++--
 .../linux-generic/include/odp_atomic_internal.h| 208 ++
 3 files changed, 364 insertions(+), 217 deletions(-)

diff --git a/platform/linux-generic/include/odp/api/plat/atomic_inlines.h 
b/platform/linux-generic/include/odp/api/plat/atomic_inlines.h
index 03b2884fdfca..1c58c77db993 100644
--- a/platform/linux-generic/include/odp/api/plat/atomic_inlines.h
+++ b/platform/linux-generic/include/odp/api/plat/atomic_inlines.h
@@ -109,177 +109,254 @@ _ODP_INLINE void odp_atomic_min_u32(odp_atomic_u32_t 
*atom, uint32_t new_min)
}
 }
 
+#ifdef ODP_ATOMIC_U64_LOCK
+
+/**
+ * @internal
+ * CAS operation expression for the ATOMIC_OP macro
+ */
+#define ATOMIC_CAS_OP(ret_ptr, old_val, new_val) \
+({ \
+   if (atom->v == (old_val)) { \
+   atom->v = (new_val); \
+   *(ret_ptr) = 1; \
+   } else { \
+   *(ret_ptr) = 0; \
+   } \
+})
+
+/**
+ * @internal
+ * Helper macro for lock-based atomic operations on 64-bit integers
+ * @param[in,out] atom Pointer to the 64-bit atomic variable
+ * @param expr Expression used update the variable.
+ * @return The old value of the variable.
+ */
+#define ATOMIC_OP(atom, expr) \
+({ \
+   uint64_t _old_val; \
+   /* Loop while lock is already taken, stop when lock becomes clear */ \
+   while (__atomic_test_and_set(&(atom)->lock, __ATOMIC_ACQUIRE)) \
+   (void)0; \
+   _old_val = (atom)->v; \
+   (expr); /* Perform whatever update is desired */ \
+   __atomic_clear(&(atom)->lock, __ATOMIC_RELEASE); \
+   _old_val; /* Return old value */ \
+})
+
 _ODP_INLINE void odp_atomic_init_u64(odp_atomic_u64_t *atom, uint64_t val)
 {
atom->v = val;
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
__atomic_clear(>lock, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE uint64_t odp_atomic_load_u64(odp_atomic_u64_t *atom)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
return ATOMIC_OP(atom, (void)0);
-#else
-   return __atomic_load_n(>v, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE void odp_atomic_store_u64(odp_atomic_u64_t *atom, uint64_t val)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
(void)ATOMIC_OP(atom, atom->v = val);
-#else
-   __atomic_store_n(>v, val, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE uint64_t odp_atomic_fetch_add_u64(odp_atomic_u64_t *atom,
  uint64_t val)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
return ATOMIC_OP(atom, atom->v += val);
-#else
-   return __atomic_fetch_add(>v, val, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE void odp_atomic_add_u64(odp_atomic_u64_t *atom, uint64_t val)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
(void)ATOMIC_OP(atom, atom->v += val);
-#else
-   (void)__atomic_fetch_add(>v, val, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE uint64_t odp_atomic_fetch_sub_u64(odp_atomic_u64_t *atom,
  uint64_t val)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
return ATOMIC_OP(atom, atom->v -= val);
-#else
-   return __atomic_fetch_sub(>v, val, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE void odp_atomic_sub_u64(odp_atomic_u64_t *atom, uint64_t val)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
(void)ATOMIC_OP(atom, atom->v -= val);
-#else
-   (void)__atomic_fetch_sub(>v, val, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE uint64_t odp_atomic_fetch_inc_u64(odp_atomic_u64_t *atom)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
return ATOMIC_OP(atom, atom->v++);
-#else
-   return __atomic_fetch_add(>v, 1, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE void odp_atomic_inc_u64(odp_atomic_u64_t *atom)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
(void)ATOMIC_OP(atom, atom->v++);
-#else
-   (void)__atomic_fetch_add(>v, 1, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE uint64_t odp_atomic_fetch_dec_u64(odp_atomic_u64_t *atom)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
return ATOMIC_OP(atom, atom->v--);
-#else
-   return __atomic_fetch_sub(>v, 1, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE void odp_atomic_dec_u64(odp_atomic_u64_t *atom)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
(void)ATOMIC_OP(atom, atom->v--);
-#else
-   (void)__atomic_fetch_sub(>v, 1, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE int odp_atomic_cas_u64(odp_atomic_u64_t *atom, uint64_t *old_val,
   uint64_t new_val)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
int ret;
*old_val

[lng-odp] [PATCH 22/29] linux-gen, include: switch ticketlock.h to api+abi

2017-10-23 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am |  1 +
 .../include => include}/odp/api/ticketlock.h| 11 +++
 platform/linux-generic/Makefile.am  |  7 +++
 .../odp/api/abi/ticketlock.h}   | 21 -
 .../include/odp/api/plat/ticketlock_inlines.h   | 20 
 platform/linux-generic/odp_queue_scalable.c |  1 +
 platform/linux-generic/odp_ticketlock.c |  4 +++-
 7 files changed, 27 insertions(+), 38 deletions(-)
 rename {platform/linux-generic/include => include}/odp/api/ticketlock.h (54%)
 rename platform/linux-generic/{include/odp/api/plat/ticketlock_types.h => 
include-abi/odp/api/abi/ticketlock.h} (52%)

diff --git a/include/Makefile.am b/include/Makefile.am
index 4a9c3efe674a..617aa4a6e67a 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -27,6 +27,7 @@ odpapiinclude_HEADERS = \
odp/api/sync.h \
odp/api/thread.h \
odp/api/thrmask.h \
+   odp/api/ticketlock.h \
odp/api/time.h \
odp/api/timer.h \
odp/api/traffic_mngr.h \
diff --git a/platform/linux-generic/include/odp/api/ticketlock.h 
b/include/odp/api/ticketlock.h
similarity index 54%
rename from platform/linux-generic/include/odp/api/ticketlock.h
rename to include/odp/api/ticketlock.h
index ca12cc37cf9f..d875c0e34e76 100644
--- a/platform/linux-generic/include/odp/api/ticketlock.h
+++ b/include/odp/api/ticketlock.h
@@ -10,19 +10,14 @@
  * ODP ticketlock
  */
 
-#ifndef ODP_PLAT_TICKETLOCK_H_
-#define ODP_PLAT_TICKETLOCK_H_
+#ifndef ODP_API_TICKETLOCK_H_
+#define ODP_API_TICKETLOCK_H_
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include 
-
-#include 
-#if ODP_ABI_COMPAT == 0
-#include 
-#endif
+#include 
 
 #include 
 
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 69ccd8e0b978..3aee7ce6340e 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -37,8 +37,7 @@ odpapiinclude_HEADERS = \
  include/odp/api/packet_io_stats.h \
  include/odp/api/random.h \
  include/odp/api/support.h \
- include/odp/api/system_info.h \
- include/odp/api/ticketlock.h
+ include/odp/api/system_info.h
 
 odpapiplatincludedir= $(includedir)/odp/api/plat
 odpapiplatinclude_HEADERS = \
@@ -53,8 +52,7 @@ odpapiplatinclude_HEADERS = \
  include/odp/api/plat/strong_types.h \
  include/odp/api/plat/sync_inlines.h \
  include/odp/api/plat/ticketlock_inlines.h \
- include/odp/api/plat/ticketlock_inlines_api.h \
- include/odp/api/plat/ticketlock_types.h
+ include/odp/api/plat/ticketlock_inlines_api.h
 
 nodist_odpapiplatinclude_HEADERS = \
  include/odp/api/plat/static_inline.h
@@ -87,6 +85,7 @@ odpapiabiarchinclude_HEADERS = \
  include-abi/odp/api/abi/sync.h \
  include-abi/odp/api/abi/thread.h \
  include-abi/odp/api/abi/thrmask.h \
+ include-abi/odp/api/abi/ticketlock.h \
  include-abi/odp/api/abi/time.h \
  include-abi/odp/api/abi/timer.h \
  include-abi/odp/api/abi/traffic_mngr.h \
diff --git a/platform/linux-generic/include/odp/api/plat/ticketlock_types.h 
b/platform/linux-generic/include-abi/odp/api/abi/ticketlock.h
similarity index 52%
rename from platform/linux-generic/include/odp/api/plat/ticketlock_types.h
rename to platform/linux-generic/include-abi/odp/api/abi/ticketlock.h
index 81d479d61a61..958184be6907 100644
--- a/platform/linux-generic/include/odp/api/plat/ticketlock_types.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/ticketlock.h
@@ -11,8 +11,8 @@
  * ODP ticketlock
  */
 
-#ifndef ODP_TICKETLOCK_TYPES_H_
-#define ODP_TICKETLOCK_TYPES_H_
+#ifndef ODP_API_ABI_TICKETLOCK_H_
+#define ODP_API_ABI_TICKETLOCK_H_
 
 #ifdef __cplusplus
 extern "C" {
@@ -20,13 +20,24 @@ extern "C" {
 
 #include 
 
+/** @ingroup odp_locks
+ *  @{
+ */
+
 /** @internal */
-struct odp_ticketlock_s {
+typedef struct odp_ticketlock_s {
odp_atomic_u32_t  next_ticket; /**< Next ticket */
odp_atomic_u32_t  cur_ticket;  /**< Current ticket */
-};
+} odp_ticketlock_t;
+
+/* Include inlined versions of API functions */
+#include 
+#include 
+#include 
 
-typedef struct odp_ticketlock_s odp_ticketlock_t;
+/**
+ * @}
+ */
 
 #ifdef __cplusplus
 }
diff --git a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h 
b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h
index ecbea7c4d611..185d77de015f 100644
--- a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h
+++ b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h
@@ -14,1

[lng-odp] [PATCH 23/29] linux-gen, include: move more headers from platform to generic

2017-10-23 Thread Dmitry Eremin-Solenikov
Move more generic headers from platform include dir to common include
dir.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am  | 10 ++
 {platform/linux-generic/include => include}/odp/api/chksum.h | 12 ++--
 .../linux-generic/include => include}/odp/api/compiler.h | 12 ++--
 .../linux-generic/include => include}/odp/api/deprecated.h   |  4 ++--
 {platform/linux-generic/include => include}/odp/api/errno.h  |  5 ++---
 .../linux-generic/include => include}/odp/api/feature.h  | 12 ++--
 {platform/linux-generic/include => include}/odp/api/hash.h   | 12 ++--
 {platform/linux-generic/include => include}/odp/api/hints.h  | 12 ++--
 {platform/linux-generic/include => include}/odp/api/random.h | 12 ++--
 .../linux-generic/include => include}/odp/api/support.h  | 12 ++--
 .../linux-generic/include => include}/odp/api/system_info.h  |  5 ++---
 platform/linux-generic/Makefile.am   | 12 +---
 12 files changed, 31 insertions(+), 89 deletions(-)
 rename {platform/linux-generic/include => include}/odp/api/chksum.h (72%)
 rename {platform/linux-generic/include => include}/odp/api/compiler.h (69%)
 rename {platform/linux-generic/include => include}/odp/api/deprecated.h (82%)
 rename {platform/linux-generic/include => include}/odp/api/errno.h (83%)
 rename {platform/linux-generic/include => include}/odp/api/feature.h (71%)
 rename {platform/linux-generic/include => include}/odp/api/hash.h (72%)
 rename {platform/linux-generic/include => include}/odp/api/hints.h (70%)
 rename {platform/linux-generic/include => include}/odp/api/random.h (70%)
 rename {platform/linux-generic/include => include}/odp/api/support.h (73%)
 rename {platform/linux-generic/include => include}/odp/api/system_info.h (82%)

diff --git a/include/Makefile.am b/include/Makefile.am
index 617aa4a6e67a..addf4bc92261 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -9,12 +9,20 @@ odpapiinclude_HEADERS = \
odp/api/barrier.h \
odp/api/buffer.h \
odp/api/byteorder.h \
+   odp/api/chksum.h \
+   odp/api/compiler.h \
odp/api/cpumask.h \
+   odp/api/deprecated.h \
+   odp/api/errno.h \
odp/api/event.h \
+   odp/api/feature.h \
+   odp/api/hash.h \
+   odp/api/hints.h \
odp/api/init.h \
odp/api/ipsec.h \
odp/api/pool.h \
odp/api/queue.h \
+   odp/api/random.h \
odp/api/rwlock.h \
odp/api/rwlock_recursive.h \
odp/api/schedule.h \
@@ -24,7 +32,9 @@ odpapiinclude_HEADERS = \
odp/api/spinlock_recursive.h \
odp/api/std_clib.h \
odp/api/std_types.h \
+   odp/api/support.h \
odp/api/sync.h \
+   odp/api/system_info.h \
odp/api/thread.h \
odp/api/thrmask.h \
odp/api/ticketlock.h \
diff --git a/platform/linux-generic/include/odp/api/chksum.h 
b/include/odp/api/chksum.h
similarity index 72%
rename from platform/linux-generic/include/odp/api/chksum.h
rename to include/odp/api/chksum.h
index 18dcb6d11cb9..6dd1554ce48d 100644
--- a/platform/linux-generic/include/odp/api/chksum.h
+++ b/include/odp/api/chksum.h
@@ -10,21 +10,13 @@
  * ODP checksum functions
  */
 
-#ifndef ODP_PLAT_CHKSUM_H_
-#define ODP_PLAT_CHKSUM_H_
+#ifndef ODP_API_CHKSUM_H_
+#define ODP_API_CHKSUM_H_
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/** @ingroup odp_chksum
- *  @{
- */
-
-/**
- * @}
- */
-
 #include 
 
 #ifdef __cplusplus
diff --git a/platform/linux-generic/include/odp/api/compiler.h 
b/include/odp/api/compiler.h
similarity index 69%
rename from platform/linux-generic/include/odp/api/compiler.h
rename to include/odp/api/compiler.h
index 5249d5d6264b..04e815bb0fa5 100644
--- a/platform/linux-generic/include/odp/api/compiler.h
+++ b/include/odp/api/compiler.h
@@ -10,21 +10,13 @@
  * Compiler related
  */
 
-#ifndef ODP_PLAT_COMPILER_H_
-#define ODP_PLAT_COMPILER_H_
+#ifndef ODP_API_COMPILER_H_
+#define ODP_API_COMPILER_H_
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/** @ingroup odp_compiler_optim
- *  @{
- */
-
-/**
- * @}
- */
-
 #include 
 
 #ifdef __cplusplus
diff --git a/platform/linux-generic/include/odp/api/deprecated.h 
b/include/odp/api/deprecated.h
similarity index 82%
rename from platform/linux-generic/include/odp/api/deprecated.h
rename to include/odp/api/deprecated.h
index 82797ebc4505..881f23d1975f 100644
--- a/platform/linux-generic/include/odp/api/deprecated.h
+++ b/include/odp/api/deprecated.h
@@ -10,8 +10,8 @@
  * Control deprecated API definitions
  */
 
-#ifndef ODP_PLAT_DEPRECATED_H_
-#define ODP_PLAT_DEPRECATED_H_
+#ifndef ODP_API_DEPRECATED_H_
+#define ODP_API_DEPRECATED_H_
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/platform/linux-generic/include/odp/api/errno.h 
b/include

[lng-odp] [PATCH 27/29] linux-gen: remove static_inline.h header

2017-10-23 Thread Dmitry Eremin-Solenikov
Replace static_inline.h header with unconditional defines of _ODP_INLINE
macro (either to 'static inline' or to empty value) depending on the
compilation place.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 Makefile.inc   |  1 -
 platform/linux-generic/.gitignore  |  1 -
 platform/linux-generic/Makefile.am |  3 --
 .../linux-generic/include-abi/odp/api/abi/atomic.h |  2 +-
 .../include-abi/odp/api/abi/byteorder.h|  2 +-
 .../linux-generic/include-abi/odp/api/abi/packet.h |  5 ++-
 .../include-abi/odp/api/abi/std_clib.h |  2 +-
 .../linux-generic/include-abi/odp/api/abi/sync.h   |  2 +-
 .../include-abi/odp/api/abi/ticketlock.h   |  2 +-
 .../include/odp/api/plat/packet_inlines.h  |  3 +-
 .../include/odp/api/plat/static_inline.h.in| 43 --
 platform/linux-generic/m4/configure.m4 |  1 -
 12 files changed, 10 insertions(+), 57 deletions(-)
 delete mode 100644 
platform/linux-generic/include/odp/api/plat/static_inline.h.in

diff --git a/Makefile.inc b/Makefile.inc
index 91be46bcb017..9d31dff1da9b 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1,5 +1,4 @@
 ODP_INCLUDES = \
-   -I$(top_builddir)/platform/@with_platform@/include \
-I$(top_srcdir)/platform/@with_platform@/include \
-I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
-I$(top_builddir)/include \
diff --git a/platform/linux-generic/.gitignore 
b/platform/linux-generic/.gitignore
index 442e82a938bb..fd5ade7e304d 100644
--- a/platform/linux-generic/.gitignore
+++ b/platform/linux-generic/.gitignore
@@ -1,2 +1 @@
-include/odp/api/plat/static_inline.h
 libodp-linux.pc
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 3c1551aab7a6..0a49fe67e03b 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -38,9 +38,6 @@ odpapiplatinclude_HEADERS = \
  include/odp/api/plat/ticketlock_inlines.h \
  include/odp/api/plat/ticketlock_inlines_api.h
 
-nodist_odpapiplatinclude_HEADERS = \
- include/odp/api/plat/static_inline.h
-
 if !ODP_ABI_COMPAT
 odpapiabiarchincludedir= $(includedir)/odp/api/abi
 odpapiabiarchinclude_HEADERS = \
diff --git a/platform/linux-generic/include-abi/odp/api/abi/atomic.h 
b/platform/linux-generic/include-abi/odp/api/abi/atomic.h
index 0b7b254ced23..67127aa4d64e 100644
--- a/platform/linux-generic/include-abi/odp/api/abi/atomic.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/atomic.h
@@ -63,7 +63,7 @@ typedef struct odp_atomic_u32_s odp_atomic_u32_t;
  *  @{
  */
 
-#include 
+#define _ODP_INLINE static inline
 #include 
 
 /**
diff --git a/platform/linux-generic/include-abi/odp/api/abi/byteorder.h 
b/platform/linux-generic/include-abi/odp/api/abi/byteorder.h
index 0f8fac0b16c8..da07c0eb0b87 100644
--- a/platform/linux-generic/include-abi/odp/api/abi/byteorder.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/byteorder.h
@@ -75,7 +75,7 @@ typedef uint64_t __odp_bitwiseodp_u64be_t;
 typedef uint16_t __odp_bitwise  odp_u16sum_t;
 typedef uint32_t __odp_bitwise  odp_u32sum_t;
 
-#include 
+#define _ODP_INLINE static inline
 #include 
 
 /**
diff --git a/platform/linux-generic/include-abi/odp/api/abi/packet.h 
b/platform/linux-generic/include-abi/odp/api/abi/packet.h
index 31d446f8dd9f..1aa7cbd5838e 100644
--- a/platform/linux-generic/include-abi/odp/api/abi/packet.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/packet.h
@@ -32,6 +32,9 @@ typedef ODP_HANDLE_T(odp_packet_t);
 
 typedef uint8_t odp_packet_seg_t;
 
+/* or it will be provided by packet_inlines.h */
+#define _ODP_HAVE_PACKET_SEG_NDX   1
+
 static inline uint8_t _odp_packet_seg_to_ndx(odp_packet_seg_t seg)
 {
return (uint8_t)seg;
@@ -53,7 +56,7 @@ typedef enum {
 
 #define ODP_NUM_PACKET_COLORS 3
 
-#include 
+#define _ODP_INLINE static inline
 #include 
 #include 
 
diff --git a/platform/linux-generic/include-abi/odp/api/abi/std_clib.h 
b/platform/linux-generic/include-abi/odp/api/abi/std_clib.h
index b31034df4705..8ef9e9ad22c8 100644
--- a/platform/linux-generic/include-abi/odp/api/abi/std_clib.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/std_clib.h
@@ -17,7 +17,7 @@
 extern "C" {
 #endif
 
-#include 
+#define _ODP_INLINE static inline
 #include 
 
 #ifdef __cplusplus
diff --git a/platform/linux-generic/include-abi/odp/api/abi/sync.h 
b/platform/linux-generic/include-abi/odp/api/abi/sync.h
index 74e3fb15fef9..9ecc40f227c7 100644
--- a/platform/linux-generic/include-abi/odp/api/abi/sync.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/sync.h
@@ -21,7 +21,7 @@ extern "C" {
  *  @{
  */
 
-#include 
+#define _ODP_INLINE static inline
 #include 
 
 /**
diff --git a/platform/linux-generic/include-abi/odp/api/abi/ticketlock.h 
b/platform/linux-generic/include-abi/odp/

[lng-odp] [PATCH 28/29] linux-gen: don't install inline headers in non-ABI-compat mode

2017-10-23 Thread Dmitry Eremin-Solenikov
There is no point in installing inline headers in non-ABI-compat mode
anymore. They are not included by any other header.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 platform/linux-generic/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 0a49fe67e03b..08e915af4e36 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -24,6 +24,7 @@ odpapiinclude_HEADERS = \
  include/odp/api/debug.h
 
 odpapiplatincludedir= $(includedir)/odp/api/plat
+if !ODP_ABI_COMPAT
 odpapiplatinclude_HEADERS = \
  include/odp/api/plat/atomic_inlines.h \
  include/odp/api/plat/byteorder_inlines.h \
@@ -38,7 +39,6 @@ odpapiplatinclude_HEADERS = \
  include/odp/api/plat/ticketlock_inlines.h \
  include/odp/api/plat/ticketlock_inlines_api.h
 
-if !ODP_ABI_COMPAT
 odpapiabiarchincludedir= $(includedir)/odp/api/abi
 odpapiabiarchinclude_HEADERS = \
  include-abi/odp/api/abi/atomic.h \
-- 
2.14.2



[lng-odp] [PATCH 29/29] configure: stop AC_SUBST'ing ODP_ABI_COMPAT

2017-10-23 Thread Dmitry Eremin-Solenikov
With static_inline.h gone, there is no need to
AC_SUBST([ODP_ABI_COMPAT]). Drop it from configure.ac.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 configure.ac | 1 -
 1 file changed, 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 255de960c180..6d74c98b3083 100644
--- a/configure.ac
+++ b/configure.ac
@@ -270,7 +270,6 @@ AC_ARG_ENABLE([abi-compat],
#if there is no ABI compatibility the .so numbers are meaningless
ODP_LIBSO_VERSION=0:0:0
 fi])
-AC_SUBST(ODP_ABI_COMPAT)
 AM_CONDITIONAL(ODP_ABI_COMPAT, [test "x$ODP_ABI_COMPAT" = "x1"])
 
 ##
-- 
2.14.2



[lng-odp] [PATCH 15/29] linux-gen, include: for several simple headers switch to api+abi pattern

2017-10-23 Thread Dmitry Eremin-Solenikov
Start simplifying platform headers by using same include paths for
ABI-compat and non-ABI-compat modes. In either case there will be
 header (provided either by generic includes, or
by platform itself). In case of non-ABI-compat mode, this header
provides runtime-optimized versions of some functions, etc.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 Makefile.inc   |   3 +
 include/Makefile.am|  17 ++
 .../include => include}/odp/api/cpumask.h  |   6 +-
 .../include => include}/odp/api/init.h |  14 +-
 .../include => include}/odp/api/rwlock.h   |   6 +-
 .../include => include}/odp/api/rwlock_recursive.h |   6 +-
 .../include => include}/odp/api/schedule.h |  15 +-
 .../include => include}/odp/api/schedule_types.h   |   6 +-
 .../include => include}/odp/api/spinlock.h |   6 +-
 .../odp/api/spinlock_recursive.h   |   6 +-
 .../include => include}/odp/api/std_types.h|  19 +--
 .../include => include}/odp/api/thread.h   |   6 +-
 .../include => include}/odp/api/thrmask.h  |  14 +-
 .../include => include}/odp/api/time.h |   8 +-
 .../include => include}/odp/api/traffic_mngr.h |  13 +-
 .../include => include}/odp/api/version.h  |   7 +-
 platform/linux-generic/Makefile.am |  51 +++---
 .../odp/api/abi/barrier.h} |   4 +-
 .../include-abi/odp/api/abi/cpumask.h  |   7 +
 .../linux-generic/include-abi/odp/api/abi/init.h   |   7 +
 .../linux-generic/include-abi/odp/api/abi/rwlock.h |   7 +
 .../include-abi/odp/api/abi/rwlock_recursive.h |   7 +
 .../include-abi/odp/api/abi/schedule.h |   7 +
 .../include-abi/odp/api/abi/schedule_types.h   |   7 +
 .../include-abi/odp/api/abi/spinlock.h |   7 +
 .../include-abi/odp/api/abi/spinlock_recursive.h   |   7 +
 .../include-abi/odp/api/abi/std_types.h|   7 +
 .../linux-generic/include-abi/odp/api/abi/thread.h |   7 +
 .../include-abi/odp/api/abi/thrmask.h  |   7 +
 .../linux-generic/include-abi/odp/api/abi/time.h   |   7 +
 .../include-abi/odp/api/abi/traffic_mngr.h |   7 +
 .../include-abi/odp/api/abi/version.h  |   7 +
 platform/linux-generic/include/odp/api/barrier.h   |   2 +-
 .../include/odp/api/plat/cpumask_types.h   |  54 --
 .../include/odp/api/plat/init_types.h  |  35 
 .../include/odp/api/plat/rwlock_recursive_types.h  |  38 -
 .../include/odp/api/plat/rwlock_types.h|  37 -
 .../include/odp/api/plat/schedule_types.h  |  64 ---
 .../odp/api/plat/spinlock_recursive_types.h|  36 
 .../include/odp/api/plat/spinlock_types.h  |  34 
 .../include/odp/api/plat/thread_types.h|  34 
 .../include/odp/api/plat/thrmask_types.h   |  48 --
 .../include/odp/api/plat/time_types.h  |  53 --
 .../include/odp/api/plat/traffic_mngr_types.h  | 185 -
 .../include/odp/api/plat/version_types.h   |  30 
 45 files changed, 187 insertions(+), 768 deletions(-)
 rename {platform/linux-generic/include => include}/odp/api/cpumask.h (74%)
 rename {platform/linux-generic/include => include}/odp/api/init.h (64%)
 rename {platform/linux-generic/include => include}/odp/api/rwlock.h (75%)
 rename {platform/linux-generic/include => include}/odp/api/rwlock_recursive.h 
(70%)
 rename {platform/linux-generic/include => include}/odp/api/schedule.h (63%)
 rename {platform/linux-generic/include => include}/odp/api/schedule_types.h 
(71%)
 rename {platform/linux-generic/include => include}/odp/api/spinlock.h (72%)
 rename {platform/linux-generic/include => 
include}/odp/api/spinlock_recursive.h (68%)
 rename {platform/linux-generic/include => include}/odp/api/std_types.h (54%)
 rename {platform/linux-generic/include => include}/odp/api/thread.h (74%)
 rename {platform/linux-generic/include => include}/odp/api/thrmask.h (64%)
 rename {platform/linux-generic/include => include}/odp/api/time.h (76%)
 rename {platform/linux-generic/include => include}/odp/api/traffic_mngr.h (62%)
 rename {platform/linux-generic/include => include}/odp/api/version.h (73%)
 rename platform/linux-generic/{include/odp/api/plat/barrier_types.h => 
include-abi/odp/api/abi/barrier.h} (89%)
 create mode 100644 platform/linux-generic/include-abi/odp/api/abi/cpumask.h
 create mode 100644 platform/linux-generic/include-abi/odp/api/abi/init.h
 create mode 100644 platform/linux-generic/include-abi/odp/api/abi/rwlock.h
 create mode 100644 
platform/linux-generic/include-abi/odp/api/abi/rwlock_recursive.h
 create mode 100644 platform/linux-generic/include-abi/odp/api/abi/schedule.h
 create mode 100644 
platform/linux-generic/include-abi/odp/api/abi/sche

[lng-odp] [PATCH 18/29] linux-gen, include: switch atomic.h to api+abi

2017-10-23 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am|  1 +
 include/odp/api/atomic.h   | 28 +++
 platform/linux-generic/Makefile.am |  3 +-
 .../odp/api/abi/atomic.h}  | 14 ++--
 platform/linux-generic/include/odp/api/atomic.h| 42 --
 .../linux-generic/include/odp/api/ticketlock.h |  1 +
 platform/linux-generic/odp_atomic.c|  1 +
 7 files changed, 44 insertions(+), 46 deletions(-)
 create mode 100644 include/odp/api/atomic.h
 rename platform/linux-generic/{include/odp/api/plat/atomic_types.h => 
include-abi/odp/api/abi/atomic.h} (86%)
 delete mode 100644 platform/linux-generic/include/odp/api/atomic.h

diff --git a/include/Makefile.am b/include/Makefile.am
index 946b7c07cf73..d1eb26bc59c2 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -5,6 +5,7 @@ include_HEADERS = \
 
 odpapiincludedir= $(includedir)/odp/api/
 odpapiinclude_HEADERS = \
+   odp/api/atomic.h \
odp/api/barrier.h \
odp/api/buffer.h \
odp/api/cpumask.h \
diff --git a/include/odp/api/atomic.h b/include/odp/api/atomic.h
new file mode 100644
index ..8e515ec6f736
--- /dev/null
+++ b/include/odp/api/atomic.h
@@ -0,0 +1,28 @@
+/* Copyright (c) 2013, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP atomic operations
+ */
+
+#ifndef ODP_API_ATOMIC_H_
+#define ODP_API_ATOMIC_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+
+#include 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 1516f8ee7aee..304ca86862f3 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -20,7 +20,6 @@ odpinclude_HEADERS = \
 odpapiincludedir= $(includedir)/odp/api
 odpapiinclude_HEADERS = \
  include/odp/api/align.h \
- include/odp/api/atomic.h \
  include/odp/api/byteorder.h \
  include/odp/api/chksum.h \
  include/odp/api/classification.h \
@@ -47,7 +46,6 @@ odpapiinclude_HEADERS = \
 odpapiplatincludedir= $(includedir)/odp/api/plat
 odpapiplatinclude_HEADERS = \
  include/odp/api/plat/atomic_inlines.h \
- include/odp/api/plat/atomic_types.h \
  include/odp/api/plat/byteorder_inlines.h \
  include/odp/api/plat/byteorder_types.h \
  include/odp/api/plat/packet_flag_inlines.h \
@@ -68,6 +66,7 @@ nodist_odpapiplatinclude_HEADERS = \
 if !ODP_ABI_COMPAT
 odpapiabiarchincludedir= $(includedir)/odp/api/abi
 odpapiabiarchinclude_HEADERS = \
+ include-abi/odp/api/abi/atomic.h \
  include-abi/odp/api/abi/barrier.h \
  include-abi/odp/api/abi/buffer.h \
  include-abi/odp/api/abi/classification.h \
diff --git a/platform/linux-generic/include/odp/api/plat/atomic_types.h 
b/platform/linux-generic/include-abi/odp/api/abi/atomic.h
similarity index 86%
rename from platform/linux-generic/include/odp/api/plat/atomic_types.h
rename to platform/linux-generic/include-abi/odp/api/abi/atomic.h
index c0803bf11f63..0b7b254ced23 100644
--- a/platform/linux-generic/include/odp/api/plat/atomic_types.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/atomic.h
@@ -10,8 +10,8 @@
  * ODP atomic operations
  */
 
-#ifndef ODP_ATOMIC_TYPES_H_
-#define ODP_ATOMIC_TYPES_H_
+#ifndef ODP_API_ABI_ATOMIC_H_
+#define ODP_API_ABI_ATOMIC_H_
 
 #ifdef __cplusplus
 extern "C" {
@@ -59,6 +59,16 @@ typedef struct odp_atomic_u64_s odp_atomic_u64_t;
 
 typedef struct odp_atomic_u32_s odp_atomic_u32_t;
 
+/** @ingroup odp_atomic
+ *  @{
+ */
+
+#include 
+#include 
+
+/**
+ * @}
+ */
 #ifdef __cplusplus
 }
 #endif
diff --git a/platform/linux-generic/include/odp/api/atomic.h 
b/platform/linux-generic/include/odp/api/atomic.h
deleted file mode 100644
index 7886cb4ea382..
--- a/platform/linux-generic/include/odp/api/atomic.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP atomic operations
- */
-
-#ifndef ODP_PLAT_ATOMIC_H_
-#define ODP_PLAT_ATOMIC_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include 
-#include 
-
-/** @ingroup odp_atomic
- *  @{
- */
-
-#include 
-#if ODP_ABI_COMPAT == 0
-#include 
-#endif
-
-/**
- * @}
- */
-
-#include 
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/platform/linux-generic/include/odp/api/ticketlock.h 
b/platform/linux-generic/include/odp/api/ticketlock.h
index e0f5d81fd6ed..ca12cc37cf9f 100644
--- a/platform/linux-generic/include/odp/api/ticketlock.h
+++ b/platform/linux-generic/include/odp/api/ticketlock.h
@@ 

[lng-odp] [PATCH 19/29] linux-gen, include: switch byteorder.h to api+abi

2017-10-23 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am|  1 +
 include/odp/api/byteorder.h| 28 ++
 platform/linux-generic/Makefile.am |  3 +-
 .../odp/api/abi/byteorder.h}   | 15 +---
 platform/linux-generic/include/odp/api/byteorder.h | 43 --
 .../include/odp/api/plat/byteorder_inlines.h   |  6 +++
 platform/linux-generic/odp_byteorder.c |  1 +
 7 files changed, 47 insertions(+), 50 deletions(-)
 create mode 100644 include/odp/api/byteorder.h
 rename platform/linux-generic/{include/odp/api/plat/byteorder_types.h => 
include-abi/odp/api/abi/byteorder.h} (84%)
 delete mode 100644 platform/linux-generic/include/odp/api/byteorder.h

diff --git a/include/Makefile.am b/include/Makefile.am
index d1eb26bc59c2..229f47fc7173 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -8,6 +8,7 @@ odpapiinclude_HEADERS = \
odp/api/atomic.h \
odp/api/barrier.h \
odp/api/buffer.h \
+   odp/api/byteorder.h \
odp/api/cpumask.h \
odp/api/event.h \
odp/api/init.h \
diff --git a/include/odp/api/byteorder.h b/include/odp/api/byteorder.h
new file mode 100644
index ..cbb45429943a
--- /dev/null
+++ b/include/odp/api/byteorder.h
@@ -0,0 +1,28 @@
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP byteorder
+ */
+
+#ifndef ODP_API_BYTEORDER_H_
+#define ODP_API_BYTEORDER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+
+#include 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 304ca86862f3..966fc13f5c02 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -20,7 +20,6 @@ odpinclude_HEADERS = \
 odpapiincludedir= $(includedir)/odp/api
 odpapiinclude_HEADERS = \
  include/odp/api/align.h \
- include/odp/api/byteorder.h \
  include/odp/api/chksum.h \
  include/odp/api/classification.h \
  include/odp/api/compiler.h \
@@ -47,7 +46,6 @@ odpapiplatincludedir= $(includedir)/odp/api/plat
 odpapiplatinclude_HEADERS = \
  include/odp/api/plat/atomic_inlines.h \
  include/odp/api/plat/byteorder_inlines.h \
- include/odp/api/plat/byteorder_types.h \
  include/odp/api/plat/packet_flag_inlines.h \
  include/odp/api/plat/packet_flag_inlines_api.h \
  include/odp/api/plat/packet_inlines.h \
@@ -69,6 +67,7 @@ odpapiabiarchinclude_HEADERS = \
  include-abi/odp/api/abi/atomic.h \
  include-abi/odp/api/abi/barrier.h \
  include-abi/odp/api/abi/buffer.h \
+ include-abi/odp/api/abi/byteorder.h \
  include-abi/odp/api/abi/classification.h \
  include-abi/odp/api/abi/cpumask.h \
  include-abi/odp/api/abi/crypto.h \
diff --git a/platform/linux-generic/include/odp/api/plat/byteorder_types.h 
b/platform/linux-generic/include-abi/odp/api/abi/byteorder.h
similarity index 84%
rename from platform/linux-generic/include/odp/api/plat/byteorder_types.h
rename to platform/linux-generic/include-abi/odp/api/abi/byteorder.h
index 20d52bf8fa6b..0f8fac0b16c8 100644
--- a/platform/linux-generic/include/odp/api/plat/byteorder_types.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/byteorder.h
@@ -10,23 +10,25 @@
  * ODP byteorder
  */
 
-#ifndef ODP_BYTEORDER_TYPES_H_
-#define ODP_BYTEORDER_TYPES_H_
+#ifndef ODP_API_ABI_BYTEORDER_H_
+#define ODP_API_ABI_BYTEORDER_H_
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+#include 
+
 #ifndef __BYTE_ORDER__
-#error __BYTE_ORDER not defined!
+#error __BYTE_ORDER__ not defined!
 #endif
 
 #ifndef __ORDER_BIG_ENDIAN__
-#error __BIG_ENDIAN not defined!
+#error __ORDER_BIG_ENDIAN__ not defined!
 #endif
 
 #ifndef __ORDER_LITTLE_ENDIAN__
-#error __LITTLE_ENDIAN not defined!
+#error __ORDER_LITTLE_ENDIAN__ not defined!
 #endif
 
 /* for use with type checkers such as sparse */
@@ -73,6 +75,9 @@ typedef uint64_t __odp_bitwiseodp_u64be_t;
 typedef uint16_t __odp_bitwise  odp_u16sum_t;
 typedef uint32_t __odp_bitwise  odp_u32sum_t;
 
+#include 
+#include 
+
 /**
  * @}
  */
diff --git a/platform/linux-generic/include/odp/api/byteorder.h 
b/platform/linux-generic/include/odp/api/byteorder.h
deleted file mode 100644
index ec3d0eef763a..
--- a/platform/linux-generic/include/odp/api/byteorder.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (c) 2014, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP byteorder
- */
-
-#ifndef ODP_PLAT_BYTEORDER_H_
-#define OD

[lng-odp] [PATCH 20/29] linux-gen, include: switch std_clib.h to api+abi

2017-10-23 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 example/traffic_mgmt/odp_traffic_mgmt.c|  1 +
 helper/test/linux/process.c|  2 ++
 helper/test/linux/pthread.c|  2 ++
 helper/threads.c   |  1 +
 include/Makefile.am|  1 +
 include/odp/api/std_clib.h | 24 ++
 platform/linux-generic/Makefile.am |  2 +-
 .../odp/api => include-abi/odp/api/abi}/std_clib.h | 17 ---
 .../include/odp/api/plat/std_clib_inlines.h|  1 -
 platform/linux-generic/odp_std_clib.c  |  1 +
 10 files changed, 41 insertions(+), 11 deletions(-)
 create mode 100644 include/odp/api/std_clib.h
 rename platform/linux-generic/{include/odp/api => 
include-abi/odp/api/abi}/std_clib.h (60%)

diff --git a/example/traffic_mgmt/odp_traffic_mgmt.c 
b/example/traffic_mgmt/odp_traffic_mgmt.c
index 1f1102ddfdaf..e02a1af8dc3f 100644
--- a/example/traffic_mgmt/odp_traffic_mgmt.c
+++ b/example/traffic_mgmt/odp_traffic_mgmt.c
@@ -10,6 +10,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/helper/test/linux/process.c b/helper/test/linux/process.c
index 12504d01bd9f..3ed2032b0c59 100644
--- a/helper/test/linux/process.c
+++ b/helper/test/linux/process.c
@@ -11,6 +11,8 @@
 #include 
 #include 
 
+#include 
+
 #define NUMBER_WORKERS 16 /* 0 = max */
 
 static void *worker_fn(void *arg ODPH_UNUSED)
diff --git a/helper/test/linux/pthread.c b/helper/test/linux/pthread.c
index a50df027f3f2..0863283d60aa 100644
--- a/helper/test/linux/pthread.c
+++ b/helper/test/linux/pthread.c
@@ -10,6 +10,8 @@
 #include 
 #include 
 
+#include 
+
 #define NUMBER_WORKERS 16
 static void *worker_fn(void *arg ODPH_UNUSED)
 {
diff --git a/helper/threads.c b/helper/threads.c
index a83014d424de..32a092825084 100644
--- a/helper/threads.c
+++ b/helper/threads.c
@@ -10,6 +10,7 @@
 #define _GNU_SOURCE
 #endif
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/Makefile.am b/include/Makefile.am
index 229f47fc7173..6b3d12f793a4 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -22,6 +22,7 @@ odpapiinclude_HEADERS = \
odp/api/shared_memory.h \
odp/api/spinlock.h \
odp/api/spinlock_recursive.h \
+   odp/api/std_clib.h \
odp/api/std_types.h \
odp/api/thread.h \
odp/api/thrmask.h \
diff --git a/include/odp/api/std_clib.h b/include/odp/api/std_clib.h
new file mode 100644
index ..fde1c1dd3a4a
--- /dev/null
+++ b/include/odp/api/std_clib.h
@@ -0,0 +1,24 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef ODP_API_STD_CLIB_H_
+#define ODP_API_STD_CLIB_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+
+#include 
+
+#include 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 966fc13f5c02..cdb45d8e0c9a 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -36,7 +36,6 @@ odpapiinclude_HEADERS = \
  include/odp/api/packet_io.h \
  include/odp/api/packet_io_stats.h \
  include/odp/api/random.h \
- include/odp/api/std_clib.h \
  include/odp/api/support.h \
  include/odp/api/sync.h \
  include/odp/api/system_info.h \
@@ -84,6 +83,7 @@ odpapiabiarchinclude_HEADERS = \
  include-abi/odp/api/abi/shared_memory.h \
  include-abi/odp/api/abi/spinlock.h \
  include-abi/odp/api/abi/spinlock_recursive.h \
+ include-abi/odp/api/abi/std_clib.h \
  include-abi/odp/api/abi/std_types.h \
  include-abi/odp/api/abi/thread.h \
  include-abi/odp/api/abi/thrmask.h \
diff --git a/platform/linux-generic/include/odp/api/std_clib.h 
b/platform/linux-generic/include-abi/odp/api/abi/std_clib.h
similarity index 60%
rename from platform/linux-generic/include/odp/api/std_clib.h
rename to platform/linux-generic/include-abi/odp/api/abi/std_clib.h
index fea4725437e7..b31034df4705 100644
--- a/platform/linux-generic/include/odp/api/std_clib.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/std_clib.h
@@ -4,22 +4,21 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef ODP_PLAT_STD_CLIB_H_
-#define ODP_PLAT_STD_CLIB_H_
+/**
+ * @file
+ *
+ * ODP barrier
+ */
+
+#ifndef ODP_API_ABI_STD_CLIB_H_
+#define ODP_API_ABI_STD_CLIB_H_
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include 
-#include 
-
 #include 
-#if ODP_ABI_COMPAT == 0
 #include 
-#endif
-
-#include 
 
 #ifdef __cplusplus
 }
diff --git a/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h 
b/platform/li

[lng-odp] [PATCH 21/29] linux-gen, include: switch sync.h to api+abi

2017-10-23 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am|  1 +
 include/odp/api/sync.h | 28 ++
 platform/linux-generic/Makefile.am |  2 +-
 .../odp/api => include-abi/odp/api/abi}/sync.h | 12 --
 platform/linux-generic/odp_sync.c  |  1 +
 5 files changed, 35 insertions(+), 9 deletions(-)
 create mode 100644 include/odp/api/sync.h
 rename platform/linux-generic/{include/odp/api => 
include-abi/odp/api/abi}/sync.h (63%)

diff --git a/include/Makefile.am b/include/Makefile.am
index 6b3d12f793a4..4a9c3efe674a 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -24,6 +24,7 @@ odpapiinclude_HEADERS = \
odp/api/spinlock_recursive.h \
odp/api/std_clib.h \
odp/api/std_types.h \
+   odp/api/sync.h \
odp/api/thread.h \
odp/api/thrmask.h \
odp/api/time.h \
diff --git a/include/odp/api/sync.h b/include/odp/api/sync.h
new file mode 100644
index ..b84289ca8cb6
--- /dev/null
+++ b/include/odp/api/sync.h
@@ -0,0 +1,28 @@
+/* Copyright (c) 2013, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP synchronisation
+ */
+
+#ifndef ODP_API_SYNC_H_
+#define ODP_API_SYNC_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+
+#include 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index cdb45d8e0c9a..69ccd8e0b978 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -37,7 +37,6 @@ odpapiinclude_HEADERS = \
  include/odp/api/packet_io_stats.h \
  include/odp/api/random.h \
  include/odp/api/support.h \
- include/odp/api/sync.h \
  include/odp/api/system_info.h \
  include/odp/api/ticketlock.h
 
@@ -85,6 +84,7 @@ odpapiabiarchinclude_HEADERS = \
  include-abi/odp/api/abi/spinlock_recursive.h \
  include-abi/odp/api/abi/std_clib.h \
  include-abi/odp/api/abi/std_types.h \
+ include-abi/odp/api/abi/sync.h \
  include-abi/odp/api/abi/thread.h \
  include-abi/odp/api/abi/thrmask.h \
  include-abi/odp/api/abi/time.h \
diff --git a/platform/linux-generic/include/odp/api/sync.h 
b/platform/linux-generic/include-abi/odp/api/abi/sync.h
similarity index 63%
rename from platform/linux-generic/include/odp/api/sync.h
rename to platform/linux-generic/include-abi/odp/api/abi/sync.h
index e1afcc722d07..74e3fb15fef9 100644
--- a/platform/linux-generic/include/odp/api/sync.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/sync.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, Linaro Limited
+/* Copyright (c) 2015, Linaro Limited
  * All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
@@ -7,11 +7,11 @@
 /**
  * @file
  *
- * ODP synchronisation
+ * ODP barrier
  */
 
-#ifndef ODP_PLAT_SYNC_H_
-#define ODP_PLAT_SYNC_H_
+#ifndef ODP_API_ABI_SYNC_H_
+#define ODP_API_ABI_SYNC_H_
 
 #ifdef __cplusplus
 extern "C" {
@@ -22,16 +22,12 @@ extern "C" {
  */
 
 #include 
-#if ODP_ABI_COMPAT == 0
 #include 
-#endif
 
 /**
  * @}
  */
 
-#include 
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/platform/linux-generic/odp_sync.c 
b/platform/linux-generic/odp_sync.c
index 7acdc92dd497..a9d2bbe24369 100644
--- a/platform/linux-generic/odp_sync.c
+++ b/platform/linux-generic/odp_sync.c
@@ -7,6 +7,7 @@
 #include "config.h"
 
 #include 
+#include 
 #if ODP_ABI_COMPAT == 1
 #include 
 #endif
-- 
2.14.2



[lng-odp] [PATCH 24/29] linux-gen, include: switch packet headers to api+abi

2017-10-23 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am|  6 ++
 .../include => include}/odp/api/classification.h   |  2 +-
 .../include => include}/odp/api/crypto.h   |  2 +-
 .../include => include}/odp/api/packet.h   | 11 +---
 .../include => include}/odp/api/packet_flags.h |  9 +--
 .../include => include}/odp/api/packet_io.h|  6 +-
 .../include => include}/odp/api/packet_io_stats.h  |  4 +-
 platform/linux-generic/Makefile.am | 12 ++--
 .../linux-generic/include-abi/odp/api/abi/packet.h | 68 ++
 .../include-abi/odp/api/abi/packet_flags.h | 27 +
 .../include/odp/api/plat/packet_flag_inlines.h | 19 +-
 .../plat/{packet_types.h => packet_inline_types.h} | 53 +
 .../include/odp/api/plat/packet_inlines.h  | 27 +++--
 .../linux-generic/include/odp_packet_internal.h|  3 +-
 platform/linux-generic/odp_packet.c|  2 +-
 platform/linux-generic/pktio/dpdk.c|  2 +-
 platform/linux-generic/pktio/netmap.c  |  2 +-
 17 files changed, 136 insertions(+), 119 deletions(-)
 rename {platform/linux-generic/include => include}/odp/api/classification.h 
(93%)
 rename {platform/linux-generic/include => include}/odp/api/crypto.h (92%)
 rename {platform/linux-generic/include => include}/odp/api/packet.h (67%)
 rename {platform/linux-generic/include => include}/odp/api/packet_flags.h (59%)
 rename {platform/linux-generic/include => include}/odp/api/packet_io.h (83%)
 rename {platform/linux-generic/include => include}/odp/api/packet_io_stats.h 
(79%)
 create mode 100644 platform/linux-generic/include-abi/odp/api/abi/packet.h
 create mode 100644 
platform/linux-generic/include-abi/odp/api/abi/packet_flags.h
 rename platform/linux-generic/include/odp/api/plat/{packet_types.h => 
packet_inline_types.h} (76%)

diff --git a/include/Makefile.am b/include/Makefile.am
index addf4bc92261..4ef4d89185d0 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -10,8 +10,10 @@ odpapiinclude_HEADERS = \
odp/api/buffer.h \
odp/api/byteorder.h \
odp/api/chksum.h \
+   odp/api/classification.h \
odp/api/compiler.h \
odp/api/cpumask.h \
+   odp/api/crypto.h \
odp/api/deprecated.h \
odp/api/errno.h \
odp/api/event.h \
@@ -20,6 +22,10 @@ odpapiinclude_HEADERS = \
odp/api/hints.h \
odp/api/init.h \
odp/api/ipsec.h \
+   odp/api/packet.h \
+   odp/api/packet_flags.h \
+   odp/api/packet_io.h \
+   odp/api/packet_io_stats.h \
odp/api/pool.h \
odp/api/queue.h \
odp/api/random.h \
diff --git a/platform/linux-generic/include/odp/api/classification.h 
b/include/odp/api/classification.h
similarity index 93%
rename from platform/linux-generic/include/odp/api/classification.h
rename to include/odp/api/classification.h
index 01be7063d102..ecdf92031d0a 100644
--- a/platform/linux-generic/include/odp/api/classification.h
+++ b/include/odp/api/classification.h
@@ -20,7 +20,7 @@ extern "C" {
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/platform/linux-generic/include/odp/api/crypto.h 
b/include/odp/api/crypto.h
similarity index 92%
rename from platform/linux-generic/include/odp/api/crypto.h
rename to include/odp/api/crypto.h
index ead28eab0bfc..3f4104677201 100644
--- a/platform/linux-generic/include/odp/api/crypto.h
+++ b/include/odp/api/crypto.h
@@ -18,7 +18,7 @@ extern "C" {
 #endif
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/platform/linux-generic/include/odp/api/packet.h 
b/include/odp/api/packet.h
similarity index 67%
rename from platform/linux-generic/include/odp/api/packet.h
rename to include/odp/api/packet.h
index 5d744df544d6..88c4f0278c84 100644
--- a/platform/linux-generic/include/odp/api/packet.h
+++ b/include/odp/api/packet.h
@@ -10,8 +10,8 @@
  * ODP packet descriptor
  */
 
-#ifndef ODP_PLAT_PACKET_H_
-#define ODP_PLAT_PACKET_H_
+#ifndef ODP_API_PACKET_H_
+#define ODP_API_PACKET_H_
 
 #ifdef __cplusplus
 extern "C" {
@@ -20,15 +20,10 @@ extern "C" {
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
-#include 
-#if ODP_ABI_COMPAT == 0
-#include 
-#endif
-
 #include 
 
 #ifdef __cplusplus
diff --git a/platform/linux-generic/include/odp/api/packet_flags.h 
b/include/odp/api/packet_flags.h
similarity index 59%
rename from platform/linux-generic/include/odp/api/packet_flags.h
rename to include/odp/api/packet_flags.h
index 1e55af823736..2b3006b5192c 100644
--- a/platform/linux-generic/include/odp/api/packet_flags.h
+++ b/include/odp/api/packet_flags.h
@@ -10,17 +10,14 @@
  * ODP packet flags
  */
 
-#ifndef ODP_PLAT_PACKET_FLAGS_H_
-#define ODP_PLAT_PACKET_FLAGS_H_
+#ifndef O

[lng-odp] [PATCH 25/29] linux-gen: move several files under ODP_ABI_COMPAT condition

2017-10-23 Thread Dmitry Eremin-Solenikov
Several files consist only (or mostly) of functions compiled only if
ODP is compiled in ABI compatibility mode. Instead of having an ifdef
inside, guard them with if ODP_ABI_COMPAT condition in Makefile.am

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 platform/linux-generic/Makefile.am  | 13 +
 .../include/odp/api/plat/ticketlock_inlines_api.h   |  6 ++
 platform/linux-generic/odp_atomic.c |  4 
 platform/linux-generic/odp_atomic_api.c | 13 +
 platform/linux-generic/odp_byteorder.c  |  6 +++---
 platform/linux-generic/odp_std_clib.c   |  6 +++---
 platform/linux-generic/odp_sync.c   |  6 +++---
 platform/linux-generic/odp_ticketlock.c | 10 +-
 8 files changed, 38 insertions(+), 26 deletions(-)
 create mode 100644 platform/linux-generic/odp_atomic_api.c

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index f2454ac51fff..078d154f8f15 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -167,7 +167,6 @@ __LIB__libodp_linux_la_SOURCES = \
   odp_barrier.c \
   odp_bitmap.c \
   odp_buffer.c \
-  odp_byteorder.c \
   odp_chksum.c \
   odp_classification.c \
   odp_cpu.c \
@@ -215,12 +214,9 @@ __LIB__libodp_linux_la_SOURCES = \
   odp_sorted_list.c \
   odp_spinlock.c \
   odp_spinlock_recursive.c \
-  odp_std_clib.c \
-  odp_sync.c \
   odp_system_info.c \
   odp_thread.c \
   odp_thrmask.c \
-  odp_ticketlock.c \
   odp_time.c \
   odp_timer.c \
   odp_timer_wheel.c \
@@ -233,6 +229,15 @@ __LIB__libodp_linux_la_SOURCES = \
   drv_shm.c \
   drv_spinlock.c
 
+if ODP_ABI_COMPAT
+__LIB__libodp_linux_la_SOURCES += \
+  odp_atomic_api.c \
+  odp_byteorder.c \
+  odp_std_clib.c \
+  odp_sync.c \
+  odp_ticketlock.c
+endif
+
 if ARCH_IS_ARM
 __LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_arch.c \
  arch/default/odp_cpu_cycles.c \
diff --git 
a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h 
b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h
index 5efe696ff734..4f8509569228 100644
--- a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h
+++ b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h
@@ -33,4 +33,10 @@ _ODP_INLINE int odp_ticketlock_is_locked(odp_ticketlock_t 
*lock)
return _odp_ticketlock_is_locked(lock);
 }
 
+_ODP_INLINE void odp_ticketlock_init(odp_ticketlock_t *ticketlock)
+{
+   odp_atomic_init_u32(>next_ticket, 0);
+   odp_atomic_init_u32(>cur_ticket, 0);
+}
+
 #endif
diff --git a/platform/linux-generic/odp_atomic.c 
b/platform/linux-generic/odp_atomic.c
index 1d76caf2b82f..8c46bb5bb11f 100644
--- a/platform/linux-generic/odp_atomic.c
+++ b/platform/linux-generic/odp_atomic.c
@@ -7,10 +7,6 @@
 #include "config.h"
 
 #include 
-#include 
-#if ODP_ABI_COMPAT == 1
-#include 
-#endif
 
 int odp_atomic_lock_free_u64(odp_atomic_op_t *atomic_op)
 {
diff --git a/platform/linux-generic/odp_atomic_api.c 
b/platform/linux-generic/odp_atomic_api.c
new file mode 100644
index ..a1aabb07c692
--- /dev/null
+++ b/platform/linux-generic/odp_atomic_api.c
@@ -0,0 +1,13 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include "config.h"
+
+#include 
+
+/* Include non-inlined versions of API functions */
+#define _ODP_INLINE
+#include 
diff --git a/platform/linux-generic/odp_byteorder.c 
b/platform/linux-generic/odp_byteorder.c
index faf1c5904bb4..ff0b74b233cf 100644
--- a/platform/linux-generic/odp_byteorder.c
+++ b/platform/linux-generic/odp_byteorder.c
@@ -7,7 +7,7 @@
 #include "config.h"
 
 #include 
-#include 
-#if ODP_ABI_COMPAT == 1
+
+/* Include non-inlined versions of API functions */
+#define _ODP_INLINE
 #include 
-#endif
diff --git a/platform/linux-generic/odp_std_clib.c 
b/platform/linux-generic/odp_std_clib.c
index 38406b86b3c4..b267ea654ee2 100644
--- a/platform/linux-generic/odp_std_clib.c
+++ b/platform/linux-generic/odp_std_clib.c
@@ -7,7 +7,7 @@
 #include "config.h"
 
 #include 
-#include 
-#if ODP_ABI_COMPAT == 1

Re: [lng-odp] Latest odp_ipsec_sa_disable() discussion and proposed resolution

2017-10-24 Thread Dmitry Eremin-Solenikov
Hello,

On 23 October 2017 at 20:56, Bill Fischofer  wrote:
> 2. All other IPsec events are reported as events of type ODP_EVENT_PACKET,
> subtype ODP_EVENT_PACKET_IPSEC with appropriate error/warning bits set.
> Implementations are free to use dummy packets to communicate events like
> IPsec disable completion. Such dummy packets should have an
> odp_packet_len() of 0. Applications should not attempt to use these as
> actual packets, but instead take appropriate action in response to the
> notification and then free them.

Started to work on implementation. What pool should IPsec use as a source
of those packets?

-- 
With best wishes
Dmitry


Re: [lng-odp] Static ODP library and DPDK drivers

2017-10-24 Thread Dmitry Eremin-Solenikov
Hello,

On 24/10/17 14:02, Elo, Matias (Nokia - FI/Espoo) wrote:
> Hi Dmitry,
> 
> Currently, when odp is configured with '--disable-shared' flag, dpdk drivers 
> are not included in the resulting libodp-linux.a library (doesn't include any 
> dpdk driver symbols) and hence an applications using this library doesn't 
> find any dpdk devices. However, if the flag is not used the drivers are 
> included in the shared libodp-linux.so and everything works as expected. Do 
> you have any ideas how this problem could be fixed?

Neither does it include openssl, pcap or any other dependency. Use
pkg-config to generate full list of required flags for linking. It will
include all DPDK libraries, if ODP is configured to use DPDK.

-- 
With best wishes
Dmitry


Re: [lng-odp] abi version support

2017-11-10 Thread Dmitry Eremin-Solenikov
10 нояб. 2017 г. 13:22 пользователь "Maxim Uvarov" 
написал:

I see that dpdk started to support abi versions in following ways

I.e. they describe in .map file which functions to expert and what ABI/API
level they are.
We can use something the same. But I'm not big fun of manually writing such
files. And maybe maintain different ABI versions in one source is not a
good idea. But we can try to generate .map and filter out all not "odp_"
functions, then specify this .map to linked.


This requires maintaining ABI compatibility between releases. The whole
point of versioning symbols is to be able to declare that this symbol
conforms to old ABI and this one is new. And yes, this requires manual
listings.


[lng-odp] ODP vs Protocol headers

2017-11-10 Thread Dmitry Eremin-Solenikov
Hello,

Historically ODP helper provided protocol-related headers with
linux-generic ODP implementation using modified private copy of them.
The main reason for that was, if I remember correctly, that ODP should
not provide protocol-related definitions.

I'd like to return to that question:
 - I'm now adding more definitions to private protocol headers and I
would not like for them to be too much out of sync.
 - We started adding more and more protocol-specific handling in form of
odp_packet_parse, odp packet flags, etc.

I'd propose to put protocol headers (ip.h, tcp.h, udp.h, eth.h) into
public ODP namespace (to ) with the following
phrase specifying them:


These headers are not a part of ODP API specification, however they are
provided to enable applications to use standard definitions for the
protocol data. While neither of ODP API/ABI headers uses these protocol
headers, an implementation SHOULD provide them AS IS to ease porting
applications between ODP implementations.


-- 
With best wishes
Dmitry


Re: [lng-odp] Preparing for ODP 2.0

2017-11-28 Thread Dmitry Eremin-Solenikov
On 28/11/17 00:57, Bill Fischofer wrote:
> As a way of easing the sync burden on the 2.0 development branch, what do
> folks think of the idea of asking that new PRs being posted to api-next
> also be posted to 2.0? The contributions to api-next should be winding down
> as we approach Tiger Moth freeze, so this will help keep things in sync as
> we transition back into a single development target post-Tiger Moth.
> 
> Please share your views on this.

No, current '2.0' should be refactored as a set of PRs against
master/api-next. When its development was started, it was promised that
2.0 will be reviewed before merging to master/api-next.


-- 
With best wishes
Dmitry


Re: [lng-odp] IPsec: handling dummy packets (NH=59)

2017-11-28 Thread Dmitry Eremin-Solenikov
Hello,

On 20/11/17 18:23, Bill Fischofer wrote:
> Traffic Flow Confidentiality (TFC) is a feature of SAs according to RFC
> 4303 that must be negotiated on a per-SA basis before it is used. So
> This would need to be hooked into higher-level protocols.
> 
> From an ODP perspective, it would be an additional set of parameters on
> the odp_ipsec_sa_create() API. Not clear this is something we should
> worry about for Tiger Moth, but something to consider as an addition in
> the future.

In fact I think that control can go to application level. I was thinking
about allowing application to specify if outgoing packet is dummy or
not. In fact I'm going to propose the possibility to specify if outgoing
packet is IPv4, IPv6 or dummy.

> 
> On Mon, Nov 20, 2017 at 8:37 AM, Dmitry Eremin-Solenikov
> <dmitry.ereminsoleni...@linaro.org
> <mailto:dmitry.ereminsoleni...@linaro.org>> wrote:
> 
> Hello,
> 
> I was thinking about another minor part of IPsec RFCs: dummy packets
> used to mask traffic statistics. IPsec implementation is required to
> drop ESP packets with NH = 59 (no next header) on receiver side and is
> expected to be able to generate these packets on transmitter side.
> Currently we do not provide a way to inject these packets in any way.
> 
> Possible solutions:
> 
> TX side:
>  - Add API call to transmit single packet.
> 
>  - Extend transmit parameters to specify next header (IPv4, IPv6 or
> NoNH) for each packet to be transmitted (per-packet or per-odp call).
> 
>  - ???
> 
> RX side:
>  - Silently drop NoNH packets
> 
>  - Report NoNH packets to app via error or status event mechanism.
> 
>  - ???
> 
> --
> With best wishes
> Dmitry
> 
> 


-- 
With best wishes
Dmitry


Re: [lng-odp] Suspected SPAM - Re: IPsec and crypto performance and OpenSSL

2017-12-13 Thread Dmitry Eremin-Solenikov
Hello

On 12 December 2017 at 12:38, Peltonen, Janne (Nokia - FI/Espoo)
<janne.pelto...@nokia.com> wrote:
>
>> So, I'd suggest to preallocate Open SSL (per thread) context memory in 
>> global_init(). I
>> guess context allocation depends on algorithm, etc config, but we could e.g. 
>> pre-allocate
>> the most obvious ones (e.g. AES+SHA1, or AES-GCM) and leave all others as 
>> they are today.
>> A balance between simple solution, process support and better performance 
>> for the common
>> case.
>
> That would help but since the same context would be shared by
> many crypto sessions the keys would have to be configured in the
> context in every crypto op.
>
> The current code looks like this (in every crypto op):
>
> ctx = EVP_CIPHER_CTX_new();
> EVP_EncryptInit_ex(ctx, session->cipher.evp_cipher, NULL,
>session->cipher.key_data, NULL);
> EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, iv_ptr);
> EVP_CIPHER_CTX_set_padding(ctx, 0);
>
> ret = internal_encrypt(ctx, pkt, param);
>
> EVP_CIPHER_CTX_free(ctx);
>
> I tried this, with big speedup (and broken process support):
>
> ctx = session->perthread[odp_thread_id()].cipher_ctx;
> EVP_EncryptInit_ex(ctx, NULL, NULL, NULL, iv_ptr);
>
> ret = internal_encrypt(ctx, pkt, param);
>
> What you propose, would be in between. Maybe I should try and
> see how fast it would be.

I did some interim version (see https://github.com/Linaro/odp/pull/342).
Speedup is not so large. I will try hacking support for per-session
CTX + local CTX, but this
might take some time.

>
> Janne
>
>
>> -Original Message-
>> From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of 
>> Savolainen, Petri
>> (Nokia - FI/Espoo)
>> Sent: Tuesday, December 12, 2017 10:30 AM
>> To: Bill Fischofer <bill.fischo...@linaro.org>; Dmitry Eremin-Solenikov
>> <dmitry.ereminsoleni...@linaro.org>
>> Cc: lng-odp@lists.linaro.org
>> Subject: Suspected SPAM - Re: [lng-odp] IPsec and crypto performance and 
>> OpenSSL
>>
>> We should not deliberately break process support. Since ODP and OFP are 
>> libraries, it's
>> the application (e.g. NGINX) that creates the threads and it may have 
>> historical or other
>> valid reasons to fork processes instead of creating pthreads. Processes may 
>> be forked at
>> many points. If we target fork after global init, we are making process 
>> support better
>> instead of making it worse.
>>
>> So, I'd suggest to preallocate Open SSL (per thread) context memory in 
>> global_init(). I
>> guess context allocation depends on algorithm, etc config, but we could e.g. 
>> pre-allocate
>> the most obvious ones (e.g. AES+SHA1, or AES-GCM) and leave all others as 
>> they are today.
>> A balance between simple solution, process support and better performance 
>> for the common
>> case.
>>
>> -Petri
>>
>>
>>
>> > -Original Message-
>> > From: lng-odp [mailto:lng-odp-boun...@lists.linaro.org] On Behalf Of Bill
>> > Fischofer
>> > Sent: Tuesday, December 12, 2017 3:23 AM
>> > To: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
>> > Cc: lng-odp@lists.linaro.org
>> > Subject: Re: [lng-odp] IPsec and crypto performance and OpenSSL
>> >
>> > I think we've pretty much abandoned the notion that linux-generic will
>> > support threads as separate processes as there seems to be little
>> > justification for it. The current plan is to continue this assumption in
>> > the "2.0" code base as well. So having OpenSSL rely on threads sharing the
>> > same address space should not be a problem in practice.
>> >
>> > Any platform that has native HW crypto capabilities would certainly use
>> > those in preference OpenSSL, so again such restrictions should not be of
>> > concern here.
>> >
>> > I agree, however, that this sort of tuning should be a follow-on activity,
>> > perhaps under the general performance improvement work we want for 2.0,
>> > but
>> > should not be a gating consideration for the Tiger Moth release.
>> >
>> > On Mon, Dec 11, 2017 at 5:19 PM, Dmitry Eremin-Solenikov <
>> > dmitry.ereminsoleni...@linaro.org> wrote:
>> >
>> > > On 11 December 2017 at 19:14, Maxim Uvarov <maxim.uva...@linaro.org>
>> > > wrote:
>> > > > odp_init_global() allocates shm, then odp_init_lo

[lng-odp] IPv6 packet L3 checksum status

2017-12-18 Thread Dmitry Eremin-Solenikov
Hello,

I was working on checksum parsing/status. What is the L3 checksum status
of IPv6 packets? Is it UNKNOWN (as there is no checksum) or OK (as in
NOT BAD)?

-- 
With best wishes
Dmitry


[lng-odp] IPsec: handling dummy packets (NH=59)

2017-11-20 Thread Dmitry Eremin-Solenikov
Hello,

I was thinking about another minor part of IPsec RFCs: dummy packets
used to mask traffic statistics. IPsec implementation is required to
drop ESP packets with NH = 59 (no next header) on receiver side and is
expected to be able to generate these packets on transmitter side.
Currently we do not provide a way to inject these packets in any way.

Possible solutions:

TX side:
 - Add API call to transmit single packet.

 - Extend transmit parameters to specify next header (IPv4, IPv6 or
NoNH) for each packet to be transmitted (per-packet or per-odp call).

 - ???

RX side:
 - Silently drop NoNH packets

 - Report NoNH packets to app via error or status event mechanism.

 - ???

-- 
With best wishes
Dmitry


Re: [lng-odp] drv api in api-next

2017-11-01 Thread Dmitry Eremin-Solenikov
On 31/10/17 22:21, Honnappa Nagarahalli wrote:
> But they are APIs, even though they were copied from Linux-generic. I
> am thinking the discussion has already happened on why they should be
> in API directory. Is there any reason to revert and restart the
> discussion?

They are used for 2.0, but are unused in linux-generic (at least in
TigerMoth). I'd vote to remove incomplete drv_* headers from TM. They
will come back through 2.0.

> On 30 October 2017 at 11:43, Maxim Uvarov  wrote:
>> In api-next we have some drv apis which is a copy of linux-generic but
>> with drv prefix. I'm thinking what to do with them for Tiger Moth. Or
>> merge them or merge and revert. For now we do not use that api.
>>
>> Maxim.


-- 
With best wishes
Dmitry


Re: [lng-odp] [Bug 3426] Support IPv6 Jumbo frames

2017-11-07 Thread Dmitry Eremin-Solenikov
I stumbled upon it as I was writing header parsing code for IPsec.


Re: [lng-odp] [PATCH API-NEXT v1] AES-GMAC implementation

2017-11-08 Thread Dmitry Eremin-Solenikov
updated


Re: [lng-odp] IPsec and crypto performance and OpenSSL

2017-12-11 Thread Dmitry Eremin-Solenikov
On 11 December 2017 at 19:14, Maxim Uvarov  wrote:
> odp_init_global() allocates shm, then odp_init_local() / odp_term_local()
> allocates/destroys per thread contexts in array in that shm. I think that
> has to work.

The problem lies in OpenSSL 1.1 "opaque structures" approach. They stopped
providing exact struct definitions which can be embedded somewhere. Another
option would be to switch to libnettle licensed under LGPL-2.1+. It may be
however less optimized compared to OpenSSL.

> On 11 December 2017 at 17:02, Francois Ozog 
> wrote:
>
>> I favor finishing ODP (ex 2.0) integration rather than optimizing
>> linux-generic at this stage.
>>
>> On 11 December 2017 at 14:39, Peltonen, Janne (Nokia - FI/Espoo) <
>> janne.pelto...@nokia.com> wrote:
>>
>> > Hi,
>> >
>> > When playing with IPsec I noticed that the Linux generic
>> > ODP implementation creates a separate OpenSSL crypto context
>> > for each crypto-operation as opposed to doing it at ODP
>> > crypto session creation. With IPsec this adds a lot of
>> > overhead for every packet processed and significantly
>> > reduces packet throughput.
>> >
>> > I wonder what, if anything, should be done about it.
>> >
>> > I already almost sent a patch to create and initialize
>> > crypto contexts only once per session but realized that
>> > it is not that easy.
>> >
>> > Here are some alternatives that came to my mind, but all
>> > of them have their own problems:
>> >
>> > a) Create per-thread OpenSSL contexts at crypto session
>> >creation time.
>> >- Does not work with ODP threads that do not share
>> >  their address space since OpenSSL is allocating
>> >  memory through malloc() during context creation.
>> >
>> > b) Do a) plus provide OpenSSL a custom memory allocator
>> >on top of shared memory.
>> >- There is no generic heap allocator in ODP code base.
>> >
>> > c) Create per-thread contexts lazily when needed.
>> >- Creation would work as it would happen in the right
>> >  thread but there would be no way to delete the
>> >  contexts. The thread destroying the ODP crypto
>> >  session cannot delete the per-thread contexts that
>> >  might reside in a different address spaces. That
>> >  thread could ask every other thread to do the
>> >  per-thread cleanup, except that there is no mechanism
>> >  for that without application assistance or big
>> >  changes in the generic ODP code.
>> >
>> > d) Create a limited-size cache of per-thread contexts.
>> >- This would allow postponing the deletion of each
>> >  context either to the point the cache slot needs
>> >  to be reused or all the way to ODP termination,
>> >  both occuring in the right thread. But this is
>> >  getting complicated and sizing the cache is nasty.
>> >
>> > Any thoughts?
>> >
>> > Janne
>> >
>> >
>> >
>>
>>
>> --
>> [image: Linaro] 
>> François-Frédéric Ozog | *Director Linaro Networking Group*
>> T: +33.67221.6485
>> francois.o...@linaro.org | Skype: ffozog
>>



-- 
With best wishes
Dmitry


Re: [lng-odp] IPsec and crypto performance and OpenSSL

2017-12-12 Thread Dmitry Eremin-Solenikov
On 12 December 2017 at 14:00, Peltonen, Janne (Nokia - FI/Espoo)
 wrote:
>> Also note that this will break explicit IV support.
>
> Why so? The iv is set in every operation.

Sorry, I meant implicit IV, when there is no override_iv_ptr, but IV
is 'kept' inside session.

-- 
With best wishes
Dmitry


[lng-odp] API-next branch

2017-10-25 Thread Dmitry Eremin-Solenikov
Hello,

I tried to actually check, which patches are sitting in the api-next.
And actually I failed
to do that in a timely manner. git cherry produces a list of patches,
that contains a lot of patches, which already landed to the master.

Quick proposal would be to stop using api-next as a long-lived branch
which received updates from master and rather use it as a branch being
regularly rebased on top of current master.

Another possiblity would be to abandon api-next completely, develop
features on topic branches, which get merged to master, rather than to
api-next. At least this would save us from situations, when there is
API definition (or change), but no actual implementation behind.

-- 
With best wishes
Dmitry


Re: [lng-odp] [PATCH API-NEXT v1 1/3] api: ipsec: rework ODP_IPSEC_SA_DISABLE into packet error

2017-10-24 Thread Dmitry Eremin-Solenikov
Hi,

On 24/10/17 15:49, Peltonen, Janne (Nokia - FI/Espoo) wrote:

Thank for the review!

>> @@ -927,7 +930,12 @@ typedef struct odp_ipsec_error_t {
>>
>>  } odp_ipsec_error_t;
>>
>> -/** IPSEC warnings */
>> +/** IPSEC warnings
>> + *
>> + * For outbound SAs in ODP_IPSEC_OP_MODE_INLINE mode warnings can be 
>> reported
>> + * only as status events. In all other cases warnings can be reported 
>> either as
>> + * a part of packet result or via separate ODP status event.
>> + */
> 
> Reporting warnings in the other cases either through packet result or status
> event is not according to Bill's summary and not consistent with the comments
> below.

Hmm, true. Changed to stricter specification.


-- 
With best wishes
Dmitry


Re: [lng-odp] [PATCH API-NEXT v2 1/3] api: ipsec: rework ODP_IPSEC_SA_DISABLE into packet error

2017-10-25 Thread Dmitry Eremin-Solenikov
> delete "either" and reflow comment.

done



Re: [lng-odp] drv api in api-next

2017-10-31 Thread Dmitry Eremin-Solenikov
On 30/10/17 19:43, Maxim Uvarov wrote:
> In api-next we have some drv apis which is a copy of linux-generic but
> with drv prefix. I'm thinking what to do with them for Tiger Moth. Or
> merge them or merge and revert. For now we do not use that api.

I'd say, let's revert that for now. Implementation in master is far from
being complete. We can reintroduce them later.

-- 
With best wishes
Dmitry


Re: [lng-odp] Debian package for ODP

2018-04-28 Thread Dmitry Eremin-Solenikov
Hi,

On 28 April 2018 at 13:59, Dmitry Eremin-Solenikov
<dmitry.ereminsoleni...@linaro.org> wrote:
> Current package review is handled in Debian bug 896970:
>
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=896970

And just for the reference. ODP-DPDK preview (basing on Matias' merge branch)
is also uploaded to mentors.d.n: https://mentors.debian.net/package/odp-dpdk


-- 
With best wishes
Dmitry


[lng-odp] TigerMoth_LTS brach

2018-04-28 Thread Dmitry Eremin-Solenikov
Hello, Maxim,

Could you please start pushing pending fixes to tigermoth_lts branch, so that
they can be picked into packaging?

-- 
With best wishes
Dmitry


[lng-odp] Debian package for ODP

2018-04-28 Thread Dmitry Eremin-Solenikov
Hello,

Current package review is handled in Debian bug 896970:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=896970

-- 
With best wishes
Dmitry


Re: [lng-odp] Debian package for ODP

2018-04-28 Thread Dmitry Eremin-Solenikov
Hello,

On 28 April 2018 at 14:28, Maxim Uvarov <maxim.uva...@linaro.org> wrote:
> Nice,
>
> might be better to have common examples with abi-compat mode, so they will
> not depend on platfrom.

Of course packages are built in ABI-compat mode. That is the whole point.

>
> Maxim.
>
> On 28 April 2018 at 13:59, Dmitry Eremin-Solenikov
> <dmitry.ereminsoleni...@linaro.org> wrote:
>>
>> Hello,
>>
>> Current package review is handled in Debian bug 896970:
>>
>> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=896970
>>
>> --
>> With best wishes
>> Dmitry
>
>



-- 
With best wishes
Dmitry


Re: [lng-odp] TigerMoth_LTS brach

2018-04-28 Thread Dmitry Eremin-Solenikov
Hi,

On 28 April 2018 at 16:44, Bill Fischofer  wrote:
> If we're going to be doing formal distributions each of these should have
> their own branch which are created off of the main base release branch. So
> TigerMoth_LTS is the "master" branch and it can have sub-branches for
> various distributions created from it. This permits distributions to control
> which service level(s) are included as well as handling distribution-unique
> service items or other issues.

This seems too complicated. Why would we have special branches for
individual distributions? We should have separate single tigermoth_lts
branch. It should have commits cherry-picked from master, that are
suiatable for stable releases (suitability depends on exact 'stable' or
'lts' definition). From my point of view these commits should contain only
bugfixes without any additional changes.

-- 
With best wishes
Dmitry


Re: [lng-odp] Debian package for ODP

2018-04-28 Thread Dmitry Eremin-Solenikov
On 28 April 2018 at 16:05, Maxim Uvarov <maxim.uva...@linaro.org> wrote:
>
>
> On 28 April 2018 at 14:38, Dmitry Eremin-Solenikov
> <dmitry.ereminsoleni...@linaro.org> wrote:
>>
>> Hello,
>>
>> On 28 April 2018 at 14:28, Maxim Uvarov <maxim.uva...@linaro.org> wrote:
>> > Nice,
>> >
>> > might be better to have common examples with abi-compat mode, so they
>> > will
>> > not depend on platfrom.
>>
>> Of course packages are built in ABI-compat mode. That is the whole point.
>>
>
> in that case package name for examples can not include platform name.

odp-linux-examples uses platform name (odp-linux) rather than implementation
name (odp-generic).

>
>>
>> >
>> > Maxim.
>> >
>> > On 28 April 2018 at 13:59, Dmitry Eremin-Solenikov
>> > <dmitry.ereminsoleni...@linaro.org> wrote:
>> >>
>> >> Hello,
>> >>
>> >> Current package review is handled in Debian bug 896970:
>> >>
>> >> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=896970
>> >>
>> >> --
>> >> With best wishes
>> >> Dmitry
>> >
>> >
>>
>>
>>
>> --
>> With best wishes
>> Dmitry
>
>



-- 
With best wishes
Dmitry


[lng-odp] Updated ODP packages

2018-05-30 Thread Dmitry Eremin-Solenikov
Hello,

I've uploaded next iteration of ODP/ODP-DPDK Debian packages to
people.linaro.org. You can download them after adding following
strings
to your apt sources.list:

deb https://people.linaro.org/~dmitry.ereminsolenikov unstable main
deb-src https://people.linaro.org/~dmitry.ereminsolenikov unstable main

You might need to add my GnuPG key to apt-add. For the reference it is
attached to this email.

-- 
With best wishes
Dmitry


lumag.key
Description: application/iwork-keynote-sffkey


[lng-odp] odp tools manpages

2018-06-05 Thread Dmitry Eremin-Solenikov
Hello,

To finish ODP packaging work I have to provide manpages for ODP tools
that are going to be packages. I've written manpages for odp_hello and
odp_crypto, however
I'm asking for the help in writing manpages for l2fwd/l3fwd/generator.
Could you please help me by sketching clean descriptions of what these
tools do, that I can put into manpage?

-- 
With best wishes
Dmitry


Re: [lng-odp] unrecognized command line option '-fstack-protector-strong'

2018-06-27 Thread Dmitry Eremin-Solenikov
On 27/06/18 18:41, Maxim Uvarov wrote:
> Ubuntu 14.04.5 which I run in container uses gcc 4.8 but on host I use more
> fresh Ubuntu kernel compiled with stack protector. That makes dpdk modules
> not compatible.  But it's not clear why dpdk modules inherit kernels
> compiler options. Is there any workaround for that?

- Check which gcc was used when compiling kernel
- Use that gcc version instead of default one.

Or:

- Disable IGB kernel module in DPDK .config

>   LD
> /root/dpdk/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/igb_uio/built-in.o
>   CC [M]
> /root/dpdk/x86_64-native-linuxapp-gcc/build/lib/librte_eal/linuxapp/igb_uio/igb_uio.o
> gcc: error: unrecognized command line option '-fstack-protector-strong'
-- 
With best wishes
Dmitry


Re: [lng-odp] TigerMoth_LTS brach

2018-04-28 Thread Dmitry Eremin-Solenikov
Hi,

On 28 April 2018 at 20:32, Bill Fischofer  wrote:
>
> Distributions have unique packaging. What if that packaging needs to be
> changed either because of an error in creating it or else a change in
> packaging requirements on the part of the distro?

It is handled by a distro itself. We support neither deb nor rpm packages.

-- 
With best wishes
Dmitry


Re: [lng-odp] Debian package for ODP

2018-04-28 Thread Dmitry Eremin-Solenikov
Hello,

On 28 April 2018 at 21:58, Maxim Uvarov  wrote:
> Thanks. What are the next steps in upstreaming it to debian? How we can help
> with it?

It would be nice to have team's feedback on providing test tools/examples
on target platform. I'll upload final odp-dpdk packages once 1.19 is
tagged there
Other than that I think no help is required.

-- 
With best wishes
Dmitry


Re: [lng-odp] [PATCH API-NEXT v4 1/3] api: ipsec: rework ODP_IPSEC_SA_DISABLE into packet error

2017-10-26 Thread Dmitry Eremin-Solenikov
On 26/10/17 14:55, 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: Wednesday, October 25, 2017 12:00 PM
>> To: lng-odp@lists.linaro.org
>> Subject: [lng-odp] [PATCH API-NEXT v4 1/3] api: ipsec: rework
>> ODP_IPSEC_SA_DISABLE into packet error
>>
>> From: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
>>
>> According to the discussion on mailing list, most of implementations
>> will not be able to support odp_ipsec_sa_disable() status event
>> directly.  Instead they will submit a dummy packet to that SA. Then
>> after receiving this packet after odp_ipsec_result() will detect this
>> packet and will report it as a packet with
>> odp_ipsec_error_t->sa_disabled bit set.
>>
>> Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
>> Cc: Nikhil Agarwal <nikhil.agar...@linaro.org>
>> Cc: Balasubramanian Manoharan <bala.manoha...@linaro.org>
>> ---
>> /** Email created from pull request 256 (lumag:ipsec_sa_disable_v2)
>>  ** https://github.com/Linaro/odp/pull/256
>>  ** Patch: https://github.com/Linaro/odp/pull/256.patch
>>  ** Base sha: 825f75ed8644ef57c5648961e7982daf13cd9375
>>  ** Merge commit sha: ba520d0a3f4c46777c7aedca029e9979a89c69e7
>>  **/
>>  include/odp/api/spec/ipsec.h | 44 ---
>> -
>>  1 file changed, 20 insertions(+), 24 deletions(-)
>>
>> diff --git a/include/odp/api/spec/ipsec.h b/include/odp/api/spec/ipsec.h
>> index 26e852fca..b9ad282ce 100644
>> --- a/include/odp/api/spec/ipsec.h
>> +++ b/include/odp/api/spec/ipsec.h
>> @@ -843,10 +843,12 @@ odp_ipsec_sa_t odp_ipsec_sa_create(const
>> odp_ipsec_sa_param_t *param);
>>   *
>>   * 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.
>> + * artificial packet event sent to the queue specified for the SA having
>> + * sa_disabled error bit set in the odp_ipsec_packet_result_t returned by
>> + * odp_ipsec_result(). The packet 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. No packets
>> will come
>> + * from SA after this one.
> 
> This still lacks the definition of what is the difference between an 
> artificial packet vs a normal packet. We could define it e.g. by saying that 
> length is always zero and application must not do anything else with it than 
> free it. But then, why it's a packet anyway? Why it would not then be e.g. a 
> ipsec status event (which is not a packet, but could be implemented as an 
> artificial packet).

No difference from my POV. Processing path for all packets coming from
IPsec:
- Error packet. Process error flags, drop the packet.
- Not an error. Process warning flags, forward the packet.

> 
> The idea of event type vs sub-event type is that:
>  1) all events of the same base type (e.g. packet) contain the same metadata 
> and can be processed the same way. For example, someone may write a generic 
> packet statistics (application) module, and plug that before and after an 
> ipsec termination (application) module, without need to know that packets 
> before ipsec module carry extra ipsec metadata (from inline inbound ipsec).

As long as they don't carry error flag. odp_packet_has_error(), etc.
BTW: I should check that my implementation sets that flag.

>  2) sub-type adds metadata and other properties to the base type
> 
> An artificial packet would not fit in either category, it would be a 
> non-packet.

I somewhat agree with you here. I would prefer separate event for
SA_DISABLE. However some (most?) hardware ATM will not be able to
support such an event directly. And an application will need separate
processing for error packets anyway.

> Usually, application receives multiple event types anyway: e.g. packets and 
> timeouts. So, for application it would not be an issue to have one additional 
> switch-case for IPSEC status events. API integrity is more important than 
> (potential) save of couple if-else branches.

It is not a problem of application, but rather an implementation problem.

> So, I think this solution is not complete yet and I don't see how it would in 
> the end make a real difference to the current status event API.



-- 
With best wishes
Dmitry


Re: [lng-odp] odp api to query free/tottal ram

2017-10-23 Thread Dmitry Eremin-Solenikov
On 23/10/17 10:39, Maxim Uvarov wrote:
> It might be reasonable to add also api call to get return free memory. So
> that application can adjust pools /buffers size according to hardware or VM
> settings. Which might be good fit for NFV set up.
> Any opinions on that?

It would depend on the platform too much. Also remember, that in some
cases buffers/packets will use separate memory, not main RAM.

-- 
With best wishes
Dmitry


[lng-odp] [PATCH v10 01/30] travis: also run make distcheck in non-ABI-compat mode

2017-10-27 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 .travis.yml | 8 
 1 file changed, 8 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index 49b922e3cdba..fdeeefd113ea 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -244,6 +244,14 @@ jobs:
   - ./configure --prefix=$HOME/odp-install
 --enable-user-guides
   - sudo PATH="$PATH" 
LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" make 
distcheck
+- stage: test
+  env: TEST=distcheck-non-abi
+  compiler: gcc
+  script:
+  - ./bootstrap
+  - ./configure --prefix=$HOME/odp-install
+--enable-user-guides
+  - sudo PATH="$PATH" 
LD_LIBRARY_PATH="$HOME/cunit-install/$CROSS_ARCH/lib:$LD_LIBRARY_PATH" make 
distcheck DISTCHECK__CONFIGURE_FLAGS=--disable-abi-compat
 - stage: test
   env: TEST=doxygen
   compiler: gcc
-- 
2.14.2



[lng-odp] [PATCH v10 11/30] abi: queue: drop unused odp_queue_group_t

2017-10-27 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/odp/api/spec/queue.h   |  5 -
 platform/linux-generic/include/odp/api/queue.h | 12 
 2 files changed, 17 deletions(-)

diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h
index 73598be06d93..3cd99a9f3035 100644
--- a/include/odp/api/spec/queue.h
+++ b/include/odp/api/spec/queue.h
@@ -32,11 +32,6 @@ extern "C" {
  * ODP queue
  */
 
-/**
- * @typedef odp_queue_group_t
- * Queue group instance type
- */
-
 /**
  * @def ODP_QUEUE_INVALID
  * Invalid queue
diff --git a/platform/linux-generic/include/odp/api/queue.h 
b/platform/linux-generic/include/odp/api/queue.h
index adceafbd1c3b..f958ff5140c8 100644
--- a/platform/linux-generic/include/odp/api/queue.h
+++ b/platform/linux-generic/include/odp/api/queue.h
@@ -23,18 +23,6 @@ extern "C" {
 #include 
 #include 
 
-/** @ingroup odp_queue
- *  @{
- */
-
-/* REMOVE FROM API SPEC. Typedef needed only for suppressing Doxygen
- * warning. */
-typedef void odp_queue_group_t;
-
-/**
- * @}
- */
-
 #include 
 
 #ifdef __cplusplus
-- 
2.14.2



[lng-odp] [PATCH v10 12/30] abi: classification: drop two unused types

2017-10-27 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/odp/api/spec/classification.h   | 11 ---
 platform/linux-generic/include/odp/api/classification.h | 13 -
 2 files changed, 24 deletions(-)

diff --git a/include/odp/api/spec/classification.h 
b/include/odp/api/spec/classification.h
index 0c4a95c5f6e7..d0d51d1fb2b8 100644
--- a/include/odp/api/spec/classification.h
+++ b/include/odp/api/spec/classification.h
@@ -30,11 +30,6 @@ extern "C" {
  * ODP Class of service handle
  */
 
-/**
- * @typedef odp_flowsig_t
- * flow signature type, only used for packet metadata field.
- */
-
 /**
  * @def ODP_COS_INVALID
  * This value is returned from odp_cls_cos_create() on failure,
@@ -389,12 +384,6 @@ int odp_cos_with_l3_qos(odp_pktio_t pktio_in,
odp_bool_t l3_preference);
 
 
-/**
- * @typedef odp_cos_flow_set_t
- * Set of header fields that take part in flow signature hash calculation:
- * bit positions per odp_cos_hdr_flow_fields_t enumeration.
- */
-
 /**
  * @typedef odp_pmr_t
  * PMR - Packet Matching Rule
diff --git a/platform/linux-generic/include/odp/api/classification.h 
b/platform/linux-generic/include/odp/api/classification.h
index 2ba6eb0eb6b0..377d1a02f7e8 100644
--- a/platform/linux-generic/include/odp/api/classification.h
+++ b/platform/linux-generic/include/odp/api/classification.h
@@ -24,19 +24,6 @@ extern "C" {
 #include 
 #include 
 
-/** @ingroup odp_classification
- *  @{
- */
-
-/* REMOVE THESE FROM API SPEC. Typedefs needed only for suppressing Doxygen
- * warning. */
-typedef void odp_flowsig_t;
-typedef void odp_cos_flow_set_t;
-
-/**
- * @}
- */
-
 #include 
 
 #ifdef __cplusplus
-- 
2.14.2



[lng-odp] [PATCH v10 09/30] include: install ABI headers without additional ARCH_ABI level

2017-10-27 Thread Dmitry Eremin-Solenikov
Install ABI headers directly to odp/api/abi, removing the need for extra
symlink.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am | 12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/include/Makefile.am b/include/Makefile.am
index 5328133dd4e4..d841e65b8795 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -110,7 +110,7 @@ odpapiabidefaultinclude_HEADERS = \
odp/api/abi-default/queue.h \
odp/api/abi-default/shared_memory.h
 
-odpapiabiarchincludedir= $(includedir)/odp/arch/@ARCH_ABI@/odp/api/abi
+odpapiabiarchincludedir= $(includedir)/odp/api/abi
 if ARCH_IS_ARM
 odpapiabiarchinclude_HEADERS = \
odp/arch/arm32-linux/odp/api/abi/atomic.h \
@@ -322,16 +322,6 @@ odpapiabiarchinclude_HEADERS = \
odp/arch/x86_64-linux/odp/api/abi/version.h
 endif
 
-# Create symlink for ABI header files. Application does not need to use the 
arch
-# specific include path for installed files.
-install-data-hook:
-   if [ -h $(DESTDIR)$(prefix)/include/odp/api/abi ]; then \
-   : ; \
-   else \
-   $(LN_S) -rf 
$(DESTDIR)$(prefix)/include/odp/arch/@ARCH_ABI@/odp/api/abi \
-   $(DESTDIR)$(prefix)/include/odp/api/abi; \
-   fi
-
 # Rerefence all nodist_*_HEADERS here
 .PHONY: $(nodist_odpapispecinclude_HEADERS)
 $(nodist_odpapispecinclude_HEADERS):
-- 
2.14.2



[lng-odp] [PATCH v10 17/30] linux-gen: atomic: simplify locked 64-bit support

2017-10-27 Thread Dmitry Eremin-Solenikov
Rewrite atomic_types.h/atomic_inlines.h to clearly separate simple
(common) and locked 64-bit cases. This is allows us to ease switching of
atomic header to abi setup.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 .../include/odp/api/plat/atomic_inlines.h  | 315 +
 .../include/odp/api/plat/atomic_types.h|  58 ++--
 .../linux-generic/include/odp_atomic_internal.h| 208 ++
 3 files changed, 364 insertions(+), 217 deletions(-)

diff --git a/platform/linux-generic/include/odp/api/plat/atomic_inlines.h 
b/platform/linux-generic/include/odp/api/plat/atomic_inlines.h
index 03b2884fdfca..1c58c77db993 100644
--- a/platform/linux-generic/include/odp/api/plat/atomic_inlines.h
+++ b/platform/linux-generic/include/odp/api/plat/atomic_inlines.h
@@ -109,177 +109,254 @@ _ODP_INLINE void odp_atomic_min_u32(odp_atomic_u32_t 
*atom, uint32_t new_min)
}
 }
 
+#ifdef ODP_ATOMIC_U64_LOCK
+
+/**
+ * @internal
+ * CAS operation expression for the ATOMIC_OP macro
+ */
+#define ATOMIC_CAS_OP(ret_ptr, old_val, new_val) \
+({ \
+   if (atom->v == (old_val)) { \
+   atom->v = (new_val); \
+   *(ret_ptr) = 1; \
+   } else { \
+   *(ret_ptr) = 0; \
+   } \
+})
+
+/**
+ * @internal
+ * Helper macro for lock-based atomic operations on 64-bit integers
+ * @param[in,out] atom Pointer to the 64-bit atomic variable
+ * @param expr Expression used update the variable.
+ * @return The old value of the variable.
+ */
+#define ATOMIC_OP(atom, expr) \
+({ \
+   uint64_t _old_val; \
+   /* Loop while lock is already taken, stop when lock becomes clear */ \
+   while (__atomic_test_and_set(&(atom)->lock, __ATOMIC_ACQUIRE)) \
+   (void)0; \
+   _old_val = (atom)->v; \
+   (expr); /* Perform whatever update is desired */ \
+   __atomic_clear(&(atom)->lock, __ATOMIC_RELEASE); \
+   _old_val; /* Return old value */ \
+})
+
 _ODP_INLINE void odp_atomic_init_u64(odp_atomic_u64_t *atom, uint64_t val)
 {
atom->v = val;
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
__atomic_clear(>lock, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE uint64_t odp_atomic_load_u64(odp_atomic_u64_t *atom)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
return ATOMIC_OP(atom, (void)0);
-#else
-   return __atomic_load_n(>v, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE void odp_atomic_store_u64(odp_atomic_u64_t *atom, uint64_t val)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
(void)ATOMIC_OP(atom, atom->v = val);
-#else
-   __atomic_store_n(>v, val, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE uint64_t odp_atomic_fetch_add_u64(odp_atomic_u64_t *atom,
  uint64_t val)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
return ATOMIC_OP(atom, atom->v += val);
-#else
-   return __atomic_fetch_add(>v, val, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE void odp_atomic_add_u64(odp_atomic_u64_t *atom, uint64_t val)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
(void)ATOMIC_OP(atom, atom->v += val);
-#else
-   (void)__atomic_fetch_add(>v, val, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE uint64_t odp_atomic_fetch_sub_u64(odp_atomic_u64_t *atom,
  uint64_t val)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
return ATOMIC_OP(atom, atom->v -= val);
-#else
-   return __atomic_fetch_sub(>v, val, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE void odp_atomic_sub_u64(odp_atomic_u64_t *atom, uint64_t val)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
(void)ATOMIC_OP(atom, atom->v -= val);
-#else
-   (void)__atomic_fetch_sub(>v, val, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE uint64_t odp_atomic_fetch_inc_u64(odp_atomic_u64_t *atom)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
return ATOMIC_OP(atom, atom->v++);
-#else
-   return __atomic_fetch_add(>v, 1, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE void odp_atomic_inc_u64(odp_atomic_u64_t *atom)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
(void)ATOMIC_OP(atom, atom->v++);
-#else
-   (void)__atomic_fetch_add(>v, 1, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE uint64_t odp_atomic_fetch_dec_u64(odp_atomic_u64_t *atom)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
return ATOMIC_OP(atom, atom->v--);
-#else
-   return __atomic_fetch_sub(>v, 1, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE void odp_atomic_dec_u64(odp_atomic_u64_t *atom)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
(void)ATOMIC_OP(atom, atom->v--);
-#else
-   (void)__atomic_fetch_sub(>v, 1, __ATOMIC_RELAXED);
-#endif
 }
 
 _ODP_INLINE int odp_atomic_cas_u64(odp_atomic_u64_t *atom, uint64_t *old_val,
   uint64_t new_val)
 {
-#if __GCC_ATOMIC_LLONG_LOCK_FREE < 2
int ret;
*old_val

[lng-odp] [PATCH v10 24/30] linux-gen, include: switch packet headers to api+abi

2017-10-27 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am|  6 ++
 .../include => include}/odp/api/classification.h   |  2 +-
 .../include => include}/odp/api/crypto.h   |  2 +-
 .../include => include}/odp/api/packet.h   | 11 +---
 .../include => include}/odp/api/packet_flags.h |  9 +--
 .../include => include}/odp/api/packet_io.h|  6 +-
 .../include => include}/odp/api/packet_io_stats.h  |  4 +-
 platform/linux-generic/Makefile.am | 12 ++--
 .../linux-generic/include-abi/odp/api/abi/packet.h | 68 ++
 .../include-abi/odp/api/abi/packet_flags.h | 27 +
 .../include/odp/api/plat/packet_flag_inlines.h | 19 +-
 .../plat/{packet_types.h => packet_inline_types.h} | 53 +
 .../include/odp/api/plat/packet_inlines.h  | 27 +++--
 .../linux-generic/include/odp_packet_internal.h|  3 +-
 platform/linux-generic/odp_packet.c|  2 +-
 platform/linux-generic/pktio/dpdk.c|  2 +-
 platform/linux-generic/pktio/netmap.c  |  2 +-
 17 files changed, 136 insertions(+), 119 deletions(-)
 rename {platform/linux-generic/include => include}/odp/api/classification.h 
(93%)
 rename {platform/linux-generic/include => include}/odp/api/crypto.h (92%)
 rename {platform/linux-generic/include => include}/odp/api/packet.h (67%)
 rename {platform/linux-generic/include => include}/odp/api/packet_flags.h (59%)
 rename {platform/linux-generic/include => include}/odp/api/packet_io.h (83%)
 rename {platform/linux-generic/include => include}/odp/api/packet_io_stats.h 
(79%)
 create mode 100644 platform/linux-generic/include-abi/odp/api/abi/packet.h
 create mode 100644 
platform/linux-generic/include-abi/odp/api/abi/packet_flags.h
 rename platform/linux-generic/include/odp/api/plat/{packet_types.h => 
packet_inline_types.h} (76%)

diff --git a/include/Makefile.am b/include/Makefile.am
index addf4bc92261..4ef4d89185d0 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -10,8 +10,10 @@ odpapiinclude_HEADERS = \
odp/api/buffer.h \
odp/api/byteorder.h \
odp/api/chksum.h \
+   odp/api/classification.h \
odp/api/compiler.h \
odp/api/cpumask.h \
+   odp/api/crypto.h \
odp/api/deprecated.h \
odp/api/errno.h \
odp/api/event.h \
@@ -20,6 +22,10 @@ odpapiinclude_HEADERS = \
odp/api/hints.h \
odp/api/init.h \
odp/api/ipsec.h \
+   odp/api/packet.h \
+   odp/api/packet_flags.h \
+   odp/api/packet_io.h \
+   odp/api/packet_io_stats.h \
odp/api/pool.h \
odp/api/queue.h \
odp/api/random.h \
diff --git a/platform/linux-generic/include/odp/api/classification.h 
b/include/odp/api/classification.h
similarity index 93%
rename from platform/linux-generic/include/odp/api/classification.h
rename to include/odp/api/classification.h
index 01be7063d102..ecdf92031d0a 100644
--- a/platform/linux-generic/include/odp/api/classification.h
+++ b/include/odp/api/classification.h
@@ -20,7 +20,7 @@ extern "C" {
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/platform/linux-generic/include/odp/api/crypto.h 
b/include/odp/api/crypto.h
similarity index 92%
rename from platform/linux-generic/include/odp/api/crypto.h
rename to include/odp/api/crypto.h
index ead28eab0bfc..3f4104677201 100644
--- a/platform/linux-generic/include/odp/api/crypto.h
+++ b/include/odp/api/crypto.h
@@ -18,7 +18,7 @@ extern "C" {
 #endif
 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/platform/linux-generic/include/odp/api/packet.h 
b/include/odp/api/packet.h
similarity index 67%
rename from platform/linux-generic/include/odp/api/packet.h
rename to include/odp/api/packet.h
index 5d744df544d6..88c4f0278c84 100644
--- a/platform/linux-generic/include/odp/api/packet.h
+++ b/include/odp/api/packet.h
@@ -10,8 +10,8 @@
  * ODP packet descriptor
  */
 
-#ifndef ODP_PLAT_PACKET_H_
-#define ODP_PLAT_PACKET_H_
+#ifndef ODP_API_PACKET_H_
+#define ODP_API_PACKET_H_
 
 #ifdef __cplusplus
 extern "C" {
@@ -20,15 +20,10 @@ extern "C" {
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
-#include 
-#if ODP_ABI_COMPAT == 0
-#include 
-#endif
-
 #include 
 
 #ifdef __cplusplus
diff --git a/platform/linux-generic/include/odp/api/packet_flags.h 
b/include/odp/api/packet_flags.h
similarity index 59%
rename from platform/linux-generic/include/odp/api/packet_flags.h
rename to include/odp/api/packet_flags.h
index 1e55af823736..2b3006b5192c 100644
--- a/platform/linux-generic/include/odp/api/packet_flags.h
+++ b/include/odp/api/packet_flags.h
@@ -10,17 +10,14 @@
  * ODP packet flags
  */
 
-#ifndef ODP_PLAT_PACKET_FLAGS_H_
-#define ODP_PLAT_PACKET_FLAGS_H_
+#ifndef O

[lng-odp] [PATCH v10 30/30] include: provide formal description of ODP specification

2017-10-27 Thread Dmitry Eremin-Solenikov
Provide formal description of files being part of ODP specification,
platform-specific headers, substituting parts of ODP specification and
additional headers supplementing ODP specification.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/README | 77 ++
 1 file changed, 77 insertions(+)
 create mode 100644 include/README

diff --git a/include/README b/include/README
new file mode 100644
index ..8f13dbad68e5
--- /dev/null
+++ b/include/README
@@ -0,0 +1,77 @@
+ODP specification
+=
+
+ODP specification consists of several types of files, which together provide
+full list of types, values and functions that ODP implemention MUST provide.
+
+ODP API specification
+-
+
+These are the files from `include/odp/api/spec` directory. They specify a set
+of function prototypes, types, type names, enumerations etc that MUST be
+provided by ODP implementation. Doxygen comments inside these files document
+requirements for ABI interface provided by an implementation. An implementation
+MUST use these headers AS IS, without any modifications to be compatible with
+ODP specification.
+
+ODP ABI compatibility specification
+---
+
+These are the files from `include/odp/arch/@ARCH_ABI@/odp/api/abi/` directory.
+They specify a set of types and values that MUST be used AS IS without any
+modifications by an implementation if it supports and is compiled for
+ABI-compatibility mode.
+
+ODP default ABI headers
+---
+
+These are the files from `include/odp/api/abi-default` directory. They provide
+default specification for ODP types and values for ABI compatibility. CPU
+architecture specific ABI compatibility files heavily depend on these headers.
+These files MUST NOT be changed by an implementation.
+
+odp_api.h header
+
+
+This header found at `include/odp_api.h` is an entry point for an application.
+Application MUST include only odp_api.h, nothing else. This file includes all
+files from ODP specification.
+
+Additional ODP headers
+==
+
+These are the headers provided by an ODP to supplement ODP specification.
+
+ODP API headers
+---
+
+These are the files from `include/odp/api` directory. They glue together API
+and ABI specification headers. Although they are not part of ODP specification
+itself, they provide an easy way for an implementation to use ODP API/ABI
+header files.  An implementation SHOULD use these headers AS IS unless it has
+strong reason not to do so.
+
+Platform-specific headers
+=
+
+Platform ABI headers
+
+
+These are the headers found at
+`platform/@with_platform@/include-abi/odp/api/abi` directory. They are used by
+the reset of ODP code if implementation is compiled with ABI compatibility
+disabled. They should implement at least a set of types and values documented
+in ODP API specification headers. They are permitted to provide any platform
+specific optimizations (i.e. they might provide types and/or values that map
+directly onto the hardware details, they might provide inline functions to
+speed up execution of the application, etc). These headers MAY use ODP default
+ABI headers if they do fit.
+
+Rest of platform-specific headers
+-
+
+Platform MAY provide additional headers at `platform/@with_platform/include`.
+However these headers SHOULD NOT be used directly by an application, because
+this will tie it to the exact implementation details. Application MUST include
+only  header.  Platform ABI headers MAY use these headers to
+implement platform-specific optimizations.
-- 
2.14.2



[lng-odp] [PATCH v10 10/30] include: install and use ABI headers only in ABI-compat mode

2017-10-27 Thread Dmitry Eremin-Solenikov
There is no need to install ABI headers (or to have them in include
path) in non-ABI-compat mode, they should not be used at all. Still
provide default ABI headers, because platform may depend on them.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 Makefile.inc| 6 +-
 include/Makefile.am | 4 
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Makefile.inc b/Makefile.inc
index 10e4041fe662..11fc7c759c85 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -3,9 +3,13 @@ ODP_INCLUDES = \
-I$(top_srcdir)/platform/@with_platform@/include \
-I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
-I$(top_builddir)/include \
-   -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
-I$(top_srcdir)/include
 
+if ODP_ABI_COMPAT
+ODP_INCLUDES += \
+   -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@
+endif
+
 HELPER_INCLUDES = \
-I$(top_srcdir)/helper/include
 
diff --git a/include/Makefile.am b/include/Makefile.am
index d841e65b8795..9437f5f68d5a 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -110,6 +110,9 @@ odpapiabidefaultinclude_HEADERS = \
odp/api/abi-default/queue.h \
odp/api/abi-default/shared_memory.h
 
+# Insall ABI headers only if required
+if ODP_ABI_COMPAT
+
 odpapiabiarchincludedir= $(includedir)/odp/api/abi
 if ARCH_IS_ARM
 odpapiabiarchinclude_HEADERS = \
@@ -321,6 +324,7 @@ odpapiabiarchinclude_HEADERS = \
odp/arch/x86_64-linux/odp/api/abi/traffic_mngr.h \
odp/arch/x86_64-linux/odp/api/abi/version.h
 endif
+endif # ODP_ABI_COMPAT
 
 # Rerefence all nodist_*_HEADERS here
 .PHONY: $(nodist_odpapispecinclude_HEADERS)
-- 
2.14.2



[lng-odp] [PATCH v10 14/30] api: schedule: remove duplication between schedule and schedule_types

2017-10-27 Thread Dmitry Eremin-Solenikov
Move the rest of ODP_SCHED_GROUP_* defines to schedule_types.h to remove
duplication between headers.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/odp/api/abi-default/schedule.h   |  8 
 include/odp/api/abi-default/schedule_types.h |  8 
 include/odp/api/spec/schedule.h  | 20 
 include/odp/api/spec/schedule_types.h| 10 ++
 4 files changed, 18 insertions(+), 28 deletions(-)

diff --git a/include/odp/api/abi-default/schedule.h 
b/include/odp/api/abi-default/schedule.h
index 27f9b3a2bf7d..009b14ecb49a 100644
--- a/include/odp/api/abi-default/schedule.h
+++ b/include/odp/api/abi-default/schedule.h
@@ -26,14 +26,6 @@ extern "C" {
 #define ODP_SCHED_WAIT UINT64_MAX
 #define ODP_SCHED_NO_WAIT  0
 
-typedef int odp_schedule_group_t;
-
-/* These must be kept in sync with thread_globals_t in odp_thread.c */
-#define ODP_SCHED_GROUP_INVALID ((odp_schedule_group_t)-1)
-#define ODP_SCHED_GROUP_ALL 0
-#define ODP_SCHED_GROUP_WORKER  1
-#define ODP_SCHED_GROUP_CONTROL 2
-
 #define ODP_SCHED_GROUP_NAME_LEN 32
 
 /**
diff --git a/include/odp/api/abi-default/schedule_types.h 
b/include/odp/api/abi-default/schedule_types.h
index f71df37ce430..10065a98c7f7 100644
--- a/include/odp/api/abi-default/schedule_types.h
+++ b/include/odp/api/abi-default/schedule_types.h
@@ -37,6 +37,14 @@ typedef int odp_schedule_sync_t;
 #define ODP_SCHED_SYNC_ATOMIC   1
 #define ODP_SCHED_SYNC_ORDERED  2
 
+typedef int odp_schedule_group_t;
+
+/* These must be kept in sync with thread_globals_t in odp_thread.c */
+#define ODP_SCHED_GROUP_INVALID ((odp_schedule_group_t)-1)
+#define ODP_SCHED_GROUP_ALL 0
+#define ODP_SCHED_GROUP_WORKER  1
+#define ODP_SCHED_GROUP_CONTROL 2
+
 /**
  * @}
  */
diff --git a/include/odp/api/spec/schedule.h b/include/odp/api/spec/schedule.h
index 524449647b0c..8c55b4ec2ba5 100644
--- a/include/odp/api/spec/schedule.h
+++ b/include/odp/api/spec/schedule.h
@@ -45,26 +45,6 @@ extern "C" {
  * Maximum schedule group name length in chars including null char
  */
 
-/**
- * @def ODP_SCHED_GROUP_INVALID
- * Invalid scheduler group
- */
-
-/**
- * @def ODP_SCHED_GROUP_ALL
- * Predefined scheduler group of all threads
- */
-
-/**
- * @def ODP_SCHED_GROUP_WORKER
- * Predefined scheduler group of all worker threads
- */
-
-/**
- * @def ODP_SCHED_GROUP_CONTROL
- * Predefined scheduler group of all control threads
- */
-
 /**
  * Schedule wait time
  *
diff --git a/include/odp/api/spec/schedule_types.h 
b/include/odp/api/spec/schedule_types.h
index e0dc4027b91b..a13cc4f13317 100644
--- a/include/odp/api/spec/schedule_types.h
+++ b/include/odp/api/spec/schedule_types.h
@@ -112,6 +112,11 @@ extern "C" {
  * Scheduler thread group
  */
 
+/**
+ * @def ODP_SCHED_GROUP_INVALID
+ * Invalid scheduler group
+ */
+
 /**
  * @def ODP_SCHED_GROUP_ALL
  * Group of all threads. All active worker and control threads belong to this
@@ -126,6 +131,11 @@ extern "C" {
  * old threads exit ODP.
  */
 
+/**
+ * @def ODP_SCHED_GROUP_CONTROL
+ * Predefined scheduler group of all control threads
+ */
+
 /** Scheduler parameters */
 typedefstruct odp_schedule_param_t {
/** Priority level
-- 
2.14.2



[lng-odp] [PATCH v10 16/30] linux-gen, include: progress in switching headers to api+abi pattern

2017-10-27 Thread Dmitry Eremin-Solenikov
Rework more platform headers to use odp/api/abi/ subdir instead of
odp/api/plat/.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am|  8 +
 .../include => include}/odp/api/barrier.h  |  6 ++--
 .../include => include}/odp/api/buffer.h   | 18 
 .../include => include}/odp/api/event.h| 14 ++---
 .../include => include}/odp/api/ipsec.h| 14 ++---
 .../include => include}/odp/api/pool.h | 17 ---
 .../include => include}/odp/api/queue.h| 12 
 .../include => include}/odp/api/shared_memory.h| 14 ++---
 .../include => include}/odp/api/timer.h| 20 -
 platform/linux-generic/Makefile.am | 34 +-
 .../odp/api/abi/buffer.h}  | 11 ++-
 .../odp/api/abi/classification.h}  | 11 ++-
 .../odp/api/abi/crypto.h}  | 11 ++-
 .../odp/api/abi/event.h}   | 12 ++--
 .../odp/api/abi/ipsec.h}   |  4 +--
 .../odp/api/abi/packet_io.h}   | 10 ++-
 .../odp/api/abi/pool.h}| 13 ++---
 .../odp/api/abi/queue.h}   | 11 ++-
 .../odp/api/abi/shared_memory.h}   | 11 ++-
 .../odp/api/abi/timer.h}   |  4 +--
 .../linux-generic/include/odp/api/classification.h | 12 
 platform/linux-generic/include/odp/api/crypto.h| 10 +++
 platform/linux-generic/include/odp/api/packet.h|  8 ++---
 platform/linux-generic/include/odp/api/packet_io.h |  8 ++---
 .../include/odp/api/plat/packet_inlines.h  |  1 +
 .../include/odp/api/plat/strong_types.h|  2 ++
 .../linux-generic/include/odp_queue_internal.h |  1 +
 .../include/odp_queue_scalable_internal.h  |  1 +
 platform/linux-generic/odp_packet_io.c |  6 
 29 files changed, 106 insertions(+), 198 deletions(-)
 rename {platform/linux-generic/include => include}/odp/api/barrier.h (78%)
 rename {platform/linux-generic/include => include}/odp/api/buffer.h (58%)
 rename {platform/linux-generic/include => include}/odp/api/event.h (65%)
 rename {platform/linux-generic/include => include}/odp/api/ipsec.h (67%)
 rename {platform/linux-generic/include => include}/odp/api/pool.h (53%)
 rename {platform/linux-generic/include => include}/odp/api/queue.h (58%)
 rename {platform/linux-generic/include => include}/odp/api/shared_memory.h 
(62%)
 rename {platform/linux-generic/include => include}/odp/api/timer.h (54%)
 rename platform/linux-generic/{include/odp/api/plat/buffer_types.h => 
include-abi/odp/api/abi/buffer.h} (73%)
 rename platform/linux-generic/{include/odp/api/plat/classification_types.h => 
include-abi/odp/api/abi/classification.h} (74%)
 rename platform/linux-generic/{include/odp/api/plat/crypto_types.h => 
include-abi/odp/api/abi/crypto.h} (71%)
 rename platform/linux-generic/{include/odp/api/plat/event_types.h => 
include-abi/odp/api/abi/event.h} (80%)
 rename platform/linux-generic/{include/odp/api/plat/ipsec_types.h => 
include-abi/odp/api/abi/ipsec.h} (88%)
 rename platform/linux-generic/{include/odp/api/plat/packet_io_types.h => 
include-abi/odp/api/abi/packet_io.h} (83%)
 rename platform/linux-generic/{include/odp/api/plat/pool_types.h => 
include-abi/odp/api/abi/pool.h} (76%)
 rename platform/linux-generic/{include/odp/api/plat/queue_types.h => 
include-abi/odp/api/abi/queue.h} (74%)
 rename platform/linux-generic/{include/odp/api/plat/shared_memory_types.h => 
include-abi/odp/api/abi/shared_memory.h} (73%)
 rename platform/linux-generic/{include/odp/api/plat/timer_types.h => 
include-abi/odp/api/abi/timer.h} (92%)

diff --git a/include/Makefile.am b/include/Makefile.am
index 0e39a0d8db5f..946b7c07cf73 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -5,18 +5,26 @@ include_HEADERS = \
 
 odpapiincludedir= $(includedir)/odp/api/
 odpapiinclude_HEADERS = \
+   odp/api/barrier.h \
+   odp/api/buffer.h \
odp/api/cpumask.h \
+   odp/api/event.h \
odp/api/init.h \
+   odp/api/ipsec.h \
+   odp/api/pool.h \
+   odp/api/queue.h \
odp/api/rwlock.h \
odp/api/rwlock_recursive.h \
odp/api/schedule.h \
odp/api/schedule_types.h \
+   odp/api/shared_memory.h \
odp/api/spinlock.h \
odp/api/spinlock_recursive.h \
odp/api/std_types.h \
odp/api/thread.h \
odp/api/thrmask.h \
odp/api/time.h \
+   odp/api/timer.h \
odp/api/traffic_mngr.h \
odp/api/version.h
 
diff --git a/platform/linux-generic/include/odp/api/barrier.h 
b/include/odp/api/barrier.h
similarity index 78%
rename from platform/linux-generic/include/odp/api/b

[lng-odp] [PATCH v10 18/30] linux-gen, include: switch atomic.h to api+abi

2017-10-27 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am|  1 +
 include/odp/api/atomic.h   | 28 +++
 platform/linux-generic/Makefile.am |  3 +-
 .../odp/api/abi/atomic.h}  | 14 ++--
 platform/linux-generic/include/odp/api/atomic.h| 42 --
 .../linux-generic/include/odp/api/ticketlock.h |  1 +
 platform/linux-generic/odp_atomic.c|  1 +
 7 files changed, 44 insertions(+), 46 deletions(-)
 create mode 100644 include/odp/api/atomic.h
 rename platform/linux-generic/{include/odp/api/plat/atomic_types.h => 
include-abi/odp/api/abi/atomic.h} (86%)
 delete mode 100644 platform/linux-generic/include/odp/api/atomic.h

diff --git a/include/Makefile.am b/include/Makefile.am
index 946b7c07cf73..d1eb26bc59c2 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -5,6 +5,7 @@ include_HEADERS = \
 
 odpapiincludedir= $(includedir)/odp/api/
 odpapiinclude_HEADERS = \
+   odp/api/atomic.h \
odp/api/barrier.h \
odp/api/buffer.h \
odp/api/cpumask.h \
diff --git a/include/odp/api/atomic.h b/include/odp/api/atomic.h
new file mode 100644
index ..8e515ec6f736
--- /dev/null
+++ b/include/odp/api/atomic.h
@@ -0,0 +1,28 @@
+/* Copyright (c) 2013, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP atomic operations
+ */
+
+#ifndef ODP_API_ATOMIC_H_
+#define ODP_API_ATOMIC_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+
+#include 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 1516f8ee7aee..304ca86862f3 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -20,7 +20,6 @@ odpinclude_HEADERS = \
 odpapiincludedir= $(includedir)/odp/api
 odpapiinclude_HEADERS = \
  include/odp/api/align.h \
- include/odp/api/atomic.h \
  include/odp/api/byteorder.h \
  include/odp/api/chksum.h \
  include/odp/api/classification.h \
@@ -47,7 +46,6 @@ odpapiinclude_HEADERS = \
 odpapiplatincludedir= $(includedir)/odp/api/plat
 odpapiplatinclude_HEADERS = \
  include/odp/api/plat/atomic_inlines.h \
- include/odp/api/plat/atomic_types.h \
  include/odp/api/plat/byteorder_inlines.h \
  include/odp/api/plat/byteorder_types.h \
  include/odp/api/plat/packet_flag_inlines.h \
@@ -68,6 +66,7 @@ nodist_odpapiplatinclude_HEADERS = \
 if !ODP_ABI_COMPAT
 odpapiabiarchincludedir= $(includedir)/odp/api/abi
 odpapiabiarchinclude_HEADERS = \
+ include-abi/odp/api/abi/atomic.h \
  include-abi/odp/api/abi/barrier.h \
  include-abi/odp/api/abi/buffer.h \
  include-abi/odp/api/abi/classification.h \
diff --git a/platform/linux-generic/include/odp/api/plat/atomic_types.h 
b/platform/linux-generic/include-abi/odp/api/abi/atomic.h
similarity index 86%
rename from platform/linux-generic/include/odp/api/plat/atomic_types.h
rename to platform/linux-generic/include-abi/odp/api/abi/atomic.h
index c0803bf11f63..0b7b254ced23 100644
--- a/platform/linux-generic/include/odp/api/plat/atomic_types.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/atomic.h
@@ -10,8 +10,8 @@
  * ODP atomic operations
  */
 
-#ifndef ODP_ATOMIC_TYPES_H_
-#define ODP_ATOMIC_TYPES_H_
+#ifndef ODP_API_ABI_ATOMIC_H_
+#define ODP_API_ABI_ATOMIC_H_
 
 #ifdef __cplusplus
 extern "C" {
@@ -59,6 +59,16 @@ typedef struct odp_atomic_u64_s odp_atomic_u64_t;
 
 typedef struct odp_atomic_u32_s odp_atomic_u32_t;
 
+/** @ingroup odp_atomic
+ *  @{
+ */
+
+#include 
+#include 
+
+/**
+ * @}
+ */
 #ifdef __cplusplus
 }
 #endif
diff --git a/platform/linux-generic/include/odp/api/atomic.h 
b/platform/linux-generic/include/odp/api/atomic.h
deleted file mode 100644
index 7886cb4ea382..
--- a/platform/linux-generic/include/odp/api/atomic.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright (c) 2013, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP atomic operations
- */
-
-#ifndef ODP_PLAT_ATOMIC_H_
-#define ODP_PLAT_ATOMIC_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include 
-#include 
-
-/** @ingroup odp_atomic
- *  @{
- */
-
-#include 
-#if ODP_ABI_COMPAT == 0
-#include 
-#endif
-
-/**
- * @}
- */
-
-#include 
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/platform/linux-generic/include/odp/api/ticketlock.h 
b/platform/linux-generic/include/odp/api/ticketlock.h
index e0f5d81fd6ed..ca12cc37cf9f 100644
--- a/platform/linux-generic/include/odp/api/ticketlock.h
+++ b/platform/linux-generic/include/odp/api/ticketlock.h
@@ 

[lng-odp] [PATCH v10 21/30] linux-gen, include: switch sync.h to api+abi

2017-10-27 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am|  1 +
 include/odp/api/sync.h | 28 ++
 platform/linux-generic/Makefile.am |  2 +-
 .../odp/api => include-abi/odp/api/abi}/sync.h | 12 --
 platform/linux-generic/odp_sync.c  |  1 +
 5 files changed, 35 insertions(+), 9 deletions(-)
 create mode 100644 include/odp/api/sync.h
 rename platform/linux-generic/{include/odp/api => 
include-abi/odp/api/abi}/sync.h (63%)

diff --git a/include/Makefile.am b/include/Makefile.am
index 6b3d12f793a4..4a9c3efe674a 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -24,6 +24,7 @@ odpapiinclude_HEADERS = \
odp/api/spinlock_recursive.h \
odp/api/std_clib.h \
odp/api/std_types.h \
+   odp/api/sync.h \
odp/api/thread.h \
odp/api/thrmask.h \
odp/api/time.h \
diff --git a/include/odp/api/sync.h b/include/odp/api/sync.h
new file mode 100644
index ..b84289ca8cb6
--- /dev/null
+++ b/include/odp/api/sync.h
@@ -0,0 +1,28 @@
+/* Copyright (c) 2013, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP synchronisation
+ */
+
+#ifndef ODP_API_SYNC_H_
+#define ODP_API_SYNC_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+
+#include 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index cdb45d8e0c9a..69ccd8e0b978 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -37,7 +37,6 @@ odpapiinclude_HEADERS = \
  include/odp/api/packet_io_stats.h \
  include/odp/api/random.h \
  include/odp/api/support.h \
- include/odp/api/sync.h \
  include/odp/api/system_info.h \
  include/odp/api/ticketlock.h
 
@@ -85,6 +84,7 @@ odpapiabiarchinclude_HEADERS = \
  include-abi/odp/api/abi/spinlock_recursive.h \
  include-abi/odp/api/abi/std_clib.h \
  include-abi/odp/api/abi/std_types.h \
+ include-abi/odp/api/abi/sync.h \
  include-abi/odp/api/abi/thread.h \
  include-abi/odp/api/abi/thrmask.h \
  include-abi/odp/api/abi/time.h \
diff --git a/platform/linux-generic/include/odp/api/sync.h 
b/platform/linux-generic/include-abi/odp/api/abi/sync.h
similarity index 63%
rename from platform/linux-generic/include/odp/api/sync.h
rename to platform/linux-generic/include-abi/odp/api/abi/sync.h
index e1afcc722d07..74e3fb15fef9 100644
--- a/platform/linux-generic/include/odp/api/sync.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/sync.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013, Linaro Limited
+/* Copyright (c) 2015, Linaro Limited
  * All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
@@ -7,11 +7,11 @@
 /**
  * @file
  *
- * ODP synchronisation
+ * ODP barrier
  */
 
-#ifndef ODP_PLAT_SYNC_H_
-#define ODP_PLAT_SYNC_H_
+#ifndef ODP_API_ABI_SYNC_H_
+#define ODP_API_ABI_SYNC_H_
 
 #ifdef __cplusplus
 extern "C" {
@@ -22,16 +22,12 @@ extern "C" {
  */
 
 #include 
-#if ODP_ABI_COMPAT == 0
 #include 
-#endif
 
 /**
  * @}
  */
 
-#include 
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/platform/linux-generic/odp_sync.c 
b/platform/linux-generic/odp_sync.c
index 7acdc92dd497..a9d2bbe24369 100644
--- a/platform/linux-generic/odp_sync.c
+++ b/platform/linux-generic/odp_sync.c
@@ -7,6 +7,7 @@
 #include "config.h"
 
 #include 
+#include 
 #if ODP_ABI_COMPAT == 1
 #include 
 #endif
-- 
2.14.2



[lng-odp] [PATCH v10 22/30] linux-gen, include: switch ticketlock.h to api+abi

2017-10-27 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am |  1 +
 .../include => include}/odp/api/ticketlock.h| 11 +++
 platform/linux-generic/Makefile.am  |  7 +++
 .../odp/api/abi/ticketlock.h}   | 21 -
 .../include/odp/api/plat/ticketlock_inlines.h   | 20 
 platform/linux-generic/odp_queue_scalable.c |  1 +
 platform/linux-generic/odp_ticketlock.c |  4 +++-
 7 files changed, 27 insertions(+), 38 deletions(-)
 rename {platform/linux-generic/include => include}/odp/api/ticketlock.h (54%)
 rename platform/linux-generic/{include/odp/api/plat/ticketlock_types.h => 
include-abi/odp/api/abi/ticketlock.h} (52%)

diff --git a/include/Makefile.am b/include/Makefile.am
index 4a9c3efe674a..617aa4a6e67a 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -27,6 +27,7 @@ odpapiinclude_HEADERS = \
odp/api/sync.h \
odp/api/thread.h \
odp/api/thrmask.h \
+   odp/api/ticketlock.h \
odp/api/time.h \
odp/api/timer.h \
odp/api/traffic_mngr.h \
diff --git a/platform/linux-generic/include/odp/api/ticketlock.h 
b/include/odp/api/ticketlock.h
similarity index 54%
rename from platform/linux-generic/include/odp/api/ticketlock.h
rename to include/odp/api/ticketlock.h
index ca12cc37cf9f..d875c0e34e76 100644
--- a/platform/linux-generic/include/odp/api/ticketlock.h
+++ b/include/odp/api/ticketlock.h
@@ -10,19 +10,14 @@
  * ODP ticketlock
  */
 
-#ifndef ODP_PLAT_TICKETLOCK_H_
-#define ODP_PLAT_TICKETLOCK_H_
+#ifndef ODP_API_TICKETLOCK_H_
+#define ODP_API_TICKETLOCK_H_
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include 
-
-#include 
-#if ODP_ABI_COMPAT == 0
-#include 
-#endif
+#include 
 
 #include 
 
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 69ccd8e0b978..3aee7ce6340e 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -37,8 +37,7 @@ odpapiinclude_HEADERS = \
  include/odp/api/packet_io_stats.h \
  include/odp/api/random.h \
  include/odp/api/support.h \
- include/odp/api/system_info.h \
- include/odp/api/ticketlock.h
+ include/odp/api/system_info.h
 
 odpapiplatincludedir= $(includedir)/odp/api/plat
 odpapiplatinclude_HEADERS = \
@@ -53,8 +52,7 @@ odpapiplatinclude_HEADERS = \
  include/odp/api/plat/strong_types.h \
  include/odp/api/plat/sync_inlines.h \
  include/odp/api/plat/ticketlock_inlines.h \
- include/odp/api/plat/ticketlock_inlines_api.h \
- include/odp/api/plat/ticketlock_types.h
+ include/odp/api/plat/ticketlock_inlines_api.h
 
 nodist_odpapiplatinclude_HEADERS = \
  include/odp/api/plat/static_inline.h
@@ -87,6 +85,7 @@ odpapiabiarchinclude_HEADERS = \
  include-abi/odp/api/abi/sync.h \
  include-abi/odp/api/abi/thread.h \
  include-abi/odp/api/abi/thrmask.h \
+ include-abi/odp/api/abi/ticketlock.h \
  include-abi/odp/api/abi/time.h \
  include-abi/odp/api/abi/timer.h \
  include-abi/odp/api/abi/traffic_mngr.h \
diff --git a/platform/linux-generic/include/odp/api/plat/ticketlock_types.h 
b/platform/linux-generic/include-abi/odp/api/abi/ticketlock.h
similarity index 52%
rename from platform/linux-generic/include/odp/api/plat/ticketlock_types.h
rename to platform/linux-generic/include-abi/odp/api/abi/ticketlock.h
index 81d479d61a61..958184be6907 100644
--- a/platform/linux-generic/include/odp/api/plat/ticketlock_types.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/ticketlock.h
@@ -11,8 +11,8 @@
  * ODP ticketlock
  */
 
-#ifndef ODP_TICKETLOCK_TYPES_H_
-#define ODP_TICKETLOCK_TYPES_H_
+#ifndef ODP_API_ABI_TICKETLOCK_H_
+#define ODP_API_ABI_TICKETLOCK_H_
 
 #ifdef __cplusplus
 extern "C" {
@@ -20,13 +20,24 @@ extern "C" {
 
 #include 
 
+/** @ingroup odp_locks
+ *  @{
+ */
+
 /** @internal */
-struct odp_ticketlock_s {
+typedef struct odp_ticketlock_s {
odp_atomic_u32_t  next_ticket; /**< Next ticket */
odp_atomic_u32_t  cur_ticket;  /**< Current ticket */
-};
+} odp_ticketlock_t;
+
+/* Include inlined versions of API functions */
+#include 
+#include 
+#include 
 
-typedef struct odp_ticketlock_s odp_ticketlock_t;
+/**
+ * @}
+ */
 
 #ifdef __cplusplus
 }
diff --git a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h 
b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h
index ecbea7c4d611..185d77de015f 100644
--- a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h
+++ b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines.h
@@ -14,1

[lng-odp] [PATCH v10 28/30] linux-gen: don't install inline headers in non-ABI-compat mode

2017-10-27 Thread Dmitry Eremin-Solenikov
There is no point in installing inline headers in non-ABI-compat mode
anymore. They are not included by any other header.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 platform/linux-generic/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 0a49fe67e03b..08e915af4e36 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -24,6 +24,7 @@ odpapiinclude_HEADERS = \
  include/odp/api/debug.h
 
 odpapiplatincludedir= $(includedir)/odp/api/plat
+if !ODP_ABI_COMPAT
 odpapiplatinclude_HEADERS = \
  include/odp/api/plat/atomic_inlines.h \
  include/odp/api/plat/byteorder_inlines.h \
@@ -38,7 +39,6 @@ odpapiplatinclude_HEADERS = \
  include/odp/api/plat/ticketlock_inlines.h \
  include/odp/api/plat/ticketlock_inlines_api.h
 
-if !ODP_ABI_COMPAT
 odpapiabiarchincludedir= $(includedir)/odp/api/abi
 odpapiabiarchinclude_HEADERS = \
  include-abi/odp/api/abi/atomic.h \
-- 
2.14.2



[lng-odp] [PATCH v10 29/30] configure: stop AC_SUBST'ing ODP_ABI_COMPAT

2017-10-27 Thread Dmitry Eremin-Solenikov
With static_inline.h gone, there is no need to
AC_SUBST([ODP_ABI_COMPAT]). Drop it from configure.ac.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 configure.ac | 1 -
 1 file changed, 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 255de960c180..6d74c98b3083 100644
--- a/configure.ac
+++ b/configure.ac
@@ -270,7 +270,6 @@ AC_ARG_ENABLE([abi-compat],
#if there is no ABI compatibility the .so numbers are meaningless
ODP_LIBSO_VERSION=0:0:0
 fi])
-AC_SUBST(ODP_ABI_COMPAT)
 AM_CONDITIONAL(ODP_ABI_COMPAT, [test "x$ODP_ABI_COMPAT" = "x1"])
 
 ##
-- 
2.14.2



[lng-odp] [PATCH v10 02/30] travis: add cross-compiling tests with ABI compatibility disabled

2017-10-27 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 .travis.yml | 4 
 1 file changed, 4 insertions(+)

diff --git a/.travis.yml b/.travis.yml
index fdeeefd113ea..6196f91d41de 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -74,6 +74,10 @@ env:
 - CROSS_ARCH="armhf" CFLAGS="-march=armv7-a"
 - CROSS_ARCH="powerpc"
 - CROSS_ARCH="i386"
+- CROSS_ARCH="arm64" CONF="--disable-abi-compat"
+- CROSS_ARCH="armhf" CFLAGS="-march=armv7-a" 
CONF="--disable-abi-compat"
+- CROSS_ARCH="powerpc" CONF="--disable-abi-compat"
+- CROSS_ARCH="i386" CONF="--disable-abi-compat"
 
 before_install:
 
-- 
2.14.2



[lng-odp] [PATCH v10 03/30] linux-gen: ipsec: don't use __odp_force

2017-10-27 Thread Dmitry Eremin-Solenikov
__odp_force is not part of ODP API, so it should not be used directly.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 platform/linux-generic/odp_ipsec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/platform/linux-generic/odp_ipsec.c 
b/platform/linux-generic/odp_ipsec.c
index e57736c2a792..7e833adee0a8 100644
--- a/platform/linux-generic/odp_ipsec.c
+++ b/platform/linux-generic/odp_ipsec.c
@@ -126,7 +126,7 @@ odp_u16sum_t _odp_chksum(void *buffer, int len)
sum += (sum >> 16);
result = ~sum;
 
-   return  (__odp_force odp_u16sum_t) result;
+   return  (odp_u16sum_t)result;
 }
 
 static inline int _odp_ipv4_csum(odp_packet_t pkt,
-- 
2.14.2



[lng-odp] [PATCH v10 06/30] configure: provide conditional for ABI-compat mode

2017-10-27 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 configure.ac | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure.ac b/configure.ac
index 4bc77500c279..255de960c180 100644
--- a/configure.ac
+++ b/configure.ac
@@ -271,6 +271,7 @@ AC_ARG_ENABLE([abi-compat],
ODP_LIBSO_VERSION=0:0:0
 fi])
 AC_SUBST(ODP_ABI_COMPAT)
+AM_CONDITIONAL(ODP_ABI_COMPAT, [test "x$ODP_ABI_COMPAT" = "x1"])
 
 ##
 # Enable/disable deprecated API definitions
-- 
2.14.2



[lng-odp] [PATCH v10 07/30] build: move ODP include path to common Makefile.inc

2017-10-27 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 Makefile.inc   | 12 
 example/Makefile.inc   | 12 
 helper/Makefile.am | 12 
 helper/test/Makefile.am| 18 +-
 platform/Makefile.inc  |  2 +-
 platform/linux-generic/Makefile.am |  8 +---
 platform/linux-generic/test/Makefile.inc   | 12 ++--
 platform/linux-generic/test/ring/Makefile.am   |  2 +-
 .../test/validation/api/shmem/Makefile.am  |  4 ++--
 test/Makefile.inc  | 17 +
 10 files changed, 37 insertions(+), 62 deletions(-)
 create mode 100644 Makefile.inc

diff --git a/Makefile.inc b/Makefile.inc
new file mode 100644
index ..10e4041fe662
--- /dev/null
+++ b/Makefile.inc
@@ -0,0 +1,12 @@
+ODP_INCLUDES = \
+   -I$(top_builddir)/platform/@with_platform@/include \
+   -I$(top_srcdir)/platform/@with_platform@/include \
+   -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
+   -I$(top_builddir)/include \
+   -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
+   -I$(top_srcdir)/include
+
+HELPER_INCLUDES = \
+   -I$(top_srcdir)/helper/include
+
+LIB   = $(top_builddir)/lib
diff --git a/example/Makefile.inc b/example/Makefile.inc
index 1609066e64c2..498f656faa66 100644
--- a/example/Makefile.inc
+++ b/example/Makefile.inc
@@ -1,16 +1,12 @@
+include $(top_srcdir)/Makefile.inc
+
 TESTS_ENVIRONMENT = EXEEXT=${EXEEXT}
 
-LIB   = $(top_builddir)/lib
 LDADD = $(LIB)/libodp-linux.la $(LIB)/libodphelper.la $(DPDK_PMDS)
 AM_CFLAGS = \
-I$(srcdir) \
-I$(top_srcdir)/example \
-   -I$(top_srcdir)/platform/@with_platform@/include \
-   -I$(top_srcdir)/include/ \
-   -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
-   -I$(top_srcdir)/helper/include \
-   -I$(top_builddir)/platform/@with_platform@/include \
-   -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
-   -I$(top_builddir)/include
+   $(ODP_INCLUDES) \
+   $(HELPER_INCLUDES)
 
 AM_LDFLAGS = -L$(LIB) -static
diff --git a/helper/Makefile.am b/helper/Makefile.am
index ee1c17d6d0a3..2321a2d4f24c 100644
--- a/helper/Makefile.am
+++ b/helper/Makefile.am
@@ -1,15 +1,11 @@
+include $(top_srcdir)/Makefile.inc
+
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libodphelper.pc
 
-LIB   = $(top_builddir)/lib
 AM_CPPFLAGS = \
-   -I$(top_builddir)/platform/@with_platform@/include \
-   -I$(top_srcdir)/helper/include \
-   -I$(top_srcdir)/include \
-   -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
-   -I$(top_srcdir)/platform/@with_platform@/include \
-   -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
-   -I$(top_builddir)/include
+   $(ODP_INCLUDES) \
+   $(HELPER_INCLUDES)
 
 AM_LDFLAGS = -version-number '$(ODPHELPER_LIBSO_VERSION)'
 
diff --git a/helper/test/Makefile.am b/helper/test/Makefile.am
index 8eee643bee39..27c414aa7461 100644
--- a/helper/test/Makefile.am
+++ b/helper/test/Makefile.am
@@ -1,25 +1,17 @@
-TESTS_ENVIRONMENT = EXEEXT=${EXEEXT}
+include $(top_srcdir)/Makefile.inc
 
-LIB   = $(top_builddir)/lib
+TESTS_ENVIRONMENT = EXEEXT=${EXEEXT}
 
 #in the following line, the libs using the symbols should come before
 #the libs containing them! The includer is given a chance to add things
 #before libodp by setting PRE_LDADD before the inclusion.
 LDADD = $(PRE_LDADD) $(LIB)/libodphelper.la $(LIB)/libodp-linux.la
 
-INCFLAGS = \
-   -I$(top_builddir)/platform/@with_platform@/include \
-   -I$(top_srcdir)/helper/include \
-   -I$(top_srcdir)/include \
-   -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@ \
-   -I$(top_srcdir)/platform/@with_platform@/include \
-   -I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
-   -I$(top_builddir)/include \
-   -I$(top_srcdir)/helper
-
 ODP_PLATFORM=${with_platform}
 
-AM_CPPFLAGS = $(INCFLAGS)
+AM_CPPFLAGS = \
+   $(ODP_INCLUDES) \
+   $(HELPER_INCLUDES)
 AM_LDFLAGS = -static
 
 EXECUTABLES = chksum \
diff --git a/platform/Makefile.inc b/platform/Makefile.inc
index 0086db779897..4714de0ee805 100644
--- a/platform/Makefile.inc
+++ b/platform/Makefile.inc
@@ -1,4 +1,4 @@
-LIB   = $(top_builddir)/lib
+include $(top_srcdir)/Makefile.inc
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = libodp-linux.pc
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index c5406760935e..703b12c702ea 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -3,14 +3,8 @@
 
 include $(top_srcdir)/platform/Makefile.inc
 
-AM_CPPFLAGS =  -I$(srcdir)/include
-AM_CPPFLAGS +=  -I$(top_srcdir)/include
-AM_CPPFLAGS +=  -I$(top_srcdir)/include/odp/arch/@ARCH_ABI@
-AM_CP

[lng-odp] [PATCH v10 19/30] linux-gen, include: switch byteorder.h to api+abi

2017-10-27 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am|  1 +
 include/odp/api/byteorder.h| 28 ++
 platform/linux-generic/Makefile.am |  3 +-
 .../odp/api/abi/byteorder.h}   | 15 +---
 platform/linux-generic/include/odp/api/byteorder.h | 43 --
 .../include/odp/api/plat/byteorder_inlines.h   |  6 +++
 platform/linux-generic/odp_byteorder.c |  1 +
 7 files changed, 47 insertions(+), 50 deletions(-)
 create mode 100644 include/odp/api/byteorder.h
 rename platform/linux-generic/{include/odp/api/plat/byteorder_types.h => 
include-abi/odp/api/abi/byteorder.h} (84%)
 delete mode 100644 platform/linux-generic/include/odp/api/byteorder.h

diff --git a/include/Makefile.am b/include/Makefile.am
index d1eb26bc59c2..229f47fc7173 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -8,6 +8,7 @@ odpapiinclude_HEADERS = \
odp/api/atomic.h \
odp/api/barrier.h \
odp/api/buffer.h \
+   odp/api/byteorder.h \
odp/api/cpumask.h \
odp/api/event.h \
odp/api/init.h \
diff --git a/include/odp/api/byteorder.h b/include/odp/api/byteorder.h
new file mode 100644
index ..cbb45429943a
--- /dev/null
+++ b/include/odp/api/byteorder.h
@@ -0,0 +1,28 @@
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP byteorder
+ */
+
+#ifndef ODP_API_BYTEORDER_H_
+#define ODP_API_BYTEORDER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+
+#include 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 304ca86862f3..966fc13f5c02 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -20,7 +20,6 @@ odpinclude_HEADERS = \
 odpapiincludedir= $(includedir)/odp/api
 odpapiinclude_HEADERS = \
  include/odp/api/align.h \
- include/odp/api/byteorder.h \
  include/odp/api/chksum.h \
  include/odp/api/classification.h \
  include/odp/api/compiler.h \
@@ -47,7 +46,6 @@ odpapiplatincludedir= $(includedir)/odp/api/plat
 odpapiplatinclude_HEADERS = \
  include/odp/api/plat/atomic_inlines.h \
  include/odp/api/plat/byteorder_inlines.h \
- include/odp/api/plat/byteorder_types.h \
  include/odp/api/plat/packet_flag_inlines.h \
  include/odp/api/plat/packet_flag_inlines_api.h \
  include/odp/api/plat/packet_inlines.h \
@@ -69,6 +67,7 @@ odpapiabiarchinclude_HEADERS = \
  include-abi/odp/api/abi/atomic.h \
  include-abi/odp/api/abi/barrier.h \
  include-abi/odp/api/abi/buffer.h \
+ include-abi/odp/api/abi/byteorder.h \
  include-abi/odp/api/abi/classification.h \
  include-abi/odp/api/abi/cpumask.h \
  include-abi/odp/api/abi/crypto.h \
diff --git a/platform/linux-generic/include/odp/api/plat/byteorder_types.h 
b/platform/linux-generic/include-abi/odp/api/abi/byteorder.h
similarity index 84%
rename from platform/linux-generic/include/odp/api/plat/byteorder_types.h
rename to platform/linux-generic/include-abi/odp/api/abi/byteorder.h
index 20d52bf8fa6b..0f8fac0b16c8 100644
--- a/platform/linux-generic/include/odp/api/plat/byteorder_types.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/byteorder.h
@@ -10,23 +10,25 @@
  * ODP byteorder
  */
 
-#ifndef ODP_BYTEORDER_TYPES_H_
-#define ODP_BYTEORDER_TYPES_H_
+#ifndef ODP_API_ABI_BYTEORDER_H_
+#define ODP_API_ABI_BYTEORDER_H_
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+#include 
+
 #ifndef __BYTE_ORDER__
-#error __BYTE_ORDER not defined!
+#error __BYTE_ORDER__ not defined!
 #endif
 
 #ifndef __ORDER_BIG_ENDIAN__
-#error __BIG_ENDIAN not defined!
+#error __ORDER_BIG_ENDIAN__ not defined!
 #endif
 
 #ifndef __ORDER_LITTLE_ENDIAN__
-#error __LITTLE_ENDIAN not defined!
+#error __ORDER_LITTLE_ENDIAN__ not defined!
 #endif
 
 /* for use with type checkers such as sparse */
@@ -73,6 +75,9 @@ typedef uint64_t __odp_bitwiseodp_u64be_t;
 typedef uint16_t __odp_bitwise  odp_u16sum_t;
 typedef uint32_t __odp_bitwise  odp_u32sum_t;
 
+#include 
+#include 
+
 /**
  * @}
  */
diff --git a/platform/linux-generic/include/odp/api/byteorder.h 
b/platform/linux-generic/include/odp/api/byteorder.h
deleted file mode 100644
index ec3d0eef763a..
--- a/platform/linux-generic/include/odp/api/byteorder.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (c) 2014, Linaro Limited
- * All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-/**
- * @file
- *
- * ODP byteorder
- */
-
-#ifndef ODP_PLAT_BYTEORDER_H_
-#define OD

[lng-odp] [PATCH v10 20/30] linux-gen, include: switch std_clib.h to api+abi

2017-10-27 Thread Dmitry Eremin-Solenikov
Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 example/traffic_mgmt/odp_traffic_mgmt.c|  1 +
 helper/test/linux/process.c|  2 ++
 helper/test/linux/pthread.c|  2 ++
 helper/threads.c   |  1 +
 include/Makefile.am|  1 +
 include/odp/api/std_clib.h | 24 ++
 platform/linux-generic/Makefile.am |  2 +-
 .../odp/api => include-abi/odp/api/abi}/std_clib.h | 17 ---
 .../include/odp/api/plat/std_clib_inlines.h|  1 -
 platform/linux-generic/odp_std_clib.c  |  1 +
 10 files changed, 41 insertions(+), 11 deletions(-)
 create mode 100644 include/odp/api/std_clib.h
 rename platform/linux-generic/{include/odp/api => 
include-abi/odp/api/abi}/std_clib.h (60%)

diff --git a/example/traffic_mgmt/odp_traffic_mgmt.c 
b/example/traffic_mgmt/odp_traffic_mgmt.c
index 1f1102ddfdaf..e02a1af8dc3f 100644
--- a/example/traffic_mgmt/odp_traffic_mgmt.c
+++ b/example/traffic_mgmt/odp_traffic_mgmt.c
@@ -10,6 +10,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/helper/test/linux/process.c b/helper/test/linux/process.c
index 12504d01bd9f..3ed2032b0c59 100644
--- a/helper/test/linux/process.c
+++ b/helper/test/linux/process.c
@@ -11,6 +11,8 @@
 #include 
 #include 
 
+#include 
+
 #define NUMBER_WORKERS 16 /* 0 = max */
 
 static void *worker_fn(void *arg ODPH_UNUSED)
diff --git a/helper/test/linux/pthread.c b/helper/test/linux/pthread.c
index a50df027f3f2..0863283d60aa 100644
--- a/helper/test/linux/pthread.c
+++ b/helper/test/linux/pthread.c
@@ -10,6 +10,8 @@
 #include 
 #include 
 
+#include 
+
 #define NUMBER_WORKERS 16
 static void *worker_fn(void *arg ODPH_UNUSED)
 {
diff --git a/helper/threads.c b/helper/threads.c
index a83014d424de..32a092825084 100644
--- a/helper/threads.c
+++ b/helper/threads.c
@@ -10,6 +10,7 @@
 #define _GNU_SOURCE
 #endif
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/Makefile.am b/include/Makefile.am
index 229f47fc7173..6b3d12f793a4 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -22,6 +22,7 @@ odpapiinclude_HEADERS = \
odp/api/shared_memory.h \
odp/api/spinlock.h \
odp/api/spinlock_recursive.h \
+   odp/api/std_clib.h \
odp/api/std_types.h \
odp/api/thread.h \
odp/api/thrmask.h \
diff --git a/include/odp/api/std_clib.h b/include/odp/api/std_clib.h
new file mode 100644
index ..fde1c1dd3a4a
--- /dev/null
+++ b/include/odp/api/std_clib.h
@@ -0,0 +1,24 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#ifndef ODP_API_STD_CLIB_H_
+#define ODP_API_STD_CLIB_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include 
+
+#include 
+
+#include 
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 966fc13f5c02..cdb45d8e0c9a 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -36,7 +36,6 @@ odpapiinclude_HEADERS = \
  include/odp/api/packet_io.h \
  include/odp/api/packet_io_stats.h \
  include/odp/api/random.h \
- include/odp/api/std_clib.h \
  include/odp/api/support.h \
  include/odp/api/sync.h \
  include/odp/api/system_info.h \
@@ -84,6 +83,7 @@ odpapiabiarchinclude_HEADERS = \
  include-abi/odp/api/abi/shared_memory.h \
  include-abi/odp/api/abi/spinlock.h \
  include-abi/odp/api/abi/spinlock_recursive.h \
+ include-abi/odp/api/abi/std_clib.h \
  include-abi/odp/api/abi/std_types.h \
  include-abi/odp/api/abi/thread.h \
  include-abi/odp/api/abi/thrmask.h \
diff --git a/platform/linux-generic/include/odp/api/std_clib.h 
b/platform/linux-generic/include-abi/odp/api/abi/std_clib.h
similarity index 60%
rename from platform/linux-generic/include/odp/api/std_clib.h
rename to platform/linux-generic/include-abi/odp/api/abi/std_clib.h
index fea4725437e7..b31034df4705 100644
--- a/platform/linux-generic/include/odp/api/std_clib.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/std_clib.h
@@ -4,22 +4,21 @@
  * SPDX-License-Identifier: BSD-3-Clause
  */
 
-#ifndef ODP_PLAT_STD_CLIB_H_
-#define ODP_PLAT_STD_CLIB_H_
+/**
+ * @file
+ *
+ * ODP barrier
+ */
+
+#ifndef ODP_API_ABI_STD_CLIB_H_
+#define ODP_API_ABI_STD_CLIB_H_
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#include 
-#include 
-
 #include 
-#if ODP_ABI_COMPAT == 0
 #include 
-#endif
-
-#include 
 
 #ifdef __cplusplus
 }
diff --git a/platform/linux-generic/include/odp/api/plat/std_clib_inlines.h 
b/platform/li

[lng-odp] [PATCH v10 26/30] linux-gen: split odp_packet/odp_packet_flags

2017-10-27 Thread Dmitry Eremin-Solenikov
Split away inclusion of API implementation to the files selected by
Automake.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 platform/linux-generic/Makefile.am|  2 ++
 platform/linux-generic/odp_packet.c   |  5 -
 platform/linux-generic/odp_packet_api.c   | 28 +++
 platform/linux-generic/odp_packet_flags.c |  5 -
 platform/linux-generic/odp_packet_flags_api.c | 15 ++
 5 files changed, 45 insertions(+), 10 deletions(-)
 create mode 100644 platform/linux-generic/odp_packet_api.c
 create mode 100644 platform/linux-generic/odp_packet_flags_api.c

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 078d154f8f15..3c1551aab7a6 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -233,6 +233,8 @@ if ODP_ABI_COMPAT
 __LIB__libodp_linux_la_SOURCES += \
   odp_atomic_api.c \
   odp_byteorder.c \
+  odp_packet_api.c \
+  odp_packet_flags_api.c \
   odp_std_clib.c \
   odp_sync.c \
   odp_ticketlock.c
diff --git a/platform/linux-generic/odp_packet.c 
b/platform/linux-generic/odp_packet.c
index ada02faec018..ebfaeea29e93 100644
--- a/platform/linux-generic/odp_packet.c
+++ b/platform/linux-generic/odp_packet.c
@@ -2311,8 +2311,3 @@ int odp_packet_has_ref(odp_packet_t pkt)
 
return 0;
 }
-
-/* Include non-inlined versions of API functions */
-#if ODP_ABI_COMPAT == 1
-#include 
-#endif
diff --git a/platform/linux-generic/odp_packet_api.c 
b/platform/linux-generic/odp_packet_api.c
new file mode 100644
index ..dd038e81c3ff
--- /dev/null
+++ b/platform/linux-generic/odp_packet_api.c
@@ -0,0 +1,28 @@
+/* Copyright (c) 2013, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include "config.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+/* Include non-inlined versions of API functions */
+#define _ODP_INLINE
+#include 
diff --git a/platform/linux-generic/odp_packet_flags.c 
b/platform/linux-generic/odp_packet_flags.c
index 2e26ad601735..96507c6644d3 100644
--- a/platform/linux-generic/odp_packet_flags.c
+++ b/platform/linux-generic/odp_packet_flags.c
@@ -299,8 +299,3 @@ void odp_packet_has_ts_clr(odp_packet_t pkt)
 
pkt_hdr->p.input_flags.timestamp = 0;
 }
-
-/* Include non-inlined versions of API functions */
-#if ODP_ABI_COMPAT == 1
-#include 
-#endif
diff --git a/platform/linux-generic/odp_packet_flags_api.c 
b/platform/linux-generic/odp_packet_flags_api.c
new file mode 100644
index ..6b373843a3ce
--- /dev/null
+++ b/platform/linux-generic/odp_packet_flags_api.c
@@ -0,0 +1,15 @@
+/* Copyright (c) 2014, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include "config.h"
+
+#include 
+#include 
+#include 
+
+/* Include non-inlined versions of API functions */
+#define _ODP_INLINE
+#include 
-- 
2.14.2



[lng-odp] [PATCH v10 13/30] include: change spec guarding define from ODP_API to ODP_API_SPEC

2017-10-27 Thread Dmitry Eremin-Solenikov
Change defines guarding inclusion of ODP API spec files from ODP_API_FOO
to ODP_API_SPEC_FOO, as they are placed in odp/api/spec/foo.h path.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/odp/api/spec/align.h  | 4 ++--
 include/odp/api/spec/atomic.h | 4 ++--
 include/odp/api/spec/barrier.h| 4 ++--
 include/odp/api/spec/buffer.h | 4 ++--
 include/odp/api/spec/byteorder.h  | 4 ++--
 include/odp/api/spec/chksum.h | 4 ++--
 include/odp/api/spec/classification.h | 4 ++--
 include/odp/api/spec/compiler.h   | 4 ++--
 include/odp/api/spec/cpu.h| 4 ++--
 include/odp/api/spec/cpumask.h| 4 ++--
 include/odp/api/spec/crypto.h | 4 ++--
 include/odp/api/spec/debug.h  | 4 ++--
 include/odp/api/spec/deprecated.h.in  | 4 ++--
 include/odp/api/spec/errno.h  | 4 ++--
 include/odp/api/spec/event.h  | 4 ++--
 include/odp/api/spec/feature.h| 4 ++--
 include/odp/api/spec/hash.h   | 4 ++--
 include/odp/api/spec/hints.h  | 4 ++--
 include/odp/api/spec/init.h   | 4 ++--
 include/odp/api/spec/ipsec.h  | 4 ++--
 include/odp/api/spec/packet.h | 4 ++--
 include/odp/api/spec/packet_flags.h   | 4 ++--
 include/odp/api/spec/packet_io.h  | 4 ++--
 include/odp/api/spec/packet_io_stats.h| 4 ++--
 include/odp/api/spec/pool.h   | 4 ++--
 include/odp/api/spec/queue.h  | 4 ++--
 include/odp/api/spec/random.h | 4 ++--
 include/odp/api/spec/rwlock.h | 4 ++--
 include/odp/api/spec/rwlock_recursive.h   | 4 ++--
 include/odp/api/spec/schedule.h   | 4 ++--
 include/odp/api/spec/schedule_types.h | 4 ++--
 include/odp/api/spec/shared_memory.h  | 4 ++--
 include/odp/api/spec/spinlock.h   | 4 ++--
 include/odp/api/spec/spinlock_recursive.h | 4 ++--
 include/odp/api/spec/std_clib.h   | 4 ++--
 include/odp/api/spec/std_types.h  | 4 ++--
 include/odp/api/spec/support.h| 4 ++--
 include/odp/api/spec/sync.h   | 4 ++--
 include/odp/api/spec/system_info.h| 4 ++--
 include/odp/api/spec/thread.h | 4 ++--
 include/odp/api/spec/thrmask.h| 4 ++--
 include/odp/api/spec/ticketlock.h | 4 ++--
 include/odp/api/spec/time.h   | 4 ++--
 include/odp/api/spec/timer.h  | 4 ++--
 include/odp/api/spec/traffic_mngr.h   | 4 ++--
 include/odp/api/spec/version.h.in | 4 ++--
 46 files changed, 92 insertions(+), 92 deletions(-)

diff --git a/include/odp/api/spec/align.h b/include/odp/api/spec/align.h
index fdf8c29e14e4..0a9db3488232 100644
--- a/include/odp/api/spec/align.h
+++ b/include/odp/api/spec/align.h
@@ -11,8 +11,8 @@
  * ODP alignments
  */
 
-#ifndef ODP_API_ALIGN_H_
-#define ODP_API_ALIGN_H_
+#ifndef ODP_API_SPEC_ALIGN_H_
+#define ODP_API_SPEC_ALIGN_H_
 #include 
 
 #ifdef __cplusplus
diff --git a/include/odp/api/spec/atomic.h b/include/odp/api/spec/atomic.h
index 408829df299f..d828ea47da3b 100644
--- a/include/odp/api/spec/atomic.h
+++ b/include/odp/api/spec/atomic.h
@@ -10,8 +10,8 @@
  * ODP atomic operations
  */
 
-#ifndef ODP_API_ATOMIC_H_
-#define ODP_API_ATOMIC_H_
+#ifndef ODP_API_SPEC_ATOMIC_H_
+#define ODP_API_SPEC_ATOMIC_H_
 #include 
 
 #ifdef __cplusplus
diff --git a/include/odp/api/spec/barrier.h b/include/odp/api/spec/barrier.h
index 6de683c73e0c..8351ef8864b7 100644
--- a/include/odp/api/spec/barrier.h
+++ b/include/odp/api/spec/barrier.h
@@ -10,8 +10,8 @@
  * ODP execution barriers
  */
 
-#ifndef ODP_API_BARRIER_H_
-#define ODP_API_BARRIER_H_
+#ifndef ODP_API_SPEC_BARRIER_H_
+#define ODP_API_SPEC_BARRIER_H_
 #include 
 
 #ifdef __cplusplus
diff --git a/include/odp/api/spec/buffer.h b/include/odp/api/spec/buffer.h
index 94829b324dd9..b2f90f949864 100644
--- a/include/odp/api/spec/buffer.h
+++ b/include/odp/api/spec/buffer.h
@@ -11,8 +11,8 @@
  * ODP buffer descriptor
  */
 
-#ifndef ODP_API_BUFFER_H_
-#define ODP_API_BUFFER_H_
+#ifndef ODP_API_SPEC_BUFFER_H_
+#define ODP_API_SPEC_BUFFER_H_
 #include 
 
 #ifdef __cplusplus
diff --git a/include/odp/api/spec/byteorder.h b/include/odp/api/spec/byteorder.h
index 38c0bdbf7a3d..814438d3f803 100644
--- a/include/odp/api/spec/byteorder.h
+++ b/include/odp/api/spec/byteorder.h
@@ -10,8 +10,8 @@
  * ODP byteorder
  */
 
-#ifndef ODP_API_BYTEORDER_H_
-#define ODP_API_BYTEORDER_H_
+#ifndef ODP_API_SPEC_BYTEORDER_H_
+#define ODP_API_SPEC_BYTEORDER_H_
 #include 
 
 #ifdef __cplusplus
diff --git a/include/odp/api/spec/chksum.h b/include/odp/api/spec/chksum.h
index e523ac286528..8f35e253fe91 100644
--- a/include/odp/api/spec/chksum.h
+++ b/include/odp/api/spec/chksum.h
@@ -10,8 +10,8 @@
  * ODP Hash functions
  */
 
-#ifndef ODP_API_CHKSUM_H_
-#define ODP_API_CHKSUM_H_
+#ifndef ODP_API_SPEC_CHKSUM_H_
+#define ODP_API_SPEC_CHKSUM_H_
 #include 
 
 

[lng-odp] [PATCH v10 08/30] include: move default ABI headers

2017-10-27 Thread Dmitry Eremin-Solenikov
Reduce amount of directory levels by moving default ABI headers to
odp/api/abi-default.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 include/Makefile.am| 82 +++---
 .../default/api/abi => api/abi-default}/atomic.h   |  0
 .../default/api/abi => api/abi-default}/barrier.h  |  0
 .../default/api/abi => api/abi-default}/buffer.h   |  0
 .../api/abi => api/abi-default}/byteorder.h|  0
 .../api/abi => api/abi-default}/classification.h   |  0
 .../default/api/abi => api/abi-default}/cpumask.h  |  0
 .../default/api/abi => api/abi-default}/crypto.h   |  0
 .../default/api/abi => api/abi-default}/event.h|  0
 .../default/api/abi => api/abi-default}/init.h |  0
 .../default/api/abi => api/abi-default}/ipsec.h|  0
 .../default/api/abi => api/abi-default}/packet.h   |  0
 .../api/abi => api/abi-default}/packet_flags.h |  0
 .../api/abi => api/abi-default}/packet_io.h|  0
 .../default/api/abi => api/abi-default}/pool.h |  0
 .../default/api/abi => api/abi-default}/queue.h|  0
 .../default/api/abi => api/abi-default}/rwlock.h   |  0
 .../api/abi => api/abi-default}/rwlock_recursive.h |  0
 .../default/api/abi => api/abi-default}/schedule.h |  0
 .../api/abi => api/abi-default}/schedule_types.h   |  0
 .../api/abi => api/abi-default}/shared_memory.h|  0
 .../default/api/abi => api/abi-default}/spinlock.h |  0
 .../abi => api/abi-default}/spinlock_recursive.h   |  0
 .../default/api/abi => api/abi-default}/std_clib.h |  0
 .../api/abi => api/abi-default}/std_types.h|  0
 .../default/api/abi => api/abi-default}/sync.h |  0
 .../default/api/abi => api/abi-default}/thread.h   |  0
 .../default/api/abi => api/abi-default}/thrmask.h  |  0
 .../api/abi => api/abi-default}/ticketlock.h   |  0
 .../default/api/abi => api/abi-default}/time.h |  0
 .../default/api/abi => api/abi-default}/timer.h|  0
 .../api/abi => api/abi-default}/traffic_mngr.h |  0
 .../default/api/abi => api/abi-default}/version.h  |  0
 include/odp/arch/arm32-linux/odp/api/abi/atomic.h  |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/barrier.h |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/buffer.h  |  2 +-
 .../odp/arch/arm32-linux/odp/api/abi/byteorder.h   |  2 +-
 .../arch/arm32-linux/odp/api/abi/classification.h  |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/cpumask.h |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/crypto.h  |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/event.h   |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/init.h|  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/ipsec.h   |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/packet.h  |  2 +-
 .../arch/arm32-linux/odp/api/abi/packet_flags.h|  2 +-
 .../odp/arch/arm32-linux/odp/api/abi/packet_io.h   |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/pool.h|  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/queue.h   |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/rwlock.h  |  2 +-
 .../arm32-linux/odp/api/abi/rwlock_recursive.h |  2 +-
 .../odp/arch/arm32-linux/odp/api/abi/schedule.h|  2 +-
 .../arch/arm32-linux/odp/api/abi/schedule_types.h  |  2 +-
 .../arch/arm32-linux/odp/api/abi/shared_memory.h   |  2 +-
 .../odp/arch/arm32-linux/odp/api/abi/spinlock.h|  2 +-
 .../arm32-linux/odp/api/abi/spinlock_recursive.h   |  2 +-
 .../odp/arch/arm32-linux/odp/api/abi/std_clib.h|  2 +-
 .../odp/arch/arm32-linux/odp/api/abi/std_types.h   |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/sync.h|  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/thread.h  |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/thrmask.h |  2 +-
 .../odp/arch/arm32-linux/odp/api/abi/ticketlock.h  |  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/time.h|  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/timer.h   |  2 +-
 .../arch/arm32-linux/odp/api/abi/traffic_mngr.h|  2 +-
 include/odp/arch/arm32-linux/odp/api/abi/version.h |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/atomic.h  |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/barrier.h |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/buffer.h  |  2 +-
 .../odp/arch/arm64-linux/odp/api/abi/byteorder.h   |  2 +-
 .../arch/arm64-linux/odp/api/abi/classification.h  |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/cpumask.h |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/crypto.h  |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/event.h   |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/init.h|  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/ipsec.h   |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/packet.h  |  2 +-
 .../arch/arm64-linux/odp/api/abi/packet_flags.h|  2 +-
 .../odp/arch/arm64-linux/odp/api/abi/packet_io.h   |  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/pool.h|  2 +-
 include/odp/arch/arm64-linux/odp/api/abi/queu

[lng-odp] [PATCH v10 25/30] linux-gen: move several files under ODP_ABI_COMPAT condition

2017-10-27 Thread Dmitry Eremin-Solenikov
Several files consist only (or mostly) of functions compiled only if
ODP is compiled in ABI compatibility mode. Instead of having an ifdef
inside, guard them with if ODP_ABI_COMPAT condition in Makefile.am

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 platform/linux-generic/Makefile.am  | 13 +
 .../include/odp/api/plat/ticketlock_inlines_api.h   |  6 ++
 platform/linux-generic/odp_atomic.c |  4 
 platform/linux-generic/odp_atomic_api.c | 13 +
 platform/linux-generic/odp_byteorder.c  |  6 +++---
 platform/linux-generic/odp_std_clib.c   |  6 +++---
 platform/linux-generic/odp_sync.c   |  6 +++---
 platform/linux-generic/odp_ticketlock.c | 10 +-
 8 files changed, 38 insertions(+), 26 deletions(-)
 create mode 100644 platform/linux-generic/odp_atomic_api.c

diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index f2454ac51fff..078d154f8f15 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -167,7 +167,6 @@ __LIB__libodp_linux_la_SOURCES = \
   odp_barrier.c \
   odp_bitmap.c \
   odp_buffer.c \
-  odp_byteorder.c \
   odp_chksum.c \
   odp_classification.c \
   odp_cpu.c \
@@ -215,12 +214,9 @@ __LIB__libodp_linux_la_SOURCES = \
   odp_sorted_list.c \
   odp_spinlock.c \
   odp_spinlock_recursive.c \
-  odp_std_clib.c \
-  odp_sync.c \
   odp_system_info.c \
   odp_thread.c \
   odp_thrmask.c \
-  odp_ticketlock.c \
   odp_time.c \
   odp_timer.c \
   odp_timer_wheel.c \
@@ -233,6 +229,15 @@ __LIB__libodp_linux_la_SOURCES = \
   drv_shm.c \
   drv_spinlock.c
 
+if ODP_ABI_COMPAT
+__LIB__libodp_linux_la_SOURCES += \
+  odp_atomic_api.c \
+  odp_byteorder.c \
+  odp_std_clib.c \
+  odp_sync.c \
+  odp_ticketlock.c
+endif
+
 if ARCH_IS_ARM
 __LIB__libodp_linux_la_SOURCES += arch/default/odp_cpu_arch.c \
  arch/default/odp_cpu_cycles.c \
diff --git 
a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h 
b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h
index 5efe696ff734..4f8509569228 100644
--- a/platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h
+++ b/platform/linux-generic/include/odp/api/plat/ticketlock_inlines_api.h
@@ -33,4 +33,10 @@ _ODP_INLINE int odp_ticketlock_is_locked(odp_ticketlock_t 
*lock)
return _odp_ticketlock_is_locked(lock);
 }
 
+_ODP_INLINE void odp_ticketlock_init(odp_ticketlock_t *ticketlock)
+{
+   odp_atomic_init_u32(>next_ticket, 0);
+   odp_atomic_init_u32(>cur_ticket, 0);
+}
+
 #endif
diff --git a/platform/linux-generic/odp_atomic.c 
b/platform/linux-generic/odp_atomic.c
index 1d76caf2b82f..8c46bb5bb11f 100644
--- a/platform/linux-generic/odp_atomic.c
+++ b/platform/linux-generic/odp_atomic.c
@@ -7,10 +7,6 @@
 #include "config.h"
 
 #include 
-#include 
-#if ODP_ABI_COMPAT == 1
-#include 
-#endif
 
 int odp_atomic_lock_free_u64(odp_atomic_op_t *atomic_op)
 {
diff --git a/platform/linux-generic/odp_atomic_api.c 
b/platform/linux-generic/odp_atomic_api.c
new file mode 100644
index ..a1aabb07c692
--- /dev/null
+++ b/platform/linux-generic/odp_atomic_api.c
@@ -0,0 +1,13 @@
+/* Copyright (c) 2015, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include "config.h"
+
+#include 
+
+/* Include non-inlined versions of API functions */
+#define _ODP_INLINE
+#include 
diff --git a/platform/linux-generic/odp_byteorder.c 
b/platform/linux-generic/odp_byteorder.c
index faf1c5904bb4..ff0b74b233cf 100644
--- a/platform/linux-generic/odp_byteorder.c
+++ b/platform/linux-generic/odp_byteorder.c
@@ -7,7 +7,7 @@
 #include "config.h"
 
 #include 
-#include 
-#if ODP_ABI_COMPAT == 1
+
+/* Include non-inlined versions of API functions */
+#define _ODP_INLINE
 #include 
-#endif
diff --git a/platform/linux-generic/odp_std_clib.c 
b/platform/linux-generic/odp_std_clib.c
index 38406b86b3c4..b267ea654ee2 100644
--- a/platform/linux-generic/odp_std_clib.c
+++ b/platform/linux-generic/odp_std_clib.c
@@ -7,7 +7,7 @@
 #include "config.h"
 
 #include 
-#include 
-#if ODP_ABI_COMPAT == 1

[lng-odp] [PATCH v10 27/30] linux-gen: remove static_inline.h header

2017-10-27 Thread Dmitry Eremin-Solenikov
Replace static_inline.h header with unconditional defines of _ODP_INLINE
macro (either to 'static inline' or to empty value) depending on the
compilation place.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsoleni...@linaro.org>
---
 Makefile.inc   |  1 -
 platform/linux-generic/.gitignore  |  1 -
 platform/linux-generic/Makefile.am |  3 --
 .../linux-generic/include-abi/odp/api/abi/atomic.h |  2 +-
 .../include-abi/odp/api/abi/byteorder.h|  2 +-
 .../linux-generic/include-abi/odp/api/abi/packet.h |  5 ++-
 .../include-abi/odp/api/abi/std_clib.h |  2 +-
 .../linux-generic/include-abi/odp/api/abi/sync.h   |  2 +-
 .../include-abi/odp/api/abi/ticketlock.h   |  2 +-
 .../include/odp/api/plat/packet_inlines.h  |  3 +-
 .../include/odp/api/plat/static_inline.h.in| 43 --
 platform/linux-generic/m4/configure.m4 |  1 -
 12 files changed, 10 insertions(+), 57 deletions(-)
 delete mode 100644 
platform/linux-generic/include/odp/api/plat/static_inline.h.in

diff --git a/Makefile.inc b/Makefile.inc
index 91be46bcb017..9d31dff1da9b 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -1,5 +1,4 @@
 ODP_INCLUDES = \
-   -I$(top_builddir)/platform/@with_platform@/include \
-I$(top_srcdir)/platform/@with_platform@/include \
-I$(top_srcdir)/platform/@with_platform@/arch/@ARCH_DIR@ \
-I$(top_builddir)/include \
diff --git a/platform/linux-generic/.gitignore 
b/platform/linux-generic/.gitignore
index 442e82a938bb..fd5ade7e304d 100644
--- a/platform/linux-generic/.gitignore
+++ b/platform/linux-generic/.gitignore
@@ -1,2 +1 @@
-include/odp/api/plat/static_inline.h
 libodp-linux.pc
diff --git a/platform/linux-generic/Makefile.am 
b/platform/linux-generic/Makefile.am
index 3c1551aab7a6..0a49fe67e03b 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -38,9 +38,6 @@ odpapiplatinclude_HEADERS = \
  include/odp/api/plat/ticketlock_inlines.h \
  include/odp/api/plat/ticketlock_inlines_api.h
 
-nodist_odpapiplatinclude_HEADERS = \
- include/odp/api/plat/static_inline.h
-
 if !ODP_ABI_COMPAT
 odpapiabiarchincludedir= $(includedir)/odp/api/abi
 odpapiabiarchinclude_HEADERS = \
diff --git a/platform/linux-generic/include-abi/odp/api/abi/atomic.h 
b/platform/linux-generic/include-abi/odp/api/abi/atomic.h
index 0b7b254ced23..67127aa4d64e 100644
--- a/platform/linux-generic/include-abi/odp/api/abi/atomic.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/atomic.h
@@ -63,7 +63,7 @@ typedef struct odp_atomic_u32_s odp_atomic_u32_t;
  *  @{
  */
 
-#include 
+#define _ODP_INLINE static inline
 #include 
 
 /**
diff --git a/platform/linux-generic/include-abi/odp/api/abi/byteorder.h 
b/platform/linux-generic/include-abi/odp/api/abi/byteorder.h
index 0f8fac0b16c8..da07c0eb0b87 100644
--- a/platform/linux-generic/include-abi/odp/api/abi/byteorder.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/byteorder.h
@@ -75,7 +75,7 @@ typedef uint64_t __odp_bitwiseodp_u64be_t;
 typedef uint16_t __odp_bitwise  odp_u16sum_t;
 typedef uint32_t __odp_bitwise  odp_u32sum_t;
 
-#include 
+#define _ODP_INLINE static inline
 #include 
 
 /**
diff --git a/platform/linux-generic/include-abi/odp/api/abi/packet.h 
b/platform/linux-generic/include-abi/odp/api/abi/packet.h
index 31d446f8dd9f..1aa7cbd5838e 100644
--- a/platform/linux-generic/include-abi/odp/api/abi/packet.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/packet.h
@@ -32,6 +32,9 @@ typedef ODP_HANDLE_T(odp_packet_t);
 
 typedef uint8_t odp_packet_seg_t;
 
+/* or it will be provided by packet_inlines.h */
+#define _ODP_HAVE_PACKET_SEG_NDX   1
+
 static inline uint8_t _odp_packet_seg_to_ndx(odp_packet_seg_t seg)
 {
return (uint8_t)seg;
@@ -53,7 +56,7 @@ typedef enum {
 
 #define ODP_NUM_PACKET_COLORS 3
 
-#include 
+#define _ODP_INLINE static inline
 #include 
 #include 
 
diff --git a/platform/linux-generic/include-abi/odp/api/abi/std_clib.h 
b/platform/linux-generic/include-abi/odp/api/abi/std_clib.h
index b31034df4705..8ef9e9ad22c8 100644
--- a/platform/linux-generic/include-abi/odp/api/abi/std_clib.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/std_clib.h
@@ -17,7 +17,7 @@
 extern "C" {
 #endif
 
-#include 
+#define _ODP_INLINE static inline
 #include 
 
 #ifdef __cplusplus
diff --git a/platform/linux-generic/include-abi/odp/api/abi/sync.h 
b/platform/linux-generic/include-abi/odp/api/abi/sync.h
index 74e3fb15fef9..9ecc40f227c7 100644
--- a/platform/linux-generic/include-abi/odp/api/abi/sync.h
+++ b/platform/linux-generic/include-abi/odp/api/abi/sync.h
@@ -21,7 +21,7 @@ extern "C" {
  *  @{
  */
 
-#include 
+#define _ODP_INLINE static inline
 #include 
 
 /**
diff --git a/platform/linux-generic/include-abi/odp/api/abi/ticketlock.h 
b/platform/linux-generic/include-abi/odp/

<    1   2   3   4   5   >