@@ -34,6 +34,7 @@ helperinclude_HEADERS = \
$(srcdir)/include/odp/helper/table.h\
$(srcdir)/include/odp/helper/threads.h \
$(srcdir)/include/odp/helper/udp.h \
+ $(srcdir)/include/odp/helper/udp_inlines.h \
$(srcdir)/include/odp/helper/udp_types.h
if helper_extn
@@ -53,7 +54,8 @@ __LIB__libodphelper_@with_platform@_la_SOURCES = \
lineartable.c \
cuckootable.c \
iplookuptable.c \
- threads.c
+ threads.c \
+ udp.c
if helper_extn
__LIB__libodphelper_@with_platform@_la_SOURCES += \
@@ -25,6 +25,7 @@ extern "C" {
*/
/**
+ * @fn odph_ipv4_udp_chksum(odp_packet_t pkt)
* UDP checksum
*
* This function calculates the UDP checksum given an odp packet.
@@ -32,14 +33,12 @@ extern "C" {
* @param pkt calculate chksum for pkt
* @return checksum value in BE endianness
*/
-static inline uint16_t odph_ipv4_udp_chksum(odp_packet_t pkt)
-{
- uint16_t chksum;
- int rc;
- rc = odph_udp_tcp_chksum(pkt, ODPH_CHKSUM_RETURN, &chksum);
- return (rc == 0) ? chksum : 0;
-}
+#if ODP_HELPER_ABI_COMPAT == 0
+#include <odp/helper/udp_inlines.h>
+#else
+uint16_t odph_ipv4_udp_chksum(odp_packet_t pkt);
+#endif
/**
* @}
new file mode 100644
@@ -0,0 +1,36 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+/**
+ * @file
+ *
+ * ODP UDP inline header
+ */
+
+#ifndef ODPH_UDP_INLINES_H_
+#define ODPH_UDP_INLINES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <odp/helper/static_inline.h>
+#include <odp/helper/udp.h>
+
+_HELPER_STATIC uint16_t odph_ipv4_udp_chksum(odp_packet_t pkt)
+{
+ uint16_t chksum;
+ int rc;
+
+ rc = odph_udp_tcp_chksum(pkt, ODPH_CHKSUM_RETURN, &chksum);
+ return (rc == 0) ? chksum : 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
new file mode 100644
@@ -0,0 +1,14 @@
+/* Copyright (c) 2017, Linaro Limited
+ * All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <odp/helper/udp.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#if ODP_ABI_COMPAT == 1
+#include <odp/helper/udp_inlines.h>
+#endif
Signed-off-by: Mike Holmes <mike.holmes@linaro.org> --- helper/Makefile.am | 4 +++- helper/include/odp/helper/udp.h | 13 ++++++------ helper/include/odp/helper/udp_inlines.h | 36 +++++++++++++++++++++++++++++++++ helper/udp.c | 14 +++++++++++++ 4 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 helper/include/odp/helper/udp_inlines.h create mode 100644 helper/udp.c -- 2.9.3