Skip to contentSkip to conversation

vhost/crypto: fix Makefile

PATCH In review Fan Zhang 3 participants 5 messages Apr 16, 2018 – Apr 17, 2018

lore
Share & tools
lore

Fan Zhang

author
#0 lore raw

PATCH 1/1 vhost/crypto: fix Makefile

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.

---
 lib/librte_vhost/Makefile | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
lib/librte_vhost/Makefile +8 -3
index 92c267475..de431fbb7 100644
@@ -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
Signature · 1 line
2.13.6
#1 lore raw

16/04/2018 16:08, Fan Zhang:

Quoted 9 lines
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.

---
 lib/librte_vhost/Makefile | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

What about meson.build?

#2 lore raw

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

Quoted 22 lines

-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Monday, April 16, 2018 10:43 PM
To: Zhang, Roy Fan <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; Richardson, Bruce <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] vhost/crypto: fix Makefile

16/04/2018 16:08, Fan Zhang:

Quoted 9 lines
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.

---
 lib/librte_vhost/Makefile | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

What about meson.build?

#3 lore raw
In reply to Thomas Monjalon
Quoted 6 lines · Thomas Monjalon

16/04/2018 16:08, Fan Zhang:

Quoted 5 lines
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.

Quoted 7 lines
Quoted 4 lines
---
 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

#4 lore raw
In reply to Fan Zhang

16/04/2018 16:08, Fan Zhang:

Quoted 6 lines
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.

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

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

Thanks