[dpdk-dev] [PATCH] doc: update vhost guide

2016-06-26 Thread Mcnamara, John
> -Original Message-
> From: Yuanhan Liu [mailto:yuanhan.liu at linux.intel.com]
> Sent: Friday, June 24, 2016 8:53 AM
> To: dev at dpdk.org
> Cc: Xie, Huawei ; Mcnamara, John
> ; Thomas Monjalon ;
> Yuanhan Liu 
> Subject: [PATCH] doc: update vhost guide
> 
> Mainly on updating vhost-user part: we now support client mode.
> Also refine some words, and add a bit more explanation.
> 
> And made an emphatic statement that you are suggested to use vhost-user
> instead of vhost-cuse, because we have enhanced vhost-user a lot since
> v2.2 (Actually, I doubt there are any people still using vhost-cuse)

Hi Yuahan,

Nice doc and updates. Some minor comments below.


> +
> +* access the guest memory
> +
> +  For QEMU, this is done by using **-object
> + memory-backend-file,share=on,...**
> +  option. Which means QEMU will create a file to serve as the guest RAM.
> +  The **share=on** option allows another process to map that file,
> + which  means it can access the guest RAM.

Fixed width quotes `` `` would be better here than bold ** **.


> +Currently, there are two ways to pass those messages. That results to
> +we have two implementations: vhost-cuse (character devices in user
> +space) and vhost-user. Vhost-cuse creates a user space char dev and
> +hook a function ioctl, so that all ioctl commands (that represent those
> +messages) sent from the frontend (QEMU) will be captured and handled.
> +While vhost-user creates a Unix domain socket file, through which those
> messages are passed.

Probably better to separate the vhost-cuse and vhost-user into 2 paragraphs
to make the text clearer.

Also, it is probably better to standardize on using a hyphen in vhost-cuse
and vhost-user throughout the doc; there are cases with and without.


> +Note that since DPDK v2.2, we have spent a lot of efforts on enhancing
> +vhost-user, such as multiple queue, live migration, reconnect, etc.
> +Thus, **you are encouraged to use vhost-user instead of vhost-cuse**.

In general I prefer to use a simple "Note" in the text, like this, rather
that the RST Note:: directive which creates a more distinctive but usually
unnecessary callout box. However in this case it is probably worth having
this recommendation displayed prominently. Something like the following:

.. Note::

   Since DPDK v2.2, the majority of the development effort has gone into
   enhancing vhost-user, such as multiple queue, live migration, and
   reconnect. Thus, it is strongly advised to use vhost-user instead of
   vhost-cuse.



>   * VHOST_SET_LOG_FD
>   * VHOST_SET_VRING_ERR

Probably best to prefix this list with a sentence that explains what they
are. Something like:

The supported vhost messages are:

* ``VHOST_SET_MEM_TABLE``
* ``VHOST_SET_VRING_KICK``
* ``VHOST_SET_VRING_CALL``
* ``VHOST_SET_LOG_FD``
* ``VHOST_SET_VRING_ERR``

Also, use fixed width quotes here and elsewhere for function or variable
names coming from code.

I will send you on some other suggestions.

John


[dpdk-dev] [PATCH v2 2/2] i40e: fix missing break in switch

2016-06-26 Thread Mcnamara, John
> -Original Message-
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Helin Zhang
> Sent: Sunday, June 26, 2016 4:46 PM
> To: dev at dpdk.org
> Cc: Zhang, Helin 
> Subject: [dpdk-dev] [PATCH v2 2/2] i40e: fix missing break in switch
> 
> It fixes the issue reported by Coverity of 'Missing break in switch', by
> deleting 'case I40E_VIRTCHNL_OP_FCOE', as it is not necessary at all.
> 
> Coverity ID 13265: Missing break in switch.
> 
> Fixes: 4861cde46116 ("i40e: new poll mode driver")
> 
> Signed-off-by: Helin Zhang 

Acked-by: John McNamara 



[dpdk-dev] [PATCH v2 7/7] mk: check shared library dependencies

2016-06-26 Thread Thomas Monjalon
From: Panu Matilainen 

Require all symbols used by a DSO to be resolvable via LDLIBS at
build-time. Previously it was possible to build a library with
incomplete dependencies which could then fail at run-time.

Signed-off-by: Panu Matilainen 
---
 mk/rte.lib.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 924dfb5..0187ae8 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -94,7 +94,7 @@ O_TO_A_DO = @set -e; \
echo $(O_TO_A_CMD) > $(call exe2cmd,$(@))

 O_TO_S = $(LD) -L$(RTE_SDK_BIN)/lib $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS) \
- -shared $(OBJS-y) $(LDLIBS) -Wl,-soname,$(LIB) -o $(LIB)
+ -shared $(OBJS-y) -z defs $(LDLIBS) -Wl,-soname,$(LIB) -o $(LIB)
 O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight
 O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)","  LD $(@)")
 O_TO_S_DO = @set -e; \
-- 
2.7.0



[dpdk-dev] [PATCH v2 6/7] pdump: fix missing dependency on libpthread

2016-06-26 Thread Thomas Monjalon
From: Panu Matilainen 

Fixes: 278f945402c5 ("pdump: add new library for packet capture")

Signed-off-by: Panu Matilainen 
---
 lib/librte_pdump/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_pdump/Makefile b/lib/librte_pdump/Makefile
index 14cd53e..166441a 100644
--- a/lib/librte_pdump/Makefile
+++ b/lib/librte_pdump/Makefile
@@ -36,6 +36,7 @@ LIB = librte_pdump.a

 CFLAGS += $(WERROR_FLAGS) -I$(SRCDIR) -O3
 CFLAGS += -D_GNU_SOURCE
+LDLIBS += -lpthread

 EXPORT_MAP := rte_pdump_version.map

-- 
2.7.0



[dpdk-dev] [PATCH v2 5/7] mk: fix external dependencies of crypto drivers

2016-06-26 Thread Thomas Monjalon
When linking drivers as shared libraries, the dependencies need
to be marked as DT_NEEDED entries.

The crypto dependencies (libsso and libIPSec) are static libraries.
To make them linked in the shared PMDs, the code must relocatable:
- libIPSec_MB.a must be built with -fPIC
- libsso_kasumi.a must be built with KASUMI_CFLAGS=-DKASUMI_C

Fixes: 924e84f87306 ("aesni_mb: add driver for multi buffer based crypto")
Fixes: eec136f3c54f ("aesni_gcm: add driver for AES-GCM crypto operations")
Fixes: 3aafc423cf4d ("snow3g: add driver for SNOW 3G library")
Fixes: 2773c86d061a ("crypto/kasumi: add driver for KASUMI library")

Signed-off-by: Thomas Monjalon 
---
 drivers/crypto/aesni_gcm/Makefile | 3 ++-
 drivers/crypto/aesni_mb/Makefile  | 3 ++-
 drivers/crypto/kasumi/Makefile| 3 ++-
 drivers/crypto/snow3g/Makefile| 3 ++-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/aesni_gcm/Makefile 
b/drivers/crypto/aesni_gcm/Makefile
index ab5d2ed..5898cae 100644
--- a/drivers/crypto/aesni_gcm/Makefile
+++ b/drivers/crypto/aesni_gcm/Makefile
@@ -49,9 +49,10 @@ LIBABIVER := 1
 # versioning export map
 EXPORT_MAP := rte_pmd_aesni_gcm_version.map

-# external library include paths
+# external library dependencies
 CFLAGS += -I$(AESNI_MULTI_BUFFER_LIB_PATH)
 CFLAGS += -I$(AESNI_MULTI_BUFFER_LIB_PATH)/include
+LDLIBS += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
 LDLIBS += -lcrypto

 # library source files
diff --git a/drivers/crypto/aesni_mb/Makefile b/drivers/crypto/aesni_mb/Makefile
index 348a8bd..d3994cc 100644
--- a/drivers/crypto/aesni_mb/Makefile
+++ b/drivers/crypto/aesni_mb/Makefile
@@ -49,9 +49,10 @@ LIBABIVER := 1
 # versioning export map
 EXPORT_MAP := rte_pmd_aesni_version.map

-# external library include paths
+# external library dependencies
 CFLAGS += -I$(AESNI_MULTI_BUFFER_LIB_PATH)
 CFLAGS += -I$(AESNI_MULTI_BUFFER_LIB_PATH)/include
+LDLIBS += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB

 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += rte_aesni_mb_pmd.c
diff --git a/drivers/crypto/kasumi/Makefile b/drivers/crypto/kasumi/Makefile
index 72b1ca4..9fb0be8 100644
--- a/drivers/crypto/kasumi/Makefile
+++ b/drivers/crypto/kasumi/Makefile
@@ -49,10 +49,11 @@ LIBABIVER := 1
 # versioning export map
 EXPORT_MAP := rte_pmd_kasumi_version.map

-# external library include paths
+# external library dependencies
 CFLAGS += -I$(LIBSSO_KASUMI_PATH)
 CFLAGS += -I$(LIBSSO_KASUMI_PATH)/include
 CFLAGS += -I$(LIBSSO_KASUMI_PATH)/build
+LDLIBS += -L$(LIBSSO_KASUMI_PATH)/build -lsso_kasumi

 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += rte_kasumi_pmd.c
diff --git a/drivers/crypto/snow3g/Makefile b/drivers/crypto/snow3g/Makefile
index 582907f..bea6760 100644
--- a/drivers/crypto/snow3g/Makefile
+++ b/drivers/crypto/snow3g/Makefile
@@ -49,10 +49,11 @@ LIBABIVER := 1
 # versioning export map
 EXPORT_MAP := rte_pmd_snow3g_version.map

-# external library include paths
+# external library dependencies
 CFLAGS += -I$(LIBSSO_SNOW3G_PATH)
 CFLAGS += -I$(LIBSSO_SNOW3G_PATH)/include
 CFLAGS += -I$(LIBSSO_SNOW3G_PATH)/build
+LDLIBS += -L$(LIBSSO_SNOW3G_PATH)/build -lsso_snow3g

 # library source files
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += rte_snow3g_pmd.c
-- 
2.7.0



[dpdk-dev] [PATCH v2 4/7] mk: fix internal dependencies

2016-06-26 Thread Thomas Monjalon
Some libraries were missing their dependency on eal, mbuf, mempool,
ring and kvargs.
It is revealed by the linker option "-z defs".

Signed-off-by: Thomas Monjalon 
---
 drivers/crypto/aesni_gcm/Makefile | 2 ++
 drivers/crypto/aesni_mb/Makefile  | 2 ++
 drivers/crypto/kasumi/Makefile| 2 ++
 drivers/crypto/null/Makefile  | 3 ++-
 drivers/crypto/qat/Makefile   | 1 +
 drivers/crypto/snow3g/Makefile| 2 ++
 drivers/net/af_packet/Makefile| 1 +
 drivers/net/null/Makefile | 1 +
 drivers/net/pcap/Makefile | 1 +
 drivers/net/szedata2/Makefile | 2 ++
 drivers/net/vhost/Makefile| 1 +
 drivers/net/virtio/Makefile   | 1 +
 examples/ethtool/lib/Makefile | 4 
 lib/librte_ip_frag/Makefile   | 6 +++---
 lib/librte_kni/Makefile   | 5 +++--
 lib/librte_pdump/Makefile | 1 +
 lib/librte_pipeline/Makefile  | 2 ++
 lib/librte_reorder/Makefile   | 1 +
 lib/librte_vhost/Makefile | 1 +
 19 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/drivers/crypto/aesni_gcm/Makefile 
b/drivers/crypto/aesni_gcm/Makefile
index 3c70ee8..ab5d2ed 100644
--- a/drivers/crypto/aesni_gcm/Makefile
+++ b/drivers/crypto/aesni_gcm/Makefile
@@ -64,6 +64,8 @@ SYMLINK-y-include +=
 # library dependencies
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += lib/librte_eal
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += lib/librte_mbuf
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += lib/librte_mempool
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += lib/librte_ring
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += lib/librte_cryptodev

 include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/crypto/aesni_mb/Makefile b/drivers/crypto/aesni_mb/Makefile
index ec65291..348a8bd 100644
--- a/drivers/crypto/aesni_mb/Makefile
+++ b/drivers/crypto/aesni_mb/Makefile
@@ -60,6 +60,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += 
rte_aesni_mb_pmd_ops.c
 # library dependencies
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += lib/librte_eal
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += lib/librte_mbuf
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += lib/librte_mempool
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += lib/librte_ring
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += lib/librte_cryptodev

 include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/crypto/kasumi/Makefile b/drivers/crypto/kasumi/Makefile
index 5b82be4..72b1ca4 100644
--- a/drivers/crypto/kasumi/Makefile
+++ b/drivers/crypto/kasumi/Makefile
@@ -61,6 +61,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += rte_kasumi_pmd_ops.c
 # library dependencies
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += lib/librte_eal
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += lib/librte_mbuf
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += lib/librte_mempool
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += lib/librte_ring
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_KASUMI) += lib/librte_cryptodev

 include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/crypto/null/Makefile b/drivers/crypto/null/Makefile
index 35db8b1..c143929 100644
--- a/drivers/crypto/null/Makefile
+++ b/drivers/crypto/null/Makefile
@@ -54,7 +54,8 @@ SYMLINK-y-include +=
 # library dependencies
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_eal
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_mbuf
-DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_cryptodev
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_mempool
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_ring
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_cryptodev

 include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/crypto/qat/Makefile b/drivers/crypto/qat/Makefile
index ee72a61..20a70d4 100644
--- a/drivers/crypto/qat/Makefile
+++ b/drivers/crypto/qat/Makefile
@@ -59,6 +59,7 @@ EXPORT_MAP := rte_pmd_qat_version.map
 # library dependencies
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += lib/librte_eal
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += lib/librte_mbuf
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += lib/librte_mempool
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += lib/librte_cryptodev


diff --git a/drivers/crypto/snow3g/Makefile b/drivers/crypto/snow3g/Makefile
index fb64059..582907f 100644
--- a/drivers/crypto/snow3g/Makefile
+++ b/drivers/crypto/snow3g/Makefile
@@ -61,6 +61,8 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += rte_snow3g_pmd_ops.c
 # library dependencies
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += lib/librte_eal
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += lib/librte_mbuf
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += lib/librte_mempool
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += lib/librte_ring
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += lib/librte_cryptodev

 include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/af_packet/Makefile b/drivers/net/af_packet/Makefile
index c6de1c6..e14d6d0 100644
--- a/drivers/net/af_packet/Makefile
+++ b/drivers/net/af_packet/Makefile
@@ -53,6 +53,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += rte_eth_af_packet.c
 # this lib depends upon:
 

[dpdk-dev] [PATCH v2 3/7] pipeline: fix truncated dependency list

2016-06-26 Thread Thomas Monjalon
From: Panu Matilainen 

In other libraries, dependency list is always appended to, but
in commit 6cbf4f75e059 it with an assignment. This causes the
librte_eal dependency added in commit 6cbf4f75e059 to get discarded,
resulting in missing dependency on librte_eal.

Fixes: 6cbf4f75e059 ("mk: fix missing internal dependencies")

Signed-off-by: Panu Matilainen 
---
 lib/librte_pipeline/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_pipeline/Makefile b/lib/librte_pipeline/Makefile
index 95387aa..a8f3128 100644
--- a/lib/librte_pipeline/Makefile
+++ b/lib/librte_pipeline/Makefile
@@ -53,7 +53,7 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_PIPELINE)-include += 
rte_pipeline.h

 # this lib depends upon:
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += lib/librte_eal
-DEPDIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) := lib/librte_table
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += lib/librte_table
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += lib/librte_port

 include $(RTE_SDK)/mk/rte.lib.mk
-- 
2.7.0



[dpdk-dev] [PATCH v2 2/7] mk: fix external library link

2016-06-26 Thread Thomas Monjalon
When building an external library with rte.extlib.mk, the internal
libraries were not found because the linker search path was the
external library install directory (RTE_OUTPUT/lib).
It is fixed by searching in the internal library install directory
(RTE_SDK_BIN/lib).
When building an internal library, RTE_SDK_BIN = RTE_OUTPUT.

Fixes: c6417ce61f83 ("mk: add build-time library directory to linker path")

Signed-off-by: Thomas Monjalon 
---
 mk/rte.lib.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index d2523ee..924dfb5 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -93,7 +93,7 @@ O_TO_A_DO = @set -e; \
$(O_TO_A) && \
echo $(O_TO_A_CMD) > $(call exe2cmd,$(@))

-O_TO_S = $(LD) -L$(RTE_OUTPUT)/lib $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS) \
+O_TO_S = $(LD) -L$(RTE_SDK_BIN)/lib $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS) \
  -shared $(OBJS-y) $(LDLIBS) -Wl,-soname,$(LIB) -o $(LIB)
 O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight
 O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)","  LD $(@)")
-- 
2.7.0



[dpdk-dev] [PATCH v2 1/7] mk: remove traces of combined library

2016-06-26 Thread Thomas Monjalon
Fixes: 948fd64befc3 ("mk: replace the combined library with a linker script")

Signed-off-by: Thomas Monjalon 
---
 mk/rte.lib.mk | 18 --
 1 file changed, 18 deletions(-)

diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 1ff403f..d2523ee 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -102,24 +102,6 @@ O_TO_S_DO = @set -e; \
$(O_TO_S) && \
echo $(O_TO_S_CMD) > $(call exe2cmd,$(@))

-ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
-O_TO_C = $(AR) crus $(LIB_ONE) $(OBJS-y)
-O_TO_C_STR = $(subst ','\'',$(O_TO_C)) #'# fix syntax highlight
-O_TO_C_DISP = $(if $(V),"$(O_TO_C_STR)","  AR_C $(@)")
-O_TO_C_DO = @set -e; \
-   $(lib_dir) \
-   $(copy_obj)
-else
-O_TO_C = $(LD) -shared $(OBJS-y) -o $(LIB_ONE)
-O_TO_C_STR = $(subst ','\'',$(O_TO_C)) #'# fix syntax highlight
-O_TO_C_DISP = $(if $(V),"$(O_TO_C_STR)","  LD_C $(@)")
-O_TO_C_DO = @set -e; \
-   $(lib_dir) \
-   $(copy_obj)
-endif
-
-copy_obj = cp -f $(OBJS-y) $(RTE_OUTPUT)/build/lib;
-lib_dir = [ -d $(RTE_OUTPUT)/lib ] || mkdir -p $(RTE_OUTPUT)/lib;
 -include .$(LIB).cmd

 #
-- 
2.7.0



[dpdk-dev] [PATCH v2 0/7] fix dependencies

2016-06-26 Thread Thomas Monjalon
Thanks to the option '-z defs' it is possible to check for missing
link dependencies.
This series add the missing internal and external dependencies,
fix use of rte.extlib.mk and force the check with '-z defs'.

v2:
- remove traces of combined library
- fix a lot more internal dependencies
- fix external library link
- fix external dependencies of crypto drivers

Panu Matilainen (3):
  pipeline: fix truncated dependency list
  pdump: fix missing dependency on libpthread
  mk: check shared library dependencies

Thomas Monjalon (4):
  mk: remove traces of combined library
  mk: fix external library link
  mk: fix internal dependencies
  mk: fix external dependencies of crypto drivers

 drivers/crypto/aesni_gcm/Makefile |  5 -
 drivers/crypto/aesni_mb/Makefile  |  5 -
 drivers/crypto/kasumi/Makefile|  5 -
 drivers/crypto/null/Makefile  |  3 ++-
 drivers/crypto/qat/Makefile   |  1 +
 drivers/crypto/snow3g/Makefile|  5 -
 drivers/net/af_packet/Makefile|  1 +
 drivers/net/null/Makefile |  1 +
 drivers/net/pcap/Makefile |  1 +
 drivers/net/szedata2/Makefile |  2 ++
 drivers/net/vhost/Makefile|  1 +
 drivers/net/virtio/Makefile   |  1 +
 examples/ethtool/lib/Makefile |  4 
 lib/librte_ip_frag/Makefile   |  6 +++---
 lib/librte_kni/Makefile   |  5 +++--
 lib/librte_pdump/Makefile |  2 ++
 lib/librte_pipeline/Makefile  |  4 +++-
 lib/librte_reorder/Makefile   |  1 +
 lib/librte_vhost/Makefile |  1 +
 mk/rte.lib.mk | 22 ++
 20 files changed, 45 insertions(+), 31 deletions(-)

-- 
2.7.0



[dpdk-dev] [PATCH v3] cryptodev: uninline parameter parsing

2016-06-26 Thread Thomas Monjalon
There is no need to have this parsing inlined in the header.
It brings kvargs dependency to every crypto drivers.
The functions are moved into rte_cryptodev.c.

Signed-off-by: Thomas Monjalon 
---
v2:
- remove kvargs dep in null PMD
- add function in .map file
v3:
- remove kvargs include in drivers
---
 drivers/crypto/kasumi/rte_kasumi_pmd.c |  1 -
 drivers/crypto/null/Makefile   |  1 -
 drivers/crypto/snow3g/rte_snow3g_pmd.c |  1 -
 lib/librte_cryptodev/rte_cryptodev.c   | 91 
 lib/librte_cryptodev/rte_cryptodev.h   | 95 ++
 lib/librte_cryptodev/rte_cryptodev_version.map |  7 ++
 6 files changed, 102 insertions(+), 94 deletions(-)

diff --git a/drivers/crypto/kasumi/rte_kasumi_pmd.c 
b/drivers/crypto/kasumi/rte_kasumi_pmd.c
index 0bf415d..5f8c7a2 100644
--- a/drivers/crypto/kasumi/rte_kasumi_pmd.c
+++ b/drivers/crypto/kasumi/rte_kasumi_pmd.c
@@ -38,7 +38,6 @@
 #include 
 #include 
 #include 
-#include 

 #include "rte_kasumi_pmd_private.h"

diff --git a/drivers/crypto/null/Makefile b/drivers/crypto/null/Makefile
index 573894f..35db8b1 100644
--- a/drivers/crypto/null/Makefile
+++ b/drivers/crypto/null/Makefile
@@ -56,6 +56,5 @@ DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_eal
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_mbuf
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_cryptodev
 DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_ring
-DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_kvargs

 include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/crypto/snow3g/rte_snow3g_pmd.c 
b/drivers/crypto/snow3g/rte_snow3g_pmd.c
index 6d59de7..dc8de6b 100644
--- a/drivers/crypto/snow3g/rte_snow3g_pmd.c
+++ b/drivers/crypto/snow3g/rte_snow3g_pmd.c
@@ -38,7 +38,6 @@
 #include 
 #include 
 #include 
-#include 

 #include "rte_snow3g_pmd_private.h"

diff --git a/lib/librte_cryptodev/rte_cryptodev.c 
b/lib/librte_cryptodev/rte_cryptodev.c
index 960e2d5..20e5beb 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -102,6 +102,97 @@ struct rte_cryptodev_callback {
uint32_t active;/**< Callback is executing */
 };

+#define RTE_CRYPTODEV_VDEV_MAX_NB_QP_ARG   ("max_nb_queue_pairs")
+#define RTE_CRYPTODEV_VDEV_MAX_NB_SESS_ARG ("max_nb_sessions")
+#define RTE_CRYPTODEV_VDEV_SOCKET_ID   ("socket_id")
+
+static const char *cryptodev_vdev_valid_params[] = {
+   RTE_CRYPTODEV_VDEV_MAX_NB_QP_ARG,
+   RTE_CRYPTODEV_VDEV_MAX_NB_SESS_ARG,
+   RTE_CRYPTODEV_VDEV_SOCKET_ID
+};
+
+static uint8_t
+number_of_sockets(void)
+{
+   int sockets = 0;
+   int i;
+   const struct rte_memseg *ms = rte_eal_get_physmem_layout();
+
+   for (i = 0; ((i < RTE_MAX_MEMSEG) && (ms[i].addr != NULL)); i++) {
+   if (sockets < ms[i].socket_id)
+   sockets = ms[i].socket_id;
+   }
+
+   /* Number of sockets = maximum socket_id + 1 */
+   return ++sockets;
+}
+
+/** Parse integer from integer argument */
+static int
+parse_integer_arg(const char *key __rte_unused,
+   const char *value, void *extra_args)
+{
+   int *i = (int *) extra_args;
+
+   *i = atoi(value);
+   if (*i < 0) {
+   CDEV_LOG_ERR("Argument has to be positive.");
+   return -1;
+   }
+
+   return 0;
+}
+
+int
+rte_cryptodev_parse_vdev_init_params(struct rte_crypto_vdev_init_params 
*params,
+   const char *input_args)
+{
+   struct rte_kvargs *kvlist;
+   int ret;
+
+   if (params == NULL)
+   return -EINVAL;
+
+   if (input_args) {
+   kvlist = rte_kvargs_parse(input_args,
+   cryptodev_vdev_valid_params);
+   if (kvlist == NULL)
+   return -1;
+
+   ret = rte_kvargs_process(kvlist,
+   RTE_CRYPTODEV_VDEV_MAX_NB_QP_ARG,
+   _integer_arg,
+   >max_nb_queue_pairs);
+   if (ret < 0)
+   goto free_kvlist;
+
+   ret = rte_kvargs_process(kvlist,
+   RTE_CRYPTODEV_VDEV_MAX_NB_SESS_ARG,
+   _integer_arg,
+   >max_nb_sessions);
+   if (ret < 0)
+   goto free_kvlist;
+
+   ret = rte_kvargs_process(kvlist, RTE_CRYPTODEV_VDEV_SOCKET_ID,
+   _integer_arg,
+   >socket_id);
+   if (ret < 0)
+   goto free_kvlist;
+
+   if (params->socket_id >= number_of_sockets()) {
+   CDEV_LOG_ERR("Invalid socket id specified to create "
+   "the 

[dpdk-dev] [PATCH v2] cryptodev: uninline parameter parsing

2016-06-26 Thread Thomas Monjalon
2016-06-25 15:24, De Lara Guarch, Pablo:
> > +DPDK_16.07 {
> > +   global:
> > +
> > +   rte_cryptodev_parse_vdev_init_params;
> 
> I think this function does not need to be public.
> This function is only called in the PMDs, and the only public function
> to initialize a crypto device is rte_eal_vdev_init.

It needs to be public to be called by the PMDs,
like, example, rte_cryptodev_pmd_virtual_dev_init.

> Also, could you remove the includes of rte_vargs.h in the PMDs,
> as it is not needed (I think it was not necessary before either).

Yes I am going to send a v3 with this change.
Thanks


[dpdk-dev] [PATCH] net/virtio-user: fix O_CLOEXEC undeclared error

2016-06-26 Thread Jianfeng Tan
On some older systems, such as SUSE 11, the compiling error shows
as:
   .../dpdk/drivers/net/virtio/virtio_user/virtio_user_dev.c:67:22:
 error: ?O_CLOEXEC? undeclared (first use in this function)

The fix is to declare _GNU_SOURCE macro before include fcntl.h.

Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer")

Signed-off-by: Jianfeng Tan 
---
 drivers/net/virtio/virtio_user/virtio_user_dev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c 
b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 3d12a32..180f824 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -31,6 +31,7 @@
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */

+#define _GNU_SOURCE
 #include 
 #include 
 #include 
-- 
2.1.4



[dpdk-dev] [PATCH v2] net/virtio-user: fix implicit int to enum conversion

2016-06-26 Thread Jianfeng Tan
Implicit int to enum conversion is not allowed when icc is used as
the compiler. It raises the compiling error like,
/.../dpdk/drivers/net/virtio/virtio_user/vhost_user.c(257):
error #188: enumerated type mixed with another type
msg.request = req;
^

The fix is simple, change the type of parameter req to enum
vhost_user_request.

Fixes: 6a84c37e3975 ("net/virtio-user: add vhost-user adapter layer")

Suggested-by: Stephen Hemminger 
Signed-off-by: Jianfeng Tan 
---
 drivers/net/virtio/virtio_user/vhost.h  | 2 +-
 drivers/net/virtio/virtio_user/vhost_user.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/virtio/virtio_user/vhost.h 
b/drivers/net/virtio/virtio_user/vhost.h
index 897042f..7adb55f 100644
--- a/drivers/net/virtio/virtio_user/vhost.h
+++ b/drivers/net/virtio/virtio_user/vhost.h
@@ -139,7 +139,7 @@ struct vhost_user_msg {
 #define VHOST_USER_F_PROTOCOL_FEATURES 30
 #define VHOST_USER_MQ (1ULL << VHOST_USER_F_PROTOCOL_FEATURES)

-int vhost_user_sock(int vhostfd, uint64_t req, void *arg);
+int vhost_user_sock(int vhostfd, enum vhost_user_request req, void *arg);
 int vhost_user_setup(const char *path);
 int vhost_user_enable_queue_pair(int vhostfd, uint16_t pair_idx, int enable);

diff --git a/drivers/net/virtio/virtio_user/vhost_user.c 
b/drivers/net/virtio/virtio_user/vhost_user.c
index 95e80f8..a2b0687 100644
--- a/drivers/net/virtio/virtio_user/vhost_user.c
+++ b/drivers/net/virtio/virtio_user/vhost_user.c
@@ -240,7 +240,7 @@ static const char * const vhost_msg_strings[] = {
 };

 int
-vhost_user_sock(int vhostfd, uint64_t req, void *arg)
+vhost_user_sock(int vhostfd, enum vhost_user_request req, void *arg)
 {
struct vhost_user_msg msg;
struct vhost_vring_file *file = 0;
-- 
2.1.4



[dpdk-dev] [Crypto API use error]

2016-06-26 Thread amartya....@wipro.com
Hi,

I am trying to run one sample application with crypto library with DPDK 16.04 
from below path in VM:
dpdk-16.04/examples/l2fwd-crypto

Command use:
./build/l2fwd-crypto -c 0x1 -n 4 --vdev "cryptodev_aesni_mb_pmd" --vdev 
"cryptodev_aesni_mb_pmd" -- -p 0x1 --chain CIPHER_HASH --cipher_op ENCRYPT 
--cipher_algo AES_CBC --cipher_key 
00:01:02:03:04:05:06:07:08:09:0a:0b:0c:0d:0e:0f --auth_op GENERATE --auth_algo 
SHA1_HMAC --auth_key 10:11:12:13:14:15:16:17:18:19:1a:1b:1c:1d:1e:1f

I am getting below error:
EAL: Detected lcore 0 as core 0 on socket 0
EAL: Support maximum 128 logical core(s) by configuration.
EAL: Detected 1 lcore(s)
EAL: Probing VFIO support...
EAL: Module /sys/module/vfio_pci not found! error 2 (No such file or directory)
EAL: VFIO modules not loaded, skipping VFIO support...
EAL: Setting up physically contiguous memory...
EAL: Ask a virtual area of 0x1e0 bytes
EAL: Virtual area found at 0x7fa6bd20 (size = 0x1e0)
EAL: Ask a virtual area of 0x3e20 bytes
EAL: Virtual area found at 0x7fa67ee0 (size = 0x3e20)
EAL: Ask a virtual area of 0x3fc0 bytes
EAL: Virtual area found at 0x7fa63f00 (size = 0x3fc0)
EAL: Ask a virtual area of 0x20 bytes
EAL: Virtual area found at 0x7fa63ec0 (size = 0x20)
EAL: Ask a virtual area of 0x20 bytes
EAL: Virtual area found at 0x7fa63e80 (size = 0x20)
EAL: Requesting 1024 pages of size 2MB from socket 0
EAL: TSC frequency is ~1995189 KHz
EAL: WARNING: cpu flags constant_tsc=yes nonstop_tsc=no -> using unreliable 
clock cycles !
EAL: Master lcore 0 is ready (tid=c11ca8c0;cpuset=[0])
EAL: no driver found for cryptodev_aesni_mb_pmd
EAL: failed to initialize cryptodev_aesni_mb_pmd device
PANIC in rte_eal_init():
Cannot init pmd devices
6: [./build/l2fwd-crypto() [0x42e0a3]]
5: [/lib64/libc.so.6(__libc_start_main+0xf0) [0x7fa6c02ebfe0]]
4: [./build/l2fwd-crypto(main+0x2f) [0x42b2cf]]
3: [./build/l2fwd-crypto(rte_eal_init+0xdc0) [0x49f920]]
2: [./build/l2fwd-crypto(__rte_panic+0xc9) [0x425008]]
1: [./build/l2fwd-crypto(rte_dump_stack+0x18) [0x4a6748]]
Aborted (core dumped)

What could be the cause for it and how to resolve this problem?

Thanks,
Amartya




The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. WARNING: Computer viruses can be transmitted via email. The 
recipient should check this email and any attachments for the presence of 
viruses. The company accepts no liability for any damage caused by any virus 
transmitted by this email. www.wipro.com


[dpdk-dev] [DPDK16.04: Error While compiling]

2016-06-26 Thread amartya....@wipro.com
Thanks.  It has supports sse3. I was not able to nail the problem. But replaced 
the vm with other working VM for now which is working fine.

-Original Message-
From: Anupam Kapoor [mailto:anupam.kap...@gmail.com]
Sent: Tuesday, June 21, 2016 3:34 PM
To: Amartya Kumar Das (MFG & Tech) 
Cc: dev at dpdk.org
Subject: Re: [dpdk-dev] [DPDK16.04: Error While compiling]

** This mail has been sent from an external source **

> [2016-06-21T15:12:27+0530]: "amartya.das" (amarty-das):
,[ amartya-das ]
| Its VM fedora21, gcc 4.9.
`
does your vcpu support sse3 ?

---
thanks
anupam
The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. WARNING: Computer viruses can be transmitted via email. The 
recipient should check this email and any attachments for the presence of 
viruses. The company accepts no liability for any damage caused by any virus 
transmitted by this email. www.wipro.com


[dpdk-dev] [PATCH v2 2/2] fix building with clang-3.8.0 compiler

2016-06-26 Thread Keith Wiles
Latest clang compiler 3.8.0 on latest update of Ubuntu
creates a few more warnings on -Warray-bounds and extra
() around 'if' expressions.

Signed-off-by: Keith Wiles 
---
 app/test-pmd/Makefile| 3 +++
 app/test/Makefile| 3 +++
 drivers/net/bonding/Makefile | 4 
 drivers/net/fm10k/Makefile   | 2 ++
 drivers/net/i40e/Makefile| 2 ++
 lib/librte_cmdline/Makefile  | 6 ++
 lib/librte_eal/linuxapp/eal/Makefile | 8 
 7 files changed, 28 insertions(+)

diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile
index 2a0b5a5..14ab77c 100644
--- a/app/test-pmd/Makefile
+++ b/app/test-pmd/Makefile
@@ -59,6 +59,9 @@ SRCS-y += icmpecho.c
 SRCS-$(CONFIG_RTE_LIBRTE_IEEE1588) += ieee1588fwd.c

 CFLAGS_cmdline.o := -D_GNU_SOURCE
+ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+CFLAGS_cmdline.o += -Wno-array-bounds
+endif

 # this application needs libraries first
 DEPDIRS-y += lib drivers
diff --git a/app/test/Makefile b/app/test/Makefile
index 2de8c7a..5593426 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -211,6 +211,9 @@ ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1)
 CFLAGS_test_memcpy.o += -fno-var-tracking-assignments
 CFLAGS_test_memcpy_perf.o += -fno-var-tracking-assignments
 endif
+else ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+CFLAGS_test_errno.o += -Wno-array-bounds
+CFLAGS_test_devargs.o += -Wno-array-bounds
 endif

 # this application needs libraries first
diff --git a/drivers/net/bonding/Makefile b/drivers/net/bonding/Makefile
index 504f2e8..ee5f44a 100644
--- a/drivers/net/bonding/Makefile
+++ b/drivers/net/bonding/Makefile
@@ -43,6 +43,10 @@ EXPORT_MAP := rte_eth_bond_version.map

 LIBABIVER := 1

+ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+CFLAGS_rte_eth_bond_args.o := -Wno-array-bounds
+endif
+
 #
 # all source are stored in SRCS-y
 #
diff --git a/drivers/net/fm10k/Makefile b/drivers/net/fm10k/Makefile
index afcbd1d..d6c692d 100644
--- a/drivers/net/fm10k/Makefile
+++ b/drivers/net/fm10k/Makefile
@@ -59,6 +59,8 @@ CFLAGS_BASE_DRIVER += -Wno-strict-aliasing 
-Wno-format-extra-args
 CFLAGS_BASE_DRIVER += -Wno-unused-variable
 CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers

+CFLAGS_fm10k_ethdev.o := -Wno-array-bounds
+
 else
 #
 # CFLAGS for gcc
diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile
index 9ffef3f..3a9e5a1 100644
--- a/drivers/net/i40e/Makefile
+++ b/drivers/net/i40e/Makefile
@@ -60,6 +60,8 @@ CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers
 CFLAGS_BASE_DRIVER += -Wno-pointer-to-int-cast
 CFLAGS_BASE_DRIVER += -Wno-format-nonliteral
 CFLAGS_BASE_DRIVER += -Wno-unused-variable
+
+CFLAGS_i40e_hmc.o += -Wno-tautological-compare
 else
 CFLAGS_BASE_DRIVER  = -Wno-sign-compare
 CFLAGS_BASE_DRIVER += -Wno-unused-value
diff --git a/lib/librte_cmdline/Makefile b/lib/librte_cmdline/Makefile
index 7d2d148..0af1d0a 100644
--- a/lib/librte_cmdline/Makefile
+++ b/lib/librte_cmdline/Makefile
@@ -40,6 +40,12 @@ EXPORT_MAP := rte_cmdline_version.map

 LIBABIVER := 2

+ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+CFLAGS_cmdline_cirbuf.o:= -Wno-parentheses-equality
+CFLAGS_cmdline_rdline.o:= -Wno-parentheses-equality
+CFLAGS_cmdline_parse_string.o:= -Wno-array-bounds
+endif
+
 # all source are stored in SRCS-y
 SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := cmdline.c
 SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_cirbuf.c
diff --git a/lib/librte_eal/linuxapp/eal/Makefile 
b/lib/librte_eal/linuxapp/eal/Makefile
index 30b30f3..c771a85 100644
--- a/lib/librte_eal/linuxapp/eal/Makefile
+++ b/lib/librte_eal/linuxapp/eal/Makefile
@@ -125,6 +125,14 @@ CFLAGS_eal_common_options.o := -D_GNU_SOURCE
 CFLAGS_eal_common_thread.o := -D_GNU_SOURCE
 CFLAGS_eal_common_lcore.o := -D_GNU_SOURCE

+ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+CFLAGS_eal_alarm.o += -Wno-parentheses-equality
+CFLAGS_eal_interrupts.o += -Wno-parentheses-equality
+CFLAGS_eal_common_options.o += -Wno-array-bounds
+CFLAGS_eal_pci.o += -Wno-parentheses-equality
+CFLAGS_eal_pci.o += -Wno-array-bounds
+endif
+
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-- 
2.8.0.GIT



[dpdk-dev] [PATCH v2 1/2] e1000:fix gcc test for clang builds

2016-06-26 Thread Keith Wiles
Signed-off-by: Keith Wiles 
---
 drivers/net/e1000/Makefile | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/e1000/Makefile b/drivers/net/e1000/Makefile
index 5b801f5..1305163 100644
--- a/drivers/net/e1000/Makefile
+++ b/drivers/net/e1000/Makefile
@@ -48,7 +48,7 @@ ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
 # CFLAGS for icc
 #
 CFLAGS_BASE_DRIVER = -wd177 -wd181 -wd188 -wd869 -wd2259
-else
+else ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
 #
 # CFLAGS for gcc
 #
@@ -57,6 +57,9 @@ CFLAGS_BASE_DRIVER += -Wno-unused-variable
 ifeq ($(shell test $(GCC_VERSION) -ge 60 && echo 1), 1)
 CFLAGS_BASE_DRIVER += -Wno-misleading-indentation
 endif
+else
+CFLAGS_BASE_DRIVER = -Wno-uninitialized -Wno-unused-parameter
+CFLAGS_BASE_DRIVER += -Wno-unused-variable
 endif

 #
-- 
2.8.0.GIT



[dpdk-dev] [PATCH 2/2] fix building with clang-3.8.0 compiler

2016-06-26 Thread Keith Wiles
Latest clang compiler 3.8.0 on latest update of Ubuntu
creates a few more warnings on -Warray-bounds and extra
() around 'if' expressions.

Signed-off-by: Keith Wiles 
---
 app/test-pmd/Makefile| 3 +++
 app/test/Makefile| 3 +++
 drivers/net/bonding/Makefile | 4 
 drivers/net/fm10k/Makefile   | 2 ++
 drivers/net/i40e/Makefile| 2 ++
 lib/librte_cmdline/Makefile  | 6 ++
 lib/librte_eal/linuxapp/eal/Makefile | 7 +++
 7 files changed, 27 insertions(+)

diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile
index 2a0b5a5..14ab77c 100644
--- a/app/test-pmd/Makefile
+++ b/app/test-pmd/Makefile
@@ -59,6 +59,9 @@ SRCS-y += icmpecho.c
 SRCS-$(CONFIG_RTE_LIBRTE_IEEE1588) += ieee1588fwd.c

 CFLAGS_cmdline.o := -D_GNU_SOURCE
+ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+CFLAGS_cmdline.o += -Wno-array-bounds
+endif

 # this application needs libraries first
 DEPDIRS-y += lib drivers
diff --git a/app/test/Makefile b/app/test/Makefile
index 2de8c7a..5593426 100644
--- a/app/test/Makefile
+++ b/app/test/Makefile
@@ -211,6 +211,9 @@ ifeq ($(shell test $(GCC_VERSION) -ge 44 && echo 1), 1)
 CFLAGS_test_memcpy.o += -fno-var-tracking-assignments
 CFLAGS_test_memcpy_perf.o += -fno-var-tracking-assignments
 endif
+else ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+CFLAGS_test_errno.o += -Wno-array-bounds
+CFLAGS_test_devargs.o += -Wno-array-bounds
 endif

 # this application needs libraries first
diff --git a/drivers/net/bonding/Makefile b/drivers/net/bonding/Makefile
index 504f2e8..ee5f44a 100644
--- a/drivers/net/bonding/Makefile
+++ b/drivers/net/bonding/Makefile
@@ -43,6 +43,10 @@ EXPORT_MAP := rte_eth_bond_version.map

 LIBABIVER := 1

+ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+CFLAGS_rte_eth_bond_args.o := -Wno-array-bounds
+endif
+
 #
 # all source are stored in SRCS-y
 #
diff --git a/drivers/net/fm10k/Makefile b/drivers/net/fm10k/Makefile
index afcbd1d..d6c692d 100644
--- a/drivers/net/fm10k/Makefile
+++ b/drivers/net/fm10k/Makefile
@@ -59,6 +59,8 @@ CFLAGS_BASE_DRIVER += -Wno-strict-aliasing 
-Wno-format-extra-args
 CFLAGS_BASE_DRIVER += -Wno-unused-variable
 CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers

+CFLAGS_fm10k_ethdev.o := -Wno-array-bounds
+
 else
 #
 # CFLAGS for gcc
diff --git a/drivers/net/i40e/Makefile b/drivers/net/i40e/Makefile
index 9ffef3f..3a9e5a1 100644
--- a/drivers/net/i40e/Makefile
+++ b/drivers/net/i40e/Makefile
@@ -60,6 +60,8 @@ CFLAGS_BASE_DRIVER += -Wno-missing-field-initializers
 CFLAGS_BASE_DRIVER += -Wno-pointer-to-int-cast
 CFLAGS_BASE_DRIVER += -Wno-format-nonliteral
 CFLAGS_BASE_DRIVER += -Wno-unused-variable
+
+CFLAGS_i40e_hmc.o += -Wno-tautological-compare
 else
 CFLAGS_BASE_DRIVER  = -Wno-sign-compare
 CFLAGS_BASE_DRIVER += -Wno-unused-value
diff --git a/lib/librte_cmdline/Makefile b/lib/librte_cmdline/Makefile
index 7d2d148..0af1d0a 100644
--- a/lib/librte_cmdline/Makefile
+++ b/lib/librte_cmdline/Makefile
@@ -40,6 +40,12 @@ EXPORT_MAP := rte_cmdline_version.map

 LIBABIVER := 2

+ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+CFLAGS_cmdline_cirbuf.o:= -Wno-parentheses-equality
+CFLAGS_cmdline_rdline.o:= -Wno-parentheses-equality
+CFLAGS_cmdline_parse_string.o:= -Wno-array-bounds
+endif
+
 # all source are stored in SRCS-y
 SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := cmdline.c
 SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += cmdline_cirbuf.c
diff --git a/lib/librte_eal/linuxapp/eal/Makefile 
b/lib/librte_eal/linuxapp/eal/Makefile
index 30b30f3..2ff8d62 100644
--- a/lib/librte_eal/linuxapp/eal/Makefile
+++ b/lib/librte_eal/linuxapp/eal/Makefile
@@ -125,6 +125,13 @@ CFLAGS_eal_common_options.o := -D_GNU_SOURCE
 CFLAGS_eal_common_thread.o := -D_GNU_SOURCE
 CFLAGS_eal_common_lcore.o := -D_GNU_SOURCE

+ifeq ($(CONFIG_RTE_TOOLCHAIN_CLANG),y)
+CFLAGS_eal_alarm.o += -Wno-parentheses-equality
+CFLAGS_eal_common_options.o += -Wno-array-bounds
+CFLAGS_eal_pci.o += -Wno-parentheses-equality
+CFLAGS_eal_pci.o += -Wno-array-bounds
+endif
+
 # workaround for a gcc bug with noreturn attribute
 # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-- 
2.8.0.GIT



[dpdk-dev] [PATCH 1/2] e1000:fix gcc test for clang builds

2016-06-26 Thread Keith Wiles
Signed-off-by: Keith Wiles 
---
 drivers/net/e1000/Makefile | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/e1000/Makefile b/drivers/net/e1000/Makefile
index 5b801f5..1305163 100644
--- a/drivers/net/e1000/Makefile
+++ b/drivers/net/e1000/Makefile
@@ -48,7 +48,7 @@ ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
 # CFLAGS for icc
 #
 CFLAGS_BASE_DRIVER = -wd177 -wd181 -wd188 -wd869 -wd2259
-else
+else ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
 #
 # CFLAGS for gcc
 #
@@ -57,6 +57,9 @@ CFLAGS_BASE_DRIVER += -Wno-unused-variable
 ifeq ($(shell test $(GCC_VERSION) -ge 60 && echo 1), 1)
 CFLAGS_BASE_DRIVER += -Wno-misleading-indentation
 endif
+else
+CFLAGS_BASE_DRIVER = -Wno-uninitialized -Wno-unused-parameter
+CFLAGS_BASE_DRIVER += -Wno-unused-variable
 endif

 #
-- 
2.8.0.GIT