* [PATCH 19.11 1/3] eal: fix missing C++ guards
2022-03-15 9:46 [PATCH 19.11 0/3] add missing C++ guards Brian Dooley
@ 2022-03-15 9:46 ` Brian Dooley
2022-03-15 9:46 ` [PATCH 19.11 2/3] ethdev: add " Brian Dooley
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Brian Dooley @ 2022-03-15 9:46 UTC (permalink / raw)
To: stable
Cc: christian.ehrhardt, Brian Dooley, nhorman, thomas,
anatoly.burakov, adrien.mazarguil, anand.rawat, Bruce Richardson,
Tyler Retzlaff, Sergio Gonzalez Monroy, Jerin Jacob, Remy Horton,
Harini Ramakrishnan, Pallavi Kadam
[ upstream commit d7e9c02ccad8928b6b804049ced9a3ce6172d81e ]
Some public header files were missing 'extern "C"' C++ guards,
and couldn't be used by C++ applications. Add the missing guards.
Fixes: af75078fece3 ("first public release")
Fixes: 166a743c53fa ("compat: add infrastructure to support symbol versioning")
Fixes: 8f40ee0734c8 ("eal/x86: get hypervisor name")
Fixes: 75583b0d1efd ("eal: add keep alive monitoring")
Fixes: 88701645c98c ("eal: move interrupt type out of igb_uio")
Fixes: f04519d8092e ("lib: add missing include dependencies")
Fixes: 428eb983f5f7 ("eal: add OS specific header file")
Cc: nhorman@tuxdriver.com
Cc: thomas@monjalon.net
Cc: anatoly.burakov@intel.com
Cc: adrien.mazarguil@6wind.com
Cc: anand.rawat@intel.com
Cc: stable@dpdk.org
Signed-off-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/librte_eal/common/include/rte_branch_prediction.h | 8 ++++++++
lib/librte_eal/common/include/rte_compat.h | 8 ++++++++
lib/librte_eal/common/include/rte_hypervisor.h | 8 ++++++++
lib/librte_eal/common/include/rte_keepalive.h | 8 ++++++++
lib/librte_eal/common/include/rte_pci_dev_feature_defs.h | 8 ++++++++
lib/librte_eal/common/include/rte_pci_dev_features.h | 8 ++++++++
lib/librte_eal/common/include/rte_time.h | 8 ++++++++
lib/librte_eal/linux/eal/include/rte_os.h | 8 ++++++++
8 files changed, 64 insertions(+)
diff --git a/lib/librte_eal/common/include/rte_branch_prediction.h b/lib/librte_eal/common/include/rte_branch_prediction.h
index 854ef9e5d..0256a9de6 100644
--- a/lib/librte_eal/common/include/rte_branch_prediction.h
+++ b/lib/librte_eal/common/include/rte_branch_prediction.h
@@ -10,6 +10,10 @@
#ifndef _RTE_BRANCH_PREDICTION_H_
#define _RTE_BRANCH_PREDICTION_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* Check if a branch is likely to be taken.
*
@@ -38,4 +42,8 @@
#define unlikely(x) __builtin_expect(!!(x), 0)
#endif /* unlikely */
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_BRANCH_PREDICTION_H_ */
diff --git a/lib/librte_eal/common/include/rte_compat.h b/lib/librte_eal/common/include/rte_compat.h
index 3eb33784b..0b8ba4353 100644
--- a/lib/librte_eal/common/include/rte_compat.h
+++ b/lib/librte_eal/common/include/rte_compat.h
@@ -6,6 +6,10 @@
#ifndef _RTE_COMPAT_H_
#define _RTE_COMPAT_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifndef ALLOW_EXPERIMENTAL_API
#define __rte_experimental \
@@ -19,4 +23,8 @@ __attribute__((section(".text.experimental")))
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_COMPAT_H_ */
diff --git a/lib/librte_eal/common/include/rte_hypervisor.h b/lib/librte_eal/common/include/rte_hypervisor.h
index 5fe719c1d..1666431ce 100644
--- a/lib/librte_eal/common/include/rte_hypervisor.h
+++ b/lib/librte_eal/common/include/rte_hypervisor.h
@@ -5,6 +5,10 @@
#ifndef RTE_HYPERVISOR_H
#define RTE_HYPERVISOR_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* @file
* Hypervisor awareness.
@@ -30,4 +34,8 @@ rte_hypervisor_get(void);
const char *
rte_hypervisor_get_name(enum rte_hypervisor id);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* RTE_HYPERVISOR_H */
diff --git a/lib/librte_eal/common/include/rte_keepalive.h b/lib/librte_eal/common/include/rte_keepalive.h
index 4bda7ca56..cd5099295 100644
--- a/lib/librte_eal/common/include/rte_keepalive.h
+++ b/lib/librte_eal/common/include/rte_keepalive.h
@@ -11,6 +11,10 @@
#ifndef _KEEPALIVE_H_
#define _KEEPALIVE_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <rte_config.h>
#include <rte_memory.h>
@@ -139,4 +143,8 @@ rte_keepalive_register_relay_callback(struct rte_keepalive *keepcfg,
rte_keepalive_relay_callback_t callback,
void *data);
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _KEEPALIVE_H_ */
diff --git a/lib/librte_eal/common/include/rte_pci_dev_feature_defs.h b/lib/librte_eal/common/include/rte_pci_dev_feature_defs.h
index e12c22081..c5bb63128 100644
--- a/lib/librte_eal/common/include/rte_pci_dev_feature_defs.h
+++ b/lib/librte_eal/common/include/rte_pci_dev_feature_defs.h
@@ -5,6 +5,10 @@
#ifndef _RTE_PCI_DEV_DEFS_H_
#define _RTE_PCI_DEV_DEFS_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* interrupt mode */
enum rte_intr_mode {
RTE_INTR_MODE_NONE = 0,
@@ -13,4 +17,8 @@ enum rte_intr_mode {
RTE_INTR_MODE_MSIX
};
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_PCI_DEV_DEFS_H_ */
diff --git a/lib/librte_eal/common/include/rte_pci_dev_features.h b/lib/librte_eal/common/include/rte_pci_dev_features.h
index 6104123d2..ee6e10590 100644
--- a/lib/librte_eal/common/include/rte_pci_dev_features.h
+++ b/lib/librte_eal/common/include/rte_pci_dev_features.h
@@ -5,6 +5,10 @@
#ifndef _RTE_PCI_DEV_FEATURES_H
#define _RTE_PCI_DEV_FEATURES_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <rte_pci_dev_feature_defs.h>
#define RTE_INTR_MODE_NONE_NAME "none"
@@ -12,4 +16,8 @@
#define RTE_INTR_MODE_MSI_NAME "msi"
#define RTE_INTR_MODE_MSIX_NAME "msix"
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/lib/librte_eal/common/include/rte_time.h b/lib/librte_eal/common/include/rte_time.h
index 5ad7c8841..ec25f7b93 100644
--- a/lib/librte_eal/common/include/rte_time.h
+++ b/lib/librte_eal/common/include/rte_time.h
@@ -5,6 +5,10 @@
#ifndef _RTE_TIME_H_
#define _RTE_TIME_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stdint.h>
#include <time.h>
@@ -98,4 +102,8 @@ rte_ns_to_timespec(uint64_t nsec)
return ts;
}
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_TIME_H_ */
diff --git a/lib/librte_eal/linux/eal/include/rte_os.h b/lib/librte_eal/linux/eal/include/rte_os.h
index 390b87b3a..afa28ece9 100644
--- a/lib/librte_eal/linux/eal/include/rte_os.h
+++ b/lib/librte_eal/linux/eal/include/rte_os.h
@@ -5,6 +5,10 @@
#ifndef _RTE_OS_H_
#define _RTE_OS_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**
* This header should contain any definition
* which is not supported natively or named differently in Linux.
@@ -29,4 +33,8 @@ typedef cpu_set_t rte_cpuset_t;
CPU_XOR(dst, &tmp, src); \
} while (0)
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_OS_H_ */
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 19.11 2/3] ethdev: add missing C++ guards
2022-03-15 9:46 [PATCH 19.11 0/3] add missing C++ guards Brian Dooley
2022-03-15 9:46 ` [PATCH 19.11 1/3] eal: fix " Brian Dooley
@ 2022-03-15 9:46 ` Brian Dooley
2022-03-15 9:46 ` [PATCH 19.11 3/3] vhost: add missing c++ guards Brian Dooley
2022-03-17 9:00 ` [PATCH 19.11 0/3] add missing C++ guards Christian Ehrhardt
3 siblings, 0 replies; 5+ messages in thread
From: Brian Dooley @ 2022-03-15 9:46 UTC (permalink / raw)
To: stable
Cc: christian.ehrhardt, Brian Dooley, liang-min.wang, jblunck,
Bruce Richardson, Tyler Retzlaff, Thomas Monjalon, Ferruh Yigit,
Andrew Rybchenko, Andrew Harvey, David Harton,
Konstantin Ananyev, Stephen Hemminger
[ upstream commit dbf9fc1dac70b64dd1ed9a3ffd6997838fbf170e ]
Some public header files were missing 'extern "C"' C++ guards,
and couldn't be used by C++ applications. Add the missing guards.
Fixes: 7a3f27c ("ethdev: add access to specific device info")
Fixes: dcd5c81 ("ethdev: add PCI driver helpers")
Fixes: 7f0a669 ("ethdev: add allocation helper for virtual drivers")
Cc: liang-min.wang@intel.com
Cc: jblunck@infradead.org
Cc: stable@dpdk.org
Signed-off-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/librte_ethdev/rte_dev_info.h | 8 ++++++++
lib/librte_ethdev/rte_ethdev_pci.h | 8 ++++++++
lib/librte_ethdev/rte_ethdev_vdev.h | 8 ++++++++
3 files changed, 24 insertions(+)
diff --git a/lib/librte_ethdev/rte_dev_info.h b/lib/librte_ethdev/rte_dev_info.h
index 7a6b61fdb..cacb989ce 100644
--- a/lib/librte_ethdev/rte_dev_info.h
+++ b/lib/librte_ethdev/rte_dev_info.h
@@ -5,6 +5,10 @@
#ifndef _RTE_DEV_INFO_H_
#define _RTE_DEV_INFO_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <stdint.h>
/*
@@ -48,4 +52,8 @@ struct rte_eth_dev_module_info {
#define RTE_ETH_MODULE_SFF_8436_LEN 256
#define RTE_ETH_MODULE_SFF_8436_MAX_LEN 640
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_DEV_INFO_H_ */
diff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_ethdev_pci.h
index 9e41220a4..b20c32dfd 100644
--- a/lib/librte_ethdev/rte_ethdev_pci.h
+++ b/lib/librte_ethdev/rte_ethdev_pci.h
@@ -8,6 +8,10 @@
#ifndef _RTE_ETHDEV_PCI_H_
#define _RTE_ETHDEV_PCI_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <rte_malloc.h>
#include <rte_pci.h>
#include <rte_bus_pci.h>
@@ -185,4 +189,8 @@ rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev,
return 0;
}
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_ETHDEV_PCI_H_ */
diff --git a/lib/librte_ethdev/rte_ethdev_vdev.h b/lib/librte_ethdev/rte_ethdev_vdev.h
index 0abce0d21..a1110f54b 100644
--- a/lib/librte_ethdev/rte_ethdev_vdev.h
+++ b/lib/librte_ethdev/rte_ethdev_vdev.h
@@ -8,6 +8,10 @@
#ifndef _RTE_ETHDEV_VDEV_H_
#define _RTE_ETHDEV_VDEV_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <rte_config.h>
#include <rte_malloc.h>
#include <rte_bus_vdev.h>
@@ -55,4 +59,8 @@ rte_eth_vdev_allocate(struct rte_vdev_device *dev, size_t private_data_size)
return eth_dev;
}
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RTE_ETHDEV_VDEV_H_ */
--
2.25.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 19.11 3/3] vhost: add missing c++ guards
2022-03-15 9:46 [PATCH 19.11 0/3] add missing C++ guards Brian Dooley
2022-03-15 9:46 ` [PATCH 19.11 1/3] eal: fix " Brian Dooley
2022-03-15 9:46 ` [PATCH 19.11 2/3] ethdev: add " Brian Dooley
@ 2022-03-15 9:46 ` Brian Dooley
2022-03-17 9:00 ` [PATCH 19.11 0/3] add missing C++ guards Christian Ehrhardt
3 siblings, 0 replies; 5+ messages in thread
From: Brian Dooley @ 2022-03-15 9:46 UTC (permalink / raw)
To: stable
Cc: christian.ehrhardt, Brian Dooley, roy.fan.zhang, maxime.coquelin,
Bruce Richardson, Chenbo Xia, Tyler Retzlaff, Tiwei Bie,
Zhihong Wang, Jay Zhou
[ 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@intel.com
Cc: maxime.coquelin@redhat.com
Cc: stable@dpdk.org
Signed-off-by: Brian Dooley <brian.dooley@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Tyler Retzlaff <roretzla@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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 19.11 0/3] add missing C++ guards
2022-03-15 9:46 [PATCH 19.11 0/3] add missing C++ guards Brian Dooley
` (2 preceding siblings ...)
2022-03-15 9:46 ` [PATCH 19.11 3/3] vhost: add missing c++ guards Brian Dooley
@ 2022-03-17 9:00 ` Christian Ehrhardt
3 siblings, 0 replies; 5+ messages in thread
From: Christian Ehrhardt @ 2022-03-17 9:00 UTC (permalink / raw)
To: Brian Dooley; +Cc: stable
On Tue, Mar 15, 2022 at 10:46 AM Brian Dooley <brian.dooley@intel.com> wrote:
>
> Public header files were missing 'extern "C"' guards.
> This set adds them in.
>
> Brian Dooley (3):
> eal: fix missing C++ guards
> ethdev: add missing C++ guards
> vhost: add missing c++ guards
Thank you - all three applied and building fine.
> lib/librte_eal/common/include/rte_branch_prediction.h | 8 ++++++++
> lib/librte_eal/common/include/rte_compat.h | 8 ++++++++
> lib/librte_eal/common/include/rte_hypervisor.h | 8 ++++++++
> lib/librte_eal/common/include/rte_keepalive.h | 8 ++++++++
> lib/librte_eal/common/include/rte_pci_dev_feature_defs.h | 8 ++++++++
> lib/librte_eal/common/include/rte_pci_dev_features.h | 8 ++++++++
> lib/librte_eal/common/include/rte_time.h | 8 ++++++++
> lib/librte_eal/linux/eal/include/rte_os.h | 8 ++++++++
> lib/librte_ethdev/rte_dev_info.h | 8 ++++++++
> lib/librte_ethdev/rte_ethdev_pci.h | 8 ++++++++
> lib/librte_ethdev/rte_ethdev_vdev.h | 8 ++++++++
> lib/librte_vhost/rte_vdpa.h | 9 +++++++++
> lib/librte_vhost/rte_vhost_crypto.h | 8 ++++++++
> 13 files changed, 105 insertions(+)
>
> --
> 2.25.1
>
--
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd
^ permalink raw reply [flat|nested] 5+ messages in thread