* [dpdk-dev] [PATCH] examples: fix clang compilation issues
@ 2014-07-21 3:47 Matthew Hall
2014-07-21 3:47 ` [dpdk-dev] [PATCH 1/4] l3fwd: some functions are unused in l3fwd-acl Matthew Hall
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Matthew Hall @ 2014-07-21 3:47 UTC (permalink / raw)
To: dev
Contains adjustments to some warnings which prevent examples from compiling
under clang.
Contains ability to override RTE_SDK_BIN in rte.extvars.mk, without which it's
impossible to compile the examples against DPDK if it compiled into any build
directory not named identically to the RTE_TARGET.
Signed-off-by: Matthew Hall <mhall@mhcomputing.net>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH 1/4] l3fwd: some functions are unused in l3fwd-acl
2014-07-21 3:47 [dpdk-dev] [PATCH] examples: fix clang compilation issues Matthew Hall
@ 2014-07-21 3:47 ` Matthew Hall
2014-07-21 13:44 ` Thomas Monjalon
2014-07-21 17:37 ` Richardson, Bruce
2014-07-21 3:47 ` [dpdk-dev] [PATCH 2/4] virtio-net.c: incorrect parens around equality check Matthew Hall
` (2 subsequent siblings)
3 siblings, 2 replies; 12+ messages in thread
From: Matthew Hall @ 2014-07-21 3:47 UTC (permalink / raw)
To: dev
Signed-off-by: Matthew Hall <mhall@mhcomputing.net>
---
examples/l3fwd/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/examples/l3fwd/Makefile b/examples/l3fwd/Makefile
index 68de8fc..5cd7396 100644
--- a/examples/l3fwd/Makefile
+++ b/examples/l3fwd/Makefile
@@ -46,6 +46,7 @@ SRCS-y := main.c
CFLAGS += -O3 $(USER_FLAGS)
CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -Wno-unused-function
# workaround for a gcc bug with noreturn attribute
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
--
1.9.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH 2/4] virtio-net.c: incorrect parens around equality check
2014-07-21 3:47 [dpdk-dev] [PATCH] examples: fix clang compilation issues Matthew Hall
2014-07-21 3:47 ` [dpdk-dev] [PATCH 1/4] l3fwd: some functions are unused in l3fwd-acl Matthew Hall
@ 2014-07-21 3:47 ` Matthew Hall
2014-07-22 13:14 ` Thomas Monjalon
2014-07-21 3:47 ` [dpdk-dev] [PATCH 3/4] examples/*: -Wno-switch required for weird ioctl() ID's Matthew Hall
2014-07-21 3:47 ` [dpdk-dev] [PATCH 4/4] rte.extvars.mk: allow user to override RTE_SDK_BIN Matthew Hall
3 siblings, 1 reply; 12+ messages in thread
From: Matthew Hall @ 2014-07-21 3:47 UTC (permalink / raw)
To: dev
Signed-off-by: Matthew Hall <mhall@mhcomputing.net>
---
examples/vhost/virtio-net.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/examples/vhost/virtio-net.c b/examples/vhost/virtio-net.c
index 801607a..5e659c7 100644
--- a/examples/vhost/virtio-net.c
+++ b/examples/vhost/virtio-net.c
@@ -280,8 +280,8 @@ get_config_ll_entry(struct vhost_device_ctx ctx)
/* Loop through linked list until the device_fh is found. */
while (ll_dev != NULL) {
- if ((ll_dev->dev.device_fh == ctx.fh))
- return ll_dev;
+ if (ll_dev->dev.device_fh == ctx.fh)
+ return ll_dev;
ll_dev = ll_dev->next;
}
--
1.9.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH 3/4] examples/*: -Wno-switch required for weird ioctl() ID's
2014-07-21 3:47 [dpdk-dev] [PATCH] examples: fix clang compilation issues Matthew Hall
2014-07-21 3:47 ` [dpdk-dev] [PATCH 1/4] l3fwd: some functions are unused in l3fwd-acl Matthew Hall
2014-07-21 3:47 ` [dpdk-dev] [PATCH 2/4] virtio-net.c: incorrect parens around equality check Matthew Hall
@ 2014-07-21 3:47 ` Matthew Hall
2014-07-21 13:45 ` Thomas Monjalon
2014-07-21 3:47 ` [dpdk-dev] [PATCH 4/4] rte.extvars.mk: allow user to override RTE_SDK_BIN Matthew Hall
3 siblings, 1 reply; 12+ messages in thread
From: Matthew Hall @ 2014-07-21 3:47 UTC (permalink / raw)
To: dev
Signed-off-by: Matthew Hall <mhall@mhcomputing.net>
---
examples/multi_process/client_server_mp/mp_client/Makefile | 1 +
examples/multi_process/client_server_mp/mp_server/Makefile | 1 +
examples/multi_process/l2fwd_fork/Makefile | 1 +
examples/multi_process/simple_mp/Makefile | 1 +
examples/multi_process/symmetric_mp/Makefile | 1 +
examples/netmap_compat/Makefile | 2 ++
examples/netmap_compat/bridge/Makefile | 1 +
examples/vhost/Makefile | 1 +
8 files changed, 9 insertions(+)
diff --git a/examples/multi_process/client_server_mp/mp_client/Makefile b/examples/multi_process/client_server_mp/mp_client/Makefile
index 2688fed..ba2481d 100644
--- a/examples/multi_process/client_server_mp/mp_client/Makefile
+++ b/examples/multi_process/client_server_mp/mp_client/Makefile
@@ -43,6 +43,7 @@ APP = mp_client
SRCS-y := client.c
CFLAGS += $(WERROR_FLAGS) -O3
+CFLAGS += -Wno-switch
CFLAGS += -I$(SRCDIR)/../shared
include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/multi_process/client_server_mp/mp_server/Makefile b/examples/multi_process/client_server_mp/mp_server/Makefile
index c29e478..bf96c30 100644
--- a/examples/multi_process/client_server_mp/mp_server/Makefile
+++ b/examples/multi_process/client_server_mp/mp_server/Makefile
@@ -52,6 +52,7 @@ SRCS-y := main.c init.c args.c
INC := $(wildcard *.h)
CFLAGS += $(WERROR_FLAGS) -O3
+CFLAGS += -Wno-switch
CFLAGS += -I$(SRCDIR)/../shared
# for newer gcc, e.g. 4.4, no-strict-aliasing may not be necessary
diff --git a/examples/multi_process/l2fwd_fork/Makefile b/examples/multi_process/l2fwd_fork/Makefile
index ff257a3..2c5a808 100644
--- a/examples/multi_process/l2fwd_fork/Makefile
+++ b/examples/multi_process/l2fwd_fork/Makefile
@@ -46,5 +46,6 @@ SRCS-y := main.c flib.c
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -Wno-switch
include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/multi_process/simple_mp/Makefile b/examples/multi_process/simple_mp/Makefile
index 31ec0c8..dd43814 100644
--- a/examples/multi_process/simple_mp/Makefile
+++ b/examples/multi_process/simple_mp/Makefile
@@ -46,5 +46,6 @@ SRCS-y := main.c mp_commands.c
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -Wno-switch
include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/multi_process/symmetric_mp/Makefile b/examples/multi_process/symmetric_mp/Makefile
index c789f3c..9f1d184 100644
--- a/examples/multi_process/symmetric_mp/Makefile
+++ b/examples/multi_process/symmetric_mp/Makefile
@@ -46,5 +46,6 @@ SRCS-y := main.c
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -Wno-switch
include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/netmap_compat/Makefile b/examples/netmap_compat/Makefile
index d398e5f..4ee8c60 100644
--- a/examples/netmap_compat/Makefile
+++ b/examples/netmap_compat/Makefile
@@ -38,6 +38,8 @@ unexport RTE_SRCDIR RTE_OUTPUT RTE_EXTMK
DIRS-y += bridge
+CFLAGS += -Wno-switch
+
.PHONY: all clean $(DIRS-y)
all: $(DIRS-y)
diff --git a/examples/netmap_compat/bridge/Makefile b/examples/netmap_compat/bridge/Makefile
index 50d96e8..f91a634 100644
--- a/examples/netmap_compat/bridge/Makefile
+++ b/examples/netmap_compat/bridge/Makefile
@@ -56,6 +56,7 @@ SRCS-y += compat_netmap.c
CFLAGS += -O3 -I$(SRCDIR)/../lib -I$(SRCDIR)/../netmap
CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -Wno-switch
include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/vhost/Makefile b/examples/vhost/Makefile
index f45f83f..2c1f0ba 100644
--- a/examples/vhost/Makefile
+++ b/examples/vhost/Makefile
@@ -53,6 +53,7 @@ SRCS-y := main.c virtio-net.c vhost-net-cdev.c
CFLAGS += -O2 -I/usr/local/include -D_FILE_OFFSET_BITS=64 -Wno-unused-parameter
CFLAGS += $(WERROR_FLAGS)
+CFLAGS += -Wno-switch
LDFLAGS += -lfuse
include $(RTE_SDK)/mk/rte.extapp.mk
--
1.9.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [dpdk-dev] [PATCH 4/4] rte.extvars.mk: allow user to override RTE_SDK_BIN
2014-07-21 3:47 [dpdk-dev] [PATCH] examples: fix clang compilation issues Matthew Hall
` (2 preceding siblings ...)
2014-07-21 3:47 ` [dpdk-dev] [PATCH 3/4] examples/*: -Wno-switch required for weird ioctl() ID's Matthew Hall
@ 2014-07-21 3:47 ` Matthew Hall
2014-07-21 14:31 ` Thomas Monjalon
3 siblings, 1 reply; 12+ messages in thread
From: Matthew Hall @ 2014-07-21 3:47 UTC (permalink / raw)
To: dev
Without this patch it is impossible to compile the examples if you have
compiled the DPDK into the $(RTE_SDK)/build directory, or any other one
besides $(RTE_SDK)/$(RTE_TARGET).
Signed-off-by: Matthew Hall <mhall@mhcomputing.net>
---
mk/rte.extvars.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mk/rte.extvars.mk b/mk/rte.extvars.mk
index 3e5a990..fc583ce 100644
--- a/mk/rte.extvars.mk
+++ b/mk/rte.extvars.mk
@@ -51,7 +51,7 @@ endif
RTE_EXTMK ?= $(RTE_SRCDIR)/Makefile
export RTE_EXTMK
-RTE_SDK_BIN := $(RTE_SDK)/$(RTE_TARGET)
+RTE_SDK_BIN ?= $(RTE_SDK)/$(RTE_TARGET)
#
# Output files wil go in a separate directory: default output is
--
1.9.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 1/4] l3fwd: some functions are unused in l3fwd-acl
2014-07-21 3:47 ` [dpdk-dev] [PATCH 1/4] l3fwd: some functions are unused in l3fwd-acl Matthew Hall
@ 2014-07-21 13:44 ` Thomas Monjalon
2014-07-21 16:53 ` Matthew Hall
2014-07-21 17:37 ` Richardson, Bruce
1 sibling, 1 reply; 12+ messages in thread
From: Thomas Monjalon @ 2014-07-21 13:44 UTC (permalink / raw)
To: Matthew Hall; +Cc: dev
Hi,
2014-07-20 20:47, Matthew Hall:
> +CFLAGS += -Wno-unused-function
I think it's better to fix the code instead of removing a warning.
If there is a very good reason to not do it, it would appear in the log.
Thanks
--
Thomas
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 3/4] examples/*: -Wno-switch required for weird ioctl() ID's
2014-07-21 3:47 ` [dpdk-dev] [PATCH 3/4] examples/*: -Wno-switch required for weird ioctl() ID's Matthew Hall
@ 2014-07-21 13:45 ` Thomas Monjalon
0 siblings, 0 replies; 12+ messages in thread
From: Thomas Monjalon @ 2014-07-21 13:45 UTC (permalink / raw)
To: Matthew Hall; +Cc: dev
2014-07-20 20:47, Matthew Hall:
> +CFLAGS += -Wno-switch
As I said for patch 1/4,
I think it's better to fix the code instead of removing a warning.
If there is a very good reason to not do it, it would appear in the log.
Thanks
--
Thomas
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 4/4] rte.extvars.mk: allow user to override RTE_SDK_BIN
2014-07-21 3:47 ` [dpdk-dev] [PATCH 4/4] rte.extvars.mk: allow user to override RTE_SDK_BIN Matthew Hall
@ 2014-07-21 14:31 ` Thomas Monjalon
0 siblings, 0 replies; 12+ messages in thread
From: Thomas Monjalon @ 2014-07-21 14:31 UTC (permalink / raw)
To: Matthew Hall; +Cc: dev
Hi,
2014-07-20 20:47, Matthew Hall:
> Without this patch it is impossible to compile the examples if you have
> compiled the DPDK into the $(RTE_SDK)/build directory, or any other one
> besides $(RTE_SDK)/$(RTE_TARGET).
Please, could you explain why is it impossible in your case?
The standard usage is:
make T=x86_64-native-linuxapp-gcc install
make T=x86_64-native-linuxapp-gcc examples O=x86_64-native-linuxapp-gcc/examples
If you don't want to use install mode, you can build like this:
make config T=x86_64-native-linuxapp-gcc
make
make -C examples RTE_SDK=$(pwd) RTE_TARGET=build O=$(readlink -m build/examples)
> --- a/mk/rte.extvars.mk
> +++ b/mk/rte.extvars.mk
> -RTE_SDK_BIN := $(RTE_SDK)/$(RTE_TARGET)
> +RTE_SDK_BIN ?= $(RTE_SDK)/$(RTE_TARGET)
I don't understand why this change could help.
You can even use this:
make -C examples RTE_SDK=$(pwd) RTE_SDK_BIN=$(pwd)/build O=$(readlink -m build/examples)
without the patch because command line override variables.
Note that O= is optional.
--
Thomas
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 1/4] l3fwd: some functions are unused in l3fwd-acl
2014-07-21 13:44 ` Thomas Monjalon
@ 2014-07-21 16:53 ` Matthew Hall
0 siblings, 0 replies; 12+ messages in thread
From: Matthew Hall @ 2014-07-21 16:53 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
The same code is used in l3fwd and l3fwd-acl. When it is reused in l3fwd-acl a packet processing function from original l3fwd is not used any more.
--
Sent from my mobile device.
On July 21, 2014 6:44:41 AM PDT, Thomas Monjalon <thomas.monjalon@6wind.com> wrote:
>Hi,
>
>2014-07-20 20:47, Matthew Hall:
>> +CFLAGS += -Wno-unused-function
>
>I think it's better to fix the code instead of removing a warning.
>If there is a very good reason to not do it, it would appear in the
>log.
>
>Thanks
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 1/4] l3fwd: some functions are unused in l3fwd-acl
2014-07-21 3:47 ` [dpdk-dev] [PATCH 1/4] l3fwd: some functions are unused in l3fwd-acl Matthew Hall
2014-07-21 13:44 ` Thomas Monjalon
@ 2014-07-21 17:37 ` Richardson, Bruce
1 sibling, 0 replies; 12+ messages in thread
From: Richardson, Bruce @ 2014-07-21 17:37 UTC (permalink / raw)
To: Matthew Hall, dev
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Matthew Hall
> Sent: Sunday, July 20, 2014 8:48 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH 1/4] l3fwd: some functions are unused in l3fwd-acl
>
> Signed-off-by: Matthew Hall <mhall@mhcomputing.net>
> ---
> examples/l3fwd/Makefile | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/examples/l3fwd/Makefile b/examples/l3fwd/Makefile
> index 68de8fc..5cd7396 100644
> --- a/examples/l3fwd/Makefile
> +++ b/examples/l3fwd/Makefile
> @@ -46,6 +46,7 @@ SRCS-y := main.c
>
> CFLAGS += -O3 $(USER_FLAGS)
> CFLAGS += $(WERROR_FLAGS)
> +CFLAGS += -Wno-unused-function
>
Rather than disabling the warnings, would it not be better to remove the functions entirely from the compile? I would assume that these are functions for one leg of the l3fwd code (e.g. hash lookup vs lpm lookup) that are not used in the other leg of the code, in which case the proper fix should be to add some more #ifdefs, right?
/Bruce
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 2/4] virtio-net.c: incorrect parens around equality check
2014-07-21 3:47 ` [dpdk-dev] [PATCH 2/4] virtio-net.c: incorrect parens around equality check Matthew Hall
@ 2014-07-22 13:14 ` Thomas Monjalon
2014-07-22 19:27 ` Matthew Hall
0 siblings, 1 reply; 12+ messages in thread
From: Thomas Monjalon @ 2014-07-22 13:14 UTC (permalink / raw)
To: Matthew Hall; +Cc: dev
Hi Matthew,
I think that patches 1, 3 and 4 need some rework but this one is valid
and has no relation with other ones in the serie. So it can be integrated now.
2014-07-20 20:47, Matthew Hall:
> --- a/examples/vhost/virtio-net.c
> +++ b/examples/vhost/virtio-net.c
> @@ -280,8 +280,8 @@ get_config_ll_entry(struct vhost_device_ctx ctx)
>
> /* Loop through linked list until the device_fh is found. */
> while (ll_dev != NULL) {
> - if ((ll_dev->dev.device_fh == ctx.fh))
> - return ll_dev;
> + if (ll_dev->dev.device_fh == ctx.fh)
> + return ll_dev;
> ll_dev = ll_dev->next;
> }
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Applied for version 1.7.1.
Thanks
--
Thomas
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [dpdk-dev] [PATCH 2/4] virtio-net.c: incorrect parens around equality check
2014-07-22 13:14 ` Thomas Monjalon
@ 2014-07-22 19:27 ` Matthew Hall
0 siblings, 0 replies; 12+ messages in thread
From: Matthew Hall @ 2014-07-22 19:27 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On Tue, Jul 22, 2014 at 03:14:51PM +0200, Thomas Monjalon wrote:
> Hi Matthew,
>
> I think that patches 1, 3 and 4 need some rework but this one is valid
> and has no relation with other ones in the serie. So it can be integrated now.
Great thanks!
I'll work a bit more on the others when I've got time.
Discovered them during a weekend Open Source project.
Matthew.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2014-07-22 19:27 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-21 3:47 [dpdk-dev] [PATCH] examples: fix clang compilation issues Matthew Hall
2014-07-21 3:47 ` [dpdk-dev] [PATCH 1/4] l3fwd: some functions are unused in l3fwd-acl Matthew Hall
2014-07-21 13:44 ` Thomas Monjalon
2014-07-21 16:53 ` Matthew Hall
2014-07-21 17:37 ` Richardson, Bruce
2014-07-21 3:47 ` [dpdk-dev] [PATCH 2/4] virtio-net.c: incorrect parens around equality check Matthew Hall
2014-07-22 13:14 ` Thomas Monjalon
2014-07-22 19:27 ` Matthew Hall
2014-07-21 3:47 ` [dpdk-dev] [PATCH 3/4] examples/*: -Wno-switch required for weird ioctl() ID's Matthew Hall
2014-07-21 13:45 ` Thomas Monjalon
2014-07-21 3:47 ` [dpdk-dev] [PATCH 4/4] rte.extvars.mk: allow user to override RTE_SDK_BIN Matthew Hall
2014-07-21 14:31 ` Thomas Monjalon
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).