[v2] vhost/crypto: fix build without cryptodev (shared lib)

Message ID 5cfae41059f6e9b52f424a1a1f6b0d3d41318e2a.1539722428.git.tredaelli@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series [v2] vhost/crypto: fix build without cryptodev (shared lib) |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK

Commit Message

Timothy Redaelli Oct. 16, 2018, 8:47 p.m. UTC
  Currently it's not possible to build DPDK as shared library with
cryptodev disabled since vhost is trying to link with rte_crypto,
but rte_crypto and rte_hash are only needed when you build vhost_crypto
and so only when cryptodev is enabled.

This patch fix this by linking rte_vhost with rte_crypto and rte_hash only
when cryptodev is enabled.

Fixes: b4ca81298613 ("vhost/crypto: fix build without cryptodev")
Fixes: 939066d96563 ("vhost/crypto: add public function implementation")
Cc: stable@dpdk.org

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
v2: Fix the second 'Fixes' line. I wrongly copied that commit id from
commit b4ca81298613, but it seems it's a commit not contained in any branch
(as reported by Maxime and check-git-log.sh).
---
 lib/librte_vhost/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Maxime Coquelin Oct. 23, 2018, 9:42 a.m. UTC | #1
On 10/16/2018 10:47 PM, Timothy Redaelli wrote:
> Currently it's not possible to build DPDK as shared library with
> cryptodev disabled since vhost is trying to link with rte_crypto,
> but rte_crypto and rte_hash are only needed when you build vhost_crypto
> and so only when cryptodev is enabled.
> 
> This patch fix this by linking rte_vhost with rte_crypto and rte_hash only
> when cryptodev is enabled.
> 
> Fixes: b4ca81298613 ("vhost/crypto: fix build without cryptodev")
> Fixes: 939066d96563 ("vhost/crypto: add public function implementation")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
> v2: Fix the second 'Fixes' line. I wrongly copied that commit id from
> commit b4ca81298613, but it seems it's a commit not contained in any branch
> (as reported by Maxime and check-git-log.sh).
> ---
>   lib/librte_vhost/Makefile | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Applied to dpdk-next-virtio/master

Thanks,
Maxime
  

Patch

diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile
index 531cf4832..5dd318987 100644
--- a/lib/librte_vhost/Makefile
+++ b/lib/librte_vhost/Makefile
@@ -19,8 +19,7 @@  LDLIBS += -lpthread
 ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
 LDLIBS += -lnuma
 endif
-LDLIBS += -lrte_eal -lrte_mempool -lrte_mbuf -lrte_ethdev -lrte_net \
-					-lrte_cryptodev -lrte_hash
+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 \
@@ -31,6 +30,7 @@  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)
+LDLIBS += -lrte_cryptodev -lrte_hash
 SRCS-$(CONFIG_RTE_LIBRTE_VHOST) += vhost_crypto.c
 SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_vhost_crypto.h
 endif