DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] eventdev: drop custom OS defines
@ 2023-10-03 17:01 Bruce Richardson
  2023-10-04 16:05 ` [EXT] " Jerin Jacob Kollanukkaran
  2023-10-04 16:28 ` [PATCH v2] " Bruce Richardson
  0 siblings, 2 replies; 4+ messages in thread
From: Bruce Richardson @ 2023-10-03 17:01 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Jerin Jacob, Naga Harish K S V

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(-)

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 565428a58c..9090e5fbb7 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/eventdev/rte_event_eth_rx_adapter.c
@@ -4,7 +4,7 @@
  */
 #include <ctype.h>
 #include <stdlib.h>
-#if defined(LINUX)
+#if defined(__linux__)
 #include <sys/epoll.h>
 #endif
 #include <unistd.h>
@@ -1565,11 +1565,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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [EXT] [PATCH] eventdev: drop custom OS defines
  2023-10-03 17:01 [PATCH] eventdev: drop custom OS defines Bruce Richardson
@ 2023-10-04 16:05 ` Jerin Jacob Kollanukkaran
  2023-10-04 16:28 ` [PATCH v2] " Bruce Richardson
  1 sibling, 0 replies; 4+ messages in thread
From: Jerin Jacob Kollanukkaran @ 2023-10-04 16:05 UTC (permalink / raw)
  To: Bruce Richardson, dev; +Cc: Naga Harish K S V



> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: Tuesday, October 3, 2023 10:31 PM
> To: dev@dpdk.org
> Cc: Bruce Richardson <bruce.richardson@intel.com>; Jerin Jacob Kollanukkaran
> <jerinj@marvell.com>; Naga Harish K S V <s.v.naga.harish.k@intel.com>
> Subject: [EXT] [PATCH] eventdev: drop custom OS defines
> 
> External Email
> 
> ----------------------------------------------------------------------
> 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>


Could you fix the following merge conflict
Also, change subject as eventdev/eth_rx:

[for-main]dell[dpdk-next-eventdev] $ git pw series  apply 29725  
Failed to apply patch:
Applying: eventdev: drop custom OS defines
Using index info to reconstruct a base tree...
M       lib/eventdev/rte_event_eth_rx_adapter.c
Falling back to patching base and 3-way merge...
Auto-merging lib/eventdev/rte_event_eth_rx_adapter.c
CONFLICT (content): Merge conflict in lib/eventdev/rte_event_eth_rx_adapter.c
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 eventdev: drop custom OS defines
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

[for-main]dell[dpdk-next-eventdev] $ git diff
diff --cc lib/eventdev/rte_event_eth_rx_adapter.c
index ea7106a1fe,9090e5fbb7..0000000000
--- a/lib/eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/eventdev/rte_event_eth_rx_adapter.c
@@@ -4,8 -4,7 +4,12 @@@
   */
  #include <ctype.h>
  #include <stdlib.h>
++<<<<<<< HEAD
 +#include <pthread.h>
 +#if defined(LINUX)
++=======
+ #if defined(__linux__)
++>>>>>>> eventdev: drop custom OS defines


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] eventdev: drop custom OS defines
  2023-10-03 17:01 [PATCH] eventdev: drop custom OS defines Bruce Richardson
  2023-10-04 16:05 ` [EXT] " Jerin Jacob Kollanukkaran
@ 2023-10-04 16:28 ` Bruce Richardson
  2023-10-04 17:39   ` Jerin Jacob
  1 sibling, 1 reply; 4+ messages in thread
From: Bruce Richardson @ 2023-10-04 16:28 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Jerin Jacob, Naga Harish K S V

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(-)

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] eventdev: drop custom OS defines
  2023-10-04 16:28 ` [PATCH v2] " Bruce Richardson
@ 2023-10-04 17:39   ` Jerin Jacob
  0 siblings, 0 replies; 4+ messages in thread
From: Jerin Jacob @ 2023-10-04 17:39 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, Jerin Jacob, Naga Harish K S V

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
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-04 17:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-03 17:01 [PATCH] eventdev: drop custom OS defines Bruce Richardson
2023-10-04 16:05 ` [EXT] " Jerin Jacob Kollanukkaran
2023-10-04 16:28 ` [PATCH v2] " Bruce Richardson
2023-10-04 17:39   ` Jerin Jacob

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).