[dpdk-dev,03/15] examples/l2fwd: move structure definitions to common header

Message ID 1528477766-15788-4-git-send-email-anoob.joseph@caviumnetworks.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series preparing l2fwd for eventmode additions |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Anoob Joseph June 8, 2018, 5:09 p.m. UTC
  Signed-off-by: Anoob Joseph <anoob.joseph@caviumnetworks.com>
---
 examples/l2fwd/l2fwd_common.h | 12 ++++++++++++
 examples/l2fwd/main.c         | 10 ----------
 2 files changed, 12 insertions(+), 10 deletions(-)
  

Patch

diff --git a/examples/l2fwd/l2fwd_common.h b/examples/l2fwd/l2fwd_common.h
index fe354cf..40979fd 100644
--- a/examples/l2fwd/l2fwd_common.h
+++ b/examples/l2fwd/l2fwd_common.h
@@ -21,4 +21,16 @@ 
 
 #define MAX_TIMER_PERIOD 86400 /* 1 day max */
 
+struct lcore_queue_conf {
+	unsigned n_rx_port;
+	unsigned rx_port_list[MAX_RX_QUEUE_PER_LCORE];
+} __rte_cache_aligned;
+
+/* Per-port statistics struct */
+struct l2fwd_port_statistics {
+	uint64_t tx;
+	uint64_t rx;
+	uint64_t dropped;
+} __rte_cache_aligned;
+
 #endif /* _L2FWD_COMMON_H_ */
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 9f873c7..11ca170 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -60,10 +60,6 @@  static uint32_t l2fwd_dst_ports[RTE_MAX_ETHPORTS];
 
 static unsigned int l2fwd_rx_queue_per_lcore = 1;
 
-struct lcore_queue_conf {
-	unsigned n_rx_port;
-	unsigned rx_port_list[MAX_RX_QUEUE_PER_LCORE];
-} __rte_cache_aligned;
 struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
 
 static struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS];
@@ -81,12 +77,6 @@  static struct rte_eth_conf port_conf = {
 
 struct rte_mempool * l2fwd_pktmbuf_pool = NULL;
 
-/* Per-port statistics struct */
-struct l2fwd_port_statistics {
-	uint64_t tx;
-	uint64_t rx;
-	uint64_t dropped;
-} __rte_cache_aligned;
 struct l2fwd_port_statistics port_statistics[RTE_MAX_ETHPORTS];
 
 /* A tsc-based timer responsible for triggering statistics printout */