[dpdk-dev] [PATCH 1/3] ethdev: Remove ethdev.h dependency on mbuf + mempool

Bruce Richardson bruce.richardson at intel.com
Fri May 16 20:15:12 CEST 2014


This allows us to get the ethdev structure definition without a full
set of additional headers from other libs being included.
To ensure compilation, add new includes to C files that needed mbuf
header without explicitly including it.

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
 app/test-pmd/cmdline.c                  | 1 +
 app/test/test_pmd_ring.c                | 1 +
 lib/librte_ether/rte_ethdev.h           | 4 +++-
 lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c | 1 +
 4 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index b3824f9..2b6ffe4 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -74,6 +74,7 @@
 #include <rte_ethdev.h>
 #include <rte_string_fns.h>
 #include <rte_devargs.h>
+#include <rte_mbuf.h>
 
 #include <cmdline_rdline.h>
 #include <cmdline_parse.h>
diff --git a/app/test/test_pmd_ring.c b/app/test/test_pmd_ring.c
index 4d9c2ba..3bb98ee 100644
--- a/app/test/test_pmd_ring.c
+++ b/app/test/test_pmd_ring.c
@@ -36,6 +36,7 @@
 
 #include <stdio.h>
 
+#include <rte_mbuf.h>
 #include <rte_eth_ring.h>
 #include <rte_ethdev.h>
 
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index dea7471..44f064e 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -175,9 +175,11 @@ extern "C" {
 #include <rte_log.h>
 #include <rte_interrupts.h>
 #include <rte_pci.h>
-#include <rte_mbuf.h>
 #include "rte_ether.h"
 
+struct rte_mbuf;
+struct rte_mempool;
+
 /**
  * A structure used to retrieve statistics for an Ethernet port.
  */
diff --git a/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c b/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c
index 8259cfe..6f244b6 100644
--- a/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c
+++ b/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c
@@ -55,6 +55,7 @@
 #include <rte_tailq.h>
 #include <rte_eal.h>
 #include <rte_alarm.h>
+#include <rte_mbuf.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
 #include <rte_atomic.h>
-- 
1.9.0



More information about the dev mailing list