replace unused attributes
[dpdk.git] / examples / l3fwd / l3fwd.h
index 1893f8c..6705543 100644 (file)
@@ -5,6 +5,7 @@
 #ifndef __L3_FWD_H__
 #define __L3_FWD_H__
 
+#include <rte_ethdev.h>
 #include <rte_vect.h>
 
 #define DO_RFC_1812_CHECKS
 #define NO_HASH_MULTI_LOOKUP 1
 #endif
 
+/*
+ * Configurable number of RX/TX ring descriptors
+ */
+#define RTE_TEST_RX_DESC_DEFAULT 1024
+#define RTE_TEST_TX_DESC_DEFAULT 1024
+
 #define MAX_PKT_BURST     32
 #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */
 
+#define MEMPOOL_CACHE_SIZE 256
 #define MAX_RX_QUEUE_PER_LCORE 16
 
 /*
@@ -130,14 +138,14 @@ send_single_packet(struct lcore_conf *qconf,
 
 #ifdef DO_RFC_1812_CHECKS
 static inline int
-is_valid_ipv4_pkt(struct ipv4_hdr *pkt, uint32_t link_len)
+is_valid_ipv4_pkt(struct rte_ipv4_hdr *pkt, uint32_t link_len)
 {
        /* From http://www.rfc-editor.org/rfc/rfc1812.txt section 5.2.2 */
        /*
         * 1. The packet length reported by the Link Layer must be large
         * enough to hold the minimum length legal IP datagram (20 bytes).
         */
-       if (link_len < sizeof(struct ipv4_hdr))
+       if (link_len < sizeof(struct rte_ipv4_hdr))
                return -1;
 
        /* 2. The IP checksum must be correct. */
@@ -162,13 +170,16 @@ is_valid_ipv4_pkt(struct ipv4_hdr *pkt, uint32_t link_len)
         * datagram header, whose length is specified in the IP header length
         * field.
         */
-       if (rte_cpu_to_be_16(pkt->total_length) < sizeof(struct ipv4_hdr))
+       if (rte_cpu_to_be_16(pkt->total_length) < sizeof(struct rte_ipv4_hdr))
                return -5;
 
        return 0;
 }
 #endif /* DO_RFC_1812_CHECKS */
 
+int
+init_mem(uint16_t portid, unsigned int nb_mbuf);
+
 /* Function pointers for LPM or EM functionality. */
 void
 setup_lpm(const int socketid);
@@ -191,10 +202,29 @@ lpm_cb_parse_ptype(uint16_t port, uint16_t queue, struct rte_mbuf *pkts[],
                   uint16_t nb_pkts, uint16_t max_pkts, void *user_param);
 
 int
-em_main_loop(__attribute__((unused)) void *dummy);
+em_main_loop(__rte_unused void *dummy);
+
+int
+lpm_main_loop(__rte_unused void *dummy);
+
+int
+lpm_event_main_loop_tx_d(__rte_unused void *dummy);
+int
+lpm_event_main_loop_tx_d_burst(__rte_unused void *dummy);
+int
+lpm_event_main_loop_tx_q(__rte_unused void *dummy);
+int
+lpm_event_main_loop_tx_q_burst(__rte_unused void *dummy);
 
 int
-lpm_main_loop(__attribute__((unused)) void *dummy);
+em_event_main_loop_tx_d(__rte_unused void *dummy);
+int
+em_event_main_loop_tx_d_burst(__rte_unused void *dummy);
+int
+em_event_main_loop_tx_q(__rte_unused void *dummy);
+int
+em_event_main_loop_tx_q_burst(__rte_unused void *dummy);
+
 
 /* Return ipv4/ipv6 fwd lookup struct for LPM or EM. */
 void *