DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] cmdline: replace FreeBSD ifdef for IP address parsing
@ 2019-11-06 12:09 Thomas Monjalon
  2019-11-06 12:11 ` Burakov, Anatoly
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Thomas Monjalon @ 2019-11-06 12:09 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, Olivier Matz; +Cc: dev

The constants like AF_INET are in sys/socket.h in FreeBSD.
The #ifdef macro __FreeBSD__ is replaced with RTE_EXEC_ENV_FREEBSD
in order to be consistent across DPDK files, and allow to grep
for EXEC_ENV among other benefits.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 app/test-pmd/cmdline.c                    | 2 +-
 app/test/test_cmdline_ipaddr.c            | 2 +-
 examples/cmdline/commands.c               | 2 +-
 lib/librte_cmdline/cmdline_parse_ipaddr.c | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 4478069911..74e02d6813 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -11,7 +11,7 @@
 #include <termios.h>
 #include <unistd.h>
 #include <inttypes.h>
-#ifdef __FreeBSD__
+#ifdef RTE_EXEC_ENV_FREEBSD
 #include <sys/socket.h>
 #endif
 #include <netinet/in.h>
diff --git a/app/test/test_cmdline_ipaddr.c b/app/test/test_cmdline_ipaddr.c
index 2d11ce936c..315ac3a9f8 100644
--- a/app/test/test_cmdline_ipaddr.c
+++ b/app/test/test_cmdline_ipaddr.c
@@ -6,7 +6,7 @@
 #include <string.h>
 #include <inttypes.h>
 #include <netinet/in.h>
-#ifdef __FreeBSD__
+#ifdef RTE_EXEC_ENV_FREEBSD
 #include <sys/socket.h>
 #endif
 
diff --git a/examples/cmdline/commands.c b/examples/cmdline/commands.c
index 1249ee7a8a..4badffc257 100644
--- a/examples/cmdline/commands.c
+++ b/examples/cmdline/commands.c
@@ -12,7 +12,7 @@
 #include <errno.h>
 #include <netinet/in.h>
 #include <termios.h>
-#ifdef __FreeBSD__
+#ifdef RTE_EXEC_ENV_FREEBSD
 #include <sys/socket.h>
 #endif
 
diff --git a/lib/librte_cmdline/cmdline_parse_ipaddr.c b/lib/librte_cmdline/cmdline_parse_ipaddr.c
index 848c1eb07d..4de5ba35ae 100644
--- a/lib/librte_cmdline/cmdline_parse_ipaddr.c
+++ b/lib/librte_cmdline/cmdline_parse_ipaddr.c
@@ -13,7 +13,7 @@
 #include <errno.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
-#ifdef __FreeBSD__
+#ifdef RTE_EXEC_ENV_FREEBSD
 #include <sys/socket.h>
 #endif
 
-- 
2.23.0


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

* Re: [dpdk-dev] [PATCH] cmdline: replace FreeBSD ifdef for IP address parsing
  2019-11-06 12:09 [dpdk-dev] [PATCH] cmdline: replace FreeBSD ifdef for IP address parsing Thomas Monjalon
@ 2019-11-06 12:11 ` Burakov, Anatoly
  2019-11-08  8:44 ` Olivier Matz
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Burakov, Anatoly @ 2019-11-06 12:11 UTC (permalink / raw)
  To: Thomas Monjalon, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger,
	Olivier Matz
  Cc: dev

On 06-Nov-19 12:09 PM, Thomas Monjalon wrote:
> The constants like AF_INET are in sys/socket.h in FreeBSD.
> The #ifdef macro __FreeBSD__ is replaced with RTE_EXEC_ENV_FREEBSD
> in order to be consistent across DPDK files, and allow to grep
> for EXEC_ENV among other benefits.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

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

* Re: [dpdk-dev] [PATCH] cmdline: replace FreeBSD ifdef for IP address parsing
  2019-11-06 12:09 [dpdk-dev] [PATCH] cmdline: replace FreeBSD ifdef for IP address parsing Thomas Monjalon
  2019-11-06 12:11 ` Burakov, Anatoly
@ 2019-11-08  8:44 ` Olivier Matz
  2019-11-08 10:18   ` David Marchand
  2019-11-08 16:15 ` Stephen Hemminger
  2019-11-08 18:00 ` [dpdk-dev] [PATCH] cmdline: remove unnecessary #ifdef Stephen Hemminger
  3 siblings, 1 reply; 10+ messages in thread
From: Olivier Matz @ 2019-11-08  8:44 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, dev

On Wed, Nov 06, 2019 at 01:09:43PM +0100, Thomas Monjalon wrote:
> The constants like AF_INET are in sys/socket.h in FreeBSD.
> The #ifdef macro __FreeBSD__ is replaced with RTE_EXEC_ENV_FREEBSD
> in order to be consistent across DPDK files, and allow to grep
> for EXEC_ENV among other benefits.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Acked-by: Olivier Matz <olivier.matz@6wind.com>

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

* Re: [dpdk-dev] [PATCH] cmdline: replace FreeBSD ifdef for IP address parsing
  2019-11-08  8:44 ` Olivier Matz
@ 2019-11-08 10:18   ` David Marchand
  0 siblings, 0 replies; 10+ messages in thread
From: David Marchand @ 2019-11-08 10:18 UTC (permalink / raw)
  To: Olivier Matz
  Cc: Thomas Monjalon, Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, dev

On Fri, Nov 8, 2019 at 9:44 AM Olivier Matz <olivier.matz@6wind.com> wrote:
>
> On Wed, Nov 06, 2019 at 01:09:43PM +0100, Thomas Monjalon wrote:
> > The constants like AF_INET are in sys/socket.h in FreeBSD.
> > The #ifdef macro __FreeBSD__ is replaced with RTE_EXEC_ENV_FREEBSD
> > in order to be consistent across DPDK files, and allow to grep
> > for EXEC_ENV among other benefits.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
On 06-Nov-19 12:09 PM, Thomas Monjalon wrote:
> The constants like AF_INET are in sys/socket.h in FreeBSD.
> The #ifdef macro __FreeBSD__ is replaced with RTE_EXEC_ENV_FREEBSD
> in order to be consistent across DPDK files, and allow to grep
> for EXEC_ENV among other benefits.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Applied, thanks.



--
David Marchand


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

* Re: [dpdk-dev] [PATCH] cmdline: replace FreeBSD ifdef for IP address parsing
  2019-11-06 12:09 [dpdk-dev] [PATCH] cmdline: replace FreeBSD ifdef for IP address parsing Thomas Monjalon
  2019-11-06 12:11 ` Burakov, Anatoly
  2019-11-08  8:44 ` Olivier Matz
@ 2019-11-08 16:15 ` Stephen Hemminger
  2019-11-08 16:28   ` Thomas Monjalon
  2019-11-08 18:00 ` [dpdk-dev] [PATCH] cmdline: remove unnecessary #ifdef Stephen Hemminger
  3 siblings, 1 reply; 10+ messages in thread
From: Stephen Hemminger @ 2019-11-08 16:15 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, Olivier Matz, dev

On Wed,  6 Nov 2019 13:09:43 +0100
Thomas Monjalon <thomas@monjalon.net> wrote:

> The constants like AF_INET are in sys/socket.h in FreeBSD.
> The #ifdef macro __FreeBSD__ is replaced with RTE_EXEC_ENV_FREEBSD
> in order to be consistent across DPDK files, and allow to grep
> for EXEC_ENV among other benefits.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>  app/test-pmd/cmdline.c                    | 2 +-
>  app/test/test_cmdline_ipaddr.c            | 2 +-
>  examples/cmdline/commands.c               | 2 +-
>  lib/librte_cmdline/cmdline_parse_ipaddr.c | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index 4478069911..74e02d6813 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -11,7 +11,7 @@
>  #include <termios.h>
>  #include <unistd.h>
>  #include <inttypes.h>
> -#ifdef __FreeBSD__
> +#ifdef RTE_EXEC_ENV_FREEBSD
>  #include <sys/socket.h>
>  #endif
>  #include <netinet/in.h>
> diff --git a/app/test/test_cmdline_ipaddr.c b/app/test/test_cmdline_ipaddr.c
> index 2d11ce936c..315ac3a9f8 100644
> --- a/app/test/test_cmdline_ipaddr.c
> +++ b/app/test/test_cmdline_ipaddr.c
> @@ -6,7 +6,7 @@
>  #include <string.h>
>  #include <inttypes.h>
>  #include <netinet/in.h>
> -#ifdef __FreeBSD__
> +#ifdef RTE_EXEC_ENV_FREEBSD
>  #include <sys/socket.h>
>  #endif
>  
> diff --git a/examples/cmdline/commands.c b/examples/cmdline/commands.c
> index 1249ee7a8a..4badffc257 100644
> --- a/examples/cmdline/commands.c
> +++ b/examples/cmdline/commands.c
> @@ -12,7 +12,7 @@
>  #include <errno.h>
>  #include <netinet/in.h>
>  #include <termios.h>
> -#ifdef __FreeBSD__
> +#ifdef RTE_EXEC_ENV_FREEBSD
>  #include <sys/socket.h>
>  #endif
>  
> diff --git a/lib/librte_cmdline/cmdline_parse_ipaddr.c b/lib/librte_cmdline/cmdline_parse_ipaddr.c
> index 848c1eb07d..4de5ba35ae 100644
> --- a/lib/librte_cmdline/cmdline_parse_ipaddr.c
> +++ b/lib/librte_cmdline/cmdline_parse_ipaddr.c
> @@ -13,7 +13,7 @@
>  #include <errno.h>
>  #include <arpa/inet.h>
>  #include <netinet/in.h>
> -#ifdef __FreeBSD__
> +#ifdef RTE_EXEC_ENV_FREEBSD
>  #include <sys/socket.h>
>  #endif
>  

Why not always include sys/socket.h having an extra include
is much less of a nuisance than a silly #ifdef.

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

* Re: [dpdk-dev] [PATCH] cmdline: replace FreeBSD ifdef for IP address parsing
  2019-11-08 16:15 ` Stephen Hemminger
@ 2019-11-08 16:28   ` Thomas Monjalon
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Monjalon @ 2019-11-08 16:28 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: Wenzhuo Lu, Jingjing Wu, Bernard Iremonger, Olivier Matz, dev

08/11/2019 17:15, Stephen Hemminger:
> On Wed,  6 Nov 2019 13:09:43 +0100
> Thomas Monjalon <thomas@monjalon.net> wrote:
> 
> > The constants like AF_INET are in sys/socket.h in FreeBSD.
> > The #ifdef macro __FreeBSD__ is replaced with RTE_EXEC_ENV_FREEBSD
> > in order to be consistent across DPDK files, and allow to grep
> > for EXEC_ENV among other benefits.
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > ---
> > -#ifdef __FreeBSD__
> > +#ifdef RTE_EXEC_ENV_FREEBSD
> >  #include <sys/socket.h>
> >  #endif
> 
> Why not always include sys/socket.h having an extra include
> is much less of a nuisance than a silly #ifdef.

Yes, good suggestion.

David already merged the patch.
Do you want to propose a patch on top?



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

* [dpdk-dev] [PATCH] cmdline: remove unnecessary #ifdef
  2019-11-06 12:09 [dpdk-dev] [PATCH] cmdline: replace FreeBSD ifdef for IP address parsing Thomas Monjalon
                   ` (2 preceding siblings ...)
  2019-11-08 16:15 ` Stephen Hemminger
@ 2019-11-08 18:00 ` Stephen Hemminger
  2019-11-11 10:41   ` Bruce Richardson
  2019-11-12  8:10   ` Olivier Matz
  3 siblings, 2 replies; 10+ messages in thread
From: Stephen Hemminger @ 2019-11-08 18:00 UTC (permalink / raw)
  To: thomas; +Cc: dev, Stephen Hemminger

The #ifdef to conditionally include <sys/socket.h> on BSD
is unnecessary. It is harmless to include the header on other
OS's. An extra include is better than an #ifdef.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test-pmd/cmdline.c                    | 2 --
 app/test/test_cmdline_ipaddr.c            | 2 --
 lib/librte_cmdline/cmdline_parse_ipaddr.c | 2 --
 3 files changed, 6 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 74e02d68130f..4e5b3afd0916 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -11,9 +11,7 @@
 #include <termios.h>
 #include <unistd.h>
 #include <inttypes.h>
-#ifdef RTE_EXEC_ENV_FREEBSD
 #include <sys/socket.h>
-#endif
 #include <netinet/in.h>
 
 #include <sys/queue.h>
diff --git a/app/test/test_cmdline_ipaddr.c b/app/test/test_cmdline_ipaddr.c
index 315ac3a9f8af..088cd5afc3ad 100644
--- a/app/test/test_cmdline_ipaddr.c
+++ b/app/test/test_cmdline_ipaddr.c
@@ -6,9 +6,7 @@
 #include <string.h>
 #include <inttypes.h>
 #include <netinet/in.h>
-#ifdef RTE_EXEC_ENV_FREEBSD
 #include <sys/socket.h>
-#endif
 
 #include <rte_string_fns.h>
 
diff --git a/lib/librte_cmdline/cmdline_parse_ipaddr.c b/lib/librte_cmdline/cmdline_parse_ipaddr.c
index 4de5ba35aecc..f8dbdf204c29 100644
--- a/lib/librte_cmdline/cmdline_parse_ipaddr.c
+++ b/lib/librte_cmdline/cmdline_parse_ipaddr.c
@@ -13,9 +13,7 @@
 #include <errno.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
-#ifdef RTE_EXEC_ENV_FREEBSD
 #include <sys/socket.h>
-#endif
 
 #include <rte_string_fns.h>
 
-- 
2.20.1


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

* Re: [dpdk-dev] [PATCH] cmdline: remove unnecessary #ifdef
  2019-11-08 18:00 ` [dpdk-dev] [PATCH] cmdline: remove unnecessary #ifdef Stephen Hemminger
@ 2019-11-11 10:41   ` Bruce Richardson
  2019-11-12  8:10   ` Olivier Matz
  1 sibling, 0 replies; 10+ messages in thread
From: Bruce Richardson @ 2019-11-11 10:41 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: thomas, dev

On Fri, Nov 08, 2019 at 10:00:35AM -0800, Stephen Hemminger wrote:
> The #ifdef to conditionally include <sys/socket.h> on BSD
> is unnecessary. It is harmless to include the header on other
> OS's. An extra include is better than an #ifdef.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  app/test-pmd/cmdline.c                    | 2 --
>  app/test/test_cmdline_ipaddr.c            | 2 --
>  lib/librte_cmdline/cmdline_parse_ipaddr.c | 2 --
>  3 files changed, 6 deletions(-)
> 
Seems reasonable

Acked-by: Bruce Richardson <bruce.richardson@intel.com>


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

* Re: [dpdk-dev] [PATCH] cmdline: remove unnecessary #ifdef
  2019-11-08 18:00 ` [dpdk-dev] [PATCH] cmdline: remove unnecessary #ifdef Stephen Hemminger
  2019-11-11 10:41   ` Bruce Richardson
@ 2019-11-12  8:10   ` Olivier Matz
  2019-11-12 19:14     ` David Marchand
  1 sibling, 1 reply; 10+ messages in thread
From: Olivier Matz @ 2019-11-12  8:10 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: thomas, dev

On Fri, Nov 08, 2019 at 10:00:35AM -0800, Stephen Hemminger wrote:
> The #ifdef to conditionally include <sys/socket.h> on BSD
> is unnecessary. It is harmless to include the header on other
> OS's. An extra include is better than an #ifdef.
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

Acked-by: Olivier Matz <olivier.matz@6wind.com>

Thanks

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

* Re: [dpdk-dev] [PATCH] cmdline: remove unnecessary #ifdef
  2019-11-12  8:10   ` Olivier Matz
@ 2019-11-12 19:14     ` David Marchand
  0 siblings, 0 replies; 10+ messages in thread
From: David Marchand @ 2019-11-12 19:14 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Thomas Monjalon, dev, Bruce Richardson, Olivier Matz

On Tue, Nov 12, 2019 at 9:11 AM Olivier Matz <olivier.matz@6wind.com> wrote:
>
> On Fri, Nov 08, 2019 at 10:00:35AM -0800, Stephen Hemminger wrote:
> > The #ifdef to conditionally include <sys/socket.h> on BSD
> > is unnecessary. It is harmless to include the header on other
> > OS's. An extra include is better than an #ifdef.
> >
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Applied, thanks.



--
David Marchand


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

end of thread, other threads:[~2019-11-12 19:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 12:09 [dpdk-dev] [PATCH] cmdline: replace FreeBSD ifdef for IP address parsing Thomas Monjalon
2019-11-06 12:11 ` Burakov, Anatoly
2019-11-08  8:44 ` Olivier Matz
2019-11-08 10:18   ` David Marchand
2019-11-08 16:15 ` Stephen Hemminger
2019-11-08 16:28   ` Thomas Monjalon
2019-11-08 18:00 ` [dpdk-dev] [PATCH] cmdline: remove unnecessary #ifdef Stephen Hemminger
2019-11-11 10:41   ` Bruce Richardson
2019-11-12  8:10   ` Olivier Matz
2019-11-12 19:14     ` David Marchand

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