summaryrefslogtreecommitdiff
path: root/examples/l3fwd
diff options
context:
space:
mode:
authorDavid Marchand <david.marchand@redhat.com>2019-05-29 13:29:16 +0200
committerThomas Monjalon <thomas@monjalon.net>2019-06-03 16:54:54 +0200
commit0c9da7555da8c8373dfd69f798f832723ae6de71 (patch)
tree8f3265d9a34b302e2a69af1ec256f382fce26614 /examples/l3fwd
parentaa5d6a72de4a7454a6142e5f5b032c35dbd165ff (diff)
downloaddpdk-0c9da7555da8c8373dfd69f798f832723ae6de71.zip
dpdk-0c9da7555da8c8373dfd69f798f832723ae6de71.tar.gz
dpdk-0c9da7555da8c8373dfd69f798f832723ae6de71.tar.xz
net: replace IPv4/v6 constants with uppercase name
Since we change these macros, we might as well avoid triggering complaints from checkpatch because of mixed case. old=RTE_IPv4 new=RTE_IPV4 git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g" old=RTE_ETHER_TYPE_IPv4 new=RTE_ETHER_TYPE_IPV4 git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g" old=RTE_ETHER_TYPE_IPv6 new=RTE_ETHER_TYPE_IPV6 git grep -lw $old | xargs sed -i -e "s/\<$old\>/$new/g" Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Diffstat (limited to 'examples/l3fwd')
-rw-r--r--examples/l3fwd/l3fwd_em.c20
-rw-r--r--examples/l3fwd/l3fwd_lpm.c20
2 files changed, 20 insertions, 20 deletions
diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c
index 2911bbe..5f499e0 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[] = {
- {{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},
+ {{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 = RTE_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 = RTE_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 = RTE_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 = RTE_IPv4(211, c, b, a);
+ entry.key.ip_dst = RTE_IPV4(211, c, b, a);
break;
};
convert_ipv4_5tuple(&entry.key, &newkey);
@@ -574,7 +574,7 @@ em_parse_ptype(struct rte_mbuf *m)
eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
ether_type = eth_hdr->ether_type;
l3 = (uint8_t *)eth_hdr + sizeof(struct rte_ether_hdr);
- if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4)) {
+ 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 & RTE_IPV4_HDR_IHL_MASK) *
RTE_IPV4_IHL_MULTIPLIER;
@@ -586,7 +586,7 @@ em_parse_ptype(struct rte_mbuf *m)
packet_type |= RTE_PTYPE_L4_UDP;
} else
packet_type |= RTE_PTYPE_L3_IPV4_EXT;
- } else if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6)) {
+ } else if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6)) {
ipv6_hdr = (struct rte_ipv6_hdr *)l3;
if (ipv6_hdr->proto == IPPROTO_TCP)
packet_type |= RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_TCP;
diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c
index 6bfc3be..4143683 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[] = {
- {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},
+ {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) */
@@ -386,9 +386,9 @@ lpm_parse_ptype(struct rte_mbuf *m)
eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
ether_type = eth_hdr->ether_type;
- if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4))
+ if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV4))
packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
- else if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6))
+ else if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPV6))
packet_type |= RTE_PTYPE_L3_IPV6_EXT_UNKNOWN;
m->packet_type = packet_type;