summaryrefslogtreecommitdiff
path: root/examples/l3fwd
diff options
context:
space:
mode:
authorOlivier Matz <olivier.matz@6wind.com>2019-05-21 18:13:11 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2019-05-24 13:34:46 +0200
commit24ac604ef7469eb5773c2504b313dd00257f8df3 (patch)
treea2ee7f8600ab23cd59e47006ca2177f7d0ea6d52 /examples/l3fwd
parenta7c528e5d71ff3f569898d268f9de129fdfc152b (diff)
downloaddpdk-24ac604ef7469eb5773c2504b313dd00257f8df3.zip
dpdk-24ac604ef7469eb5773c2504b313dd00257f8df3.tar.gz
dpdk-24ac604ef7469eb5773c2504b313dd00257f8df3.tar.xz
net: add rte prefix to IP defines
Add 'RTE_' prefix to defines: - rename IPv4( as RTE_IPv4(. - rename IPV4_MAX_PKT_LEN as RTE_IPV4_MAX_PKT_LEN. - rename IPV4_HDR_IHL_MASK as RTE_IPV4_HDR_IHL_MASK. - rename IPV4_IHL_MULTIPLIER as RTE_IPV4_IHL_MULTIPLIER. - rename IPV4_HDR_DF_SHIFT as RTE_IPV4_HDR_DF_SHIFT. - rename IPV4_HDR_MF_SHIFT as RTE_IPV4_HDR_MF_SHIFT. - rename IPV4_HDR_FO_SHIFT as RTE_IPV4_HDR_FO_SHIFT. - rename IPV4_HDR_DF_FLAG as RTE_IPV4_HDR_DF_FLAG. - rename IPV4_HDR_MF_FLAG as RTE_IPV4_HDR_MF_FLAG. - rename IPV4_HDR_OFFSET_MASK as RTE_IPV4_HDR_OFFSET_MASK. - rename IPV4_HDR_OFFSET_UNITS as RTE_IPV4_HDR_OFFSET_UNITS. - rename IPV4_ANY as RTE_IPV4_ANY. - rename IPV4_LOOPBACK as RTE_IPV4_LOOPBACK. - rename IPV4_BROADCAST as RTE_IPV4_BROADCAST. - rename IPV4_ALLHOSTS_GROUP as RTE_IPV4_ALLHOSTS_GROUP. - rename IPV4_ALLRTRS_GROUP as RTE_IPV4_ALLRTRS_GROUP. - rename IPV4_MAX_LOCAL_GROUP as RTE_IPV4_MAX_LOCAL_GROUP. - rename IPV4_MIN_MCAST as RTE_IPV4_MIN_MCAST. - rename IPV4_MAX_MCAST as RTE_IPV4_MAX_MCAST. - rename IS_IPV4_MCAST as RTE_IS_IPV4_MCAST. - rename IPV6_HDR_FL_SHIFT as RTE_IPV6_HDR_FL_SHIFT. - rename IPV6_HDR_TC_SHIFT as RTE_IPV6_HDR_TC_SHIFT. - rename IPV6_HDR_FL_MASK as RTE_IPV6_HDR_FL_MASK. - rename IPV6_HDR_TC_MASK as RTE_IPV6_HDR_TC_MASK. 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_em.c20
-rw-r--r--examples/l3fwd/l3fwd_lpm.c16
2 files changed, 18 insertions, 18 deletions
diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c
index 5cf5f67..2911bbe 100644
--- a/examples/l3fwd/l3fwd_em.c
+++ b/examples/l3fwd/l3fwd_em.c
@@ -99,10 +99,10 @@ struct ipv6_l3fwd_em_route {
};
static struct ipv4_l3fwd_em_route ipv4_l3fwd_em_route_array[] = {
- {{IPv4(101, 0, 0, 0), IPv4(100, 10, 0, 1), 101, 11, IPPROTO_TCP}, 0},
- {{IPv4(201, 0, 0, 0), IPv4(200, 20, 0, 1), 102, 12, IPPROTO_TCP}, 1},
- {{IPv4(111, 0, 0, 0), IPv4(100, 30, 0, 1), 101, 11, IPPROTO_TCP}, 2},
- {{IPv4(211, 0, 0, 0), IPv4(200, 40, 0, 1), 102, 12, IPPROTO_TCP}, 3},
+ {{RTE_IPv4(101, 0, 0, 0), RTE_IPv4(100, 10, 0, 1), 101, 11, IPPROTO_TCP}, 0},
+ {{RTE_IPv4(201, 0, 0, 0), RTE_IPv4(200, 20, 0, 1), 102, 12, IPPROTO_TCP}, 1},
+ {{RTE_IPv4(111, 0, 0, 0), RTE_IPv4(100, 30, 0, 1), 101, 11, IPPROTO_TCP}, 2},
+ {{RTE_IPv4(211, 0, 0, 0), RTE_IPv4(200, 40, 0, 1), 102, 12, IPPROTO_TCP}, 3},
};
static struct ipv6_l3fwd_em_route ipv6_l3fwd_em_route_array[] = {
@@ -426,19 +426,19 @@ populate_ipv4_many_flow_into_table(const struct rte_hash *h,
switch (i & (NUMBER_PORT_USED - 1)) {
case 0:
entry = ipv4_l3fwd_em_route_array[0];
- entry.key.ip_dst = IPv4(101, c, b, a);
+ entry.key.ip_dst = RTE_IPv4(101, c, b, a);
break;
case 1:
entry = ipv4_l3fwd_em_route_array[1];
- entry.key.ip_dst = IPv4(201, c, b, a);
+ entry.key.ip_dst = RTE_IPv4(201, c, b, a);
break;
case 2:
entry = ipv4_l3fwd_em_route_array[2];
- entry.key.ip_dst = IPv4(111, c, b, a);
+ entry.key.ip_dst = RTE_IPv4(111, c, b, a);
break;
case 3:
entry = ipv4_l3fwd_em_route_array[3];
- entry.key.ip_dst = IPv4(211, c, b, a);
+ entry.key.ip_dst = RTE_IPv4(211, c, b, a);
break;
};
convert_ipv4_5tuple(&entry.key, &newkey);
@@ -576,8 +576,8 @@ em_parse_ptype(struct rte_mbuf *m)
l3 = (uint8_t *)eth_hdr + sizeof(struct rte_ether_hdr);
if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4)) {
ipv4_hdr = (struct rte_ipv4_hdr *)l3;
- hdr_len = (ipv4_hdr->version_ihl & IPV4_HDR_IHL_MASK) *
- IPV4_IHL_MULTIPLIER;
+ hdr_len = (ipv4_hdr->version_ihl & RTE_IPV4_HDR_IHL_MASK) *
+ RTE_IPV4_IHL_MULTIPLIER;
if (hdr_len == sizeof(struct rte_ipv4_hdr)) {
packet_type |= RTE_PTYPE_L3_IPV4;
if (ipv4_hdr->next_proto_id == IPPROTO_TCP)
diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c
index 5fa8c53..6bfc3be 100644
--- a/examples/l3fwd/l3fwd_lpm.c
+++ b/examples/l3fwd/l3fwd_lpm.c
@@ -43,14 +43,14 @@ struct ipv6_l3fwd_lpm_route {
/* 192.18.0.0/16 are set aside for RFC2544 benchmarking. */
static struct ipv4_l3fwd_lpm_route ipv4_l3fwd_lpm_route_array[] = {
- {IPv4(192, 18, 0, 0), 24, 0},
- {IPv4(192, 18, 1, 0), 24, 1},
- {IPv4(192, 18, 2, 0), 24, 2},
- {IPv4(192, 18, 3, 0), 24, 3},
- {IPv4(192, 18, 4, 0), 24, 4},
- {IPv4(192, 18, 5, 0), 24, 5},
- {IPv4(192, 18, 6, 0), 24, 6},
- {IPv4(192, 18, 7, 0), 24, 7},
+ {RTE_IPv4(192, 18, 0, 0), 24, 0},
+ {RTE_IPv4(192, 18, 1, 0), 24, 1},
+ {RTE_IPv4(192, 18, 2, 0), 24, 2},
+ {RTE_IPv4(192, 18, 3, 0), 24, 3},
+ {RTE_IPv4(192, 18, 4, 0), 24, 4},
+ {RTE_IPv4(192, 18, 5, 0), 24, 5},
+ {RTE_IPv4(192, 18, 6, 0), 24, 6},
+ {RTE_IPv4(192, 18, 7, 0), 24, 7},
};
/* 2001:0200::/48 is IANA reserved range for IPv6 benchmarking (RFC5180) */