summaryrefslogtreecommitdiff
path: root/examples/l3fwd-vf
diff options
context:
space:
mode:
authorOlivier Matz <olivier.matz@6wind.com>2019-05-21 18:13:10 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2019-05-24 13:34:46 +0200
commita7c528e5d71ff3f569898d268f9de129fdfc152b (patch)
treeead7c352fb1a817707a3ffbe471e6484850607d4 /examples/l3fwd-vf
parentecaeed4f1d042b4317f756ad49ab4d918d0e4f76 (diff)
downloaddpdk-a7c528e5d71ff3f569898d268f9de129fdfc152b.zip
dpdk-a7c528e5d71ff3f569898d268f9de129fdfc152b.tar.gz
dpdk-a7c528e5d71ff3f569898d268f9de129fdfc152b.tar.xz
net: add rte prefix to IP structure
Add 'rte_' prefix to structures: - rename struct ipv4_hdr as struct rte_ipv4_hdr. - rename struct ipv6_hdr as struct rte_ipv6_hdr. 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-vf')
-rw-r--r--examples/l3fwd-vf/main.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index d9b6368..ebb2378 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -314,14 +314,14 @@ send_single_packet(struct rte_mbuf *m, uint16_t port)
#ifdef DO_RFC_1812_CHECKS
static inline int
-is_valid_ipv4_pkt(struct ipv4_hdr *pkt, uint32_t link_len)
+is_valid_ipv4_pkt(struct rte_ipv4_hdr *pkt, uint32_t link_len)
{
/* From http://www.rfc-editor.org/rfc/rfc1812.txt section 5.2.2 */
/*
* 1. The packet length reported by the Link Layer must be large
* enough to hold the minimum length legal IP datagram (20 bytes).
*/
- if (link_len < sizeof(struct ipv4_hdr))
+ if (link_len < sizeof(struct rte_ipv4_hdr))
return -1;
/* 2. The IP checksum must be correct. */
@@ -346,7 +346,7 @@ is_valid_ipv4_pkt(struct ipv4_hdr *pkt, uint32_t link_len)
* datagram header, whose length is specified in the IP header length
* field.
*/
- if (rte_cpu_to_be_16(pkt->total_length) < sizeof(struct ipv4_hdr))
+ if (rte_cpu_to_be_16(pkt->total_length) < sizeof(struct rte_ipv4_hdr))
return -5;
return 0;
@@ -362,7 +362,7 @@ print_key(struct ipv4_5tuple key)
}
static inline uint16_t
-get_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid,
+get_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,
lookup_struct_t *l3fwd_lookup_struct)
{
struct ipv4_5tuple key;
@@ -377,14 +377,14 @@ get_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid,
switch (ipv4_hdr->next_proto_id) {
case IPPROTO_TCP:
tcp = (struct tcp_hdr *)((unsigned char *) ipv4_hdr +
- sizeof(struct ipv4_hdr));
+ sizeof(struct rte_ipv4_hdr));
key.port_dst = rte_be_to_cpu_16(tcp->dst_port);
key.port_src = rte_be_to_cpu_16(tcp->src_port);
break;
case IPPROTO_UDP:
udp = (struct udp_hdr *)((unsigned char *) ipv4_hdr +
- sizeof(struct ipv4_hdr));
+ sizeof(struct rte_ipv4_hdr));
key.port_dst = rte_be_to_cpu_16(udp->dst_port);
key.port_src = rte_be_to_cpu_16(udp->src_port);
break;
@@ -402,7 +402,7 @@ get_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid,
#if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM)
static inline uint32_t
-get_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid,
+get_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,
lookup_struct_t *l3fwd_lookup_struct)
{
uint32_t next_hop;
@@ -418,13 +418,13 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,
lookup_struct_t *l3fwd_lookup_struct)
{
struct rte_ether_hdr *eth_hdr;
- struct ipv4_hdr *ipv4_hdr;
+ struct rte_ipv4_hdr *ipv4_hdr;
void *tmp;
uint16_t dst_port;
eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
- ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
+ ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *,
sizeof(struct rte_ether_hdr));
#ifdef DO_RFC_1812_CHECKS