[lng-odp-dpk,09/24] linux-dpdk: porting "inline: rename _STATIC to _ODP_INLINE"

Message ID 1491483192-32007-10-git-send-email-balakrishna.garapati@linaro.org
State New
Headers show
Series
  • porting & fixes after odp v1.14 merge
Related show

Commit Message

Krishna Garapati April 6, 2017, 12:53 p.m.
Signed-off-by: Balakrishna Garapati <balakrishna.garapati@linaro.org>
---
 platform/linux-dpdk/include/odp/api/plat/event_types.h          | 8 ++------
 platform/linux-dpdk/include/odp/api/plat/packet_flags_inlines.h | 4 ++--
 platform/linux-dpdk/include/odp/api/plat/static_inline.h.in     | 4 ++--
 platform/linux-dpdk/include/odp/api/plat/std_clib_inlines.h     | 6 +++---
 4 files changed, 9 insertions(+), 13 deletions(-)

Comments

Yi He April 7, 2017, 6:16 a.m. | #1
On 6 April 2017 at 20:53, Balakrishna Garapati <
balakrishna.garapati@linaro.org> wrote:

> Signed-off-by: Balakrishna Garapati <balakrishna.garapati@linaro.org>
> ---
>  platform/linux-dpdk/include/odp/api/plat/event_types.h          | 8
> ++------
>  platform/linux-dpdk/include/odp/api/plat/packet_flags_inlines.h | 4 ++--
>  platform/linux-dpdk/include/odp/api/plat/static_inline.h.in     | 4 ++--
>  platform/linux-dpdk/include/odp/api/plat/std_clib_inlines.h     | 6
> +++---
>  4 files changed, 9 insertions(+), 13 deletions(-)
>
> diff --git a/platform/linux-dpdk/include/odp/api/plat/event_types.h
> b/platform/linux-dpdk/include/odp/api/plat/event_types.h
> index b43bc2d..b6349c6 100644
> --- a/platform/linux-dpdk/include/odp/api/plat/event_types.h
> +++ b/platform/linux-dpdk/include/odp/api/plat/event_types.h
> @@ -44,16 +44,12 @@ typedef enum odp_event_type_t {
>         ODP_EVENT_CRYPTO_COMPL  = 4,
>  } odp_event_type_t;
>
> -/** Get printable format of odp_event_t */
> -static inline uint64_t odp_event_to_u64(odp_event_t hdl)
> -{
> -       return _odp_pri(hdl);
> -}
> -
>  /**
>   * @}
>   */
>
> +#endif
> +
>

I see the missing #endif in patch [1/24] appears here, better move to patch
[1/24].


>  #ifdef __cplusplus
>  }
>  #endif
> diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_flags_inlines.h
> b/platform/linux-dpdk/include/odp/api/plat/packet_flags_inlines.h
> index 7d2464e..e92f7cf 100644
> --- a/platform/linux-dpdk/include/odp/api/plat/packet_flags_inlines.h
> +++ b/platform/linux-dpdk/include/odp/api/plat/packet_flags_inlines.h
> @@ -27,12 +27,12 @@ extern const uint64_t rss_flag;
>   * odp_packet.c, where we can see the DPDK definitions.
>   *
>   */
> -_STATIC int odp_packet_has_flow_hash(odp_packet_t pkt)
> +_ODP_INLINE int odp_packet_has_flow_hash(odp_packet_t pkt)
>  {
>         return *(uint64_t *)((char *)pkt + ol_flags_offset) & rss_flag;
>  }
>
> -_STATIC void odp_packet_has_flow_hash_clr(odp_packet_t pkt)
> +_ODP_INLINE void odp_packet_has_flow_hash_clr(odp_packet_t pkt)
>  {
>         *(uint64_t *)((char *)pkt + ol_flags_offset) &= ~rss_flag;
>  }
> diff --git a/platform/linux-dpdk/include/odp/api/plat/static_inline.h.in
> b/platform/linux-dpdk/include/odp/api/plat/static_inline.h.in
> index 4562a22..b767c98 100644
> --- a/platform/linux-dpdk/include/odp/api/plat/static_inline.h.in
> +++ b/platform/linux-dpdk/include/odp/api/plat/static_inline.h.in
> @@ -30,10 +30,10 @@ extern "C" {
>   */
>  #if @ODP_ABI_COMPAT@
>  #define ODP_ABI_COMPAT 1
> -#define _STATIC
> +#define _ODP_INLINE
>  #else
>  #define ODP_ABI_COMPAT 0
> -#define _STATIC static inline
> +#define _ODP_INLINE static inline
>  #endif
>
>  #ifdef __cplusplus
> diff --git a/platform/linux-dpdk/include/odp/api/plat/std_clib_inlines.h
> b/platform/linux-dpdk/include/odp/api/plat/std_clib_inlines.h
> index 4b02aba..b305fe8 100644
> --- a/platform/linux-dpdk/include/odp/api/plat/std_clib_inlines.h
> +++ b/platform/linux-dpdk/include/odp/api/plat/std_clib_inlines.h
> @@ -16,17 +16,17 @@ extern "C" {
>
>  extern void* (*const dpdk_memcpy)(void*, const void*, size_t);
>
> -_STATIC void *odp_memcpy(void *dst, const void *src, size_t num)
> +_ODP_INLINE void *odp_memcpy(void *dst, const void *src, size_t num)
>  {
>         return (*dpdk_memcpy)(dst, src, num);
>  }
>
> -_STATIC void *odp_memset(void *ptr, int value, size_t num)
> +_ODP_INLINE void *odp_memset(void *ptr, int value, size_t num)
>  {
>         return memset(ptr, value, num);
>  }
>
> -_STATIC int odp_memcmp(const void *ptr1, const void *ptr2, size_t num)
> +_ODP_INLINE int odp_memcmp(const void *ptr1, const void *ptr2, size_t num)
>  {
>         return memcmp(ptr1, ptr2, num);
>  }
> --
> 1.9.1
>
> _______________________________________________
> lng-odp-dpdk mailing list
> lng-odp-dpdk@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/lng-odp-dpdk
>

Patch

diff --git a/platform/linux-dpdk/include/odp/api/plat/event_types.h b/platform/linux-dpdk/include/odp/api/plat/event_types.h
index b43bc2d..b6349c6 100644
--- a/platform/linux-dpdk/include/odp/api/plat/event_types.h
+++ b/platform/linux-dpdk/include/odp/api/plat/event_types.h
@@ -44,16 +44,12 @@  typedef enum odp_event_type_t {
 	ODP_EVENT_CRYPTO_COMPL	= 4,
 } odp_event_type_t;
 
-/** Get printable format of odp_event_t */
-static inline uint64_t odp_event_to_u64(odp_event_t hdl)
-{
-	return _odp_pri(hdl);
-}
-
 /**
  * @}
  */
 
+#endif
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/platform/linux-dpdk/include/odp/api/plat/packet_flags_inlines.h b/platform/linux-dpdk/include/odp/api/plat/packet_flags_inlines.h
index 7d2464e..e92f7cf 100644
--- a/platform/linux-dpdk/include/odp/api/plat/packet_flags_inlines.h
+++ b/platform/linux-dpdk/include/odp/api/plat/packet_flags_inlines.h
@@ -27,12 +27,12 @@  extern const uint64_t rss_flag;
  * odp_packet.c, where we can see the DPDK definitions.
  *
  */
-_STATIC int odp_packet_has_flow_hash(odp_packet_t pkt)
+_ODP_INLINE int odp_packet_has_flow_hash(odp_packet_t pkt)
 {
 	return *(uint64_t *)((char *)pkt + ol_flags_offset) & rss_flag;
 }
 
-_STATIC void odp_packet_has_flow_hash_clr(odp_packet_t pkt)
+_ODP_INLINE void odp_packet_has_flow_hash_clr(odp_packet_t pkt)
 {
 	*(uint64_t *)((char *)pkt + ol_flags_offset) &= ~rss_flag;
 }
diff --git a/platform/linux-dpdk/include/odp/api/plat/static_inline.h.in b/platform/linux-dpdk/include/odp/api/plat/static_inline.h.in
index 4562a22..b767c98 100644
--- a/platform/linux-dpdk/include/odp/api/plat/static_inline.h.in
+++ b/platform/linux-dpdk/include/odp/api/plat/static_inline.h.in
@@ -30,10 +30,10 @@  extern "C" {
  */
 #if @ODP_ABI_COMPAT@
 #define ODP_ABI_COMPAT 1
-#define _STATIC
+#define _ODP_INLINE
 #else
 #define ODP_ABI_COMPAT 0
-#define _STATIC static inline
+#define _ODP_INLINE static inline
 #endif
 
 #ifdef __cplusplus
diff --git a/platform/linux-dpdk/include/odp/api/plat/std_clib_inlines.h b/platform/linux-dpdk/include/odp/api/plat/std_clib_inlines.h
index 4b02aba..b305fe8 100644
--- a/platform/linux-dpdk/include/odp/api/plat/std_clib_inlines.h
+++ b/platform/linux-dpdk/include/odp/api/plat/std_clib_inlines.h
@@ -16,17 +16,17 @@  extern "C" {
 
 extern void* (*const dpdk_memcpy)(void*, const void*, size_t);
 
-_STATIC void *odp_memcpy(void *dst, const void *src, size_t num)
+_ODP_INLINE void *odp_memcpy(void *dst, const void *src, size_t num)
 {
 	return (*dpdk_memcpy)(dst, src, num);
 }
 
-_STATIC void *odp_memset(void *ptr, int value, size_t num)
+_ODP_INLINE void *odp_memset(void *ptr, int value, size_t num)
 {
 	return memset(ptr, value, num);
 }
 
-_STATIC int odp_memcmp(const void *ptr1, const void *ptr2, size_t num)
+_ODP_INLINE int odp_memcmp(const void *ptr1, const void *ptr2, size_t num)
 {
 	return memcmp(ptr1, ptr2, num);
 }