[dpdk-dev,v3,20/22] vhost: workaround the build dependency on mbuf header

Message ID 1490705142-893-21-git-send-email-yuanhan.liu@linux.intel.com (mailing list archive)
State Superseded, archived
Delegated to: Yuanhan Liu
Headers

Checks

Context Check Description
ci/Intel-compilation fail apply patch file failure
ci/checkpatch success coding style OK

Commit Message

Yuanhan Liu March 28, 2017, 12:45 p.m. UTC
  rte_mbuf struct is something more likely will be used only in vhost-user
net driver, while we have made vhost-user generic enough that it can
be used for implementing other drivers (such as vhost-user SCSI), they
have also include <rte_mbuf.h>. Otherwise, the build will be broken.

We could workaround it by using forward declaration, so that other
non-net drivers won't need include <rte_mbuf.h>.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 lib/librte_vhost/rte_vhost.h | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Maxime Coquelin March 31, 2017, 9:13 a.m. UTC | #1
On 03/28/2017 02:45 PM, Yuanhan Liu wrote:
> rte_mbuf struct is something more likely will be used only in vhost-user
> net driver, while we have made vhost-user generic enough that it can
> be used for implementing other drivers (such as vhost-user SCSI), they
> have also include <rte_mbuf.h>. Otherwise, the build will be broken.
>
> We could workaround it by using forward declaration, so that other
> non-net drivers won't need include <rte_mbuf.h>.
>
> Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
> ---
>  lib/librte_vhost/rte_vhost.h | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  

Patch

diff --git a/lib/librte_vhost/rte_vhost.h b/lib/librte_vhost/rte_vhost.h
index d4ee210..bc1a958 100644
--- a/lib/librte_vhost/rte_vhost.h
+++ b/lib/librte_vhost/rte_vhost.h
@@ -348,6 +348,8 @@  int rte_vhost_driver_callback_register(const char *path,
  */
 uint16_t rte_vhost_avail_entries(int vid, uint16_t queue_id);
 
+struct rte_mbuf;
+struct rte_mempool;
 /**
  * This function adds buffers to the virtio devices RX virtqueue. Buffers can
  * be received from the physical port or from another virtual device. A packet