Skip to contentSkip to conversation

add missing C++ guards

PATCH Applied Brian Dooley 5 participants 28 messages Feb 15, 2022 – Feb 22, 2022

lore
Share & tools
lore
#0 lore raw

cover add missing C++ guards

Public header files were missing 'extern "C"' guards. This set adds them in.

Brian Dooley (11):
eal: fix missing C++ guards
telemetry: fix missing C++ guards
ethdev: fix missing C++ guards
metrics: fix missing C++ guards
acl: fix missing C++ guards
compressdev: fix missing C++ guards
eventdev: fix missing C++ guards
kni: fix missing C++ guards
vhost: fix missing C++ guards
bpf: fix missing C++ guards
cryptodev: fix missing C++ guards

 lib/acl/rte_acl_osdep.h                    | 8 ++++++++
 lib/bpf/bpf_def.h                          | 8 ++++++++
 lib/compressdev/rte_compressdev_internal.h | 9 +++++++++
 lib/cryptodev/cryptodev_pmd.h              | 8 ++++++++
 lib/eal/include/rte_bitops.h               | 8 ++++++++
 lib/eal/include/rte_branch_prediction.h    | 8 ++++++++
 lib/eal/include/rte_compat.h               | 8 ++++++++
 lib/eal/include/rte_hypervisor.h           | 8 ++++++++
 lib/eal/include/rte_keepalive.h            | 8 ++++++++
 lib/eal/include/rte_pci_dev_feature_defs.h | 8 ++++++++
 lib/eal/include/rte_pci_dev_features.h     | 8 ++++++++
 lib/eal/include/rte_time.h                 | 8 ++++++++
 lib/eal/include/rte_trace_point_register.h | 8 ++++++++
 lib/eal/linux/include/rte_os.h             | 8 ++++++++
 lib/ethdev/ethdev_driver.h                 | 8 ++++++++
 lib/ethdev/ethdev_pci.h                    | 8 ++++++++
 lib/ethdev/ethdev_vdev.h                   | 8 ++++++++
 lib/ethdev/rte_dev_info.h                  | 8 ++++++++
 lib/eventdev/eventdev_pmd.h                | 8 ++++++++
 lib/eventdev/eventdev_pmd_pci.h            | 8 ++++++++
 lib/eventdev/eventdev_pmd_vdev.h           | 8 ++++++++
 lib/eventdev/rte_event_ring.h              | 9 +++++++++
 lib/kni/rte_kni_common.h                   | 8 ++++++++
 lib/metrics/rte_metrics_telemetry.h        | 7 +++++++
 lib/telemetry/rte_telemetry.h              | 8 ++++++++
 lib/vhost/rte_vdpa.h                       | 9 +++++++++
 lib/vhost/rte_vhost_async.h                | 8 ++++++++
 lib/vhost/rte_vhost_crypto.h               | 8 ++++++++
 lib/vhost/vdpa_driver.h                    | 8 ++++++++
 29 files changed, 234 insertions(+)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/11 eal: fix missing C++ guards

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

Fixes af75078fece3 ("first public release")
Fixes 7f3aa0863903 ("eal: introduce bit operations API")
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 f58880682c81 ("trace: implement register API")
Fixes 428eb983f5f7 ("eal: add OS specific header file")
---
 lib/eal/include/rte_bitops.h               | 8 ++++++++
 lib/eal/include/rte_branch_prediction.h    | 8 ++++++++
 lib/eal/include/rte_compat.h               | 8 ++++++++
 lib/eal/include/rte_hypervisor.h           | 8 ++++++++
 lib/eal/include/rte_keepalive.h            | 8 ++++++++
 lib/eal/include/rte_pci_dev_feature_defs.h | 8 ++++++++
 lib/eal/include/rte_pci_dev_features.h     | 8 ++++++++
 lib/eal/include/rte_time.h                 | 8 ++++++++
 lib/eal/include/rte_trace_point_register.h | 8 ++++++++
 lib/eal/linux/include/rte_os.h             | 8 ++++++++
 10 files changed, 80 insertions(+)
lib/eal/include/rte_bitops.h +8 -0
index 141e8ea730..f50dbe4388 100644
@@ -17,6 +17,10 @@
 #include <rte_debug.h>
 #include <rte_compat.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * Get the uint64_t value for a specified bit set.
  *
@@ -271,4 +275,8 @@ rte_bit_relaxed_test_and_clear64(unsigned int nr, volatile uint64_t *addr)
 	return val & mask;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_BITOPS_H_ */
lib/eal/include/rte_branch_prediction.h +8 -0
index 854ef9e5dd..0256a9de60 100644
@@ -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_ */
lib/eal/include/rte_compat.h +8 -0
index 9556bbf4d0..fc9fbaaab2 100644
@@ -6,6 +6,10 @@
 #ifndef _RTE_COMPAT_H_
 #define _RTE_COMPAT_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifndef ALLOW_EXPERIMENTAL_API
 
 #define __rte_experimental \
@@ -46,4 +50,8 @@ __attribute__((section(".text.internal")))
 
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_COMPAT_H_ */
lib/eal/include/rte_hypervisor.h +8 -0
index 5fe719c1d4..1666431ce3 100644
@@ -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 */
lib/eal/include/rte_keepalive.h +8 -0
index bd25508da8..538fb09095 100644
@@ -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_ */
lib/eal/include/rte_pci_dev_feature_defs.h +8 -0
index e12c22081f..c5bb631286 100644
@@ -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_ */
lib/eal/include/rte_pci_dev_features.h +8 -0
index 6104123d27..ee6e10590c 100644
@@ -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
lib/eal/include/rte_time.h +8 -0
index 5ad7c8841a..ec25f7b93d 100644
@@ -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_ */
lib/eal/include/rte_trace_point_register.h +8 -0
index 4f5c86552d..2e61439940 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_TRACE_POINT_REGISTER_H_
 #define _RTE_TRACE_POINT_REGISTER_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef _RTE_TRACE_POINT_H_
 #error for registration, include this file first before <rte_trace_point.h>
 #endif
@@ -42,4 +46,8 @@ do { \
 		RTE_STR(in)"[32]", "string_bounded_t"); \
 } while (0)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_TRACE_POINT_REGISTER_H_ */
lib/eal/linux/include/rte_os.h +8 -0
index 35c07c70cb..c72bf5b7e6 100644
@@ -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.
@@ -42,4 +46,8 @@ typedef cpu_set_t rte_cpuset_t;
 } while (0)
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_OS_H_ */
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/11 telemetry: fix missing C++ guards

In reply to Brian Dooley

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

Fixes 8877ac688b52 ("telemetry: introduce infrastructure")
---
 lib/telemetry/rte_telemetry.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/telemetry/rte_telemetry.h +8 -0
index 7bca8a9a49..3372b32f38 100644
@@ -9,6 +9,10 @@
 #ifndef _RTE_TELEMETRY_H_
 #define _RTE_TELEMETRY_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** Maximum length for string used in object. */
 #define RTE_TEL_MAX_STRING_LEN 128
 /** Maximum length of string. */
@@ -294,4 +298,8 @@ rte_tel_data_alloc(void);
 void
 rte_tel_data_free(struct rte_tel_data *data);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/11 ethdev: fix missing C++ guards

In reply to Brian Dooley

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

Fixes 7a3f27cbf59b ("ethdev: add access to specific device info")
Fixes dcd5c8112bc3 ("ethdev: add PCI driver helpers")
Fixes 7f0a669e7b04 ("ethdev: add allocation helper for virtual drivers")
Fixes 7a3357205755 ("lib: remove C++ include guard from private headers")
---
 lib/ethdev/ethdev_driver.h | 8 ++++++++
 lib/ethdev/ethdev_pci.h    | 8 ++++++++
 lib/ethdev/ethdev_vdev.h   | 8 ++++++++
 lib/ethdev/rte_dev_info.h  | 8 ++++++++
 4 files changed, 32 insertions(+)
lib/ethdev/ethdev_driver.h +8 -0
index 6d697a879a..5ec00e533e 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_ETHDEV_DRIVER_H_
 #define _RTE_ETHDEV_DRIVER_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @file
  *
@@ -1881,4 +1885,8 @@ struct rte_eth_tunnel_filter_conf {
 	uint16_t queue_id;      /**< Queue assigned to if match */
 };
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_ETHDEV_DRIVER_H_ */
lib/ethdev/ethdev_pci.h +8 -0
index 71aa4b2e98..6130bcbd1f 100644
@@ -6,6 +6,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>
@@ -171,4 +175,8 @@ rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev,
 	return 0;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_ETHDEV_PCI_H_ */
lib/ethdev/ethdev_vdev.h +8 -0
index 2b49e9665b..f5f536ce64 100644
@@ -6,6 +6,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>
@@ -52,4 +56,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_ */
lib/ethdev/rte_dev_info.h +8 -0
index cb2fe0ae97..67cf0ae526 100644
@@ -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_ */
Signature · 1 line
2.25.1
#4 lore raw

PATCH 4/11 metrics: fix missing C++ guards

In reply to Brian Dooley

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

Fixes c5b7197f662e ("telemetry: move some functions to metrics library")
---
 lib/metrics/rte_metrics_telemetry.h | 7 +++++++
 1 file changed, 7 insertions(+)
lib/metrics/rte_metrics_telemetry.h +7 -0
index 2b6eb1ccc8..09b14d9336 100644
@@ -13,6 +13,9 @@
 #ifndef _RTE_METRICS_TELEMETRY_H_
 #define _RTE_METRICS_TELEMETRY_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 enum rte_telemetry_stats_type {
 	PORT_STATS = 0,
@@ -60,4 +63,8 @@ __rte_experimental
 int32_t
 rte_metrics_tel_extract_data(struct telemetry_encode_param *ep, json_t *data);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
Signature · 1 line
2.25.1
#5 lore raw

PATCH 5/11 acl: fix missing C++ guards

In reply to Brian Dooley

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

Fixes dc276b5780c2 ("acl: new library")
---
 lib/acl/rte_acl_osdep.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/acl/rte_acl_osdep.h +8 -0
index b2c262dee7..3c1dc402ca 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_ACL_OSDEP_H_
 #define _RTE_ACL_OSDEP_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @file
  *
@@ -45,4 +49,8 @@
 #include <rte_cpuflags.h>
 #include <rte_debug.h>
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_ACL_OSDEP_H_ */
Signature · 1 line
2.25.1
#6 lore raw

PATCH 6/11 compressdev: fix missing C++ guards

In reply to Brian Dooley

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

Fixes ed7dd94f7f66 ("compressdev: add basic device management")
---
 lib/compressdev/rte_compressdev_internal.h | 9 +++++++++
 1 file changed, 9 insertions(+)
lib/compressdev/rte_compressdev_internal.h +9 -0
index 22ceac66e2..888c8f5c5c 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_COMPRESSDEV_INTERNAL_H_
 #define _RTE_COMPRESSDEV_INTERNAL_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* rte_compressdev_internal.h
  * This file holds Compressdev private data structures.
  */
@@ -111,4 +115,9 @@ struct rte_compressdev_data {
 	void *dev_private;
 	/**< PMD-specific private data */
 } __rte_cache_aligned;
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
Signature · 1 line
2.25.1
#7 lore raw

PATCH 7/11 eventdev: fix missing C++ guards

In reply to Brian Dooley

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

Fixes dc39e2f359b5 ("eventdev: add ring structure for events")
Fixes 7a3357205755 ("lib: remove C++ include guard from private headers")
---
 lib/eventdev/eventdev_pmd.h      | 8 ++++++++
 lib/eventdev/eventdev_pmd_pci.h  | 8 ++++++++
 lib/eventdev/eventdev_pmd_vdev.h | 8 ++++++++
 lib/eventdev/rte_event_ring.h    | 9 +++++++++
 4 files changed, 33 insertions(+)
lib/eventdev/eventdev_pmd.h +8 -0
index b05ffce549..ce469d47a6 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_EVENTDEV_PMD_H_
 #define _RTE_EVENTDEV_PMD_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** @file
  * RTE Event PMD APIs
  *
@@ -1366,4 +1370,8 @@ void
 event_dev_fp_ops_set(struct rte_event_fp_ops *fp_ops,
 		     const struct rte_eventdev *dev);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_EVENTDEV_PMD_H_ */
lib/eventdev/eventdev_pmd_pci.h +8 -0
index 499852db16..24b56faaa9 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_EVENTDEV_PMD_PCI_H_
 #define _RTE_EVENTDEV_PMD_PCI_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** @file
  * RTE Eventdev PCI PMD APIs
  *
@@ -150,4 +154,8 @@ rte_event_pmd_pci_remove(struct rte_pci_device *pci_dev,
 	return 0;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_EVENTDEV_PMD_PCI_H_ */
lib/eventdev/eventdev_pmd_vdev.h +8 -0
index d9ee7277dd..77904910a2 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_EVENTDEV_PMD_VDEV_H_
 #define _RTE_EVENTDEV_PMD_VDEV_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** @file
  * RTE Eventdev VDEV PMD APIs
  *
@@ -99,4 +103,8 @@ rte_event_pmd_vdev_uninit(const char *name)
 	return 0;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_EVENTDEV_PMD_VDEV_H_ */
lib/eventdev/rte_event_ring.h +9 -0
index c0861b0ec2..0b9aefb000 100644
@@ -14,6 +14,10 @@
 #ifndef _RTE_EVENT_RING_
 #define _RTE_EVENT_RING_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdint.h>
 
 #include <rte_common.h>
@@ -266,4 +270,9 @@ rte_event_ring_get_capacity(const struct rte_event_ring *r)
 {
 	return rte_ring_get_capacity(&r->r);
 }
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
Signature · 1 line
2.25.1
#8 lore raw

PATCH 8/11 kni: fix missing C++ guards

In reply to Brian Dooley

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

Fixes 3fc5ca2f6352 ("kni: initial import")
---
 lib/kni/rte_kni_common.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/kni/rte_kni_common.h +8 -0
index b547ea5501..8d3ee0fa4f 100644
@@ -6,6 +6,10 @@
 #ifndef _RTE_KNI_COMMON_H_
 #define _RTE_KNI_COMMON_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef __KERNEL__
 #include <linux/if.h>
 #include <asm/barrier.h>
@@ -136,4 +140,8 @@ struct rte_kni_device_info {
 #define RTE_KNI_IOCTL_CREATE  _IOWR(0, 2, struct rte_kni_device_info)
 #define RTE_KNI_IOCTL_RELEASE _IOWR(0, 3, struct rte_kni_device_info)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_KNI_COMMON_H_ */
Signature · 1 line
2.25.1
#9 lore raw

PATCH 9/11 vhost: fix missing C++ guards

In reply to Brian Dooley

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

Fixes d7280c9fffcb ("vhost: support selective datapath")
Fixes 78639d54563a ("vhost: introduce async enqueue registration API")
Fixes 3bb595ecd682 ("vhost/crypto: add request handler")
Fixes 94c16e89d779 ("vhost: mark vDPA driver API as internal")
---
 lib/vhost/rte_vdpa.h         | 9 +++++++++
 lib/vhost/rte_vhost_async.h  | 8 ++++++++
 lib/vhost/rte_vhost_crypto.h | 8 ++++++++
 lib/vhost/vdpa_driver.h      | 8 ++++++++
 4 files changed, 33 insertions(+)
lib/vhost/rte_vdpa.h +9 -0
index 1437f400bf..6ac85d1bbf 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_VDPA_H_
 #define _RTE_VDPA_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @file
  *
@@ -183,4 +187,9 @@ rte_vdpa_get_stats(struct rte_vdpa_device *dev, uint16_t qid,
  */
 int
 rte_vdpa_reset_stats(struct rte_vdpa_device *dev, uint16_t qid);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_VDPA_H_ */
lib/vhost/rte_vhost_async.h +8 -0
index 838c4778cc..f1293c6a9d 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_VHOST_ASYNC_H_
 #define _RTE_VHOST_ASYNC_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdint.h>
 
 #include <rte_compat.h>
@@ -183,4 +187,8 @@ uint16_t rte_vhost_clear_queue_thread_unsafe(int vid, uint16_t queue_id,
 __rte_experimental
 int rte_vhost_async_dma_configure(int16_t dma_id, uint16_t vchan_id);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_VHOST_ASYNC_H_ */
lib/vhost/rte_vhost_crypto.h +8 -0
index f54d731139..b49e389579 100644
@@ -5,6 +5,10 @@
 #ifndef _VHOST_CRYPTO_H_
 #define _VHOST_CRYPTO_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdint.h>
 
 #include <rte_compat.h>
@@ -132,4 +136,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_ */
lib/vhost/vdpa_driver.h +8 -0
index fddbd50652..88138be34a 100644
@@ -5,6 +5,10 @@
 #ifndef _VDPA_DRIVER_H_
 #define _VDPA_DRIVER_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdbool.h>
 
 #include <rte_compat.h>
@@ -144,4 +148,8 @@ __rte_internal
 int
 rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _VDPA_DRIVER_H_ */
Signature · 1 line
2.25.1
#10 lore raw

PATCH 10/11 bpf: fix missing C++ guards

In reply to Brian Dooley

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

Fixes 7a3357205755 ("lib: remove C++ include guard from private headers")
---
 lib/bpf/bpf_def.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/bpf/bpf_def.h +8 -0
index fa9125307e..f08cd9106b 100644
@@ -7,6 +7,10 @@
 #ifndef _RTE_BPF_DEF_H_
 #define _RTE_BPF_DEF_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @file
  *
@@ -140,4 +144,8 @@ struct ebpf_insn {
  */
 #define	EBPF_FUNC_MAX_ARGS	(EBPF_REG_6 - EBPF_REG_1)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* RTE_BPF_DEF_H_ */
Signature · 1 line
2.25.1
#11 lore raw

PATCH 11/11 cryptodev: fix missing C++ guards

In reply to Brian Dooley

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

Fixes 7a3357205755 ("lib: remove C++ include guard from private headers")
---
 lib/cryptodev/cryptodev_pmd.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/cryptodev/cryptodev_pmd.h +8 -0
index d91902f6e0..24ff1a5480 100644
@@ -5,6 +5,10 @@
 #ifndef _CRYPTODEV_PMD_H_
 #define _CRYPTODEV_PMD_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** @file
  * RTE Crypto PMD APIs
  *
@@ -640,4 +644,8 @@ RTE_STD_C11 struct rte_cryptodev_asym_session {
 	uint8_t sess_private_data[0];
 };
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _CRYPTODEV_PMD_H_ */
Signature · 1 line
2.25.1
#12 lore raw
In reply to Brian Dooley
Quoted 16 lines · Brian Dooley

Public header files were missing 'extern "C"' guards. This set adds them in.

Brian Dooley (11):
eal: fix missing C++ guards
telemetry: fix missing C++ guards
ethdev: fix missing C++ guards
metrics: fix missing C++ guards
acl: fix missing C++ guards
compressdev: fix missing C++ guards
eventdev: fix missing C++ guards
kni: fix missing C++ guards
vhost: fix missing C++ guards
bpf: fix missing C++ guards
cryptodev: fix missing C++ guards

Good cleanup to have for compatibility.

#13 lore raw

v2 cover add missing C++ guards

In reply to Brian Dooley

Public header files were missing 'extern "C"' guards. This set adds them in.

v2:
- Fixed checkpatch errors

Brian Dooley (11):
eal: fix missing C++ guards
telemetry: fix missing C++ guards
ethdev: fix missing C++ guards
metrics: fix missing C++ guards
acl: fix missing C++ guards
compressdev: fix missing C++ guards
eventdev: fix missing C++ guards
kni: fix missing C++ guards
vhost: fix missing C++ guards
bpf: fix missing C++ guards
cryptodev: fix missing C++ guards

 lib/acl/rte_acl_osdep.h                    | 8 ++++++++
 lib/bpf/bpf_def.h                          | 8 ++++++++
 lib/compressdev/rte_compressdev_internal.h | 9 +++++++++
 lib/cryptodev/cryptodev_pmd.h              | 8 ++++++++
 lib/eal/include/rte_bitops.h               | 8 ++++++++
 lib/eal/include/rte_branch_prediction.h    | 8 ++++++++
 lib/eal/include/rte_compat.h               | 8 ++++++++
 lib/eal/include/rte_hypervisor.h           | 8 ++++++++
 lib/eal/include/rte_keepalive.h            | 8 ++++++++
 lib/eal/include/rte_pci_dev_feature_defs.h | 8 ++++++++
 lib/eal/include/rte_pci_dev_features.h     | 8 ++++++++
 lib/eal/include/rte_time.h                 | 8 ++++++++
 lib/eal/include/rte_trace_point_register.h | 8 ++++++++
 lib/eal/linux/include/rte_os.h             | 8 ++++++++
 lib/ethdev/ethdev_driver.h                 | 8 ++++++++
 lib/ethdev/ethdev_pci.h                    | 8 ++++++++
 lib/ethdev/ethdev_vdev.h                   | 8 ++++++++
 lib/ethdev/rte_dev_info.h                  | 8 ++++++++
 lib/eventdev/eventdev_pmd.h                | 8 ++++++++
 lib/eventdev/eventdev_pmd_pci.h            | 8 ++++++++
 lib/eventdev/eventdev_pmd_vdev.h           | 8 ++++++++
 lib/eventdev/rte_event_ring.h              | 9 +++++++++
 lib/kni/rte_kni_common.h                   | 8 ++++++++
 lib/metrics/rte_metrics_telemetry.h        | 7 +++++++
 lib/telemetry/rte_telemetry.h              | 8 ++++++++
 lib/vhost/rte_vdpa.h                       | 9 +++++++++
 lib/vhost/rte_vhost_async.h                | 8 ++++++++
 lib/vhost/rte_vhost_crypto.h               | 8 ++++++++
 lib/vhost/vdpa_driver.h                    | 8 ++++++++
 29 files changed, 234 insertions(+)
Signature · 1 line
2.25.1
#14 lore raw

PATCH v2 1/11 eal: fix missing C++ guards

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 7f3aa0863903 ("eal: introduce bit operations API")
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 f58880682c81 ("trace: implement register API")
Fixes 428eb983f5f7 ("eal: add OS specific header file")

---
v2: Added missing apostrophe to commit message.

---
 lib/eal/include/rte_bitops.h               | 8 ++++++++
 lib/eal/include/rte_branch_prediction.h    | 8 ++++++++
 lib/eal/include/rte_compat.h               | 8 ++++++++
 lib/eal/include/rte_hypervisor.h           | 8 ++++++++
 lib/eal/include/rte_keepalive.h            | 8 ++++++++
 lib/eal/include/rte_pci_dev_feature_defs.h | 8 ++++++++
 lib/eal/include/rte_pci_dev_features.h     | 8 ++++++++
 lib/eal/include/rte_time.h                 | 8 ++++++++
 lib/eal/include/rte_trace_point_register.h | 8 ++++++++
 lib/eal/linux/include/rte_os.h             | 8 ++++++++
 10 files changed, 80 insertions(+)
lib/eal/include/rte_bitops.h +8 -0
index 141e8ea730..f50dbe4388 100644
@@ -17,6 +17,10 @@
 #include <rte_debug.h>
 #include <rte_compat.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * Get the uint64_t value for a specified bit set.
  *
@@ -271,4 +275,8 @@ rte_bit_relaxed_test_and_clear64(unsigned int nr, volatile uint64_t *addr)
 	return val & mask;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_BITOPS_H_ */
lib/eal/include/rte_branch_prediction.h +8 -0
index 854ef9e5dd..0256a9de60 100644
@@ -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_ */
lib/eal/include/rte_compat.h +8 -0
index 9556bbf4d0..fc9fbaaab2 100644
@@ -6,6 +6,10 @@
 #ifndef _RTE_COMPAT_H_
 #define _RTE_COMPAT_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifndef ALLOW_EXPERIMENTAL_API
 
 #define __rte_experimental \
@@ -46,4 +50,8 @@ __attribute__((section(".text.internal")))
 
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_COMPAT_H_ */
lib/eal/include/rte_hypervisor.h +8 -0
index 5fe719c1d4..1666431ce3 100644
@@ -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 */
lib/eal/include/rte_keepalive.h +8 -0
index bd25508da8..538fb09095 100644
@@ -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_ */
lib/eal/include/rte_pci_dev_feature_defs.h +8 -0
index e12c22081f..c5bb631286 100644
@@ -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_ */
lib/eal/include/rte_pci_dev_features.h +8 -0
index 6104123d27..ee6e10590c 100644
@@ -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
lib/eal/include/rte_time.h +8 -0
index 5ad7c8841a..ec25f7b93d 100644
@@ -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_ */
lib/eal/include/rte_trace_point_register.h +8 -0
index 4f5c86552d..2e61439940 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_TRACE_POINT_REGISTER_H_
 #define _RTE_TRACE_POINT_REGISTER_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef _RTE_TRACE_POINT_H_
 #error for registration, include this file first before <rte_trace_point.h>
 #endif
@@ -42,4 +46,8 @@ do { \
 		RTE_STR(in)"[32]", "string_bounded_t"); \
 } while (0)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_TRACE_POINT_REGISTER_H_ */
lib/eal/linux/include/rte_os.h +8 -0
index 35c07c70cb..c72bf5b7e6 100644
@@ -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.
@@ -42,4 +46,8 @@ typedef cpu_set_t rte_cpuset_t;
 } while (0)
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_OS_H_ */
Signature · 1 line
2.25.1
#15 lore raw

PATCH v2 2/11 telemetry: fix missing C++ guards

In reply to Brian Dooley

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

Fixes 8877ac688b52 ("telemetry: introduce infrastructure")

---
v2: Added missing apostrophe to commit message.

---
 lib/telemetry/rte_telemetry.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/telemetry/rte_telemetry.h +8 -0
index 7bca8a9a49..3372b32f38 100644
@@ -9,6 +9,10 @@
 #ifndef _RTE_TELEMETRY_H_
 #define _RTE_TELEMETRY_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** Maximum length for string used in object. */
 #define RTE_TEL_MAX_STRING_LEN 128
 /** Maximum length of string. */
@@ -294,4 +298,8 @@ rte_tel_data_alloc(void);
 void
 rte_tel_data_free(struct rte_tel_data *data);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
Signature · 1 line
2.25.1
#16 lore raw

PATCH v2 3/11 ethdev: fix missing C++ guards

In reply to Brian Dooley

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

Fixes 7a3f27cbf59b ("ethdev: add access to specific device info")
Fixes dcd5c8112bc3 ("ethdev: add PCI driver helpers")
Fixes 7f0a669e7b04 ("ethdev: add allocation helper for virtual drivers")
Fixes 7a3357205755 ("lib: remove C++ include guard from private headers")

---
v2: Added missing apostrophe to commit message.

---
 lib/ethdev/ethdev_driver.h | 8 ++++++++
 lib/ethdev/ethdev_pci.h    | 8 ++++++++
 lib/ethdev/ethdev_vdev.h   | 8 ++++++++
 lib/ethdev/rte_dev_info.h  | 8 ++++++++
 4 files changed, 32 insertions(+)
lib/ethdev/ethdev_driver.h +8 -0
index 6d697a879a..5ec00e533e 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_ETHDEV_DRIVER_H_
 #define _RTE_ETHDEV_DRIVER_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @file
  *
@@ -1881,4 +1885,8 @@ struct rte_eth_tunnel_filter_conf {
 	uint16_t queue_id;      /**< Queue assigned to if match */
 };
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_ETHDEV_DRIVER_H_ */
lib/ethdev/ethdev_pci.h +8 -0
index 71aa4b2e98..6130bcbd1f 100644
@@ -6,6 +6,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>
@@ -171,4 +175,8 @@ rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev,
 	return 0;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_ETHDEV_PCI_H_ */
lib/ethdev/ethdev_vdev.h +8 -0
index 2b49e9665b..f5f536ce64 100644
@@ -6,6 +6,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>
@@ -52,4 +56,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_ */
lib/ethdev/rte_dev_info.h +8 -0
index cb2fe0ae97..67cf0ae526 100644
@@ -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_ */
Signature · 1 line
2.25.1
#17 lore raw

PATCH v2 4/11 metrics: fix missing C++ guards

In reply to Brian Dooley

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

Fixes c5b7197f662e ("telemetry: move some functions to metrics library")

---
v2: Added missing apostrophe to commit message.

---
 lib/metrics/rte_metrics_telemetry.h | 7 +++++++
 1 file changed, 7 insertions(+)
lib/metrics/rte_metrics_telemetry.h +7 -0
index 2b6eb1ccc8..09b14d9336 100644
@@ -13,6 +13,9 @@
 #ifndef _RTE_METRICS_TELEMETRY_H_
 #define _RTE_METRICS_TELEMETRY_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 enum rte_telemetry_stats_type {
 	PORT_STATS = 0,
@@ -60,4 +63,8 @@ __rte_experimental
 int32_t
 rte_metrics_tel_extract_data(struct telemetry_encode_param *ep, json_t *data);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
Signature · 1 line
2.25.1
#18 lore raw

PATCH v2 5/11 acl: fix missing C++ guards

In reply to Brian Dooley

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

Fixes dc276b5780c2 ("acl: new library")

---
v2: Added missing apostrophe to commit message.

---
 lib/acl/rte_acl_osdep.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/acl/rte_acl_osdep.h +8 -0
index b2c262dee7..3c1dc402ca 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_ACL_OSDEP_H_
 #define _RTE_ACL_OSDEP_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @file
  *
@@ -45,4 +49,8 @@
 #include <rte_cpuflags.h>
 #include <rte_debug.h>
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_ACL_OSDEP_H_ */
Signature · 1 line
2.25.1
#19 lore raw

PATCH v2 6/11 compressdev: fix missing C++ guards

In reply to Brian Dooley

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

Fixes ed7dd94f7f66 ("compressdev: add basic device management")

---
v2: Added missing apostrophe to commit message.

---
 lib/compressdev/rte_compressdev_internal.h | 9 +++++++++
 1 file changed, 9 insertions(+)
lib/compressdev/rte_compressdev_internal.h +9 -0
index 22ceac66e2..888c8f5c5c 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_COMPRESSDEV_INTERNAL_H_
 #define _RTE_COMPRESSDEV_INTERNAL_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* rte_compressdev_internal.h
  * This file holds Compressdev private data structures.
  */
@@ -111,4 +115,9 @@ struct rte_compressdev_data {
 	void *dev_private;
 	/**< PMD-specific private data */
 } __rte_cache_aligned;
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
Signature · 1 line
2.25.1
#20 lore raw

PATCH v2 7/11 eventdev: fix missing C++ guards

In reply to Brian Dooley

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

Fixes dc39e2f359b5 ("eventdev: add ring structure for events")
Fixes 7a3357205755 ("lib: remove C++ include guard from private headers")

---
v2: Added missing apostrophe to commit message.

---
 lib/eventdev/eventdev_pmd.h      | 8 ++++++++
 lib/eventdev/eventdev_pmd_pci.h  | 8 ++++++++
 lib/eventdev/eventdev_pmd_vdev.h | 8 ++++++++
 lib/eventdev/rte_event_ring.h    | 9 +++++++++
 4 files changed, 33 insertions(+)
lib/eventdev/eventdev_pmd.h +8 -0
index b05ffce549..ce469d47a6 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_EVENTDEV_PMD_H_
 #define _RTE_EVENTDEV_PMD_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** @file
  * RTE Event PMD APIs
  *
@@ -1366,4 +1370,8 @@ void
 event_dev_fp_ops_set(struct rte_event_fp_ops *fp_ops,
 		     const struct rte_eventdev *dev);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_EVENTDEV_PMD_H_ */
lib/eventdev/eventdev_pmd_pci.h +8 -0
index 499852db16..24b56faaa9 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_EVENTDEV_PMD_PCI_H_
 #define _RTE_EVENTDEV_PMD_PCI_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** @file
  * RTE Eventdev PCI PMD APIs
  *
@@ -150,4 +154,8 @@ rte_event_pmd_pci_remove(struct rte_pci_device *pci_dev,
 	return 0;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_EVENTDEV_PMD_PCI_H_ */
lib/eventdev/eventdev_pmd_vdev.h +8 -0
index d9ee7277dd..77904910a2 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_EVENTDEV_PMD_VDEV_H_
 #define _RTE_EVENTDEV_PMD_VDEV_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** @file
  * RTE Eventdev VDEV PMD APIs
  *
@@ -99,4 +103,8 @@ rte_event_pmd_vdev_uninit(const char *name)
 	return 0;
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_EVENTDEV_PMD_VDEV_H_ */
lib/eventdev/rte_event_ring.h +9 -0
index c0861b0ec2..0b9aefb000 100644
@@ -14,6 +14,10 @@
 #ifndef _RTE_EVENT_RING_
 #define _RTE_EVENT_RING_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdint.h>
 
 #include <rte_common.h>
@@ -266,4 +270,9 @@ rte_event_ring_get_capacity(const struct rte_event_ring *r)
 {
 	return rte_ring_get_capacity(&r->r);
 }
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif
Signature · 1 line
2.25.1
#21 lore raw

PATCH v2 8/11 kni: fix missing C++ guards

In reply to Brian Dooley

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

Fixes 3fc5ca2f6352 ("kni: initial import")

---
v2: Added missing apostrophe to commit message.

---
 lib/kni/rte_kni_common.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/kni/rte_kni_common.h +8 -0
index b547ea5501..8d3ee0fa4f 100644
@@ -6,6 +6,10 @@
 #ifndef _RTE_KNI_COMMON_H_
 #define _RTE_KNI_COMMON_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifdef __KERNEL__
 #include <linux/if.h>
 #include <asm/barrier.h>
@@ -136,4 +140,8 @@ struct rte_kni_device_info {
 #define RTE_KNI_IOCTL_CREATE  _IOWR(0, 2, struct rte_kni_device_info)
 #define RTE_KNI_IOCTL_RELEASE _IOWR(0, 3, struct rte_kni_device_info)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_KNI_COMMON_H_ */
Signature · 1 line
2.25.1
#22 lore raw

PATCH v2 9/11 vhost: fix missing C++ guards

In reply to Brian Dooley

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 78639d54563a ("vhost: introduce async enqueue registration API")
Fixes 3bb595ecd682 ("vhost/crypto: add request handler")
Fixes 94c16e89d779 ("vhost: mark vDPA driver API as internal")

---
v2: Added missing apostrophe to commit message.

---
 lib/vhost/rte_vdpa.h         | 9 +++++++++
 lib/vhost/rte_vhost_async.h  | 8 ++++++++
 lib/vhost/rte_vhost_crypto.h | 8 ++++++++
 lib/vhost/vdpa_driver.h      | 8 ++++++++
 4 files changed, 33 insertions(+)
lib/vhost/rte_vdpa.h +9 -0
index 1437f400bf..6ac85d1bbf 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_VDPA_H_
 #define _RTE_VDPA_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @file
  *
@@ -183,4 +187,9 @@ rte_vdpa_get_stats(struct rte_vdpa_device *dev, uint16_t qid,
  */
 int
 rte_vdpa_reset_stats(struct rte_vdpa_device *dev, uint16_t qid);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_VDPA_H_ */
lib/vhost/rte_vhost_async.h +8 -0
index 838c4778cc..f1293c6a9d 100644
@@ -5,6 +5,10 @@
 #ifndef _RTE_VHOST_ASYNC_H_
 #define _RTE_VHOST_ASYNC_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdint.h>
 
 #include <rte_compat.h>
@@ -183,4 +187,8 @@ uint16_t rte_vhost_clear_queue_thread_unsafe(int vid, uint16_t queue_id,
 __rte_experimental
 int rte_vhost_async_dma_configure(int16_t dma_id, uint16_t vchan_id);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _RTE_VHOST_ASYNC_H_ */
lib/vhost/rte_vhost_crypto.h +8 -0
index f54d731139..b49e389579 100644
@@ -5,6 +5,10 @@
 #ifndef _VHOST_CRYPTO_H_
 #define _VHOST_CRYPTO_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdint.h>
 
 #include <rte_compat.h>
@@ -132,4 +136,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_ */
lib/vhost/vdpa_driver.h +8 -0
index fddbd50652..88138be34a 100644
@@ -5,6 +5,10 @@
 #ifndef _VDPA_DRIVER_H_
 #define _VDPA_DRIVER_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdbool.h>
 
 #include <rte_compat.h>
@@ -144,4 +148,8 @@ __rte_internal
 int
 rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _VDPA_DRIVER_H_ */
Signature · 1 line
2.25.1
Reviewed-by on v2 9/11
#23 lore raw

RE: [PATCH v2 09/11] vhost: fix missing C++ guards

Quoted 14 lines

-----Original Message-----
From: Dooley, Brian <[email protected]>
Sent: Wednesday, February 16, 2022 11:15 PM
To: [email protected]
Cc: Dooley, Brian <[email protected]>; [email protected]; [email protected]; Zhang, Roy Fan <[email protected]>; [email protected]; [email protected]; Richardson, Bruce <[email protected]>; Xia, Chenbo <[email protected]>; Jay Zhou <[email protected]>; Thomas Monjalon <[email protected]>
Subject: [PATCH v2 09/11] vhost: fix missing C++ guards

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

Quoted 6 lines
Fixes d7280c9fffcb ("vhost: support selective datapath")
Fixes 78639d54563a ("vhost: introduce async enqueue registration API")
Fixes 3bb595ecd682 ("vhost/crypto: add request handler")
Fixes 94c16e89d779 ("vhost: mark vDPA driver API as internal")

Zhihong and Patrick is no longer in intel, can delete both if there's new version

For this patch:

Quoted 15 lines

---
v2: Added missing apostrophe to commit message.

---
 lib/vhost/rte_vdpa.h         | 9 +++++++++
 lib/vhost/rte_vhost_async.h  | 8 ++++++++
 lib/vhost/rte_vhost_crypto.h | 8 ++++++++
 lib/vhost/vdpa_driver.h      | 8 ++++++++
 4 files changed, 33 insertions(+)
#24 lore raw

PATCH v2 10/11 bpf: fix missing C++ guards

In reply to Brian Dooley

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

Fixes 7a3357205755 ("lib: remove C++ include guard from private headers")

---
v2: Added missing apostrophe to commit message.

---
 lib/bpf/bpf_def.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/bpf/bpf_def.h +8 -0
index fa9125307e..f08cd9106b 100644
@@ -7,6 +7,10 @@
 #ifndef _RTE_BPF_DEF_H_
 #define _RTE_BPF_DEF_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**
  * @file
  *
@@ -140,4 +144,8 @@ struct ebpf_insn {
  */
 #define	EBPF_FUNC_MAX_ARGS	(EBPF_REG_6 - EBPF_REG_1)
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* RTE_BPF_DEF_H_ */
Signature · 1 line
2.25.1
#25 lore raw

PATCH v2 11/11 cryptodev: fix missing C++ guards

In reply to Brian Dooley

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

Fixes 7a3357205755 ("lib: remove C++ include guard from private headers")

---
v2: Added missing apostrophe to commit message.

---
 lib/cryptodev/cryptodev_pmd.h | 8 ++++++++
 1 file changed, 8 insertions(+)
lib/cryptodev/cryptodev_pmd.h +8 -0
index d91902f6e0..24ff1a5480 100644
@@ -5,6 +5,10 @@
 #ifndef _CRYPTODEV_PMD_H_
 #define _CRYPTODEV_PMD_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /** @file
  * RTE Crypto PMD APIs
  *
@@ -640,4 +644,8 @@ RTE_STD_C11 struct rte_cryptodev_asym_session {
 	uint8_t sess_private_data[0];
 };
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _CRYPTODEV_PMD_H_ */
Signature · 1 line
2.25.1
#26 lore raw
In reply to Brian Dooley
Quoted 15 lines · Brian Dooley

Public header files were missing 'extern "C"' guards. This set adds them in.

Brian Dooley (11):
eal: fix missing C++ guards
telemetry: fix missing C++ guards
ethdev: fix missing C++ guards
metrics: fix missing C++ guards
acl: fix missing C++ guards
compressdev: fix missing C++ guards
eventdev: fix missing C++ guards
kni: fix missing C++ guards
vhost: fix missing C++ guards
bpf: fix missing C++ guards
cryptodev: fix missing C++ guards

#27 lore raw

17/02/2022 09:00, Tyler Retzlaff:

Quoted 17 lines · Brian Dooley
Quoted 15 lines

Public header files were missing 'extern "C"' guards. This set adds them in.

Brian Dooley (11):
eal: fix missing C++ guards
telemetry: fix missing C++ guards
ethdev: fix missing C++ guards
metrics: fix missing C++ guards
acl: fix missing C++ guards
compressdev: fix missing C++ guards
eventdev: fix missing C++ guards
kni: fix missing C++ guards
vhost: fix missing C++ guards
bpf: fix missing C++ guards
cryptodev: fix missing C++ guards

Quoted 1 line

Applied, thanks.