summaryrefslogtreecommitdiff
path: root/examples/l3fwd
diff options
context:
space:
mode:
authorOlivier Matz <olivier.matz@6wind.com>2019-05-21 18:13:03 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2019-05-24 13:34:45 +0200
commit6d13ea8e8e49ab957deae2bba5ecf4a4bfe747d1 (patch)
tree0108d8e1701d235beebca6d96c4af03426f594ff /examples/l3fwd
parente482e0fa6a106c548afe9c52e71abf3a70848d46 (diff)
downloaddpdk-6d13ea8e8e49ab957deae2bba5ecf4a4bfe747d1.zip
dpdk-6d13ea8e8e49ab957deae2bba5ecf4a4bfe747d1.tar.gz
dpdk-6d13ea8e8e49ab957deae2bba5ecf4a4bfe747d1.tar.xz
net: add rte prefix to ether structures
Add 'rte_' prefix to structures: - rename struct ether_addr as struct rte_ether_addr. - rename struct ether_hdr as struct rte_ether_hdr. - rename struct vlan_hdr as struct rte_vlan_hdr. - rename struct vxlan_hdr as struct rte_vxlan_hdr. - rename struct vxlan_gpe_hdr as struct rte_vxlan_gpe_hdr. Do not update the command line library to avoid adding a dependency to librte_net. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'examples/l3fwd')
-rw-r--r--examples/l3fwd/l3fwd.h2
-rw-r--r--examples/l3fwd/l3fwd_altivec.h12
-rw-r--r--examples/l3fwd/l3fwd_em.c6
-rw-r--r--examples/l3fwd/l3fwd_em.h8
-rw-r--r--examples/l3fwd/l3fwd_em_hlm.h11
-rw-r--r--examples/l3fwd/l3fwd_em_hlm_neon.h8
-rw-r--r--examples/l3fwd/l3fwd_em_hlm_sse.h8
-rw-r--r--examples/l3fwd/l3fwd_em_sequential.h11
-rw-r--r--examples/l3fwd/l3fwd_lpm.c14
-rw-r--r--examples/l3fwd/l3fwd_lpm.h8
-rw-r--r--examples/l3fwd/l3fwd_lpm_altivec.h10
-rw-r--r--examples/l3fwd/l3fwd_lpm_neon.h20
-rw-r--r--examples/l3fwd/l3fwd_lpm_sse.h10
-rw-r--r--examples/l3fwd/l3fwd_neon.h12
-rw-r--r--examples/l3fwd/l3fwd_sse.h12
-rw-r--r--examples/l3fwd/main.c8
16 files changed, 81 insertions, 79 deletions
diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h
index c962dea..1893f8c 100644
--- a/examples/l3fwd/l3fwd.h
+++ b/examples/l3fwd/l3fwd.h
@@ -73,7 +73,7 @@ extern volatile bool force_quit;
/* ethernet addresses of ports */
extern uint64_t dest_eth_addr[RTE_MAX_ETHPORTS];
-extern struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
+extern struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
/* mask of enabled ports */
extern uint32_t enabled_port_mask;
diff --git a/examples/l3fwd/l3fwd_altivec.h b/examples/l3fwd/l3fwd_altivec.h
index 5ec99f9..0c68aa0 100644
--- a/examples/l3fwd/l3fwd_altivec.h
+++ b/examples/l3fwd/l3fwd_altivec.h
@@ -68,13 +68,13 @@ processx4_step3(struct rte_mbuf *pkt[FWDSTEP], uint16_t dst_port[FWDSTEP])
*p[2] = te[2];
*p[3] = te[3];
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[0] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[0] + 1),
&dst_port[0], pkt[0]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[1] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[1] + 1),
&dst_port[1], pkt[1]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[2] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[2] + 1),
&dst_port[2], pkt[2]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[3] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1),
&dst_port[3], pkt[3]->packet_type);
}
@@ -121,10 +121,10 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, vector unsigned short dp1,
static inline void
process_packet(struct rte_mbuf *pkt, uint16_t *dst_port)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
vector unsigned int te, ve;
- eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
te = *(vector unsigned int *)eth_hdr;
ve = (vector unsigned int)val_eth[dst_port[0]];
diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c
index fa8f82b..64e79b9 100644
--- a/examples/l3fwd/l3fwd_em.c
+++ b/examples/l3fwd/l3fwd_em.c
@@ -561,7 +561,7 @@ em_check_ptype(int portid)
static inline void
em_parse_ptype(struct rte_mbuf *m)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
uint32_t packet_type = RTE_PTYPE_UNKNOWN;
uint16_t ether_type;
void *l3;
@@ -569,9 +569,9 @@ em_parse_ptype(struct rte_mbuf *m)
struct ipv4_hdr *ipv4_hdr;
struct ipv6_hdr *ipv6_hdr;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
ether_type = eth_hdr->ether_type;
- l3 = (uint8_t *)eth_hdr + sizeof(struct ether_hdr);
+ l3 = (uint8_t *)eth_hdr + sizeof(struct rte_ether_hdr);
if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) {
ipv4_hdr = (struct ipv4_hdr *)l3;
hdr_len = (ipv4_hdr->version_ihl & IPV4_HDR_IHL_MASK) *
diff --git a/examples/l3fwd/l3fwd_em.h b/examples/l3fwd/l3fwd_em.h
index 228164e..de1278b 100644
--- a/examples/l3fwd/l3fwd_em.h
+++ b/examples/l3fwd/l3fwd_em.h
@@ -9,20 +9,20 @@ static __rte_always_inline void
l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid,
struct lcore_conf *qconf)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
struct ipv4_hdr *ipv4_hdr;
uint16_t dst_port;
uint32_t tcp_or_udp;
uint32_t l3_ptypes;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
tcp_or_udp = m->packet_type & (RTE_PTYPE_L4_TCP | RTE_PTYPE_L4_UDP);
l3_ptypes = m->packet_type & RTE_PTYPE_L3_MASK;
if (tcp_or_udp && (l3_ptypes == RTE_PTYPE_L3_IPV4)) {
/* Handle IPv4 headers.*/
ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
#ifdef DO_RFC_1812_CHECKS
/* Check to make sure the packet is valid (RFC1812) */
@@ -55,7 +55,7 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid,
struct ipv6_hdr *ipv6_hdr;
ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
dst_port = em_get_ipv6_dst_port(ipv6_hdr, portid,
qconf->ipv6_lookup_struct);
diff --git a/examples/l3fwd/l3fwd_em_hlm.h b/examples/l3fwd/l3fwd_em_hlm.h
index 22c26dc..ec52a01 100644
--- a/examples/l3fwd/l3fwd_em_hlm.h
+++ b/examples/l3fwd/l3fwd_em_hlm.h
@@ -92,7 +92,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
/* Handle IPv4 headers.*/
ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
next_hop = em_get_ipv4_dst_port(ipv4_hdr, portid,
qconf->ipv4_lookup_struct);
@@ -107,7 +107,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
/* Handle IPv6 headers.*/
ipv6_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
next_hop = em_get_ipv6_dst_port(ipv6_hdr, portid,
qconf->ipv6_lookup_struct);
@@ -142,7 +142,7 @@ l3fwd_em_send_packets(int nb_rx, struct rte_mbuf **pkts_burst,
for (j = 0; j < EM_HASH_LOOKUP_COUNT && j < nb_rx; j++) {
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j],
- struct ether_hdr *) + 1);
+ struct rte_ether_hdr *) + 1);
}
for (j = 0; j < n; j += EM_HASH_LOOKUP_COUNT) {
@@ -159,8 +159,9 @@ l3fwd_em_send_packets(int nb_rx, struct rte_mbuf **pkts_burst,
for (i = 0, pos = j + EM_HASH_LOOKUP_COUNT;
i < EM_HASH_LOOKUP_COUNT && pos < nb_rx; i++, pos++) {
- rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[pos],
- struct ether_hdr *) + 1);
+ rte_prefetch0(rte_pktmbuf_mtod(
+ pkts_burst[pos],
+ struct rte_ether_hdr *) + 1);
}
if (tcp_or_udp && (l3_type == RTE_PTYPE_L3_IPV4)) {
diff --git a/examples/l3fwd/l3fwd_em_hlm_neon.h b/examples/l3fwd/l3fwd_em_hlm_neon.h
index 16c8b04..3ee2304 100644
--- a/examples/l3fwd/l3fwd_em_hlm_neon.h
+++ b/examples/l3fwd/l3fwd_em_hlm_neon.h
@@ -13,7 +13,7 @@ get_ipv4_5tuple(struct rte_mbuf *m0, int32x4_t mask0,
union ipv4_5tuple_host *key)
{
int32x4_t tmpdata0 = vld1q_s32(rte_pktmbuf_mtod_offset(m0, int32_t *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv4_hdr, time_to_live)));
key->xmm = vandq_s32(tmpdata0, mask0);
@@ -25,17 +25,17 @@ get_ipv6_5tuple(struct rte_mbuf *m0, int32x4_t mask0,
{
int32x4_t tmpdata0 = vld1q_s32(
rte_pktmbuf_mtod_offset(m0, int *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv6_hdr, payload_len)));
int32x4_t tmpdata1 = vld1q_s32(
rte_pktmbuf_mtod_offset(m0, int *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv6_hdr, payload_len) + 8));
int32x4_t tmpdata2 = vld1q_s32(
rte_pktmbuf_mtod_offset(m0, int *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv6_hdr, payload_len) + 16));
key->xmm[0] = vandq_s32(tmpdata0, mask0);
diff --git a/examples/l3fwd/l3fwd_em_hlm_sse.h b/examples/l3fwd/l3fwd_em_hlm_sse.h
index 41e2be9..8156bbb 100644
--- a/examples/l3fwd/l3fwd_em_hlm_sse.h
+++ b/examples/l3fwd/l3fwd_em_hlm_sse.h
@@ -13,7 +13,7 @@ get_ipv4_5tuple(struct rte_mbuf *m0, __m128i mask0,
{
__m128i tmpdata0 = _mm_loadu_si128(
rte_pktmbuf_mtod_offset(m0, __m128i *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv4_hdr, time_to_live)));
key->xmm = _mm_and_si128(tmpdata0, mask0);
@@ -25,18 +25,18 @@ get_ipv6_5tuple(struct rte_mbuf *m0, __m128i mask0,
{
__m128i tmpdata0 = _mm_loadu_si128(
rte_pktmbuf_mtod_offset(m0, __m128i *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv6_hdr, payload_len)));
__m128i tmpdata1 = _mm_loadu_si128(
rte_pktmbuf_mtod_offset(m0, __m128i *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv6_hdr, payload_len) +
sizeof(__m128i)));
__m128i tmpdata2 = _mm_loadu_si128(
rte_pktmbuf_mtod_offset(m0, __m128i *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv6_hdr, payload_len) +
sizeof(__m128i) + sizeof(__m128i)));
diff --git a/examples/l3fwd/l3fwd_em_sequential.h b/examples/l3fwd/l3fwd_em_sequential.h
index 35cf5ea..770660e 100644
--- a/examples/l3fwd/l3fwd_em_sequential.h
+++ b/examples/l3fwd/l3fwd_em_sequential.h
@@ -37,7 +37,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
/* Handle IPv4 headers.*/
ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
next_hop = em_get_ipv4_dst_port(ipv4_hdr, portid,
qconf->ipv4_lookup_struct);
@@ -52,7 +52,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
/* Handle IPv6 headers.*/
ipv6_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
next_hop = em_get_ipv6_dst_port(ipv6_hdr, portid,
qconf->ipv6_lookup_struct);
@@ -81,13 +81,14 @@ l3fwd_em_send_packets(int nb_rx, struct rte_mbuf **pkts_burst,
if (nb_rx > 0) {
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[0],
- struct ether_hdr *) + 1);
+ struct rte_ether_hdr *) + 1);
}
for (i = 1, j = 0; j < nb_rx; i++, j++) {
if (i < nb_rx) {
- rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i],
- struct ether_hdr *) + 1);
+ rte_prefetch0(rte_pktmbuf_mtod(
+ pkts_burst[i],
+ struct rte_ether_hdr *) + 1);
}
dst_port[j] = em_get_dst_port(qconf, pkts_burst[j], portid);
}
diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c
index 60a0063..b373047 100644
--- a/examples/l3fwd/l3fwd_lpm.c
+++ b/examples/l3fwd/l3fwd_lpm.c
@@ -108,18 +108,18 @@ lpm_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
{
struct ipv6_hdr *ipv6_hdr;
struct ipv4_hdr *ipv4_hdr;
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type)) {
- eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
return lpm_get_ipv4_dst_port(ipv4_hdr, portid,
qconf->ipv4_lookup_struct);
} else if (RTE_ETH_IS_IPV6_HDR(pkt->packet_type)) {
- eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
ipv6_hdr = (struct ipv6_hdr *)(eth_hdr + 1);
return lpm_get_ipv6_dst_port(ipv6_hdr, portid,
@@ -140,7 +140,7 @@ lpm_get_dst_port_with_ipv4(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
{
uint32_t next_hop;
struct ipv6_hdr *ipv6_hdr;
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type)) {
return (uint16_t) ((rte_lpm_lookup(qconf->ipv4_lookup_struct,
@@ -149,7 +149,7 @@ lpm_get_dst_port_with_ipv4(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
} else if (RTE_ETH_IS_IPV6_HDR(pkt->packet_type)) {
- eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
ipv6_hdr = (struct ipv6_hdr *)(eth_hdr + 1);
return (uint16_t) ((rte_lpm6_lookup(qconf->ipv6_lookup_struct,
@@ -380,11 +380,11 @@ lpm_check_ptype(int portid)
static inline void
lpm_parse_ptype(struct rte_mbuf *m)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
uint32_t packet_type = RTE_PTYPE_UNKNOWN;
uint16_t ether_type;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
ether_type = eth_hdr->ether_type;
if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4))
packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
diff --git a/examples/l3fwd/l3fwd_lpm.h b/examples/l3fwd/l3fwd_lpm.h
index b68868f..0c98d3f 100644
--- a/examples/l3fwd/l3fwd_lpm.h
+++ b/examples/l3fwd/l3fwd_lpm.h
@@ -9,16 +9,16 @@ static __rte_always_inline void
l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid,
struct lcore_conf *qconf)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
struct ipv4_hdr *ipv4_hdr;
uint16_t dst_port;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
/* Handle IPv4 headers.*/
ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
#ifdef DO_RFC_1812_CHECKS
/* Check to make sure the packet is valid (RFC1812) */
@@ -51,7 +51,7 @@ l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid,
struct ipv6_hdr *ipv6_hdr;
ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
dst_port = lpm_get_ipv6_dst_port(ipv6_hdr, portid,
qconf->ipv6_lookup_struct);
diff --git a/examples/l3fwd/l3fwd_lpm_altivec.h b/examples/l3fwd/l3fwd_lpm_altivec.h
index 4c9e243..b36e991 100644
--- a/examples/l3fwd/l3fwd_lpm_altivec.h
+++ b/examples/l3fwd/l3fwd_lpm_altivec.h
@@ -18,28 +18,28 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP],
uint32_t *ipv4_flag)
{
struct ipv4_hdr *ipv4_hdr;
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
uint32_t x0, x1, x2, x3;
- eth_hdr = rte_pktmbuf_mtod(pkt[0], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x0 = ipv4_hdr->dst_addr;
ipv4_flag[0] = pkt[0]->packet_type & RTE_PTYPE_L3_IPV4;
rte_compiler_barrier();
- eth_hdr = rte_pktmbuf_mtod(pkt[1], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[1], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x1 = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[1]->packet_type;
rte_compiler_barrier();
- eth_hdr = rte_pktmbuf_mtod(pkt[2], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[2], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x2 = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[2]->packet_type;
rte_compiler_barrier();
- eth_hdr = rte_pktmbuf_mtod(pkt[3], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[3], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x3 = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[3]->packet_type;
diff --git a/examples/l3fwd/l3fwd_lpm_neon.h b/examples/l3fwd/l3fwd_lpm_neon.h
index 02ec0d8..a3e42cf 100644
--- a/examples/l3fwd/l3fwd_lpm_neon.h
+++ b/examples/l3fwd/l3fwd_lpm_neon.h
@@ -19,25 +19,25 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP],
uint32_t *ipv4_flag)
{
struct ipv4_hdr *ipv4_hdr;
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
int32_t dst[FWDSTEP];
- eth_hdr = rte_pktmbuf_mtod(pkt[0], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
dst[0] = ipv4_hdr->dst_addr;
ipv4_flag[0] = pkt[0]->packet_type & RTE_PTYPE_L3_IPV4;
- eth_hdr = rte_pktmbuf_mtod(pkt[1], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[1], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
dst[1] = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[1]->packet_type;
- eth_hdr = rte_pktmbuf_mtod(pkt[2], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[2], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
dst[2] = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[2]->packet_type;
- eth_hdr = rte_pktmbuf_mtod(pkt[3], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[3], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
dst[3] = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[3]->packet_type;
@@ -98,14 +98,14 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst,
if (k) {
for (i = 0; i < FWDSTEP; i++) {
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i],
- struct ether_hdr *) + 1);
+ struct rte_ether_hdr *) + 1);
}
for (j = 0; j != k - FWDSTEP; j += FWDSTEP) {
for (i = 0; i < FWDSTEP; i++) {
rte_prefetch0(rte_pktmbuf_mtod(
pkts_burst[j + i + FWDSTEP],
- struct ether_hdr *) + 1);
+ struct rte_ether_hdr *) + 1);
}
processx4_step1(&pkts_burst[j], &dip, &ipv4_flag);
@@ -125,17 +125,17 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst,
switch (m) {
case 3:
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j],
- struct ether_hdr *) + 1);
+ struct rte_ether_hdr *) + 1);
j++;
/* fallthrough */
case 2:
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j],
- struct ether_hdr *) + 1);
+ struct rte_ether_hdr *) + 1);
j++;
/* fallthrough */
case 1:
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j],
- struct ether_hdr *) + 1);
+ struct rte_ether_hdr *) + 1);
j++;
}
diff --git a/examples/l3fwd/l3fwd_lpm_sse.h b/examples/l3fwd/l3fwd_lpm_sse.h
index 1d16159..4603e07 100644
--- a/examples/l3fwd/l3fwd_lpm_sse.h
+++ b/examples/l3fwd/l3fwd_lpm_sse.h
@@ -16,25 +16,25 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP],
uint32_t *ipv4_flag)
{
struct ipv4_hdr *ipv4_hdr;
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
uint32_t x0, x1, x2, x3;
- eth_hdr = rte_pktmbuf_mtod(pkt[0], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x0 = ipv4_hdr->dst_addr;
ipv4_flag[0] = pkt[0]->packet_type & RTE_PTYPE_L3_IPV4;
- eth_hdr = rte_pktmbuf_mtod(pkt[1], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[1], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x1 = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[1]->packet_type;
- eth_hdr = rte_pktmbuf_mtod(pkt[2], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[2], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x2 = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[2]->packet_type;
- eth_hdr = rte_pktmbuf_mtod(pkt[3], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[3], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x3 = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[3]->packet_type;
diff --git a/examples/l3fwd/l3fwd_neon.h b/examples/l3fwd/l3fwd_neon.h
index 76ccdfa..af2dc47 100644
--- a/examples/l3fwd/l3fwd_neon.h
+++ b/examples/l3fwd/l3fwd_neon.h
@@ -48,13 +48,13 @@ processx4_step3(struct rte_mbuf *pkt[FWDSTEP], uint16_t dst_port[FWDSTEP])
vst1q_u32(p[2], ve[2]);
vst1q_u32(p[3], ve[3]);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[0] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[0] + 1),
&dst_port[0], pkt[0]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[1] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[1] + 1),
&dst_port[1], pkt[1]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[2] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[2] + 1),
&dst_port[2], pkt[2]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[3] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1),
&dst_port[3], pkt[3]->packet_type);
}
@@ -104,10 +104,10 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, uint16x8_t dp1,
static inline void
process_packet(struct rte_mbuf *pkt, uint16_t *dst_port)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
uint32x4_t te, ve;
- eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
te = vld1q_u32((uint32_t *)eth_hdr);
ve = vreinterpretq_u32_s32(val_eth[dst_port[0]]);
diff --git a/examples/l3fwd/l3fwd_sse.h b/examples/l3fwd/l3fwd_sse.h
index ed5267c..3349f27 100644
--- a/examples/l3fwd/l3fwd_sse.h
+++ b/examples/l3fwd/l3fwd_sse.h
@@ -48,13 +48,13 @@ processx4_step3(struct rte_mbuf *pkt[FWDSTEP], uint16_t dst_port[FWDSTEP])
_mm_storeu_si128(p[2], te[2]);
_mm_storeu_si128(p[3], te[3]);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[0] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[0] + 1),
&dst_port[0], pkt[0]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[1] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[1] + 1),
&dst_port[1], pkt[1]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[2] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[2] + 1),
&dst_port[2], pkt[2]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[3] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1),
&dst_port[3], pkt[3]->packet_type);
}
@@ -101,10 +101,10 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, __m128i dp1, __m128i dp2)
static inline void
process_packet(struct rte_mbuf *pkt, uint16_t *dst_port)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
__m128i te, ve;
- eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
te = _mm_loadu_si128((__m128i *)eth_hdr);
ve = val_eth[dst_port[0]];
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 7b96831..b0a700a 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -81,7 +81,7 @@ volatile bool force_quit;
/* ethernet addresses of ports */
uint64_t dest_eth_addr[RTE_MAX_ETHPORTS];
-struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
+struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
xmm_t val_eth[RTE_MAX_ETHPORTS];
@@ -647,7 +647,7 @@ 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);
@@ -908,14 +908,14 @@ main(int argc, char **argv)
print_ethaddr(" Address:", &ports_eth_addr[portid]);
printf(", ");
print_ethaddr("Destination:",
- (const struct ether_addr *)&dest_eth_addr[portid]);
+ (const struct rte_ether_addr *)&dest_eth_addr[portid]);
printf(", ");
/*
* prepare src MACs for each port.
*/
ether_addr_copy(&ports_eth_addr[portid],
- (struct ether_addr *)(val_eth + portid) + 1);
+ (struct rte_ether_addr *)(val_eth + portid) + 1);
/* init memory */
if (!per_port_pool) {