* [dpdk-dev] [PATCH] vhost/crypto: fix Makefile
@ 2018-04-16 14:08 Fan Zhang
2018-04-16 21:42 ` Thomas Monjalon
2018-04-17 10:12 ` Thomas Monjalon
0 siblings, 2 replies; 7+ messages in thread
From: Fan Zhang @ 2018-04-16 14:08 UTC (permalink / raw)
To: dev; +Cc: roy.fan.zhang, maxime.coquelin, shahafs
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(-)
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
--
2.13.6
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost/crypto: fix Makefile
2018-04-16 14:08 [dpdk-dev] [PATCH] vhost/crypto: fix Makefile Fan Zhang
@ 2018-04-16 21:42 ` Thomas Monjalon
2018-04-17 8:56 ` Zhang, Roy Fan
2018-04-17 8:57 ` Bruce Richardson
2018-04-17 10:12 ` Thomas Monjalon
1 sibling, 2 replies; 7+ messages in thread
From: Thomas Monjalon @ 2018-04-16 21:42 UTC (permalink / raw)
To: Fan Zhang; +Cc: dev, maxime.coquelin, shahafs, bruce.richardson
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?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost/crypto: fix Makefile
2018-04-16 21:42 ` Thomas Monjalon
@ 2018-04-17 8:56 ` Zhang, Roy Fan
2018-04-17 8:57 ` Bruce Richardson
1 sibling, 0 replies; 7+ messages in thread
From: Zhang, Roy Fan @ 2018-04-17 8:56 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, maxime.coquelin, shahafs, Richardson, Bruce
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?
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost/crypto: fix Makefile
2018-04-16 21:42 ` Thomas Monjalon
2018-04-17 8:56 ` Zhang, Roy Fan
@ 2018-04-17 8:57 ` Bruce Richardson
1 sibling, 0 replies; 7+ messages in thread
From: Bruce Richardson @ 2018-04-17 8:57 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: Fan Zhang, dev, maxime.coquelin, shahafs
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost/crypto: fix Makefile
2018-04-16 14:08 [dpdk-dev] [PATCH] vhost/crypto: fix Makefile Fan Zhang
2018-04-16 21:42 ` Thomas Monjalon
@ 2018-04-17 10:12 ` Thomas Monjalon
1 sibling, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2018-04-17 10:12 UTC (permalink / raw)
To: Fan Zhang; +Cc: dev, maxime.coquelin, shahafs
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH v2] vhost/crypto: fix bugs
@ 2018-04-09 16:38 Fan Zhang
2018-04-09 18:01 ` [dpdk-dev] [PATCH] vhost/crypto: fix makefile Fan Zhang
0 siblings, 1 reply; 7+ messages in thread
From: Fan Zhang @ 2018-04-09 16:38 UTC (permalink / raw)
To: dev; +Cc: roy.fan.zhang, maxime.coquelin, ferruh.yigit
Fixes: 256b132f41b2 ("vhost/crypto: add session message handler")
Fixes: 7b5ad7beee17 ("vhost/crypto: update makefile")
Fixes: 2ce5bd8c442d ("examples/vhost_crypto: add vhost crypto sample application")
This patch fixes the bugs introduced in the above patches.
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
v2:
- change from "%llu" to "%"PRIu64
examples/vhost_crypto/main.c | 5 -----
lib/librte_vhost/Makefile | 3 ++-
lib/librte_vhost/vhost_crypto.c | 17 +++++++++--------
3 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/examples/vhost_crypto/main.c b/examples/vhost_crypto/main.c
index bc867240d..860200e29 100644
--- a/examples/vhost_crypto/main.c
+++ b/examples/vhost_crypto/main.c
@@ -95,11 +95,6 @@ parse_cryptodev_id(const char *q_arg)
/* parse decimal string */
pm = strtoul(q_arg, &end, 10);
- if ((pm == '\0') || (end == NULL) || (*end != '\0')) {
- RTE_LOG(ERR, USER1, "Invalid Cryptodev ID %s\n", q_arg);
- return -1;
- }
-
if (pm > rte_cryptodev_count()) {
RTE_LOG(ERR, USER1, "Invalid Cryptodev ID %s\n", q_arg);
return -1;
diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile
index 2cc65f95e..92c267475 100644
--- a/lib/librte_vhost/Makefile
+++ b/lib/librte_vhost/Makefile
@@ -18,7 +18,8 @@ LDLIBS += -lpthread
ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
LDLIBS += -lnuma
endif
-LDLIBS += -lrte_eal -lrte_mempool -lrte_mbuf -lrte_ethdev -lrte_net
+LDLIBS += -lrte_eal -lrte_mempool -lrte_mbuf -lrte_ethdev -lrte_net \
+ -lrte_cryptodev -lrte_hash
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_VHOST) := fd_man.c iotlb.c socket.c vhost.c \
diff --git a/lib/librte_vhost/vhost_crypto.c b/lib/librte_vhost/vhost_crypto.c
index d84513e7f..b67b63cc1 100644
--- a/lib/librte_vhost/vhost_crypto.c
+++ b/lib/librte_vhost/vhost_crypto.c
@@ -381,8 +381,8 @@ vhost_crypto_create_sess(struct vhost_crypto *vcrypto,
return;
}
- VC_LOG_DBG("Session (key %lu, session %p) created.",
- vcrypto->last_session_id, session);
+ VC_LOG_DBG("Session %"PRIu64" created for vid %i.",
+ vcrypto->last_session_id, vcrypto->dev->vid);
sess_param->session_id = vcrypto->last_session_id;
vcrypto->last_session_id++;
@@ -399,17 +399,18 @@ vhost_crypto_close_sess(struct vhost_crypto *vcrypto, uint64_t session_id)
(void **)&session);
if (unlikely(ret < 0)) {
- VC_LOG_ERR("Failed to delete session (key %lu).", session_id);
+ VC_LOG_ERR("Failed to delete session %"PRIu64".",
+ session_id);
return -VIRTIO_CRYPTO_INVSESS;
}
if (rte_cryptodev_sym_session_clear(vcrypto->cid, session) < 0) {
- VC_LOG_DBG("Failed to delete session");
+ VC_LOG_DBG("Failed to clear session");
return -VIRTIO_CRYPTO_ERR;
}
if (rte_cryptodev_sym_session_free(session) < 0) {
- VC_LOG_DBG("Failed to delete session");
+ VC_LOG_DBG("Failed to free session");
return -VIRTIO_CRYPTO_ERR;
}
@@ -418,8 +419,8 @@ vhost_crypto_close_sess(struct vhost_crypto *vcrypto, uint64_t session_id)
return -VIRTIO_CRYPTO_ERR;
}
- VC_LOG_DBG("Session (key %lu, session %p) deleted.", sess_id,
- session);
+ VC_LOG_DBG("Session %"PRIu64" deleted for vid %i.", sess_id,
+ vcrypto->dev->vid);
return 0;
}
@@ -932,7 +933,7 @@ vhost_crypto_process_one_req(struct vhost_crypto *vcrypto,
&session_id, (void **)&session);
if (unlikely(err < 0)) {
err = VIRTIO_CRYPTO_ERR;
- VC_LOG_ERR("Failed to retrieve session id %lu",
+ VC_LOG_ERR("Failed to obtain session %"PRIu64,
session_id);
goto error_exit;
}
--
2.13.6
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH] vhost/crypto: fix makefile
2018-04-09 16:38 [dpdk-dev] [PATCH v2] vhost/crypto: fix bugs Fan Zhang
@ 2018-04-09 18:01 ` Fan Zhang
2018-04-10 9:41 ` Maxime Coquelin
0 siblings, 1 reply; 7+ messages in thread
From: Fan Zhang @ 2018-04-09 18:01 UTC (permalink / raw)
To: dev; +Cc: roy.fan.zhang, maxime.coquelin, ferruh.yigit
Fixes: 7b5ad7beee17 ("vhost/crypto: update makefile")
Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
lib/librte_vhost/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile
index 2cc65f95e..92c267475 100644
--- a/lib/librte_vhost/Makefile
+++ b/lib/librte_vhost/Makefile
@@ -18,7 +18,8 @@ LDLIBS += -lpthread
ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
LDLIBS += -lnuma
endif
-LDLIBS += -lrte_eal -lrte_mempool -lrte_mbuf -lrte_ethdev -lrte_net
+LDLIBS += -lrte_eal -lrte_mempool -lrte_mbuf -lrte_ethdev -lrte_net \
+ -lrte_cryptodev -lrte_hash
# all source are stored in SRCS-y
SRCS-$(CONFIG_RTE_LIBRTE_VHOST) := fd_man.c iotlb.c socket.c vhost.c \
--
2.13.6
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH] vhost/crypto: fix makefile
2018-04-09 18:01 ` [dpdk-dev] [PATCH] vhost/crypto: fix makefile Fan Zhang
@ 2018-04-10 9:41 ` Maxime Coquelin
0 siblings, 0 replies; 7+ messages in thread
From: Maxime Coquelin @ 2018-04-10 9:41 UTC (permalink / raw)
To: Fan Zhang, dev; +Cc: ferruh.yigit
On 04/09/2018 08:01 PM, Fan Zhang wrote:
> Fixes: 7b5ad7beee17 ("vhost/crypto: update makefile")
>
> Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
> ---
> lib/librte_vhost/Makefile | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile
> index 2cc65f95e..92c267475 100644
> --- a/lib/librte_vhost/Makefile
> +++ b/lib/librte_vhost/Makefile
> @@ -18,7 +18,8 @@ LDLIBS += -lpthread
> ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
> LDLIBS += -lnuma
> endif
> -LDLIBS += -lrte_eal -lrte_mempool -lrte_mbuf -lrte_ethdev -lrte_net
> +LDLIBS += -lrte_eal -lrte_mempool -lrte_mbuf -lrte_ethdev -lrte_net \
> + -lrte_cryptodev -lrte_hash
>
> # all source are stored in SRCS-y
> SRCS-$(CONFIG_RTE_LIBRTE_VHOST) := fd_man.c iotlb.c socket.c vhost.c \
>
Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com>
I'll squash it with faulty commit if not yet merged by Ferruh.
Thanks,
Maxime
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-04-17 10:12 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-16 14:08 [dpdk-dev] [PATCH] vhost/crypto: fix Makefile Fan Zhang
2018-04-16 21:42 ` Thomas Monjalon
2018-04-17 8:56 ` Zhang, Roy Fan
2018-04-17 8:57 ` Bruce Richardson
2018-04-17 10:12 ` Thomas Monjalon
-- strict thread matches above, loose matches on Subject: below --
2018-04-09 16:38 [dpdk-dev] [PATCH v2] vhost/crypto: fix bugs Fan Zhang
2018-04-09 18:01 ` [dpdk-dev] [PATCH] vhost/crypto: fix makefile Fan Zhang
2018-04-10 9:41 ` Maxime Coquelin
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).