net: add rte prefix to ether defines
[dpdk.git] / examples / ip_reassembly / main.c
index b830f67..7ce5215 100644 (file)
@@ -95,7 +95,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
 static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
 
 /* ethernet addresses of ports */
-static struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
+static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
 
 #ifndef IPv4_BYTES
 #define IPv4_BYTES_FMT "%" PRIu8 ".%" PRIu8 ".%" PRIu8 ".%" PRIu8
@@ -165,8 +165,7 @@ static struct rte_eth_conf port_conf = {
                .max_rx_pkt_len = JUMBO_FRAME_MAX_SIZE,
                .split_hdr_size = 0,
                .offloads = (DEV_RX_OFFLOAD_CHECKSUM |
-                            DEV_RX_OFFLOAD_JUMBO_FRAME |
-                            DEV_RX_OFFLOAD_CRC_STRIP),
+                            DEV_RX_OFFLOAD_JUMBO_FRAME),
        },
        .rx_adv_conf = {
                        .rss_conf = {
@@ -309,7 +308,7 @@ static inline void
 reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
        struct lcore_queue_conf *qconf, uint64_t tms)
 {
-       struct ether_hdr *eth_hdr;
+       struct rte_ether_hdr *eth_hdr;
        struct rte_ip_frag_tbl *tbl;
        struct rte_ip_frag_death_row *dr;
        struct rx_queue *rxq;
@@ -319,7 +318,7 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
 
        rxq = &qconf->rx_queue_list[queue];
 
-       eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+       eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
        dst_port = portid;
 
@@ -351,7 +350,7 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
                        if (mo != m) {
                                m = mo;
                                eth_hdr = rte_pktmbuf_mtod(m,
-                                       struct ether_hdr *);
+                                       struct rte_ether_hdr *);
                                ip_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
                        }
                }
@@ -363,7 +362,7 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
                        dst_port = next_hop;
                }
 
-               eth_hdr->ether_type = rte_be_to_cpu_16(ETHER_TYPE_IPv4);
+               eth_hdr->ether_type = rte_be_to_cpu_16(RTE_ETHER_TYPE_IPv4);
        } else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
                /* if packet is IPv6 */
                struct ipv6_extension_fragment *frag_hdr;
@@ -389,7 +388,8 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
 
                        if (mo != m) {
                                m = mo;
-                               eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+                               eth_hdr = rte_pktmbuf_mtod(m,
+                                                       struct rte_ether_hdr *);
                                ip_hdr = (struct ipv6_hdr *)(eth_hdr + 1);
                        }
                }
@@ -401,7 +401,7 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
                        dst_port = next_hop;
                }
 
-               eth_hdr->ether_type = rte_be_to_cpu_16(ETHER_TYPE_IPv6);
+               eth_hdr->ether_type = rte_be_to_cpu_16(RTE_ETHER_TYPE_IPv6);
        }
        /* if packet wasn't IPv4 or IPv6, it's forwarded to the port it came from */
 
@@ -410,7 +410,7 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
        *((uint64_t *)d_addr_bytes) = 0x000000000002 + ((uint64_t)dst_port << 40);
 
        /* src addr */
-       ether_addr_copy(&ports_eth_addr[dst_port], &eth_hdr->s_addr);
+       rte_ether_addr_copy(&ports_eth_addr[dst_port], &eth_hdr->s_addr);
 
        send_single_packet(m, dst_port);
 }
@@ -692,10 +692,10 @@ parse_args(int argc, char **argv)
 }
 
 static void
-print_ethaddr(const char *name, const struct ether_addr *eth_addr)
+print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr)
 {
-       char buf[ETHER_ADDR_FMT_SIZE];
-       ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);
+       char buf[RTE_ETHER_ADDR_FMT_SIZE];
+       rte_ether_format_addr(buf, RTE_ETHER_ADDR_FMT_SIZE, eth_addr);
        printf("%s%s", name, buf);
 }