Some of the linux header includes are explicitly noted as being incompatible with C++. However, these headers can included by C files directly, or by internal headers, to avoid polluting the public DPDK headers with non-C++ safe includes.
Signed-off-by: Bruce Richardson <bruce.richard...@intel.com> --- drivers/net/vhost/rte_eth_vhost.c | 2 ++ drivers/vdpa/ifc/ifcvf_vdpa.c | 2 ++ drivers/vdpa/mlx5/mlx5_vdpa.h | 1 + lib/vhost/rte_vhost.h | 4 ---- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index 070f0e6dfd..cd2afe3100 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -16,6 +16,8 @@ #include <rte_kvargs.h> #include <rte_vhost.h> #include <rte_spinlock.h> +#include <linux/vhost.h> +#include <linux/virtio_net.h> #include "rte_eth_vhost.h" diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index 3853c4cf7e..cbd190ea8d 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -24,6 +24,8 @@ #include <rte_kvargs.h> #include <rte_devargs.h> +#include <linux/vhost_types.h> + #include "base/ifcvf.h" RTE_LOG_REGISTER(ifcvf_vdpa_logtype, pmd.vdpa.ifcvf, NOTICE); diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.h b/drivers/vdpa/mlx5/mlx5_vdpa.h index 22617924ea..a7fa4356dd 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa.h +++ b/drivers/vdpa/mlx5/mlx5_vdpa.h @@ -6,6 +6,7 @@ #define RTE_PMD_MLX5_VDPA_H_ #include <linux/virtio_net.h> +#include <linux/vhost_types.h> #include <sys/queue.h> #ifdef PEDANTIC diff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h index b454c05868..0a21177199 100644 --- a/lib/vhost/rte_vhost.h +++ b/lib/vhost/rte_vhost.h @@ -21,10 +21,6 @@ extern "C" { #endif -/* These are not C++-aware. */ -#include <linux/vhost.h> -#include <linux/virtio_ring.h> -#include <linux/virtio_net.h> #define RTE_VHOST_USER_CLIENT (1ULL << 0) #define RTE_VHOST_USER_NO_RECONNECT (1ULL << 1) -- 2.32.0