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

Anoob Joseph anoob.joseph at caviumnetworks.com
Thu Jun 14 13:48:54 CEST 2018


Signed-off-by: Anoob Joseph <anoob.joseph at caviumnetworks.com>
---
v1:
* Replaced 'unsigned' with 'unsigned int'

 examples/l2fwd/l2fwd_common.h | 12 ++++++++++++
 examples/l2fwd/main.c         | 10 ----------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/examples/l2fwd/l2fwd_common.h b/examples/l2fwd/l2fwd_common.h
index fceb0c3..ca82e29 100644
--- a/examples/l2fwd/l2fwd_common.h
+++ b/examples/l2fwd/l2fwd_common.h
@@ -22,4 +22,16 @@
 
 #define MAX_TIMER_PERIOD 86400 /* 1 day max */
 
+struct lcore_queue_conf {
+	unsigned int n_rx_port;
+	unsigned int 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 */
-- 
2.7.4



More information about the dev mailing list