[dpdk-dev] vhost/crypto: fix Makefile

Message ID 20180416140858.79994-1-roy.fan.zhang@intel.com (mailing list archive)
State Accepted, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Fan Zhang April 16, 2018, 2:08 p.m. UTC
  Fixes: d090c7f86a76 ("vhost/crypto: update makefile")

Vhost-Crypto shall not be compiled if rte_cryptodev is disabled.
This patch fix this by adding checking to Makefile.

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
 lib/librte_vhost/Makefile | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
  

Comments

Thomas Monjalon April 16, 2018, 9:42 p.m. UTC | #1
16/04/2018 16:08, Fan Zhang:
> Fixes: d090c7f86a76 ("vhost/crypto: update makefile")
> 
> Vhost-Crypto shall not be compiled if rte_cryptodev is disabled.
> This patch fix this by adding checking to Makefile.
> 
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> ---
>  lib/librte_vhost/Makefile | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)

What about meson.build?
  
Fan Zhang April 17, 2018, 8:56 a.m. UTC | #2
Hi Thomas,

In fact Meson compile enables all library builds so you cannot turn off cryptodev
manually. So the condition checking to disable vhost crypto build is not necessary.

Regards,
Fan
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Monday, April 16, 2018 10:43 PM
> To: Zhang, Roy Fan <roy.fan.zhang@intel.com>
> Cc: dev@dpdk.org; maxime.coquelin@redhat.com; shahafs@mellanox.com;
> Richardson, Bruce <bruce.richardson@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] vhost/crypto: fix Makefile
> 
> 16/04/2018 16:08, Fan Zhang:
> > Fixes: d090c7f86a76 ("vhost/crypto: update makefile")
> >
> > Vhost-Crypto shall not be compiled if rte_cryptodev is disabled.
> > This patch fix this by adding checking to Makefile.
> >
> > Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> > ---
> >  lib/librte_vhost/Makefile | 11 ++++++++---
> >  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> What about meson.build?
> 
>
  
Bruce Richardson April 17, 2018, 8:57 a.m. UTC | #3
On Mon, Apr 16, 2018 at 11:42:57PM +0200, Thomas Monjalon wrote:
> 16/04/2018 16:08, Fan Zhang:
> > Fixes: d090c7f86a76 ("vhost/crypto: update makefile")
> > 
> > Vhost-Crypto shall not be compiled if rte_cryptodev is disabled.
> > This patch fix this by adding checking to Makefile.
> > 
> > Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> > ---
> >  lib/librte_vhost/Makefile | 11 ++++++++---
> >  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> What about meson.build?
>
It's not needed. Meson build does not allow you to go arbitrarily disabling
libraries - exactly for this reason, to save us littering other build files
with all sorts of checks for various libraries. Only those libraries which
are unsupported on a particular platform need to be checked for - all core
libraries are always available. I'm sure if you looked at it, we should
have an awful lot more checks in our Makefiles for library disabling, not
to mention the fact that EAL, mbuf, mempool libraries are possible to
disable, even though doing so will result in an unbuildable mess.

/Bruce
  
Thomas Monjalon April 17, 2018, 10:12 a.m. UTC | #4
16/04/2018 16:08, Fan Zhang:
> Fixes: d090c7f86a76 ("vhost/crypto: update makefile")
> 
> Vhost-Crypto shall not be compiled if rte_cryptodev is disabled.
> This patch fix this by adding checking to Makefile.
> 
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>

Applied with title "vhost/crypto: fix build without cryptodev"

Note: "Fixes" line should be between the explanations and the SoB.

Thanks
  

Patch

diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile
index 92c267475..de431fbb7 100644
--- a/lib/librte_vhost/Makefile
+++ b/lib/librte_vhost/Makefile
@@ -23,10 +23,15 @@  LDLIBS += -lrte_eal -lrte_mempool -lrte_mbuf -lrte_ethdev -lrte_net \
 
 # all source are stored in SRCS-y
 SRCS-$(CONFIG_RTE_LIBRTE_VHOST) := fd_man.c iotlb.c socket.c vhost.c \
-					vhost_user.c virtio_net.c vdpa.c vhost_crypto.c
+					vhost_user.c virtio_net.c vdpa.c
 
 # install includes
-SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_vhost.h rte_vdpa.h \
-					rte_vhost_crypto.h
+SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_vhost.h rte_vdpa.h
+
+# only compile vhost crypto when cryptodev is enabled
+ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
+SRCS-$(CONFIG_RTE_LIBRTE_VHOST) += vhost_crypto.c
+SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_vhost_crypto.h
+endif
 
 include $(RTE_SDK)/mk/rte.lib.mk