[PATCHv2] linux-dpdk: porting "de-couple abi compatibility from shared lib"

Message ID B32743B7-067A-445A-BE13-37DA35435750@nokia-bell-labs.com
State New
Headers show

Commit Message

Elo, Matias (Nokia - FI/Espoo) Oct. 26, 2016, 2:09 p.m.
Now using '--disable-abi-compat’ configure flag breaks build:

-Matias

  CC       ../linux-generic/odp_classification.lo
In file included from ./include/odp/api/packet.h:33:0,
                 from ./include/odp_packet_internal.h:27,
                 from ../linux-generic/odp_classification.c:13:
./include/odp/api/plat/packet_inlines.h: In function ‘odp_packet_len’:
./include/odp/api/plat/packet_inlines.h:42:45: error: ‘pkt_len_offset’ undeclared (first use in this function)
  return *(uint32_t *)(void *)((char *)pkt + pkt_len_offset);
                                             ^
./include/odp/api/plat/packet_inlines.h:42:45: note: each undeclared identifier is reported only once for each function it appears in
./include/odp/api/plat/packet_inlines.h: In function ‘odp_packet_seg_len’:
./include/odp/api/plat/packet_inlines.h:47:45: error: ‘seg_len_offset’ undeclared (first use in this function)
  return *(uint16_t *)(void *)((char *)pkt + seg_len_offset);
                                             ^
./include/odp/api/plat/packet_inlines.h: In function ‘odp_packet_user_area’:
./include/odp/api/plat/packet_inlines.h:52:32: error: ‘udata_offset’ undeclared (first use in this function)
  return (void *)((char *)pkt + udata_offset);
                                ^
./include/odp/api/plat/packet_inlines.h: In function ‘odp_packet_user_area_size’:
./include/odp/api/plat/packet_inlines.h:57:45: error: ‘udata_len_offset’ undeclared (first use in this function)
  return *(uint32_t *)(void *)((char *)pkt + udata_len_offset);
                                             ^
./include/odp/api/plat/packet_inlines.h: In function ‘odp_packet_data’:
./include/odp/api/plat/packet_inlines.h:62:52: error: ‘buf_addr_offset’ undeclared (first use in this function)
  char **buf_addr = (char **)(void *)((char *)pkt + buf_addr_offset);
                                                    ^
./include/odp/api/plat/packet_inlines.h:64:39: error: ‘data_off_offset’ undeclared (first use in this function)
   *(uint16_t *)(void *)((char *)pkt + data_off_offset);
                                       ^
./include/odp/api/plat/packet_inlines.h: In function ‘odp_packet_flow_hash’:
./include/odp/api/plat/packet_inlines.h:71:45: error: ‘rss_offset’ undeclared (first use in this function)
  return *(uint32_t *)(void *)((char *)pkt + rss_offset);
                                             ^
./include/odp/api/plat/packet_inlines.h: In function ‘odp_packet_flow_hash_set’:
./include/odp/api/plat/packet_inlines.h:76:38: error: ‘rss_offset’ undeclared (first use in this function)
  *(uint32_t *)(void *)((char *)pkt + rss_offset) = flow_hash;
                                      ^
./include/odp/api/plat/packet_inlines.h:77:38: error: ‘ol_flags_offset’ undeclared (first use in this function)
  *(uint64_t *)(void *)((char *)pkt + ol_flags_offset) |= rss_flag;
                                      ^
./include/odp/api/plat/packet_inlines.h:77:58: error: ‘rss_flag’ undeclared (first use in this function)
  *(uint64_t *)(void *)((char *)pkt + ol_flags_offset) |= rss_flag;
                                                          ^
./include/odp/api/plat/packet_inlines.h: In function ‘odp_packet_len’:
./include/odp/api/plat/packet_inlines.h:43:1: error: control reaches end of non-void function [-Werror=return-type]
 }





On 26 Oct 2016, at 15:03, Balakrishna Garapati <balakrishna.garapati@linaro.org<mailto:balakrishna.garapati@linaro.org>> wrote:

porting f83b71e6a9c685227615455df1f9e4fefeff19ae

Signed-off-by: Balakrishna Garapati <balakrishna.garapati@linaro.org<mailto:balakrishna.garapati@linaro.org>>

---

since v1: Updates to linux-dpdk includes with correct inline include header

platform/linux-dpdk/.gitignore                        |  2 +-
platform/linux-dpdk/Makefile.am                       |  2 +-
platform/linux-dpdk/include/odp/api/packet.h          |  4 ++--
platform/linux-dpdk/include/odp/api/packet_flags.h    |  4 ++--
.../odp/api/plat/{inlines.h.in => static_inline.h.in} | 19 +++++++++----------
platform/linux-dpdk/include/odp/api/std_clib.h        |  4 ++--
platform/linux-dpdk/m4/configure.m4                   |  3 +--
7 files changed, 18 insertions(+), 20 deletions(-)
rename platform/linux-dpdk/include/odp/api/plat/{inlines.h.in => static_inline.h.in} (58%)

--
1.9.1

_______________________________________________
lng-odp-dpdk mailing list
lng-odp-dpdk@lists.linaro.org<mailto:lng-odp-dpdk@lists.linaro.org>
https://lists.linaro.org/mailman/listinfo/lng-odp-dpdk

Patch hide | download patch | download mbox

diff --git a/platform/linux-dpdk/.gitignore b/platform/linux-dpdk/.gitignore
index 654e50c..909756a 100644
--- a/platform/linux-dpdk/.gitignore
+++ b/platform/linux-dpdk/.gitignore
@@ -1 +1 @@ 
-include/odp/api/plat/inlines.h
\ No newline at end of file
+include/odp/api/plat/static_inline.h
diff --git a/platform/linux-dpdk/Makefile.am b/platform/linux-dpdk/Makefile.am
index 1c6295d..488f2c0 100644
--- a/platform/linux-dpdk/Makefile.am
+++ b/platform/linux-dpdk/Makefile.am
@@ -78,6 +78,7 @@  odpapiinclude_HEADERS = \

odpapiplatincludedir= $(includedir)/odp/api/plat
odpapiplatinclude_HEADERS = \
+  $(builddir)/include/odp/api/plat/static_inline.h \
 $(srcdir)/include/odp/api/plat/atomic_types.h \
 $(srcdir)/include/odp/api/plat/barrier_types.h \
 $(srcdir)/include/odp/api/plat/buffer_types.h \
@@ -87,7 +88,6 @@  odpapiplatinclude_HEADERS = \
 $(srcdir)/include/odp/api/plat/crypto_types.h \
 $(srcdir)/include/odp/api/plat/event_types.h \
 $(srcdir)/include/odp/api/plat/init_types.h \
-  $(srcdir)/include/odp/api/plat/inlines.h \
 $(srcdir)/include/odp/api/plat/packet_flags_inlines.h \
 $(srcdir)/include/odp/api/plat/packet_inlines.h \
 $(srcdir)/include/odp/api/plat/packet_io_types.h \
diff --git a/platform/linux-dpdk/include/odp/api/packet.h b/platform/linux-dpdk/include/odp/api/packet.h
index f9123d8..9df5602 100644
--- a/platform/linux-dpdk/include/odp/api/packet.h
+++ b/platform/linux-dpdk/include/odp/api/packet.h
@@ -28,8 +28,8 @@  extern "C" {
 *  @{
 */

-#include <odp/api/plat/inlines.h>
-#ifdef _ODP_INLINES
+#include <odp/api/plat/static_inline.h>
+#if ODP_ABI_COMPAT == 0
#include <odp/api/plat/packet_inlines.h>
#endif

diff --git a/platform/linux-dpdk/include/odp/api/packet_flags.h b/platform/linux-dpdk/include/odp/api/packet_flags.h
index b6ae9f8..d5fa755 100644
--- a/platform/linux-dpdk/include/odp/api/packet_flags.h
+++ b/platform/linux-dpdk/include/odp/api/packet_flags.h
@@ -28,8 +28,8 @@  extern "C" {
 *  @{
 */

-#include <odp/api/plat/inlines.h>
-#ifdef _ODP_INLINES
+#include <odp/api/plat/static_inline.h>
+#if ODP_ABI_COMPAT == 0
#include <odp/api/plat/packet_flags_inlines.h>
#endif

diff --git a/platform/linux-dpdk/include/odp/api/plat/inlines.h.in b/platform/linux-dpdk/include/odp/api/plat/static_inline.h.in
similarity index 58%
rename from platform/linux-dpdk/include/odp/api/plat/inlines.h.in
rename to platform/linux-dpdk/include/odp/api/plat/static_inline.h.in
index 43e542b..acee5f3 100644
--- a/platform/linux-dpdk/include/odp/api/plat/inlines.h.in
+++ b/platform/linux-dpdk/include/odp/api/plat/static_inline.h.in
@@ -7,27 +7,26 @@ 
/**
 * @file
 *
- * ODP packet inline functions
+ * Macro for static inline functions
 */

-#ifndef ODP_PLAT_INLINES_H_
-#define ODP_PLAT_INLINES_H_
+#ifndef ODP_PLAT_STATIC_INLINE_H_
+#define ODP_PLAT_STATIC_INLINE_H_

#ifdef __cplusplus
extern "C" {
#endif

-#define @_ODP_INLINES@
-
-#ifdef _ODP_INLINES
-#define _STATIC static inline
-#else
+#if @ODP_ABI_COMPAT@
+#define ODP_ABI_COMPAT 1
#define _STATIC
+#else
+#define ODP_ABI_COMPAT 0
+#define _STATIC static inline
#endif

#ifdef __cplusplus
}
#endif

-
-#endif /* ODP_PLAT_INLINES_H_ */
+#endif
diff --git a/platform/linux-dpdk/include/odp/api/std_clib.h b/platform/linux-dpdk/include/odp/api/std_clib.h
index c498f68..fea4725 100644
--- a/platform/linux-dpdk/include/odp/api/std_clib.h
+++ b/platform/linux-dpdk/include/odp/api/std_clib.h
@@ -14,8 +14,8 @@  extern "C" {
#include <odp/api/spec/std_types.h>
#include <string.h>

-#include <odp/api/plat/inlines.h>
-#ifdef _ODP_INLINES
+#include <odp/api/plat/static_inline.h>
+#if ODP_ABI_COMPAT == 0
#include <odp/api/plat/std_clib_inlines.h>
#endif

diff --git a/platform/linux-dpdk/m4/configure.m4 b/platform/linux-dpdk/m4/configure.m4
index 6807de4..fb50841 100644
--- a/platform/linux-dpdk/m4/configure.m4
+++ b/platform/linux-dpdk/m4/configure.m4
@@ -75,5 +75,4 @@  LDFLAGS=$OLD_LDFLAGS
CPPFLAGS=$OLD_CPPFLAGS

AC_CONFIG_FILES([platform/linux-dpdk/Makefile
- platform/linux-dpdk/include/odp/api/plat/inlines.h])
-
+ platform/linux-dpdk/include/odp/api/plat/static_inline.h])