git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net: add rte prefix to IP structure
[dpdk.git]
/
examples
/
ip_reassembly
/
main.c
diff --git
a/examples/ip_reassembly/main.c
b/examples/ip_reassembly/main.c
index
17b55d4
..
0d5bf0a
100644
(file)
--- a/
examples/ip_reassembly/main.c
+++ b/
examples/ip_reassembly/main.c
@@
-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 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
#ifndef IPv4_BYTES
#define IPv4_BYTES_FMT "%" PRIu8 ".%" PRIu8 ".%" PRIu8 ".%" PRIu8
@@
-308,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)
{
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;
struct rte_ip_frag_tbl *tbl;
struct rte_ip_frag_death_row *dr;
struct rx_queue *rxq;
@@
-318,16
+318,16
@@
reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
rxq = &qconf->rx_queue_list[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;
/* if packet is IPv4 */
if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
dst_port = portid;
/* if packet is IPv4 */
if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
- struct ipv4_hdr *ip_hdr;
+ struct
rte_
ipv4_hdr *ip_hdr;
uint32_t ip_dst;
uint32_t ip_dst;
- ip_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+ ip_hdr = (struct
rte_
ipv4_hdr *)(eth_hdr + 1);
/* if it is a fragmented packet, then try to reassemble. */
if (rte_ipv4_frag_pkt_is_fragmented(ip_hdr)) {
/* if it is a fragmented packet, then try to reassemble. */
if (rte_ipv4_frag_pkt_is_fragmented(ip_hdr)) {
@@
-350,8
+350,8
@@
reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
if (mo != m) {
m = mo;
eth_hdr = rte_pktmbuf_mtod(m,
if (mo != m) {
m = mo;
eth_hdr = rte_pktmbuf_mtod(m,
- struct ether_hdr *);
- ip_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+ struct
rte_
ether_hdr *);
+ ip_hdr = (struct
rte_
ipv4_hdr *)(eth_hdr + 1);
}
}
ip_dst = rte_be_to_cpu_32(ip_hdr->dst_addr);
}
}
ip_dst = rte_be_to_cpu_32(ip_hdr->dst_addr);
@@
-362,13
+362,13
@@
reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
dst_port = next_hop;
}
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;
} else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
/* if packet is IPv6 */
struct ipv6_extension_fragment *frag_hdr;
- struct ipv6_hdr *ip_hdr;
+ struct
rte_
ipv6_hdr *ip_hdr;
- ip_hdr = (struct ipv6_hdr *)(eth_hdr + 1);
+ ip_hdr = (struct
rte_
ipv6_hdr *)(eth_hdr + 1);
frag_hdr = rte_ipv6_frag_get_ipv6_fragment_header(ip_hdr);
frag_hdr = rte_ipv6_frag_get_ipv6_fragment_header(ip_hdr);
@@
-388,8
+388,9
@@
reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
if (mo != m) {
m = mo;
if (mo != m) {
m = mo;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
- ip_hdr = (struct ipv6_hdr *)(eth_hdr + 1);
+ eth_hdr = rte_pktmbuf_mtod(m,
+ struct rte_ether_hdr *);
+ ip_hdr = (struct rte_ipv6_hdr *)(eth_hdr + 1);
}
}
}
}
@@
-400,7
+401,7
@@
reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
dst_port = next_hop;
}
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 */
}
/* if packet wasn't IPv4 or IPv6, it's forwarded to the port it came from */
@@
-409,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 */
*((uint64_t *)d_addr_bytes) = 0x000000000002 + ((uint64_t)dst_port << 40);
/* src addr */
- ether_addr_copy(&ports_eth_addr[dst_port], ð_hdr->s_addr);
+
rte_
ether_addr_copy(&ports_eth_addr[dst_port], ð_hdr->s_addr);
send_single_packet(m, dst_port);
}
send_single_packet(m, dst_port);
}
@@
-691,10
+692,10
@@
parse_args(int argc, char **argv)
}
static void
}
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);
}
printf("%s%s", name, buf);
}