DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	Chenbo Xia <chenbo.xia@intel.com>,
	Xiao Wang <xiao.w.wang@intel.com>, Matan Azrad <matan@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Subject: [PATCH 6/7] vhost: remove non-C++ compatible includes
Date: Fri,  4 Feb 2022 17:42:08 +0000	[thread overview]
Message-ID: <20220204174209.440207-7-bruce.richardson@intel.com> (raw)
In-Reply-To: <20220204174209.440207-1-bruce.richardson@intel.com>

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.richardson@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


  parent reply	other threads:[~2022-02-04 17:42 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-04 17:42 [PATCH 0/7] Verify C++ compatibility of public headers Bruce Richardson
2022-02-04 17:42 ` [PATCH 1/7] eal: fix header build with C++ Bruce Richardson
2022-02-04 17:42 ` [PATCH 2/7] eventdev: " Bruce Richardson
2022-02-07  9:40   ` Jerin Jacob
2022-02-04 17:42 ` [PATCH 3/7] graph: add explicit cast to allow C++ build Bruce Richardson
2022-02-04 18:12   ` Stephen Hemminger
2022-02-07  9:41     ` Jerin Jacob
2022-02-04 17:42 ` [PATCH 4/7] ipsec: " Bruce Richardson
2022-02-04 17:42 ` [PATCH 5/7] table: add explicit casts for C++ compatibility Bruce Richardson
2022-02-04 17:42 ` Bruce Richardson [this message]
2022-02-04 18:18   ` [PATCH 6/7] vhost: remove non-C++ compatible includes Bruce Richardson
2022-02-09  9:10     ` Wang, Xiao W
2022-02-09  9:21       ` Bruce Richardson
2022-02-04 17:42 ` [PATCH 7/7] buildtools/chkincs: test headers for C++ compatibility Bruce Richardson
2022-02-10 12:02 ` [PATCH v2 0/7] Verify C++ compatibility of public headers Bruce Richardson
2022-02-10 12:02   ` [PATCH v2 1/7] eal: fix header build with C++ Bruce Richardson
2022-02-10 12:57     ` David Marchand
2022-02-10 14:07       ` Bruce Richardson
2022-02-10 12:02   ` [PATCH v2 2/7] eventdev: " Bruce Richardson
2022-02-10 12:02   ` [PATCH v2 3/7] graph: fix missing explicit cast for C++ build Bruce Richardson
2022-02-10 12:02   ` [PATCH v2 4/7] ipsec: " Bruce Richardson
2022-02-10 12:42     ` Ananyev, Konstantin
2022-02-10 12:02   ` [PATCH v2 5/7] table: fix missing explicit casts " Bruce Richardson
2022-02-10 12:02   ` [PATCH v2 6/7] vhost: fix incompatible header includes for C++ Bruce Richardson
2022-02-10 12:02   ` [PATCH v2 7/7] buildtools/chkincs: test headers for C++ compatibility Bruce Richardson
2022-02-10 14:03 ` [PATCH v3 0/7] Verify C++ compatibility of public headers Bruce Richardson
2022-02-10 14:03   ` [PATCH v3 1/7] eal: fix header build with C++ Bruce Richardson
2022-02-10 14:03   ` [PATCH v3 2/7] eventdev: " Bruce Richardson
2022-02-10 14:03   ` [PATCH v3 3/7] graph: fix missing explicit cast for C++ build Bruce Richardson
2022-02-10 14:03   ` [PATCH v3 4/7] ipsec: " Bruce Richardson
2022-02-10 14:03   ` [PATCH v3 5/7] table: fix missing explicit casts " Bruce Richardson
2022-02-10 14:03   ` [PATCH v3 6/7] vhost: fix incompatible header includes for C++ Bruce Richardson
2022-02-10 14:03   ` [PATCH v3 7/7] buildtools/chkincs: test headers for C++ compatibility Bruce Richardson
2022-02-10 14:37     ` David Marchand
2022-02-10 15:21       ` Bruce Richardson
2022-02-10 15:42 ` [PATCH v4 0/7] Verify C++ compatibility of public headers Bruce Richardson
2022-02-10 15:42   ` [PATCH v4 1/7] eal: fix header build with C++ Bruce Richardson
2022-02-14  9:30     ` Joyce Kong
2022-02-10 15:42   ` [PATCH v4 2/7] eventdev: " Bruce Richardson
2022-02-10 15:42   ` [PATCH v4 3/7] graph: fix missing explicit cast for C++ build Bruce Richardson
2022-02-10 15:42   ` [PATCH v4 4/7] ipsec: " Bruce Richardson
2022-02-10 15:42   ` [PATCH v4 5/7] table: fix missing explicit casts " Bruce Richardson
2022-02-10 15:42   ` [PATCH v4 6/7] vhost: fix incompatible header includes for C++ Bruce Richardson
2022-02-10 15:42   ` [PATCH v4 7/7] buildtools/chkincs: test headers for C++ compatibility Bruce Richardson
2022-02-10 21:58     ` Thomas Monjalon
2022-02-11 10:31       ` Bruce Richardson
2022-02-11 10:57         ` Bruce Richardson
2022-02-11 17:22           ` Thomas Monjalon
2022-02-10 22:07   ` [PATCH v4 0/7] Verify C++ compatibility of public headers Thomas Monjalon
2022-02-11 11:36 ` [PATCH v5 0/2] " Bruce Richardson
2022-02-11 11:36   ` [PATCH v5 1/2] buildtools/chkincs: remove unnecesary linkage Bruce Richardson
2022-02-11 11:36   ` [PATCH v5 2/2] buildtools/chkincs: test headers for C++ compatibility Bruce Richardson
2022-02-12 13:27   ` [PATCH v5 0/2] Verify C++ compatibility of public headers Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220204174209.440207-7-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=viacheslavo@nvidia.com \
    --cc=xiao.w.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).