[v2] eventdev: drop custom OS defines

Message ID 20231004162834.249828-1-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [v2] eventdev: drop custom OS defines |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build success github build: passed
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Bruce Richardson Oct. 4, 2023, 4:28 p.m. UTC
  The eventdev library doesn't need to put in place its own defines for
Linux and BSD. There are already defines for the OS environment in
rte_config.h that can be re-used, but since these are just for
identifying Linux/non-Linux, we can just check for the standard define
'__linux__' instead.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/eventdev/meson.build                | 6 ------
 lib/eventdev/rte_event_eth_rx_adapter.c | 6 +++---
 2 files changed, 3 insertions(+), 9 deletions(-)
  

Comments

Jerin Jacob Oct. 4, 2023, 5:39 p.m. UTC | #1
On Wed, Oct 4, 2023 at 10:05 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> The eventdev library doesn't need to put in place its own defines for
> Linux and BSD. There are already defines for the OS environment in
> rte_config.h that can be re-used, but since these are just for
> identifying Linux/non-Linux, we can just check for the standard define
> '__linux__' instead.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Acked-by: Jerin Jacob <jerinj@marvell.com>
Applied to dpdk-next-net-eventdev/for-main. Thanks


> ---
>  lib/eventdev/meson.build                | 6 ------
>  lib/eventdev/rte_event_eth_rx_adapter.c | 6 +++---
>  2 files changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/lib/eventdev/meson.build b/lib/eventdev/meson.build
> index 250abcb154..a04bb86f0f 100644
> --- a/lib/eventdev/meson.build
> +++ b/lib/eventdev/meson.build
> @@ -7,12 +7,6 @@ if is_windows
>      subdir_done()
>  endif
>
> -if is_linux
> -    cflags += '-DLINUX'
> -else
> -    cflags += '-DBSD'
> -endif
> -
>  sources = files(
>          'eventdev_private.c',
>          'eventdev_trace_points.c',
> diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c
> index ea7106a1fe..6db03adf04 100644
> --- a/lib/eventdev/rte_event_eth_rx_adapter.c
> +++ b/lib/eventdev/rte_event_eth_rx_adapter.c
> @@ -5,7 +5,7 @@
>  #include <ctype.h>
>  #include <stdlib.h>
>  #include <pthread.h>
> -#if defined(LINUX)
> +#if defined(__linux__)
>  #include <sys/epoll.h>
>  #endif
>  #include <unistd.h>
> @@ -1567,11 +1567,11 @@ rxa_default_conf_cb(uint8_t id, uint8_t dev_id,
>  static int
>  rxa_epoll_create1(void)
>  {
> -#if defined(LINUX)
> +#if defined(__linux__)
>         int fd;
>         fd = epoll_create1(EPOLL_CLOEXEC);
>         return fd < 0 ? -errno : fd;
> -#elif defined(BSD)
> +#else
>         return -ENOTSUP;
>  #endif
>  }
> --
> 2.39.2
>
  

Patch

diff --git a/lib/eventdev/meson.build b/lib/eventdev/meson.build
index 250abcb154..a04bb86f0f 100644
--- a/lib/eventdev/meson.build
+++ b/lib/eventdev/meson.build
@@ -7,12 +7,6 @@  if is_windows
     subdir_done()
 endif
 
-if is_linux
-    cflags += '-DLINUX'
-else
-    cflags += '-DBSD'
-endif
-
 sources = files(
         'eventdev_private.c',
         'eventdev_trace_points.c',
diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c
index ea7106a1fe..6db03adf04 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/eventdev/rte_event_eth_rx_adapter.c
@@ -5,7 +5,7 @@ 
 #include <ctype.h>
 #include <stdlib.h>
 #include <pthread.h>
-#if defined(LINUX)
+#if defined(__linux__)
 #include <sys/epoll.h>
 #endif
 #include <unistd.h>
@@ -1567,11 +1567,11 @@  rxa_default_conf_cb(uint8_t id, uint8_t dev_id,
 static int
 rxa_epoll_create1(void)
 {
-#if defined(LINUX)
+#if defined(__linux__)
 	int fd;
 	fd = epoll_create1(EPOLL_CLOEXEC);
 	return fd < 0 ? -errno : fd;
-#elif defined(BSD)
+#else
 	return -ENOTSUP;
 #endif
 }