[PATCH 19.11 3/3] vhost: add missing c++ guards

Brian Dooley brian.dooley at intel.com
Tue Mar 15 10:46:08 CET 2022


[ upstream commit cedca4084a61e85323800022974c1fde5027cbb4 ]

Some public header files were missing 'extern "C"' C++ guards,
and couldn't be used by C++ applications. Add the missing guards.

Fixes: d7280c9fffcb ("vhost: support selective datapath")
Fixes: 3bb595ecd682 ("vhost/crypto: add request handler")
Cc: roy.fan.zhang at intel.com
Cc: maxime.coquelin at redhat.com
Cc: stable at dpdk.org

Signed-off-by: Brian Dooley <brian.dooley at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia at intel.com>
Acked-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
---
 lib/librte_vhost/rte_vdpa.h         | 9 +++++++++
 lib/librte_vhost/rte_vhost_crypto.h | 8 ++++++++
 2 files changed, 17 insertions(+)

diff --git a/lib/librte_vhost/rte_vdpa.h b/lib/librte_vhost/rte_vdpa.h
index 9a3deb31d..9203c6d37 100644
--- a/lib/librte_vhost/rte_vdpa.h
+++ b/lib/librte_vhost/rte_vdpa.h
@@ -5,6 +5,10 @@
 #ifndef _RTE_VDPA_H_
 #define _RTE_VDPA_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @file
  *
@@ -200,4 +204,9 @@ rte_vhost_host_notifier_ctrl(int vid, bool enable);
 __rte_experimental
 int
 rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_VDPA_H_ */
diff --git a/lib/librte_vhost/rte_vhost_crypto.h b/lib/librte_vhost/rte_vhost_crypto.h
index b54d61db6..83ce06c55 100644
--- a/lib/librte_vhost/rte_vhost_crypto.h
+++ b/lib/librte_vhost/rte_vhost_crypto.h
@@ -5,6 +5,10 @@
 #ifndef _VHOST_CRYPTO_H_
 #define _VHOST_CRYPTO_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #define VHOST_CRYPTO_MBUF_POOL_SIZE		(8192)
 #define VHOST_CRYPTO_MAX_BURST_SIZE		(64)
 #define VHOST_CRYPTO_MAX_DATA_SIZE		(4096)
@@ -117,4 +121,8 @@ uint16_t
 rte_vhost_crypto_finalize_requests(struct rte_crypto_op **ops,
 		uint16_t nb_ops, int *callfds, uint16_t *nb_callfds);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /**< _VHOST_CRYPTO_H_ */
-- 
2.25.1



More information about the stable mailing list