Skip to contentSkip to conversation

prefix network structures

RFC Superseded Olivier Matz 9 participants 86 messages Oct 24, 2018 – May 29, 2019 Page 2 of 5

Subsystems (3)
lore
Share & tools
lore
#13 lore raw

RFC 10/14 net: add rte prefix to ip structure

In reply to Olivier Matz

Add 'rte_' prefix to structures:
- rename struct ipv4_hdr as struct rte_ipv4_hdr.
- rename struct ipv6_hdr as struct rte_ipv6_hdr.

---
 app/test-pmd/csumonly.c                            |  40 ++++----
 app/test-pmd/flowgen.c                             |   6 +-
 app/test-pmd/icmpecho.c                            |   8 +-
 app/test-pmd/macfwd.c                              |   2 +-
 app/test-pmd/macswap.c                             |   2 +-
 app/test-pmd/txonly.c                              |  12 +--
 app/test-pmd/util.c                                |  12 +--
 .../prog_guide/packet_classif_access_ctrl.rst      |  12 +--
 doc/guides/sample_app_ug/flow_classify.rst         |  10 +-
 doc/guides/sample_app_ug/ipv4_multicast.rst        |   2 +-
 doc/guides/sample_app_ug/l3_forward.rst            |  12 +--
 doc/guides/sample_app_ug/server_node_efd.rst       |   8 +-
 drivers/net/bonding/rte_eth_bond_pmd.c             |  16 +--
 drivers/net/dpaa/dpaa_rxtx.c                       |   8 +-
 drivers/net/e1000/em_rxtx.c                        |   2 +-
 drivers/net/ena/ena_ethdev.c                       |   4 +-
 drivers/net/enic/enic_clsf.c                       |  16 +--
 drivers/net/enic/enic_flow.c                       |  26 ++---
 drivers/net/i40e/i40e_fdir.c                       |  36 +++----
 drivers/net/mlx5/mlx5_flow.c                       |   6 +-
 drivers/net/mlx5/mlx5_flow_tcf.c                   |  12 +--
 drivers/net/mvpp2/mrvl_flow.c                      |   2 +-
 drivers/net/qede/qede_filter.c                     |  14 +--
 drivers/net/qede/qede_rxtx.c                       |  12 +--
 drivers/net/sfc/sfc_ef10_tx.c                      |   4 +-
 drivers/net/sfc/sfc_tso.c                          |   4 +-
 drivers/net/softnic/rte_eth_softnic_pipeline.c     |  32 +++---
 drivers/net/tap/rte_eth_tap.c                      |   8 +-
 drivers/net/virtio/virtio_rxtx.c                   |   8 +-
 drivers/net/vmxnet3/vmxnet3_rxtx.c                 |  18 ++--
 examples/bond/main.c                               |   4 +-
 examples/flow_classify/flow_classify.c             |  10 +-
 examples/ip_fragmentation/main.c                   |  12 +--
 examples/ip_pipeline/pipeline.c                    |  32 +++---
 examples/ip_reassembly/main.c                      |  12 +--
 examples/ipv4_multicast/main.c                     |   4 +-
 examples/l2fwd-crypto/main.c                       |   4 +-
 examples/l3fwd-acl/main.c                          |  80 +++++++--------
 examples/l3fwd-power/main.c                        |  28 +++---
 examples/l3fwd-vf/main.c                           |  18 ++--
 examples/l3fwd/l3fwd.h                             |   6 +-
 examples/l3fwd/l3fwd_altivec.h                     |  10 +-
 examples/l3fwd/l3fwd_common.h                      |   4 +-
 examples/l3fwd/l3fwd_em.c                          |  14 +--
 examples/l3fwd/l3fwd_em.h                          |   8 +-
 examples/l3fwd/l3fwd_em_hlm.h                      |   8 +-
 examples/l3fwd/l3fwd_em_hlm_neon.h                 |   8 +-
 examples/l3fwd/l3fwd_em_hlm_sse.h                  |   8 +-
 examples/l3fwd/l3fwd_em_sequential.h               |   8 +-
 examples/l3fwd/l3fwd_lpm.c                         |  16 +--
 examples/l3fwd/l3fwd_lpm.h                         |   8 +-
 examples/l3fwd/l3fwd_lpm_altivec.h                 |  10 +-
 examples/l3fwd/l3fwd_lpm_neon.h                    |  10 +-
 examples/l3fwd/l3fwd_lpm_sse.h                     |  10 +-
 examples/l3fwd/l3fwd_neon.h                        |  10 +-
 examples/l3fwd/l3fwd_sse.h                         |  10 +-
 examples/load_balancer/runtime.c                   |   4 +-
 examples/performance-thread/l3fwd-thread/main.c    | 110 ++++++++++-----------
 examples/server_node_efd/node/node.c               |   4 +-
 examples/server_node_efd/server/main.c             |   4 +-
 examples/tep_termination/vxlan.c                   |  32 +++---
 examples/tep_termination/vxlan.h                   |   2 +-
 examples/tep_termination/vxlan_setup.c             |   4 +-
 examples/vhost/main.c                              |   2 +-
 lib/librte_ethdev/rte_flow.h                       |   4 +-
 lib/librte_eventdev/rte_event_eth_rx_adapter.c     |  16 +--
 lib/librte_gro/gro_tcp4.c                          |   8 +-
 lib/librte_gro/gro_tcp4.h                          |   4 +-
 lib/librte_gro/gro_vxlan_tcp4.c                    |  12 +--
 lib/librte_gso/gso_common.h                        |   4 +-
 lib/librte_gso/gso_tcp4.c                          |   8 +-
 lib/librte_gso/gso_tunnel_tcp4.c                   |  10 +-
 lib/librte_gso/gso_udp4.c                          |   8 +-
 lib/librte_gso/rte_gso.h                           |   4 +-
 lib/librte_hash/rte_thash.h                        |   2 +-
 lib/librte_ip_frag/rte_ip_frag.h                   |   8 +-
 lib/librte_ip_frag/rte_ipv4_fragmentation.c        |  26 ++---
 lib/librte_ip_frag/rte_ipv4_reassembly.c           |   6 +-
 lib/librte_ip_frag/rte_ipv6_fragmentation.c        |  26 ++---
 lib/librte_ip_frag/rte_ipv6_reassembly.c           |   6 +-
 lib/librte_net/rte_ip.h                            |  20 ++--
 lib/librte_net/rte_net.c                           |  18 ++--
 lib/librte_net/rte_net.h                           |  10 +-
 lib/librte_pipeline/rte_table_action.c             |  50 +++++-----
 lib/librte_port/rte_port_ras.c                     |   4 +-
 lib/librte_vhost/virtio_net.c                      |  10 +-
 test/test-pipeline/pipeline_acl.c                  |  10 +-
 test/test-pipeline/pipeline_hash.c                 |   8 +-
 test/test/packet_burst_generator.c                 |  44 ++++-----
 test/test/packet_burst_generator.h                 |   6 +-
 test/test/test_flow_classify.c                     |  16 +--
 test/test/test_link_bonding.c                      |   8 +-
 test/test/test_link_bonding_mode4.c                |   4 +-
 test/test/test_pmd_perf.c                          |   2 +-
 test/test/test_sched.c                             |   4 +-
 test/test/test_thash.c                             |   2 +-
 96 files changed, 618 insertions(+), 618 deletions(-)
app/test-pmd/csumonly.c +20 -20
index f52608056..23f16bab3 100644
@@ -100,7 +100,7 @@ get_udptcp_checksum(void *l3_hdr, void *l4_hdr, uint16_t ethertype)
 
 /* Parse an IPv4 header to fill l3_len, l4_len, and l4_proto */
 static void
-parse_ipv4(struct ipv4_hdr *ipv4_hdr, struct testpmd_offload_info *info)
+parse_ipv4(struct rte_ipv4_hdr *ipv4_hdr, struct testpmd_offload_info *info)
 {
 	struct tcp_hdr *tcp_hdr;
 
@@ -117,11 +117,11 @@ parse_ipv4(struct ipv4_hdr *ipv4_hdr, struct testpmd_offload_info *info)
 
 /* Parse an IPv6 header to fill l3_len, l4_len, and l4_proto */
 static void
-parse_ipv6(struct ipv6_hdr *ipv6_hdr, struct testpmd_offload_info *info)
+parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr, struct testpmd_offload_info *info)
 {
 	struct tcp_hdr *tcp_hdr;
 
-	info->l3_len = sizeof(struct ipv6_hdr);
+	info->l3_len = sizeof(struct rte_ipv6_hdr);
 	info->l4_proto = ipv6_hdr->proto;
 
 	/* only fill l4_len for TCP, it's useful for TSO */
@@ -140,8 +140,8 @@ parse_ipv6(struct ipv6_hdr *ipv6_hdr, struct testpmd_offload_info *info)
 static void
 parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info *info)
 {
-	struct ipv4_hdr *ipv4_hdr;
-	struct ipv6_hdr *ipv6_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
+	struct rte_ipv6_hdr *ipv6_hdr;
 
 	info->l2_len = sizeof(struct rte_ether_hdr);
 	info->ethertype = eth_hdr->ether_type;
@@ -155,11 +155,11 @@ parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info *info)
 
 	switch (info->ethertype) {
 	case _htons(RTE_ETHER_TYPE_IPv4):
-		ipv4_hdr = (struct ipv4_hdr *) ((char *)eth_hdr + info->l2_len);
+		ipv4_hdr = (struct rte_ipv4_hdr *) ((char *)eth_hdr + info->l2_len);
 		parse_ipv4(ipv4_hdr, info);
 		break;
 	case _htons(RTE_ETHER_TYPE_IPv6):
-		ipv6_hdr = (struct ipv6_hdr *) ((char *)eth_hdr + info->l2_len);
+		ipv6_hdr = (struct rte_ipv6_hdr *) ((char *)eth_hdr + info->l2_len);
 		parse_ipv6(ipv6_hdr, info);
 		break;
 	default:
@@ -205,8 +205,8 @@ parse_vxlan_gpe(struct udp_hdr *udp_hdr,
 	    struct testpmd_offload_info *info)
 {
 	struct rte_ether_hdr *eth_hdr;
-	struct ipv4_hdr *ipv4_hdr;
-	struct ipv6_hdr *ipv6_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
+	struct rte_ipv6_hdr *ipv6_hdr;
 	struct rte_vxlan_gpe_hdr *vxlan_gpe_hdr;
 	uint8_t vxlan_gpe_len = sizeof(*vxlan_gpe_hdr);
 
@@ -225,7 +225,7 @@ parse_vxlan_gpe(struct udp_hdr *udp_hdr,
 		info->outer_l3_len = info->l3_len;
 		info->outer_l4_proto = info->l4_proto;
 
-		ipv4_hdr = (struct ipv4_hdr *)((char *)vxlan_gpe_hdr +
+		ipv4_hdr = (struct rte_ipv4_hdr *)((char *)vxlan_gpe_hdr +
 			   vxlan_gpe_len);
 
 		parse_ipv4(ipv4_hdr, info);
@@ -239,7 +239,7 @@ parse_vxlan_gpe(struct udp_hdr *udp_hdr,
 		info->outer_l3_len = info->l3_len;
 		info->outer_l4_proto = info->l4_proto;
 
-		ipv6_hdr = (struct ipv6_hdr *)((char *)vxlan_gpe_hdr +
+		ipv6_hdr = (struct rte_ipv6_hdr *)((char *)vxlan_gpe_hdr +
 			   vxlan_gpe_len);
 
 		info->ethertype = _htons(RTE_ETHER_TYPE_IPv6);
@@ -268,8 +268,8 @@ static void
 parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
 {
 	struct rte_ether_hdr *eth_hdr;
-	struct ipv4_hdr *ipv4_hdr;
-	struct ipv6_hdr *ipv6_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
+	struct rte_ipv6_hdr *ipv6_hdr;
 	uint8_t gre_len = 0;
 
 	gre_len += sizeof(struct simple_gre_hdr);
@@ -288,7 +288,7 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
 		info->outer_l3_len = info->l3_len;
 		info->outer_l4_proto = info->l4_proto;
 
-		ipv4_hdr = (struct ipv4_hdr *)((char *)gre_hdr + gre_len);
+		ipv4_hdr = (struct rte_ipv4_hdr *)((char *)gre_hdr + gre_len);
 
 		parse_ipv4(ipv4_hdr, info);
 		info->ethertype = _htons(RTE_ETHER_TYPE_IPv4);
@@ -301,7 +301,7 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
 		info->outer_l3_len = info->l3_len;
 		info->outer_l4_proto = info->l4_proto;
 
-		ipv6_hdr = (struct ipv6_hdr *)((char *)gre_hdr + gre_len);
+		ipv6_hdr = (struct rte_ipv6_hdr *)((char *)gre_hdr + gre_len);
 
 		info->ethertype = _htons(RTE_ETHER_TYPE_IPv6);
 		parse_ipv6(ipv6_hdr, info);
@@ -328,8 +328,8 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
 static void
 parse_encap_ip(void *encap_ip, struct testpmd_offload_info *info)
 {
-	struct ipv4_hdr *ipv4_hdr = encap_ip;
-	struct ipv6_hdr *ipv6_hdr = encap_ip;
+	struct rte_ipv4_hdr *ipv4_hdr = encap_ip;
+	struct rte_ipv6_hdr *ipv6_hdr = encap_ip;
 	uint8_t ip_version;
 
 	ip_version = (ipv4_hdr->version_ihl & 0xf0) >> 4;
@@ -358,7 +358,7 @@ static uint64_t
 process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 	uint64_t tx_offloads)
 {
-	struct ipv4_hdr *ipv4_hdr = l3_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr = l3_hdr;
 	struct udp_hdr *udp_hdr;
 	struct tcp_hdr *tcp_hdr;
 	struct sctp_hdr *sctp_hdr;
@@ -449,8 +449,8 @@ static uint64_t
 process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
 	uint64_t tx_offloads, int tso_enabled)
 {
-	struct ipv4_hdr *ipv4_hdr = outer_l3_hdr;
-	struct ipv6_hdr *ipv6_hdr = outer_l3_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr = outer_l3_hdr;
+	struct rte_ipv6_hdr *ipv6_hdr = outer_l3_hdr;
 	struct udp_hdr *udp_hdr;
 	uint64_t ol_flags = 0;
 
app/test-pmd/flowgen.c +3 -3
index 47fb011a1..e62601541 100644
@@ -120,7 +120,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)
 	struct rte_mempool *mbp;
 	struct rte_mbuf  *pkt;
 	struct rte_ether_hdr *eth_hdr;
-	struct ipv4_hdr *ip_hdr;
+	struct rte_ipv4_hdr *ip_hdr;
 	struct udp_hdr *udp_hdr;
 	uint16_t vlan_tci, vlan_tci_outer;
 	uint64_t ol_flags;
@@ -176,7 +176,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)
 		eth_hdr->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
 
 		/* Initialize IP header. */
-		ip_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+		ip_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);
 		memset(ip_hdr, 0, sizeof(*ip_hdr));
 		ip_hdr->version_ihl	= IP_VHL_DEF;
 		ip_hdr->type_of_service	= 0;
@@ -206,7 +206,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)
 		pkt->vlan_tci		= vlan_tci;
 		pkt->vlan_tci_outer	= vlan_tci_outer;
 		pkt->l2_len		= sizeof(struct rte_ether_hdr);
-		pkt->l3_len		= sizeof(struct ipv4_hdr);
+		pkt->l3_len		= sizeof(struct rte_ipv4_hdr);
 		pkts_burst[nb_pkt]	= pkt;
 
 		next_flow = (next_flow + 1) % cfg_n_flows;
app/test-pmd/icmpecho.c +4 -4
index 4bf3fed64..146293175 100644
@@ -243,7 +243,7 @@ ipv4_addr_dump(const char *what, uint32_t be_ipv4_addr)
 }
 
 static uint16_t
-ipv4_hdr_cksum(struct ipv4_hdr *ip_h)
+ipv4_hdr_cksum(struct rte_ipv4_hdr *ip_h)
 {
 	uint16_t *v16_h;
 	uint32_t ip_cksum;
@@ -278,7 +278,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
 	struct rte_ether_hdr *eth_h;
 	struct rte_vlan_hdr *vlan_h;
 	struct rte_arp_hdr  *arp_h;
-	struct ipv4_hdr *ip_h;
+	struct rte_ipv4_hdr *ip_h;
 	struct rte_icmp_hdr *icmp_h;
 	struct rte_ether_addr eth_addr;
 	uint32_t retry;
@@ -413,7 +413,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
 			rte_pktmbuf_free(pkt);
 			continue;
 		}
-		ip_h = (struct ipv4_hdr *) ((char *)eth_h + l2_len);
+		ip_h = (struct rte_ipv4_hdr *) ((char *)eth_h + l2_len);
 		if (verbose_level > 0) {
 			ipv4_addr_dump("  IPV4: src=", ip_h->src_addr);
 			ipv4_addr_dump(" dst=", ip_h->dst_addr);
@@ -426,7 +426,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
 		 * Check if packet is a ICMP echo request.
 		 */
 		icmp_h = (struct rte_icmp_hdr *) ((char *)ip_h +
-					      sizeof(struct ipv4_hdr));
+					      sizeof(struct rte_ipv4_hdr));
 		if (! ((ip_h->next_proto_id == IPPROTO_ICMP) &&
 		       (icmp_h->icmp_type == RTE_IP_ICMP_ECHO_REQUEST) &&
 		       (icmp_h->icmp_code == 0))) {
app/test-pmd/macfwd.c +1 -1
index f15149252..d2ebb1105 100644
@@ -99,7 +99,7 @@ pkt_burst_mac_forward(struct fwd_stream *fs)
 		mb->ol_flags &= IND_ATTACHED_MBUF | EXT_ATTACHED_MBUF;
 		mb->ol_flags |= ol_flags;
 		mb->l2_len = sizeof(struct rte_ether_hdr);
-		mb->l3_len = sizeof(struct ipv4_hdr);
+		mb->l3_len = sizeof(struct rte_ipv4_hdr);
 		mb->vlan_tci = txp->tx_vlan_id;
 		mb->vlan_tci_outer = txp->tx_vlan_id_outer;
 	}
app/test-pmd/macswap.c +1 -1
index 4c57a2a56..0ee1cec23 100644
@@ -130,7 +130,7 @@ pkt_burst_mac_swap(struct fwd_stream *fs)
 		mb->ol_flags &= IND_ATTACHED_MBUF | EXT_ATTACHED_MBUF;
 		mb->ol_flags |= ol_flags;
 		mb->l2_len = sizeof(struct rte_ether_hdr);
-		mb->l3_len = sizeof(struct ipv4_hdr);
+		mb->l3_len = sizeof(struct rte_ipv4_hdr);
 		mb->vlan_tci = txp->tx_vlan_id;
 		mb->vlan_tci_outer = txp->tx_vlan_id_outer;
 	}
app/test-pmd/txonly.c +6 -6
index ae094ab94..5d76e471e 100644
@@ -51,7 +51,7 @@
 #define IP_HDRLEN  0x05 /* default IP header length == five 32-bits words. */
 #define IP_VHL_DEF (IP_VERSION | IP_HDRLEN)
 
-static struct ipv4_hdr  pkt_ip_hdr;  /**< IP header of transmitted packets. */
+static struct rte_ipv4_hdr  pkt_ip_hdr;  /**< IP header of transmitted packets. */
 static struct udp_hdr pkt_udp_hdr; /**< UDP header of transmitted packets. */
 
 static void
@@ -92,7 +92,7 @@ copy_buf_to_pkt(void* buf, unsigned len, struct rte_mbuf *pkt, unsigned offset)
 }
 
 static void
-setup_pkt_udp_ip_headers(struct ipv4_hdr *ip_hdr,
+setup_pkt_udp_ip_headers(struct rte_ipv4_hdr *ip_hdr,
 			 struct udp_hdr *udp_hdr,
 			 uint16_t pkt_data_len)
 {
@@ -112,7 +112,7 @@ setup_pkt_udp_ip_headers(struct ipv4_hdr *ip_hdr,
 	/*
 	 * Initialize IP header.
 	 */
-	pkt_len = (uint16_t) (pkt_len + sizeof(struct ipv4_hdr));
+	pkt_len = (uint16_t) (pkt_len + sizeof(struct rte_ipv4_hdr));
 	ip_hdr->version_ihl   = IP_VHL_DEF;
 	ip_hdr->type_of_service   = 0;
 	ip_hdr->fragment_offset = 0;
@@ -239,7 +239,7 @@ pkt_burst_transmit(struct fwd_stream *fs)
 				sizeof(struct rte_ether_hdr));
 		copy_buf_to_pkt(&pkt_udp_hdr, sizeof(pkt_udp_hdr), pkt,
 				sizeof(struct rte_ether_hdr) +
-				sizeof(struct ipv4_hdr));
+				sizeof(struct rte_ipv4_hdr));
 
 		/*
 		 * Complete first mbuf of packet and append it to the
@@ -251,7 +251,7 @@ pkt_burst_transmit(struct fwd_stream *fs)
 		pkt->vlan_tci = vlan_tci;
 		pkt->vlan_tci_outer = vlan_tci_outer;
 		pkt->l2_len = sizeof(struct rte_ether_hdr);
-		pkt->l3_len = sizeof(struct ipv4_hdr);
+		pkt->l3_len = sizeof(struct rte_ipv4_hdr);
 		pkts_burst[nb_pkt] = pkt;
 	}
 	nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_pkt);
@@ -297,7 +297,7 @@ tx_only_begin(__attribute__((unused)) portid_t pi)
 	uint16_t pkt_data_len;
 
 	pkt_data_len = (uint16_t) (tx_pkt_length - (sizeof(struct rte_ether_hdr) +
-						    sizeof(struct ipv4_hdr) +
+						    sizeof(struct rte_ipv4_hdr) +
 						    sizeof(struct udp_hdr)));
 	setup_pkt_udp_ip_headers(&pkt_ip_hdr, &pkt_udp_hdr, pkt_data_len);
 }
app/test-pmd/util.c +6 -6
index 312707430..fe8b18bd3 100644
@@ -102,8 +102,8 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],
 		if (sw_packet_type & RTE_PTYPE_INNER_L4_MASK)
 			printf(" - inner_l4_len=%d", hdr_lens.inner_l4_len);
 		if (is_encapsulation) {
-			struct ipv4_hdr *ipv4_hdr;
-			struct ipv6_hdr *ipv6_hdr;
+			struct rte_ipv4_hdr *ipv4_hdr;
+			struct rte_ipv6_hdr *ipv6_hdr;
 			struct udp_hdr *udp_hdr;
 			uint8_t l2_len;
 			uint8_t l3_len;
@@ -115,15 +115,15 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],
 
 			/* Do not support ipv4 option field */
 			if (RTE_ETH_IS_IPV4_HDR(packet_type)) {
-				l3_len = sizeof(struct ipv4_hdr);
+				l3_len = sizeof(struct rte_ipv4_hdr);
 				ipv4_hdr = rte_pktmbuf_mtod_offset(mb,
-				struct ipv4_hdr *,
+				struct rte_ipv4_hdr *,
 				l2_len);
 				l4_proto = ipv4_hdr->next_proto_id;
 			} else {
-				l3_len = sizeof(struct ipv6_hdr);
+				l3_len = sizeof(struct rte_ipv6_hdr);
 				ipv6_hdr = rte_pktmbuf_mtod_offset(mb,
-				struct ipv6_hdr *,
+				struct rte_ipv6_hdr *,
 				l2_len);
 				l4_proto = ipv6_hdr->proto;
 			}
doc/guides/prog_guide/packet_classif_access_ctrl.rst +6 -6
index 395b3ec47..6887e4dc6 100644
@@ -154,7 +154,7 @@ To define classification for the IPv6 2-tuple: <protocol, IPv6 source address> o
 
 .. code-block:: c
 
-    struct struct ipv6_hdr {
+    struct struct rte_ipv6_hdr {
         uint32_t vtc_flow;     /* IP version, traffic class & flow label. */
         uint16_t payload_len;  /* IP packet length - includes sizeof(ip_header). */
         uint8_t proto;         /* Protocol, next header. */
@@ -173,7 +173,7 @@ The following array of field definitions can be used:
             .size = sizeof (uint8_t),
             .field_index = 0,
             .input_index = 0,
-            .offset = offsetof (struct ipv6_hdr, proto),
+            .offset = offsetof (struct rte_ipv6_hdr, proto),
         },
 
         {
@@ -181,7 +181,7 @@ The following array of field definitions can be used:
             .size = sizeof (uint32_t),
             .field_index = 1,
             .input_index = 1,
-            .offset = offsetof (struct ipv6_hdr, src_addr[0]),
+            .offset = offsetof (struct rte_ipv6_hdr, src_addr[0]),
         },
 
         {
@@ -189,7 +189,7 @@ The following array of field definitions can be used:
             .size = sizeof (uint32_t),
             .field_index = 2,
             .input_index = 2,
-            .offset = offsetof (struct ipv6_hdr, src_addr[4]),
+            .offset = offsetof (struct rte_ipv6_hdr, src_addr[4]),
         },
 
         {
@@ -197,7 +197,7 @@ The following array of field definitions can be used:
             .size = sizeof (uint32_t),
             .field_index = 3,
             .input_index = 3,
-           .offset = offsetof (struct ipv6_hdr, src_addr[8]),
+           .offset = offsetof (struct rte_ipv6_hdr, src_addr[8]),
         },
 
         {
@@ -205,7 +205,7 @@ The following array of field definitions can be used:
            .size = sizeof (uint32_t),
            .field_index = 4,
            .input_index = 4,
-           .offset = offsetof (struct ipv6_hdr, src_addr[12]),
+           .offset = offsetof (struct rte_ipv6_hdr, src_addr[12]),
         },
     };
 
doc/guides/sample_app_ug/flow_classify.rst +5 -5
index e028f4559..8172a96c4 100644
@@ -92,7 +92,7 @@ initialisation of the ``Flow Classify`` application..
             .field_index = PROTO_FIELD_IPV4,
             .input_index = PROTO_INPUT_IPV4,
             .offset = sizeof(struct rte_ether_hdr) +
-                offsetof(struct ipv4_hdr, next_proto_id),
+                offsetof(struct rte_ipv4_hdr, next_proto_id),
         },
         /* next input field (IPv4 source address) - 4 consecutive bytes. */
         {
@@ -102,7 +102,7 @@ initialisation of the ``Flow Classify`` application..
             .field_index = SRC_FIELD_IPV4,
             .input_index = SRC_INPUT_IPV4,
             .offset = sizeof(struct rte_ether_hdr) +
-                offsetof(struct ipv4_hdr, src_addr),
+                offsetof(struct rte_ipv4_hdr, src_addr),
         },
         /* next input field (IPv4 destination address) - 4 consecutive bytes. */
         {
@@ -112,7 +112,7 @@ initialisation of the ``Flow Classify`` application..
             .field_index = DST_FIELD_IPV4,
             .input_index = DST_INPUT_IPV4,
             .offset = sizeof(struct rte_ether_hdr) +
-                offsetof(struct ipv4_hdr, dst_addr),
+                offsetof(struct rte_ipv4_hdr, dst_addr),
         },
         /*
          * Next 2 fields (src & dst ports) form 4 consecutive bytes.
@@ -125,7 +125,7 @@ initialisation of the ``Flow Classify`` application..
             .field_index = SRCP_FIELD_IPV4,
             .input_index = SRCP_DESTP_INPUT_IPV4,
             .offset = sizeof(struct rte_ether_hdr) +
-                sizeof(struct ipv4_hdr) +
+                sizeof(struct rte_ipv4_hdr) +
                 offsetof(struct tcp_hdr, src_port),
         },
         {
@@ -135,7 +135,7 @@ initialisation of the ``Flow Classify`` application..
              .field_index = DSTP_FIELD_IPV4,
              .input_index = SRCP_DESTP_INPUT_IPV4,
              .offset = sizeof(struct rte_ether_hdr) +
-                 sizeof(struct ipv4_hdr) +
+                 sizeof(struct rte_ipv4_hdr) +
                  offsetof(struct tcp_hdr, dst_port),
         },
     };
doc/guides/sample_app_ug/ipv4_multicast.rst +1 -1
index 97bd756a2..0d89be96e 100644
@@ -146,7 +146,7 @@ Firstly, the Ethernet* header is removed from the packet and the IPv4 address is
 
     /* Remove the Ethernet header from the input packet */
 
-    iphdr = (struct ipv4_hdr *)rte_pktmbuf_adj(m, sizeof(struct rte_ether_hdr));
+    iphdr = (struct rte_ipv4_hdr *)rte_pktmbuf_adj(m, sizeof(struct rte_ether_hdr));
     RTE_ASSERT(iphdr != NULL);
     dest_addr = rte_be_to_cpu_32(iphdr->dst_addr);
 
doc/guides/sample_app_ug/l3_forward.rst +6 -6
index 58c4aae92..bf6c5ea52 100644
@@ -242,7 +242,7 @@ The get_ipv4_dst_port() function is shown below:
         int ret = 0;
         union ipv4_5tuple_host key;
 
-        ipv4_hdr = (uint8_t *)ipv4_hdr + offsetof(struct ipv4_hdr, time_to_live);
+        ipv4_hdr = (uint8_t *)ipv4_hdr + offsetof(struct rte_ipv4_hdr, time_to_live);
 
         m128i data = _mm_loadu_si128(( m128i*)(ipv4_hdr));
 
@@ -270,10 +270,10 @@ The key code snippet of simple_ipv4_fwd_4pkts() is shown below:
     {
         // ...
 
-        data[0] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[0], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live)));
-        data[1] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[1], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live)));
-        data[2] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[2], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live)));
-        data[3] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[3], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct ipv4_hdr, time_to_live)));
+        data[0] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[0], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct rte_ipv4_hdr, time_to_live)));
+        data[1] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[1], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct rte_ipv4_hdr, time_to_live)));
+        data[2] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[2], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct rte_ipv4_hdr, time_to_live)));
+        data[3] = _mm_loadu_si128(( m128i*)(rte_pktmbuf_mtod(m[3], unsigned char *) + sizeof(struct rte_ether_hdr) + offsetof(struct rte_ipv4_hdr, time_to_live)));
 
         key[0].xmm = _mm_and_si128(data[0], mask0);
         key[1].xmm = _mm_and_si128(data[1], mask0);
@@ -306,7 +306,7 @@ for LPM-based lookups is done by the get_ipv4_dst_port() function below:
 .. code-block:: c
 
     static inline uint16_t
-    get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct)
+    get_ipv4_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid, lookup_struct_t *ipv4_l3fwd_lookup_struct)
     {
         uint8_t next_hop;
 
doc/guides/sample_app_ug/server_node_efd.rst +4 -4
index f7dab9e98..12208f425 100644
@@ -191,12 +191,12 @@ which tells the node where the packet has to be distributed.
         efd_value_t data[EFD_BURST_MAX];
         const void *key_ptrs[EFD_BURST_MAX];
 
-        struct ipv4_hdr *ipv4_hdr;
+        struct rte_ipv4_hdr *ipv4_hdr;
         uint32_t ipv4_dst_ip[EFD_BURST_MAX];
 
         for (i = 0; i < rx_count; i++) {
             /* Handle IPv4 header.*/
-            ipv4_hdr = rte_pktmbuf_mtod_offset(pkts[i], struct ipv4_hdr *,
+            ipv4_hdr = rte_pktmbuf_mtod_offset(pkts[i], struct rte_ipv4_hdr *,
                     sizeof(struct rte_ether_hdr));
             ipv4_dst_ip[i] = ipv4_hdr->dst_addr;
             key_ptrs[i] = (void *)&ipv4_dst_ip[i];
@@ -348,7 +348,7 @@ flow is not handled by the node.
     static inline void
     handle_packets(struct rte_hash *h, struct rte_mbuf **bufs, uint16_t num_packets)
     {
-        struct ipv4_hdr *ipv4_hdr;
+        struct rte_ipv4_hdr *ipv4_hdr;
         uint32_t ipv4_dst_ip[PKT_READ_SIZE];
         const void *key_ptrs[PKT_READ_SIZE];
         unsigned int i;
@@ -356,7 +356,7 @@ flow is not handled by the node.
 
         for (i = 0; i < num_packets; i++) {
             /* Handle IPv4 header.*/
-            ipv4_hdr = rte_pktmbuf_mtod_offset(bufs[i], struct ipv4_hdr *,
+            ipv4_hdr = rte_pktmbuf_mtod_offset(bufs[i], struct rte_ipv4_hdr *,
                     sizeof(struct rte_ether_hdr));
             ipv4_dst_ip[i] = ipv4_hdr->dst_addr;
             key_ptrs[i] = &ipv4_dst_ip[i];
drivers/net/bonding/rte_eth_bond_pmd.c +8 -8
index 46757cf79..2aa94d7c2 100644
@@ -587,7 +587,7 @@ static void
 mode6_debug(const char __attribute__((unused)) *info, struct rte_ether_hdr *eth_h,
 		uint16_t port, uint32_t __attribute__((unused)) *burstnumber)
 {
-	struct ipv4_hdr *ipv4_h;
+	struct rte_ipv4_hdr *ipv4_h;
 #ifdef RTE_LIBRTE_BOND_DEBUG_ALB
 	struct rte_arp_hdr *arp_h;
 	char dst_ip[16];
@@ -604,7 +604,7 @@ mode6_debug(const char __attribute__((unused)) *info, struct rte_ether_hdr *eth_
 #endif
 
 	if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4)) {
-		ipv4_h = (struct ipv4_hdr *)((char *)(eth_h + 1) + offset);
+		ipv4_h = (struct rte_ipv4_hdr *)((char *)(eth_h + 1) + offset);
 		ipv4_addr_to_dot(ipv4_h->src_addr, src_ip, MaxIPv4String);
 #ifdef RTE_LIBRTE_BOND_DEBUG_ALB
 		ipv4_addr_to_dot(ipv4_h->dst_addr, dst_ip, MaxIPv4String);
@@ -750,13 +750,13 @@ ether_hash(struct rte_ether_hdr *eth_hdr)
 }
 
 static inline uint32_t
-ipv4_hash(struct ipv4_hdr *ipv4_hdr)
+ipv4_hash(struct rte_ipv4_hdr *ipv4_hdr)
 {
 	return ipv4_hdr->src_addr ^ ipv4_hdr->dst_addr;
 }
 
 static inline uint32_t
-ipv6_hash(struct ipv6_hdr *ipv6_hdr)
+ipv6_hash(struct rte_ipv6_hdr *ipv6_hdr)
 {
 	unaligned_uint32_t *word_src_addr =
 		(unaligned_uint32_t *)&(ipv6_hdr->src_addr[0]);
@@ -807,12 +807,12 @@ burst_xmit_l23_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
 		vlan_offset = get_vlan_offset(eth_hdr, &proto);
 
 		if (rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4) == proto) {
-			struct ipv4_hdr *ipv4_hdr = (struct ipv4_hdr *)
+			struct rte_ipv4_hdr *ipv4_hdr = (struct rte_ipv4_hdr *)
 					((char *)(eth_hdr + 1) + vlan_offset);
 			l3hash = ipv4_hash(ipv4_hdr);
 
 		} else if (rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6) == proto) {
-			struct ipv6_hdr *ipv6_hdr = (struct ipv6_hdr *)
+			struct rte_ipv6_hdr *ipv6_hdr = (struct rte_ipv6_hdr *)
 					((char *)(eth_hdr + 1) + vlan_offset);
 			l3hash = ipv6_hash(ipv6_hdr);
 		}
@@ -846,7 +846,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
 		l4hash = 0;
 
 		if (rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4) == proto) {
-			struct ipv4_hdr *ipv4_hdr = (struct ipv4_hdr *)
+			struct rte_ipv4_hdr *ipv4_hdr = (struct rte_ipv4_hdr *)
 					((char *)(eth_hdr + 1) + vlan_offset);
 			size_t ip_hdr_offset;
 
@@ -873,7 +873,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
 				}
 			}
 		} else if  (rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6) == proto) {
-			struct ipv6_hdr *ipv6_hdr = (struct ipv6_hdr *)
+			struct rte_ipv6_hdr *ipv6_hdr = (struct rte_ipv6_hdr *)
 					((char *)(eth_hdr + 1) + vlan_offset);
 			l3hash = ipv6_hash(ipv6_hdr);
 
drivers/net/dpaa/dpaa_rxtx.c +4 -4
index a51469373..9aa31ad42 100644
@@ -200,22 +200,22 @@ static inline void dpaa_checksum(struct rte_mbuf *mbuf)
 {
 	struct rte_ether_hdr *eth_hdr = rte_pktmbuf_mtod(mbuf, struct rte_ether_hdr *);
 	char *l3_hdr = (char *)eth_hdr + mbuf->l2_len;
-	struct ipv4_hdr *ipv4_hdr = (struct ipv4_hdr *)l3_hdr;
-	struct ipv6_hdr *ipv6_hdr = (struct ipv6_hdr *)l3_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr = (struct rte_ipv4_hdr *)l3_hdr;
+	struct rte_ipv6_hdr *ipv6_hdr = (struct rte_ipv6_hdr *)l3_hdr;
 
 	DPAA_DP_LOG(DEBUG, "Calculating checksum for mbuf: %p", mbuf);
 
 	if (((mbuf->packet_type & RTE_PTYPE_L3_MASK) == RTE_PTYPE_L3_IPV4) ||
 	    ((mbuf->packet_type & RTE_PTYPE_L3_MASK) ==
 	    RTE_PTYPE_L3_IPV4_EXT)) {
-		ipv4_hdr = (struct ipv4_hdr *)l3_hdr;
+		ipv4_hdr = (struct rte_ipv4_hdr *)l3_hdr;
 		ipv4_hdr->hdr_checksum = 0;
 		ipv4_hdr->hdr_checksum = rte_ipv4_cksum(ipv4_hdr);
 	} else if (((mbuf->packet_type & RTE_PTYPE_L3_MASK) ==
 		   RTE_PTYPE_L3_IPV6) ||
 		   ((mbuf->packet_type & RTE_PTYPE_L3_MASK) ==
 		   RTE_PTYPE_L3_IPV6_EXT))
-		ipv6_hdr = (struct ipv6_hdr *)l3_hdr;
+		ipv6_hdr = (struct rte_ipv6_hdr *)l3_hdr;
 
 	if ((mbuf->packet_type & RTE_PTYPE_L4_MASK) == RTE_PTYPE_L4_TCP) {
 		struct tcp_hdr *tcp_hdr = (struct tcp_hdr *)(l3_hdr +
drivers/net/e1000/em_rxtx.c +1 -1
index 6de335fb6..84c0c537b 100644
@@ -220,7 +220,7 @@ em_set_xmit_ctx(struct em_tx_queue* txq,
 	/* setup IPCS* fields */
 	ctx.lower_setup.ip_fields.ipcss = (uint8_t)l2len;
 	ctx.lower_setup.ip_fields.ipcso = (uint8_t)(l2len +
-			offsetof(struct ipv4_hdr, hdr_checksum));
+			offsetof(struct rte_ipv4_hdr, hdr_checksum));
 
 	/*
 	 * When doing checksum or TCP segmentation with IPv6 headers,
drivers/net/ena/ena_ethdev.c +2 -2
index 7bf8dd44c..6cf4259fe 100644
@@ -1949,7 +1949,7 @@ eth_ena_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 	uint32_t i;
 	struct rte_mbuf *m;
 	struct ena_ring *tx_ring = (struct ena_ring *)(tx_queue);
-	struct ipv4_hdr *ip_hdr;
+	struct rte_ipv4_hdr *ip_hdr;
 	uint64_t ol_flags;
 	uint16_t frag_field;
 
@@ -1966,7 +1966,7 @@ eth_ena_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		if (unlikely(m->l2_len == 0))
 			m->l2_len = sizeof(struct rte_ether_hdr);
 
-		ip_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
+		ip_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *,
 						 m->l2_len);
 		frag_field = rte_be_to_cpu_16(ip_hdr->fragment_offset);
 
drivers/net/enic/enic_clsf.c +8 -8
index 9d95201ec..ddfa52776 100644
@@ -176,9 +176,9 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 	    input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_TCP ||
 	    input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_SCTP ||
 	    input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_OTHER) {
-		struct ipv4_hdr ip4_mask, ip4_val;
-		memset(&ip4_mask, 0, sizeof(struct ipv4_hdr));
-		memset(&ip4_val, 0, sizeof(struct ipv4_hdr));
+		struct rte_ipv4_hdr ip4_mask, ip4_val;
+		memset(&ip4_mask, 0, sizeof(struct rte_ipv4_hdr));
+		memset(&ip4_val, 0, sizeof(struct rte_ipv4_hdr));
 
 		if (input->flow.ip4_flow.tos) {
 			ip4_mask.type_of_service = masks->ipv4_mask.tos;
@@ -202,7 +202,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 		}
 
 		enic_set_layer(gp, FILTER_GENERIC_1_IPV4, FILTER_GENERIC_1_L3,
-			       &ip4_mask, &ip4_val, sizeof(struct ipv4_hdr));
+			       &ip4_mask, &ip4_val, sizeof(struct rte_ipv4_hdr));
 	}
 
 	if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_UDP) {
@@ -264,9 +264,9 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 	    input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_TCP ||
 	    input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_SCTP ||
 	    input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_OTHER) {
-		struct ipv6_hdr ipv6_mask, ipv6_val;
-		memset(&ipv6_mask, 0, sizeof(struct ipv6_hdr));
-		memset(&ipv6_val, 0, sizeof(struct ipv6_hdr));
+		struct rte_ipv6_hdr ipv6_mask, ipv6_val;
+		memset(&ipv6_mask, 0, sizeof(struct rte_ipv6_hdr));
+		memset(&ipv6_val, 0, sizeof(struct rte_ipv6_hdr));
 
 		if (input->flow.ipv6_flow.proto) {
 			ipv6_mask.proto = masks->ipv6_mask.proto;
@@ -290,7 +290,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 		}
 
 		enic_set_layer(gp, FILTER_GENERIC_1_IPV6, FILTER_GENERIC_1_L3,
-			       &ipv6_mask, &ipv6_val, sizeof(struct ipv6_hdr));
+			       &ipv6_mask, &ipv6_val, sizeof(struct rte_ipv6_hdr));
 	}
 }
 
drivers/net/enic/enic_flow.c +13 -13
index c964a5e78..ede89c8f8 100644
@@ -347,7 +347,7 @@ enic_copy_item_ipv4_v1(const struct rte_flow_item *item,
 	const struct rte_flow_item_ipv4 *spec = item->spec;
 	const struct rte_flow_item_ipv4 *mask = item->mask;
 	struct filter_ipv4_5tuple *enic_5tup = &enic_filter->u.ipv4;
-	struct ipv4_hdr supported_mask = {
+	struct rte_ipv4_hdr supported_mask = {
 		.src_addr = 0xffffffff,
 		.dst_addr = 0xffffffff,
 	};
@@ -635,19 +635,19 @@ enic_copy_item_ipv4_v2(const struct rte_flow_item *item,
 			mask = &rte_flow_item_ipv4_mask;
 
 		memcpy(gp->layer[FILTER_GENERIC_1_L3].mask, &mask->hdr,
-		       sizeof(struct ipv4_hdr));
+		       sizeof(struct rte_ipv4_hdr));
 		memcpy(gp->layer[FILTER_GENERIC_1_L3].val, &spec->hdr,
-		       sizeof(struct ipv4_hdr));
+		       sizeof(struct rte_ipv4_hdr));
 	} else {
 		/* Inner IPv4 header. Mask/Val start at *inner_ofst into L5 */
-		if ((*inner_ofst + sizeof(struct ipv4_hdr)) >
+		if ((*inner_ofst + sizeof(struct rte_ipv4_hdr)) >
 		     FILTER_GENERIC_1_KEY_LEN)
 			return ENOTSUP;
 		memcpy(&gp->layer[FILTER_GENERIC_1_L5].mask[*inner_ofst],
-		       mask, sizeof(struct ipv4_hdr));
+		       mask, sizeof(struct rte_ipv4_hdr));
 		memcpy(&gp->layer[FILTER_GENERIC_1_L5].val[*inner_ofst],
-		       spec, sizeof(struct ipv4_hdr));
-		*inner_ofst += sizeof(struct ipv4_hdr);
+		       spec, sizeof(struct rte_ipv4_hdr));
+		*inner_ofst += sizeof(struct rte_ipv4_hdr);
 	}
 	return 0;
 }
@@ -685,19 +685,19 @@ enic_copy_item_ipv6_v2(const struct rte_flow_item *item,
 
 	if (*inner_ofst == 0) {
 		memcpy(gp->layer[FILTER_GENERIC_1_L3].mask, &mask->hdr,
-		       sizeof(struct ipv6_hdr));
+		       sizeof(struct rte_ipv6_hdr));
 		memcpy(gp->layer[FILTER_GENERIC_1_L3].val, &spec->hdr,
-		       sizeof(struct ipv6_hdr));
+		       sizeof(struct rte_ipv6_hdr));
 	} else {
 		/* Inner IPv6 header. Mask/Val start at *inner_ofst into L5 */
-		if ((*inner_ofst + sizeof(struct ipv6_hdr)) >
+		if ((*inner_ofst + sizeof(struct rte_ipv6_hdr)) >
 		     FILTER_GENERIC_1_KEY_LEN)
 			return ENOTSUP;
 		memcpy(&gp->layer[FILTER_GENERIC_1_L5].mask[*inner_ofst],
-		       mask, sizeof(struct ipv6_hdr));
+		       mask, sizeof(struct rte_ipv6_hdr));
 		memcpy(&gp->layer[FILTER_GENERIC_1_L5].val[*inner_ofst],
-		       spec, sizeof(struct ipv6_hdr));
-		*inner_ofst += sizeof(struct ipv6_hdr);
+		       spec, sizeof(struct rte_ipv6_hdr));
+		*inner_ofst += sizeof(struct rte_ipv6_hdr);
 	}
 	return 0;
 }
drivers/net/i40e/i40e_fdir.c +18 -18
index 4aaf27f7c..b20f30fb4 100644
@@ -686,8 +686,8 @@ i40e_fdir_fill_eth_ip_head(const struct rte_eth_fdir_input *fdir_input,
 	static uint8_t vlan_frame[] = {0x81, 0, 0, 0};
 	uint16_t *ether_type;
 	uint8_t len = 2 * sizeof(struct rte_ether_addr);
-	struct ipv4_hdr *ip;
-	struct ipv6_hdr *ip6;
+	struct rte_ipv4_hdr *ip;
+	struct rte_ipv6_hdr *ip6;
 	static const uint8_t next_proto[] = {
 		[RTE_ETH_FLOW_FRAG_IPV4] = IPPROTO_IP,
 		[RTE_ETH_FLOW_NONFRAG_IPV4_TCP] = IPPROTO_TCP,
@@ -723,7 +723,7 @@ i40e_fdir_fill_eth_ip_head(const struct rte_eth_fdir_input *fdir_input,
 	case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP:
 	case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER:
 	case RTE_ETH_FLOW_FRAG_IPV4:
-		ip = (struct ipv4_hdr *)raw_pkt;
+		ip = (struct rte_ipv4_hdr *)raw_pkt;
 
 		*ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
 		ip->version_ihl = I40E_FDIR_IP_DEFAULT_VERSION_IHL;
@@ -743,14 +743,14 @@ i40e_fdir_fill_eth_ip_head(const struct rte_eth_fdir_input *fdir_input,
 		 */
 		ip->src_addr = fdir_input->flow.ip4_flow.dst_ip;
 		ip->dst_addr = fdir_input->flow.ip4_flow.src_ip;
-		len += sizeof(struct ipv4_hdr);
+		len += sizeof(struct rte_ipv4_hdr);
 		break;
 	case RTE_ETH_FLOW_NONFRAG_IPV6_TCP:
 	case RTE_ETH_FLOW_NONFRAG_IPV6_UDP:
 	case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP:
 	case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER:
 	case RTE_ETH_FLOW_FRAG_IPV6:
-		ip6 = (struct ipv6_hdr *)raw_pkt;
+		ip6 = (struct rte_ipv6_hdr *)raw_pkt;
 
 		*ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6);
 		ip6->vtc_flow =
@@ -776,7 +776,7 @@ i40e_fdir_fill_eth_ip_head(const struct rte_eth_fdir_input *fdir_input,
 		rte_memcpy(&(ip6->dst_addr),
 			   &(fdir_input->flow.ipv6_flow.src_ip),
 			   IPV6_ADDR_LEN);
-		len += sizeof(struct ipv6_hdr);
+		len += sizeof(struct rte_ipv6_hdr);
 		break;
 	default:
 		PMD_DRV_LOG(ERR, "unknown flow type %u.",
@@ -960,8 +960,8 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 	static uint8_t vlan_frame[] = {0x81, 0, 0, 0};
 	uint16_t *ether_type;
 	uint8_t len = 2 * sizeof(struct rte_ether_addr);
-	struct ipv4_hdr *ip;
-	struct ipv6_hdr *ip6;
+	struct rte_ipv4_hdr *ip;
+	struct rte_ipv6_hdr *ip6;
 	uint8_t pctype = fdir_input->pctype;
 	bool is_customized_pctype = fdir_input->flow_ext.customized_pctype;
 	static const uint8_t next_proto[] = {
@@ -1007,7 +1007,7 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 		 pctype == I40E_FILTER_PCTYPE_NONF_IPV4_OTHER ||
 		 pctype == I40E_FILTER_PCTYPE_FRAG_IPV4 ||
 		 is_customized_pctype) {
-		ip = (struct ipv4_hdr *)raw_pkt;
+		ip = (struct rte_ipv4_hdr *)raw_pkt;
 
 		*ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
 		ip->version_ihl = I40E_FDIR_IP_DEFAULT_VERSION_IHL;
@@ -1034,13 +1034,13 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 			 cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV6 ||
 			 cus_pctype->index == I40E_CUSTOMIZED_GTPU)
 			ip->next_proto_id = IPPROTO_UDP;
-		len += sizeof(struct ipv4_hdr);
+		len += sizeof(struct rte_ipv4_hdr);
 	} else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_TCP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_UDP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_SCTP ||
 		   pctype == I40E_FILTER_PCTYPE_NONF_IPV6_OTHER ||
 		   pctype == I40E_FILTER_PCTYPE_FRAG_IPV6) {
-		ip6 = (struct ipv6_hdr *)raw_pkt;
+		ip6 = (struct rte_ipv6_hdr *)raw_pkt;
 
 		*ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6);
 		ip6->vtc_flow =
@@ -1066,7 +1066,7 @@ i40e_flow_fdir_fill_eth_ip_head(struct i40e_pf *pf,
 		rte_memcpy(&ip6->dst_addr,
 			   &fdir_input->flow.ipv6_flow.src_ip,
 			   IPV6_ADDR_LEN);
-		len += sizeof(struct ipv6_hdr);
+		len += sizeof(struct rte_ipv6_hdr);
 	} else {
 		PMD_DRV_LOG(ERR, "unknown pctype %u.",
 			    fdir_input->pctype);
@@ -1093,8 +1093,8 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 	struct tcp_hdr *tcp;
 	struct sctp_hdr *sctp;
 	struct rte_flow_item_gtp *gtp;
-	struct ipv4_hdr *gtp_ipv4;
-	struct ipv6_hdr *gtp_ipv6;
+	struct rte_ipv4_hdr *gtp_ipv4;
+	struct rte_ipv6_hdr *gtp_ipv6;
 	uint8_t size, dst = 0;
 	uint8_t i, pit_idx, set_idx = I40E_FLXPLD_L4_IDX; /* use l4 by default*/
 	int len;
@@ -1232,7 +1232,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 
 			if (cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV4) {
 				gtp->msg_type = I40E_FDIR_GTP_MSG_TYPE_0XFF;
-				gtp_ipv4 = (struct ipv4_hdr *)
+				gtp_ipv4 = (struct rte_ipv4_hdr *)
 					((unsigned char *)gtp +
 					 sizeof(struct rte_flow_item_gtp));
 				gtp_ipv4->version_ihl =
@@ -1242,11 +1242,11 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 					rte_cpu_to_be_16(
 						I40E_FDIR_INNER_IP_DEFAULT_LEN);
 				payload = (unsigned char *)gtp_ipv4 +
-					sizeof(struct ipv4_hdr);
+					sizeof(struct rte_ipv4_hdr);
 			} else if (cus_pctype->index ==
 				   I40E_CUSTOMIZED_GTPU_IPV6) {
 				gtp->msg_type = I40E_FDIR_GTP_MSG_TYPE_0XFF;
-				gtp_ipv6 = (struct ipv6_hdr *)
+				gtp_ipv6 = (struct rte_ipv6_hdr *)
 					((unsigned char *)gtp +
 					 sizeof(struct rte_flow_item_gtp));
 				gtp_ipv6->vtc_flow =
@@ -1260,7 +1260,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 				gtp_ipv6->hop_limits =
 					I40E_FDIR_IPv6_DEFAULT_HOP_LIMITS;
 				payload = (unsigned char *)gtp_ipv6 +
-					sizeof(struct ipv6_hdr);
+					sizeof(struct rte_ipv6_hdr);
 			} else
 				payload = (unsigned char *)gtp +
 					sizeof(struct rte_flow_item_gtp);
drivers/net/mlx5/mlx5_flow.c +3 -3
index bd70fce24..d99e2c526 100644
@@ -2494,13 +2494,13 @@ mlx5_fdir_filter_convert(struct rte_eth_dev *dev,
 	case RTE_ETH_FLOW_NONFRAG_IPV4_UDP:
 	case RTE_ETH_FLOW_NONFRAG_IPV4_TCP:
 	case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER:
-		attributes->l3.ipv4.hdr = (struct ipv4_hdr){
+		attributes->l3.ipv4.hdr = (struct rte_ipv4_hdr){
 			.src_addr = input->flow.ip4_flow.src_ip,
 			.dst_addr = input->flow.ip4_flow.dst_ip,
 			.time_to_live = input->flow.ip4_flow.ttl,
 			.type_of_service = input->flow.ip4_flow.tos,
 		};
-		attributes->l3_mask.ipv4.hdr = (struct ipv4_hdr){
+		attributes->l3_mask.ipv4.hdr = (struct rte_ipv4_hdr){
 			.src_addr = mask->ipv4_mask.src_ip,
 			.dst_addr = mask->ipv4_mask.dst_ip,
 			.time_to_live = mask->ipv4_mask.ttl,
@@ -2516,7 +2516,7 @@ mlx5_fdir_filter_convert(struct rte_eth_dev *dev,
 	case RTE_ETH_FLOW_NONFRAG_IPV6_UDP:
 	case RTE_ETH_FLOW_NONFRAG_IPV6_TCP:
 	case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER:
-		attributes->l3.ipv6.hdr = (struct ipv6_hdr){
+		attributes->l3.ipv6.hdr = (struct rte_ipv6_hdr){
 			.hop_limits = input->flow.ipv6_flow.hop_limits,
 			.proto = input->flow.ipv6_flow.proto,
 		};
drivers/net/mlx5/mlx5_flow_tcf.c +6 -6
index e4dea1197..f287762a4 100644
@@ -408,12 +408,12 @@ flow_tcf_pedit_key_set_dec_ttl(const struct rte_flow_action *actions,
 	if (item_flags & MLX5_FLOW_LAYER_OUTER_L3_IPV4) {
 		p_parser->keys_ex[idx].htype = TCA_PEDIT_KEY_EX_HDR_TYPE_IP4;
 		p_parser->keys[idx].off =
-			offsetof(struct ipv4_hdr, time_to_live);
+			offsetof(struct rte_ipv4_hdr, time_to_live);
 	}
 	if (item_flags & MLX5_FLOW_LAYER_OUTER_L3_IPV6) {
 		p_parser->keys_ex[idx].htype = TCA_PEDIT_KEY_EX_HDR_TYPE_IP6;
 		p_parser->keys[idx].off =
-			offsetof(struct ipv6_hdr, hop_limits);
+			offsetof(struct rte_ipv6_hdr, hop_limits);
 	}
 	if (actions->type == RTE_FLOW_ACTION_TYPE_DEC_TTL) {
 		p_parser->keys_ex[idx].cmd = TCA_PEDIT_KEY_EX_CMD_ADD;
@@ -477,8 +477,8 @@ flow_tcf_pedit_key_set_ipv6_addr(const struct rte_flow_action *actions,
 	int keys = NUM_OF_PEDIT_KEYS(IPV6_ADDR_LEN);
 	int off_base =
 		actions->type == RTE_FLOW_ACTION_TYPE_SET_IPV6_SRC ?
-		offsetof(struct ipv6_hdr, src_addr) :
-		offsetof(struct ipv6_hdr, dst_addr);
+		offsetof(struct rte_ipv6_hdr, src_addr) :
+		offsetof(struct rte_ipv6_hdr, dst_addr);
 	const struct rte_flow_action_set_ipv6 *conf =
 		(const struct rte_flow_action_set_ipv6 *)actions->conf;
 
@@ -512,8 +512,8 @@ flow_tcf_pedit_key_set_ipv4_addr(const struct rte_flow_action *actions,
 	p_parser->keys_ex[idx].cmd = TCA_PEDIT_KEY_EX_CMD_SET;
 	p_parser->keys[idx].off =
 		actions->type == RTE_FLOW_ACTION_TYPE_SET_IPV4_SRC ?
-		offsetof(struct ipv4_hdr, src_addr) :
-		offsetof(struct ipv4_hdr, dst_addr);
+		offsetof(struct rte_ipv4_hdr, src_addr) :
+		offsetof(struct rte_ipv4_hdr, dst_addr);
 	p_parser->keys[idx].mask = ~UINT32_MAX;
 	p_parser->keys[idx].val =
 		((const struct rte_flow_action_set_ipv4 *)
drivers/net/mvpp2/mrvl_flow.c +1 -1
index 738986575..381b54e29 100644
@@ -1170,7 +1170,7 @@ mrvl_parse_ip6(const struct rte_flow_item *item,
 	       struct rte_flow_error *error)
 {
 	const struct rte_flow_item_ipv6 *spec = NULL, *mask = NULL;
-	struct ipv6_hdr zero;
+	struct rte_ipv6_hdr zero;
 	uint32_t flow_mask;
 	int ret;
 
drivers/net/qede/qede_filter.c +7 -7
index 12c83f46d..34299b993 100644
@@ -457,8 +457,8 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev,
 	struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
 	uint16_t *ether_type;
 	uint8_t *raw_pkt;
-	struct ipv4_hdr *ip;
-	struct ipv6_hdr *ip6;
+	struct rte_ipv4_hdr *ip;
+	struct rte_ipv6_hdr *ip6;
 	struct udp_hdr *udp;
 	struct tcp_hdr *tcp;
 	uint16_t len;
@@ -474,14 +474,14 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev,
 	*ether_type = rte_cpu_to_be_16(arfs->tuple.eth_proto);
 	switch (arfs->tuple.eth_proto) {
 	case RTE_ETHER_TYPE_IPv4:
-		ip = (struct ipv4_hdr *)raw_pkt;
+		ip = (struct rte_ipv4_hdr *)raw_pkt;
 		ip->version_ihl = QEDE_FDIR_IP_DEFAULT_VERSION_IHL;
-		ip->total_length = sizeof(struct ipv4_hdr);
+		ip->total_length = sizeof(struct rte_ipv4_hdr);
 		ip->next_proto_id = arfs->tuple.ip_proto;
 		ip->time_to_live = QEDE_FDIR_IPV4_DEF_TTL;
 		ip->dst_addr = arfs->tuple.dst_ipv4;
 		ip->src_addr = arfs->tuple.src_ipv4;
-		len += sizeof(struct ipv4_hdr);
+		len += sizeof(struct rte_ipv4_hdr);
 		params->ipv4 = true;
 
 		raw_pkt = (uint8_t *)buff;
@@ -507,7 +507,7 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev,
 		}
 		break;
 	case RTE_ETHER_TYPE_IPv6:
-		ip6 = (struct ipv6_hdr *)raw_pkt;
+		ip6 = (struct rte_ipv6_hdr *)raw_pkt;
 		ip6->proto = arfs->tuple.ip_proto;
 		ip6->vtc_flow =
 			rte_cpu_to_be_32(QEDE_FDIR_IPV6_DEFAULT_VTC_FLOW);
@@ -516,7 +516,7 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev,
 			   IPV6_ADDR_LEN);
 		rte_memcpy(&ip6->dst_addr, arfs->tuple.dst_ipv6,
 			   IPV6_ADDR_LEN);
-		len += sizeof(struct ipv6_hdr);
+		len += sizeof(struct rte_ipv6_hdr);
 		params->ipv6 = true;
 
 		raw_pkt = (uint8_t *)buff;
drivers/net/qede/qede_rxtx.c +6 -6
index 103eeb509..2debac294 100644
@@ -903,8 +903,8 @@ static inline uint32_t qede_rx_cqe_to_pkt_type_outer(struct rte_mbuf *m)
 {
 	uint32_t packet_type = RTE_PTYPE_UNKNOWN;
 	struct rte_ether_hdr *eth_hdr;
-	struct ipv4_hdr *ipv4_hdr;
-	struct ipv6_hdr *ipv6_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
+	struct rte_ipv6_hdr *ipv6_hdr;
 	struct rte_vlan_hdr *vlan_hdr;
 	uint16_t ethertype;
 	bool vlan_tagged = 0;
@@ -924,14 +924,14 @@ static inline uint32_t qede_rx_cqe_to_pkt_type_outer(struct rte_mbuf *m)
 
 	if (ethertype == RTE_ETHER_TYPE_IPv4) {
 		packet_type |= RTE_PTYPE_L3_IPV4;
-		ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, len);
+		ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *, len);
 		if (ipv4_hdr->next_proto_id == IPPROTO_TCP)
 			packet_type |= RTE_PTYPE_L4_TCP;
 		else if (ipv4_hdr->next_proto_id == IPPROTO_UDP)
 			packet_type |= RTE_PTYPE_L4_UDP;
 	} else if (ethertype == RTE_ETHER_TYPE_IPv6) {
 		packet_type |= RTE_PTYPE_L3_IPV6;
-		ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *, len);
+		ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv6_hdr *, len);
 		if (ipv6_hdr->proto == IPPROTO_TCP)
 			packet_type |= RTE_PTYPE_L4_TCP;
 		else if (ipv6_hdr->proto == IPPROTO_UDP)
@@ -1093,7 +1093,7 @@ static inline uint32_t qede_rx_cqe_to_pkt_type(uint16_t flags)
 static inline uint8_t
 qede_check_notunn_csum_l3(struct rte_mbuf *m, uint16_t flag)
 {
-	struct ipv4_hdr *ip;
+	struct rte_ipv4_hdr *ip;
 	uint16_t pkt_csum;
 	uint16_t calc_csum;
 	uint16_t val;
@@ -1104,7 +1104,7 @@ qede_check_notunn_csum_l3(struct rte_mbuf *m, uint16_t flag)
 	if (unlikely(val)) {
 		m->packet_type = qede_rx_cqe_to_pkt_type(flag);
 		if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
-			ip = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
+			ip = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *,
 					   sizeof(struct rte_ether_hdr));
 			pkt_csum = ip->hdr_checksum;
 			ip->hdr_checksum = 0;
drivers/net/sfc/sfc_ef10_tx.c +2 -2
index bcd3153ff..e52de8ebd 100644
@@ -423,9 +423,9 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg,
 
 	switch (first_m_seg->ol_flags & (PKT_TX_IPV4 | PKT_TX_IPV6)) {
 	case PKT_TX_IPV4: {
-		const struct ipv4_hdr *iphe4;
+		const struct rte_ipv4_hdr *iphe4;
 
-		iphe4 = (const struct ipv4_hdr *)(hdr_addr + iph_off);
+		iphe4 = (const struct rte_ipv4_hdr *)(hdr_addr + iph_off);
 		rte_memcpy(&packet_id, &iphe4->packet_id, sizeof(uint16_t));
 		packet_id = rte_be_to_cpu_16(packet_id);
 		break;
drivers/net/sfc/sfc_tso.c +2 -2
index 076a25d44..cfa5c037a 100644
@@ -146,9 +146,9 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,
 
 	/* Handle IP header */
 	if (m->ol_flags & PKT_TX_IPV4) {
-		const struct ipv4_hdr *iphe4;
+		const struct rte_ipv4_hdr *iphe4;
 
-		iphe4 = (const struct ipv4_hdr *)(tsoh + nh_off);
+		iphe4 = (const struct rte_ipv4_hdr *)(tsoh + nh_off);
 		rte_memcpy(&packet_id, &iphe4->packet_id, sizeof(uint16_t));
 		packet_id = rte_be_to_cpu_16(packet_id);
 	} else if (m->ol_flags & PKT_TX_IPV6) {
drivers/net/softnic/rte_eth_softnic_pipeline.c +16 -16
index 3d37ba3fe..4e6735c75 100644
@@ -592,7 +592,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = {
 		.size = sizeof(uint8_t),
 		.field_index = 0,
 		.input_index = 0,
-		.offset = offsetof(struct ipv4_hdr, next_proto_id),
+		.offset = offsetof(struct rte_ipv4_hdr, next_proto_id),
 	},
 
 	/* Source IP address (IPv4) */
@@ -601,7 +601,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 1,
 		.input_index = 1,
-		.offset = offsetof(struct ipv4_hdr, src_addr),
+		.offset = offsetof(struct rte_ipv4_hdr, src_addr),
 	},
 
 	/* Destination IP address (IPv4) */
@@ -610,7 +610,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 2,
 		.input_index = 2,
-		.offset = offsetof(struct ipv4_hdr, dst_addr),
+		.offset = offsetof(struct rte_ipv4_hdr, dst_addr),
 	},
 
 	/* Source Port */
@@ -619,7 +619,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = {
 		.size = sizeof(uint16_t),
 		.field_index = 3,
 		.input_index = 3,
-		.offset = sizeof(struct ipv4_hdr) +
+		.offset = sizeof(struct rte_ipv4_hdr) +
 			offsetof(struct tcp_hdr, src_port),
 	},
 
@@ -629,7 +629,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = {
 		.size = sizeof(uint16_t),
 		.field_index = 4,
 		.input_index = 3,
-		.offset = sizeof(struct ipv4_hdr) +
+		.offset = sizeof(struct rte_ipv4_hdr) +
 			offsetof(struct tcp_hdr, dst_port),
 	},
 };
@@ -641,7 +641,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint8_t),
 		.field_index = 0,
 		.input_index = 0,
-		.offset = offsetof(struct ipv6_hdr, proto),
+		.offset = offsetof(struct rte_ipv6_hdr, proto),
 	},
 
 	/* Source IP address (IPv6) */
@@ -650,7 +650,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 1,
 		.input_index = 1,
-		.offset = offsetof(struct ipv6_hdr, src_addr[0]),
+		.offset = offsetof(struct rte_ipv6_hdr, src_addr[0]),
 	},
 
 	[2] = {
@@ -658,7 +658,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 2,
 		.input_index = 2,
-		.offset = offsetof(struct ipv6_hdr, src_addr[4]),
+		.offset = offsetof(struct rte_ipv6_hdr, src_addr[4]),
 	},
 
 	[3] = {
@@ -666,7 +666,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 3,
 		.input_index = 3,
-		.offset = offsetof(struct ipv6_hdr, src_addr[8]),
+		.offset = offsetof(struct rte_ipv6_hdr, src_addr[8]),
 	},
 
 	[4] = {
@@ -674,7 +674,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 4,
 		.input_index = 4,
-		.offset = offsetof(struct ipv6_hdr, src_addr[12]),
+		.offset = offsetof(struct rte_ipv6_hdr, src_addr[12]),
 	},
 
 	/* Destination IP address (IPv6) */
@@ -683,7 +683,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 5,
 		.input_index = 5,
-		.offset = offsetof(struct ipv6_hdr, dst_addr[0]),
+		.offset = offsetof(struct rte_ipv6_hdr, dst_addr[0]),
 	},
 
 	[6] = {
@@ -691,7 +691,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 6,
 		.input_index = 6,
-		.offset = offsetof(struct ipv6_hdr, dst_addr[4]),
+		.offset = offsetof(struct rte_ipv6_hdr, dst_addr[4]),
 	},
 
 	[7] = {
@@ -699,7 +699,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 7,
 		.input_index = 7,
-		.offset = offsetof(struct ipv6_hdr, dst_addr[8]),
+		.offset = offsetof(struct rte_ipv6_hdr, dst_addr[8]),
 	},
 
 	[8] = {
@@ -707,7 +707,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 8,
 		.input_index = 8,
-		.offset = offsetof(struct ipv6_hdr, dst_addr[12]),
+		.offset = offsetof(struct rte_ipv6_hdr, dst_addr[12]),
 	},
 
 	/* Source Port */
@@ -716,7 +716,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint16_t),
 		.field_index = 9,
 		.input_index = 9,
-		.offset = sizeof(struct ipv6_hdr) +
+		.offset = sizeof(struct rte_ipv6_hdr) +
 			offsetof(struct tcp_hdr, src_port),
 	},
 
@@ -726,7 +726,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint16_t),
 		.field_index = 10,
 		.input_index = 9,
-		.offset = sizeof(struct ipv6_hdr) +
+		.offset = sizeof(struct rte_ipv6_hdr) +
 			offsetof(struct tcp_hdr, dst_port),
 	},
 };
drivers/net/tap/rte_eth_tap.c +4 -4
index f50b12fa0..3d7f56a9a 100644
@@ -253,12 +253,12 @@ tap_verify_csum(struct rte_mbuf *mbuf)
 	else if (l2 == RTE_PTYPE_L2_ETHER_QINQ)
 		l2_len += 8;
 	/* Don't verify checksum for packets with discontinuous L2 header */
-	if (unlikely(l2_len + sizeof(struct ipv4_hdr) >
+	if (unlikely(l2_len + sizeof(struct rte_ipv4_hdr) >
 		     rte_pktmbuf_data_len(mbuf)))
 		return;
 	l3_hdr = rte_pktmbuf_mtod_offset(mbuf, void *, l2_len);
 	if (l3 == RTE_PTYPE_L3_IPV4 || l3 == RTE_PTYPE_L3_IPV4_EXT) {
-		struct ipv4_hdr *iph = l3_hdr;
+		struct rte_ipv4_hdr *iph = l3_hdr;
 
 		/* ihl contains the number of 4-byte words in the header */
 		l3_len = 4 * (iph->version_ihl & 0xf);
@@ -270,7 +270,7 @@ tap_verify_csum(struct rte_mbuf *mbuf)
 			PKT_RX_IP_CKSUM_BAD :
 			PKT_RX_IP_CKSUM_GOOD;
 	} else if (l3 == RTE_PTYPE_L3_IPV6) {
-		l3_len = sizeof(struct ipv6_hdr);
+		l3_len = sizeof(struct rte_ipv6_hdr);
 	} else {
 		/* IPv6 extensions are not supported */
 		return;
@@ -461,7 +461,7 @@ tap_tx_l3_cksum(char *packet, uint64_t ol_flags, unsigned int l2_len,
 	void *l3_hdr = packet + l2_len;
 
 	if (ol_flags & (PKT_TX_IP_CKSUM | PKT_TX_IPV4)) {
-		struct ipv4_hdr *iph = l3_hdr;
+		struct rte_ipv4_hdr *iph = l3_hdr;
 		uint16_t cksum;
 
 		iph->hdr_checksum = 0;
drivers/net/virtio/virtio_rxtx.c +4 -4
index ce91c59f2..b36450871 100644
@@ -316,13 +316,13 @@ virtio_tso_fix_cksum(struct rte_mbuf *m)
 	/* common case: header is not fragmented */
 	if (likely(rte_pktmbuf_data_len(m) >= m->l2_len + m->l3_len +
 			m->l4_len)) {
-		struct ipv4_hdr *iph;
-		struct ipv6_hdr *ip6h;
+		struct rte_ipv4_hdr *iph;
+		struct rte_ipv6_hdr *ip6h;
 		struct tcp_hdr *th;
 		uint16_t prev_cksum, new_cksum, ip_len, ip_paylen;
 		uint32_t tmp;
 
-		iph = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, m->l2_len);
+		iph = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *, m->l2_len);
 		th = RTE_PTR_ADD(iph, m->l3_len);
 		if ((iph->version_ihl >> 4) == 4) {
 			iph->hdr_checksum = 0;
@@ -331,7 +331,7 @@ virtio_tso_fix_cksum(struct rte_mbuf *m)
 			ip_paylen = rte_cpu_to_be_16(rte_be_to_cpu_16(ip_len) -
 				m->l3_len);
 		} else {
-			ip6h = (struct ipv6_hdr *)iph;
+			ip6h = (struct rte_ipv6_hdr *)iph;
 			ip_paylen = ip6h->payload_len;
 		}
 
drivers/net/vmxnet3/vmxnet3_rxtx.c +9 -9
index ca3b1ef33..9f22d273c 100644
@@ -665,8 +665,8 @@ vmxnet3_guess_mss(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd,
 		struct rte_mbuf *rxm)
 {
 	uint32_t hlen, slen;
-	struct ipv4_hdr *ipv4_hdr;
-	struct ipv6_hdr *ipv6_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
+	struct rte_ipv6_hdr *ipv6_hdr;
 	struct tcp_hdr *tcp_hdr;
 	char *ptr;
 
@@ -677,20 +677,20 @@ vmxnet3_guess_mss(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd,
 	hlen = sizeof(struct rte_ether_hdr);
 
 	if (rcd->v4) {
-		if (unlikely(slen < hlen + sizeof(struct ipv4_hdr)))
-			return hw->mtu - sizeof(struct ipv4_hdr)
+		if (unlikely(slen < hlen + sizeof(struct rte_ipv4_hdr)))
+			return hw->mtu - sizeof(struct rte_ipv4_hdr)
 					- sizeof(struct tcp_hdr);
 
-		ipv4_hdr = (struct ipv4_hdr *)(ptr + hlen);
+		ipv4_hdr = (struct rte_ipv4_hdr *)(ptr + hlen);
 		hlen += (ipv4_hdr->version_ihl & IPV4_HDR_IHL_MASK) *
 				IPV4_IHL_MULTIPLIER;
 	} else if (rcd->v6) {
-		if (unlikely(slen < hlen + sizeof(struct ipv6_hdr)))
-			return hw->mtu - sizeof(struct ipv6_hdr) -
+		if (unlikely(slen < hlen + sizeof(struct rte_ipv6_hdr)))
+			return hw->mtu - sizeof(struct rte_ipv6_hdr) -
 					sizeof(struct tcp_hdr);
 
-		ipv6_hdr = (struct ipv6_hdr *)(ptr + hlen);
-		hlen += sizeof(struct ipv6_hdr);
+		ipv6_hdr = (struct rte_ipv6_hdr *)(ptr + hlen);
+		hlen += sizeof(struct rte_ipv6_hdr);
 		if (unlikely(ipv6_hdr->proto != IPPROTO_TCP)) {
 			int frag;
 
examples/bond/main.c +2 -2
index b5b66ebed..b257bf63f 100644
@@ -325,7 +325,7 @@ static int lcore_main(__attribute__((unused)) void *arg1)
 
 	struct rte_ether_hdr *eth_hdr;
 	struct rte_arp_hdr *arp_hdr;
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 	uint16_t ether_type, offset;
 
 	uint16_t rx_cnt;
@@ -390,7 +390,7 @@ static int lcore_main(__attribute__((unused)) void *arg1)
 					global_flag_stru_p->port_packets[2]++;
 					rte_spinlock_unlock(&global_flag_stru_p->lock);
 				 }
-				ipv4_hdr = (struct ipv4_hdr *)((char *)(eth_hdr + 1) + offset);
+				ipv4_hdr = (struct rte_ipv4_hdr *)((char *)(eth_hdr + 1) + offset);
 				if (ipv4_hdr->dst_addr == bond_ip) {
 					rte_ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
 					rte_eth_macaddr_get(BOND_PORT, &eth_hdr->s_addr);
examples/flow_classify/flow_classify.c +5 -5
index dfb7db1c9..c75a410f4 100644
@@ -99,7 +99,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {
 		.field_index = PROTO_FIELD_IPV4,
 		.input_index = PROTO_INPUT_IPV4,
 		.offset = sizeof(struct rte_ether_hdr) +
-			offsetof(struct ipv4_hdr, next_proto_id),
+			offsetof(struct rte_ipv4_hdr, next_proto_id),
 	},
 	/* next input field (IPv4 source address) - 4 consecutive bytes. */
 	{
@@ -109,7 +109,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {
 		.field_index = SRC_FIELD_IPV4,
 		.input_index = SRC_INPUT_IPV4,
 		.offset = sizeof(struct rte_ether_hdr) +
-			offsetof(struct ipv4_hdr, src_addr),
+			offsetof(struct rte_ipv4_hdr, src_addr),
 	},
 	/* next input field (IPv4 destination address) - 4 consecutive bytes. */
 	{
@@ -119,7 +119,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {
 		.field_index = DST_FIELD_IPV4,
 		.input_index = DST_INPUT_IPV4,
 		.offset = sizeof(struct rte_ether_hdr) +
-			offsetof(struct ipv4_hdr, dst_addr),
+			offsetof(struct rte_ipv4_hdr, dst_addr),
 	},
 	/*
 	 * Next 2 fields (src & dst ports) form 4 consecutive bytes.
@@ -132,7 +132,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {
 		.field_index = SRCP_FIELD_IPV4,
 		.input_index = SRCP_DESTP_INPUT_IPV4,
 		.offset = sizeof(struct rte_ether_hdr) +
-			sizeof(struct ipv4_hdr) +
+			sizeof(struct rte_ipv4_hdr) +
 			offsetof(struct tcp_hdr, src_port),
 	},
 	{
@@ -142,7 +142,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {
 		.field_index = DSTP_FIELD_IPV4,
 		.input_index = SRCP_DESTP_INPUT_IPV4,
 		.offset = sizeof(struct rte_ether_hdr) +
-			sizeof(struct ipv4_hdr) +
+			sizeof(struct rte_ipv4_hdr) +
 			offsetof(struct tcp_hdr, dst_port),
 	},
 };
examples/ip_fragmentation/main.c +6 -6
index f92b24912..42b1d2cb0 100644
@@ -58,8 +58,8 @@
 /*
  * Default payload in bytes for the IPv6 packet.
  */
-#define	IPV4_DEFAULT_PAYLOAD	(IPV4_MTU_DEFAULT - sizeof(struct ipv4_hdr))
-#define	IPV6_DEFAULT_PAYLOAD	(IPV6_MTU_DEFAULT - sizeof(struct ipv6_hdr))
+#define	IPV4_DEFAULT_PAYLOAD	(IPV4_MTU_DEFAULT - sizeof(struct rte_ipv4_hdr))
+#define	IPV6_DEFAULT_PAYLOAD	(IPV6_MTU_DEFAULT - sizeof(struct rte_ipv6_hdr))
 
 /*
  * Max number of fragments per packet expected - defined by config file.
@@ -251,10 +251,10 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
 
 	/* if this is an IPv4 packet */
 	if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
-		struct ipv4_hdr *ip_hdr;
+		struct rte_ipv4_hdr *ip_hdr;
 		uint32_t ip_dst;
 		/* Read the lookup key (i.e. ip_dst) from the input packet */
-		ip_hdr = rte_pktmbuf_mtod(m, struct ipv4_hdr *);
+		ip_hdr = rte_pktmbuf_mtod(m, struct rte_ipv4_hdr *);
 		ip_dst = rte_be_to_cpu_32(ip_hdr->dst_addr);
 
 		/* Find destination port */
@@ -286,12 +286,12 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
 		}
 	} else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
 		/* if this is an IPv6 packet */
-		struct ipv6_hdr *ip_hdr;
+		struct rte_ipv6_hdr *ip_hdr;
 
 		ipv6 = 1;
 
 		/* Read the lookup key (i.e. ip_dst) from the input packet */
-		ip_hdr = rte_pktmbuf_mtod(m, struct ipv6_hdr *);
+		ip_hdr = rte_pktmbuf_mtod(m, struct rte_ipv6_hdr *);
 
 		/* Find destination port */
 		if (rte_lpm6_lookup(rxq->lpm6, ip_hdr->dst_addr,
examples/ip_pipeline/pipeline.c +16 -16
index b23d6c09a..1e44fe37c 100644
@@ -636,7 +636,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = {
 		.size = sizeof(uint8_t),
 		.field_index = 0,
 		.input_index = 0,
-		.offset = offsetof(struct ipv4_hdr, next_proto_id),
+		.offset = offsetof(struct rte_ipv4_hdr, next_proto_id),
 	},
 
 	/* Source IP address (IPv4) */
@@ -645,7 +645,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 1,
 		.input_index = 1,
-		.offset = offsetof(struct ipv4_hdr, src_addr),
+		.offset = offsetof(struct rte_ipv4_hdr, src_addr),
 	},
 
 	/* Destination IP address (IPv4) */
@@ -654,7 +654,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 2,
 		.input_index = 2,
-		.offset = offsetof(struct ipv4_hdr, dst_addr),
+		.offset = offsetof(struct rte_ipv4_hdr, dst_addr),
 	},
 
 	/* Source Port */
@@ -663,7 +663,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = {
 		.size = sizeof(uint16_t),
 		.field_index = 3,
 		.input_index = 3,
-		.offset = sizeof(struct ipv4_hdr) +
+		.offset = sizeof(struct rte_ipv4_hdr) +
 			offsetof(struct tcp_hdr, src_port),
 	},
 
@@ -673,7 +673,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = {
 		.size = sizeof(uint16_t),
 		.field_index = 4,
 		.input_index = 3,
-		.offset = sizeof(struct ipv4_hdr) +
+		.offset = sizeof(struct rte_ipv4_hdr) +
 			offsetof(struct tcp_hdr, dst_port),
 	},
 };
@@ -685,7 +685,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint8_t),
 		.field_index = 0,
 		.input_index = 0,
-		.offset = offsetof(struct ipv6_hdr, proto),
+		.offset = offsetof(struct rte_ipv6_hdr, proto),
 	},
 
 	/* Source IP address (IPv6) */
@@ -694,7 +694,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 1,
 		.input_index = 1,
-		.offset = offsetof(struct ipv6_hdr, src_addr[0]),
+		.offset = offsetof(struct rte_ipv6_hdr, src_addr[0]),
 	},
 
 	[2] = {
@@ -702,7 +702,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 2,
 		.input_index = 2,
-		.offset = offsetof(struct ipv6_hdr, src_addr[4]),
+		.offset = offsetof(struct rte_ipv6_hdr, src_addr[4]),
 	},
 
 	[3] = {
@@ -710,7 +710,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 3,
 		.input_index = 3,
-		.offset = offsetof(struct ipv6_hdr, src_addr[8]),
+		.offset = offsetof(struct rte_ipv6_hdr, src_addr[8]),
 	},
 
 	[4] = {
@@ -718,7 +718,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 4,
 		.input_index = 4,
-		.offset = offsetof(struct ipv6_hdr, src_addr[12]),
+		.offset = offsetof(struct rte_ipv6_hdr, src_addr[12]),
 	},
 
 	/* Destination IP address (IPv6) */
@@ -727,7 +727,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 5,
 		.input_index = 5,
-		.offset = offsetof(struct ipv6_hdr, dst_addr[0]),
+		.offset = offsetof(struct rte_ipv6_hdr, dst_addr[0]),
 	},
 
 	[6] = {
@@ -735,7 +735,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 6,
 		.input_index = 6,
-		.offset = offsetof(struct ipv6_hdr, dst_addr[4]),
+		.offset = offsetof(struct rte_ipv6_hdr, dst_addr[4]),
 	},
 
 	[7] = {
@@ -743,7 +743,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 7,
 		.input_index = 7,
-		.offset = offsetof(struct ipv6_hdr, dst_addr[8]),
+		.offset = offsetof(struct rte_ipv6_hdr, dst_addr[8]),
 	},
 
 	[8] = {
@@ -751,7 +751,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint32_t),
 		.field_index = 8,
 		.input_index = 8,
-		.offset = offsetof(struct ipv6_hdr, dst_addr[12]),
+		.offset = offsetof(struct rte_ipv6_hdr, dst_addr[12]),
 	},
 
 	/* Source Port */
@@ -760,7 +760,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint16_t),
 		.field_index = 9,
 		.input_index = 9,
-		.offset = sizeof(struct ipv6_hdr) +
+		.offset = sizeof(struct rte_ipv6_hdr) +
 			offsetof(struct tcp_hdr, src_port),
 	},
 
@@ -770,7 +770,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.size = sizeof(uint16_t),
 		.field_index = 10,
 		.input_index = 9,
-		.offset = sizeof(struct ipv6_hdr) +
+		.offset = sizeof(struct rte_ipv6_hdr) +
 			offsetof(struct tcp_hdr, dst_port),
 	},
 };
examples/ip_reassembly/main.c +6 -6
index c2a1f9228..00a95e07a 100644
@@ -324,10 +324,10 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
 
 	/* 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;
 
-		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)) {
@@ -351,7 +351,7 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
 				m = mo;
 				eth_hdr = rte_pktmbuf_mtod(m,
 					struct rte_ether_hdr *);
-				ip_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+				ip_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);
 			}
 		}
 		ip_dst = rte_be_to_cpu_32(ip_hdr->dst_addr);
@@ -366,9 +366,9 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
 	} 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);
 
@@ -389,7 +389,7 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
 			if (mo != m) {
 				m = mo;
 				eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
-				ip_hdr = (struct ipv6_hdr *)(eth_hdr + 1);
+				ip_hdr = (struct rte_ipv6_hdr *)(eth_hdr + 1);
 			}
 		}
 
examples/ipv4_multicast/main.c +2 -2
index 0c9c3a749..c97c11e75 100644
@@ -306,7 +306,7 @@ static inline void
 mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf)
 {
 	struct rte_mbuf *mc;
-	struct ipv4_hdr *iphdr;
+	struct rte_ipv4_hdr *iphdr;
 	uint32_t dest_addr, port_mask, port_num, use_clone;
 	int32_t hash;
 	uint16_t port;
@@ -316,7 +316,7 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf)
 	} dst_eth_addr;
 
 	/* Remove the Ethernet header from the input packet */
-	iphdr = (struct ipv4_hdr *)rte_pktmbuf_adj(m, (uint16_t)sizeof(struct rte_ether_hdr));
+	iphdr = (struct rte_ipv4_hdr *)rte_pktmbuf_adj(m, (uint16_t)sizeof(struct rte_ether_hdr));
 	RTE_ASSERT(iphdr != NULL);
 
 	dest_addr = rte_be_to_cpu_32(iphdr->dst_addr);
examples/l2fwd-crypto/main.c +2 -2
index 787ce3fdb..7dac6de2d 100644
@@ -384,7 +384,7 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m,
 		struct l2fwd_crypto_params *cparams)
 {
 	struct rte_ether_hdr *eth_hdr;
-	struct ipv4_hdr *ip_hdr;
+	struct rte_ipv4_hdr *ip_hdr;
 
 	uint32_t ipdata_offset, data_len;
 	uint32_t pad_len = 0;
@@ -397,7 +397,7 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m,
 
 	ipdata_offset = sizeof(struct rte_ether_hdr);
 
-	ip_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(m, char *) +
+	ip_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(m, char *) +
 			ipdata_offset);
 
 	ipdata_offset += (ip_hdr->version_ihl & IPV4_HDR_IHL_MASK)
examples/l3fwd-acl/main.c +40 -40

215 lines not on this page · raw message

examples/l3fwd-power/main.c +14 -14
index d9b752d80..abbfcc29f 100644
@@ -424,14 +424,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. */
@@ -456,7 +456,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;
@@ -481,7 +481,7 @@ print_ipv6_key(struct ipv6_5tuple key)
 }
 
 static inline uint16_t
-get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid,
+get_ipv4_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,
 		lookup_struct_t * ipv4_l3fwd_lookup_struct)
 {
 	struct ipv4_5tuple key;
@@ -496,14 +496,14 @@ get_ipv4_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;
@@ -520,7 +520,7 @@ get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid,
 }
 
 static inline uint16_t
-get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint16_t portid,
+get_ipv6_dst_port(struct rte_ipv6_hdr *ipv6_hdr, uint16_t portid,
 			lookup_struct_t *ipv6_l3fwd_lookup_struct)
 {
 	struct ipv6_5tuple key;
@@ -536,14 +536,14 @@ get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint16_t portid,
 	switch (ipv6_hdr->proto) {
 	case IPPROTO_TCP:
 		tcp = (struct tcp_hdr *)((unsigned char *) ipv6_hdr +
-					sizeof(struct ipv6_hdr));
+					sizeof(struct rte_ipv6_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 *) ipv6_hdr +
-					sizeof(struct ipv6_hdr));
+					sizeof(struct rte_ipv6_hdr));
 		key.port_dst = rte_be_to_cpu_16(udp->dst_port);
 		key.port_src = rte_be_to_cpu_16(udp->src_port);
 		break;
@@ -562,7 +562,7 @@ get_ipv6_dst_port(struct ipv6_hdr *ipv6_hdr, uint16_t portid,
 
 #if (APP_LOOKUP_METHOD == APP_LOOKUP_LPM)
 static inline uint16_t
-get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid,
+get_ipv4_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,
 		lookup_struct_t *ipv4_l3fwd_lookup_struct)
 {
 	uint32_t next_hop;
@@ -620,7 +620,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,
 				struct lcore_conf *qconf)
 {
 	struct rte_ether_hdr *eth_hdr;
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 	void *d_addr_bytes;
 	uint16_t dst_port;
 
@@ -629,7 +629,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,
 	if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
 		/* Handle IPv4 headers.*/
 		ipv4_hdr =
-			rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
+			rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *,
 						sizeof(struct rte_ether_hdr));
 
 #ifdef DO_RFC_1812_CHECKS
@@ -664,10 +664,10 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,
 	} else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
 		/* Handle IPv6 headers.*/
 #if (APP_LOOKUP_METHOD == APP_LOOKUP_EXACT_MATCH)
-		struct ipv6_hdr *ipv6_hdr;
+		struct rte_ipv6_hdr *ipv6_hdr;
 
 		ipv6_hdr =
-			rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *,
+			rte_pktmbuf_mtod_offset(m, struct rte_ipv6_hdr *,
 						sizeof(struct rte_ether_hdr));
 
 		dst_port = get_ipv6_dst_port(ipv6_hdr, portid,
examples/l3fwd-vf/main.c +9 -9
index d9b636806..ebb2378dd 100644
@@ -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
examples/l3fwd/l3fwd.h +3 -3
index 1893f8c3a..293fb1fa2 100644
@@ -130,14 +130,14 @@ send_single_packet(struct lcore_conf *qconf,
 
 #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. */
@@ -162,7 +162,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;
examples/l3fwd/l3fwd_altivec.h +5 -5
index 0c68aa01c..fc7996f88 100644
@@ -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 rte_ether_hdr *)p[0] + 1),
+	rfc1812_process((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[0] + 1),
 		&dst_port[0], pkt[0]->packet_type);
-	rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[1] + 1),
+	rfc1812_process((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[1] + 1),
 		&dst_port[1], pkt[1]->packet_type);
-	rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[2] + 1),
+	rfc1812_process((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[2] + 1),
 		&dst_port[2], pkt[2]->packet_type);
-	rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1),
+	rfc1812_process((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1),
 		&dst_port[3], pkt[3]->packet_type);
 }
 
@@ -129,7 +129,7 @@ process_packet(struct rte_mbuf *pkt, uint16_t *dst_port)
 	te = *(vector unsigned int *)eth_hdr;
 	ve = (vector unsigned int)val_eth[dst_port[0]];
 
-	rfc1812_process((struct ipv4_hdr *)(eth_hdr + 1), dst_port,
+	rfc1812_process((struct rte_ipv4_hdr *)(eth_hdr + 1), dst_port,
 			pkt->packet_type);
 
 	/* dynamically vec_sel te and ve for MASK_ETH (0x3f) */
examples/l3fwd/l3fwd_common.h +2 -2
index 0f4fcb427..7d83ff641 100644
@@ -14,7 +14,7 @@
 #define	IPV4_MAX_VER_IHL_DIFF	(IPV4_MAX_VER_IHL - IPV4_MIN_VER_IHL)
 
 /* Minimum value of IPV4 total length (20B) in network byte order. */
-#define	IPV4_MIN_LEN_BE	(sizeof(struct ipv4_hdr) << 8)
+#define	IPV4_MIN_LEN_BE	(sizeof(struct rte_ipv4_hdr) << 8)
 
 /*
  * From http://www.rfc-editor.org/rfc/rfc1812.txt section 5.2.2:
@@ -28,7 +28,7 @@
  * to BAD_PORT value.
  */
 static __rte_always_inline void
-rfc1812_process(struct ipv4_hdr *ipv4_hdr, uint16_t *dp, uint32_t ptype)
+rfc1812_process(struct rte_ipv4_hdr *ipv4_hdr, uint16_t *dp, uint32_t ptype)
 {
 	uint8_t ihl;
 
examples/l3fwd/l3fwd_em.c +7 -7
index b56b08646..fb55e196d 100644
@@ -252,7 +252,7 @@ em_get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, void *lookup_struct)
 	struct rte_hash *ipv4_l3fwd_lookup_struct =
 		(struct rte_hash *)lookup_struct;
 
-	ipv4_hdr = (uint8_t *)ipv4_hdr + offsetof(struct ipv4_hdr, time_to_live);
+	ipv4_hdr = (uint8_t *)ipv4_hdr + offsetof(struct rte_ipv4_hdr, time_to_live);
 
 	/*
 	 * Get 5 tuple: dst port, src port, dst IP address,
@@ -273,7 +273,7 @@ em_get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, void *lookup_struct)
 	struct rte_hash *ipv6_l3fwd_lookup_struct =
 		(struct rte_hash *)lookup_struct;
 
-	ipv6_hdr = (uint8_t *)ipv6_hdr + offsetof(struct ipv6_hdr, payload_len);
+	ipv6_hdr = (uint8_t *)ipv6_hdr + offsetof(struct rte_ipv6_hdr, payload_len);
 	void *data0 = ipv6_hdr;
 	void *data1 = ((uint8_t *)ipv6_hdr) + sizeof(xmm_t);
 	void *data2 = ((uint8_t *)ipv6_hdr) + sizeof(xmm_t) + sizeof(xmm_t);
@@ -566,17 +566,17 @@ em_parse_ptype(struct rte_mbuf *m)
 	uint16_t ether_type;
 	void *l3;
 	int hdr_len;
-	struct ipv4_hdr *ipv4_hdr;
-	struct ipv6_hdr *ipv6_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
+	struct rte_ipv6_hdr *ipv6_hdr;
 
 	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)) {
-		ipv4_hdr = (struct ipv4_hdr *)l3;
+		ipv4_hdr = (struct rte_ipv4_hdr *)l3;
 		hdr_len = (ipv4_hdr->version_ihl & IPV4_HDR_IHL_MASK) *
 			  IPV4_IHL_MULTIPLIER;
-		if (hdr_len == sizeof(struct ipv4_hdr)) {
+		if (hdr_len == sizeof(struct rte_ipv4_hdr)) {
 			packet_type |= RTE_PTYPE_L3_IPV4;
 			if (ipv4_hdr->next_proto_id == IPPROTO_TCP)
 				packet_type |= RTE_PTYPE_L4_TCP;
@@ -585,7 +585,7 @@ em_parse_ptype(struct rte_mbuf *m)
 		} else
 			packet_type |= RTE_PTYPE_L3_IPV4_EXT;
 	} else if (ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6)) {
-		ipv6_hdr = (struct ipv6_hdr *)l3;
+		ipv6_hdr = (struct rte_ipv6_hdr *)l3;
 		if (ipv6_hdr->proto == IPPROTO_TCP)
 			packet_type |= RTE_PTYPE_L3_IPV6 | RTE_PTYPE_L4_TCP;
 		else if (ipv6_hdr->proto == IPPROTO_UDP)
examples/l3fwd/l3fwd_em.h +4 -4
index 4a7336350..62ae1bf30 100644
@@ -10,7 +10,7 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid,
 		struct lcore_conf *qconf)
 {
 	struct rte_ether_hdr *eth_hdr;
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 	uint16_t dst_port;
 	uint32_t tcp_or_udp;
 	uint32_t l3_ptypes;
@@ -21,7 +21,7 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid,
 
 	if (tcp_or_udp && (l3_ptypes == RTE_PTYPE_L3_IPV4)) {
 		/* Handle IPv4 headers.*/
-		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
@@ -52,9 +52,9 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid,
 		send_single_packet(qconf, m, dst_port);
 	} else if (tcp_or_udp && (l3_ptypes == RTE_PTYPE_L3_IPV6)) {
 		/* Handle IPv6 headers.*/
-		struct ipv6_hdr *ipv6_hdr;
+		struct rte_ipv6_hdr *ipv6_hdr;
 
-		ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *,
+		ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv6_hdr *,
 						   sizeof(struct rte_ether_hdr));
 
 		dst_port = em_get_ipv6_dst_port(ipv6_hdr, portid,
examples/l3fwd/l3fwd_em_hlm.h +4 -4
index 5afe77591..4476a91f3 100644
@@ -80,8 +80,8 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
 		uint16_t portid)
 {
 	uint16_t next_hop;
-	struct ipv4_hdr *ipv4_hdr;
-	struct ipv6_hdr *ipv6_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
+	struct rte_ipv6_hdr *ipv6_hdr;
 	uint32_t tcp_or_udp;
 	uint32_t l3_ptypes;
 
@@ -91,7 +91,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
 	if (tcp_or_udp && (l3_ptypes == RTE_PTYPE_L3_IPV4)) {
 
 		/* Handle IPv4 headers.*/
-		ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *,
+		ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_ipv4_hdr *,
 				sizeof(struct rte_ether_hdr));
 
 		next_hop = em_get_ipv4_dst_port(ipv4_hdr, portid,
@@ -106,7 +106,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
 	} else if (tcp_or_udp && (l3_ptypes == RTE_PTYPE_L3_IPV6)) {
 
 		/* Handle IPv6 headers.*/
-		ipv6_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv6_hdr *,
+		ipv6_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_ipv6_hdr *,
 				sizeof(struct rte_ether_hdr));
 
 		next_hop = em_get_ipv6_dst_port(ipv6_hdr, portid,
examples/l3fwd/l3fwd_em_hlm_neon.h +4 -4
index 3ee2304b5..3aaf71428 100644
@@ -14,7 +14,7 @@ get_ipv4_5tuple(struct rte_mbuf *m0, int32x4_t mask0,
 {
 	int32x4_t tmpdata0 = vld1q_s32(rte_pktmbuf_mtod_offset(m0, int32_t *,
 				sizeof(struct rte_ether_hdr) +
-				offsetof(struct ipv4_hdr, time_to_live)));
+				offsetof(struct rte_ipv4_hdr, time_to_live)));
 
 	key->xmm = vandq_s32(tmpdata0, mask0);
 }
@@ -26,17 +26,17 @@ get_ipv6_5tuple(struct rte_mbuf *m0, int32x4_t mask0,
 	int32x4_t tmpdata0 = vld1q_s32(
 			rte_pktmbuf_mtod_offset(m0, int *,
 				sizeof(struct rte_ether_hdr) +
-				offsetof(struct ipv6_hdr, payload_len)));
+				offsetof(struct rte_ipv6_hdr, payload_len)));
 
 	int32x4_t tmpdata1 = vld1q_s32(
 			rte_pktmbuf_mtod_offset(m0, int *,
 				sizeof(struct rte_ether_hdr) +
-				offsetof(struct ipv6_hdr, payload_len) + 8));
+				offsetof(struct rte_ipv6_hdr, payload_len) + 8));
 
 	int32x4_t tmpdata2 = vld1q_s32(
 			rte_pktmbuf_mtod_offset(m0, int *,
 				sizeof(struct rte_ether_hdr) +
-				offsetof(struct ipv6_hdr, payload_len) + 16));
+				offsetof(struct rte_ipv6_hdr, payload_len) + 16));
 
 	key->xmm[0] = vandq_s32(tmpdata0, mask0);
 	key->xmm[1] = tmpdata1;
examples/l3fwd/l3fwd_em_hlm_sse.h +4 -4
index 8156bbb90..7964a9277 100644
@@ -14,7 +14,7 @@ get_ipv4_5tuple(struct rte_mbuf *m0, __m128i mask0,
 	 __m128i tmpdata0 = _mm_loadu_si128(
 			rte_pktmbuf_mtod_offset(m0, __m128i *,
 				sizeof(struct rte_ether_hdr) +
-				offsetof(struct ipv4_hdr, time_to_live)));
+				offsetof(struct rte_ipv4_hdr, time_to_live)));
 
 	key->xmm = _mm_and_si128(tmpdata0, mask0);
 }
@@ -26,18 +26,18 @@ get_ipv6_5tuple(struct rte_mbuf *m0, __m128i mask0,
 	__m128i tmpdata0 = _mm_loadu_si128(
 			rte_pktmbuf_mtod_offset(m0, __m128i *,
 				sizeof(struct rte_ether_hdr) +
-				offsetof(struct ipv6_hdr, payload_len)));
+				offsetof(struct rte_ipv6_hdr, payload_len)));
 
 	__m128i tmpdata1 = _mm_loadu_si128(
 			rte_pktmbuf_mtod_offset(m0, __m128i *,
 				sizeof(struct rte_ether_hdr) +
-				offsetof(struct ipv6_hdr, payload_len) +
+				offsetof(struct rte_ipv6_hdr, payload_len) +
 				sizeof(__m128i)));
 
 	__m128i tmpdata2 = _mm_loadu_si128(
 			rte_pktmbuf_mtod_offset(m0, __m128i *,
 				sizeof(struct rte_ether_hdr) +
-				offsetof(struct ipv6_hdr, payload_len) +
+				offsetof(struct rte_ipv6_hdr, payload_len) +
 				sizeof(__m128i) + sizeof(__m128i)));
 
 	key->xmm[0] = _mm_and_si128(tmpdata0, mask0);
examples/l3fwd/l3fwd_em_sequential.h +4 -4
index 6e7096c01..8307c20dd 100644
@@ -25,8 +25,8 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
 		uint16_t portid)
 {
 	uint8_t next_hop;
-	struct ipv4_hdr *ipv4_hdr;
-	struct ipv6_hdr *ipv6_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
+	struct rte_ipv6_hdr *ipv6_hdr;
 	uint32_t tcp_or_udp;
 	uint32_t l3_ptypes;
 
@@ -36,7 +36,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
 	if (tcp_or_udp && (l3_ptypes == RTE_PTYPE_L3_IPV4)) {
 
 		/* Handle IPv4 headers.*/
-		ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *,
+		ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_ipv4_hdr *,
 				sizeof(struct rte_ether_hdr));
 
 		next_hop = em_get_ipv4_dst_port(ipv4_hdr, portid,
@@ -51,7 +51,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
 	} else if (tcp_or_udp && (l3_ptypes == RTE_PTYPE_L3_IPV6)) {
 
 		/* Handle IPv6 headers.*/
-		ipv6_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv6_hdr *,
+		ipv6_hdr = rte_pktmbuf_mtod_offset(pkt, struct rte_ipv6_hdr *,
 				sizeof(struct rte_ether_hdr));
 
 		next_hop = em_get_ipv6_dst_port(ipv6_hdr, portid,
examples/l3fwd/l3fwd_lpm.c +8 -8
index 96143d871..881b0c7c0 100644
@@ -82,7 +82,7 @@ lpm_get_ipv4_dst_port(void *ipv4_hdr, uint16_t portid, void *lookup_struct)
 		(struct rte_lpm *)lookup_struct;
 
 	return (uint16_t) ((rte_lpm_lookup(ipv4_l3fwd_lookup_struct,
-		rte_be_to_cpu_32(((struct ipv4_hdr *)ipv4_hdr)->dst_addr),
+		rte_be_to_cpu_32(((struct rte_ipv4_hdr *)ipv4_hdr)->dst_addr),
 		&next_hop) == 0) ? next_hop : portid);
 }
 
@@ -94,7 +94,7 @@ lpm_get_ipv6_dst_port(void *ipv6_hdr, uint16_t portid, void *lookup_struct)
 		(struct rte_lpm6 *)lookup_struct;
 
 	return (uint16_t) ((rte_lpm6_lookup(ipv6_l3fwd_lookup_struct,
-			((struct ipv6_hdr *)ipv6_hdr)->dst_addr,
+			((struct rte_ipv6_hdr *)ipv6_hdr)->dst_addr,
 			&next_hop) == 0) ?  next_hop : portid);
 }
 
@@ -102,21 +102,21 @@ static __rte_always_inline uint16_t
 lpm_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
 		uint16_t portid)
 {
-	struct ipv6_hdr *ipv6_hdr;
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv6_hdr *ipv6_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 	struct rte_ether_hdr *eth_hdr;
 
 	if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type)) {
 
 		eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
-		ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+		ipv4_hdr = (struct rte_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 rte_ether_hdr *);
-		ipv6_hdr = (struct ipv6_hdr *)(eth_hdr + 1);
+		ipv6_hdr = (struct rte_ipv6_hdr *)(eth_hdr + 1);
 
 		return lpm_get_ipv6_dst_port(ipv6_hdr, portid,
 					     qconf->ipv6_lookup_struct);
@@ -135,7 +135,7 @@ lpm_get_dst_port_with_ipv4(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
 	uint32_t dst_ipv4, uint16_t portid)
 {
 	uint32_t next_hop;
-	struct ipv6_hdr *ipv6_hdr;
+	struct rte_ipv6_hdr *ipv6_hdr;
 	struct rte_ether_hdr *eth_hdr;
 
 	if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type)) {
@@ -146,7 +146,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 rte_ether_hdr *);
-		ipv6_hdr = (struct ipv6_hdr *)(eth_hdr + 1);
+		ipv6_hdr = (struct rte_ipv6_hdr *)(eth_hdr + 1);
 
 		return (uint16_t) ((rte_lpm6_lookup(qconf->ipv6_lookup_struct,
 				ipv6_hdr->dst_addr, &next_hop) == 0)
examples/l3fwd/l3fwd_lpm.h +4 -4
index 323f853ee..05faa5426 100644
@@ -10,14 +10,14 @@ l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid,
 		struct lcore_conf *qconf)
 {
 	struct rte_ether_hdr *eth_hdr;
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 	uint16_t dst_port;
 
 	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 *,
+		ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv4_hdr *,
 						   sizeof(struct rte_ether_hdr));
 
 #ifdef DO_RFC_1812_CHECKS
@@ -48,9 +48,9 @@ l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid,
 		send_single_packet(qconf, m, dst_port);
 	} else if (RTE_ETH_IS_IPV6_HDR(m->packet_type)) {
 		/* Handle IPv6 headers.*/
-		struct ipv6_hdr *ipv6_hdr;
+		struct rte_ipv6_hdr *ipv6_hdr;
 
-		ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *,
+		ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv6_hdr *,
 						   sizeof(struct rte_ether_hdr));
 
 		dst_port = lpm_get_ipv6_dst_port(ipv6_hdr, portid,
examples/l3fwd/l3fwd_lpm_altivec.h +5 -5
index b36e991ac..7c6814252 100644
@@ -17,30 +17,30 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP],
 		vector unsigned int *dip,
 		uint32_t *ipv4_flag)
 {
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 	struct rte_ether_hdr *eth_hdr;
 	uint32_t x0, x1, x2, x3;
 
 	eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *);
-	ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+	ipv4_hdr = (struct rte_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 rte_ether_hdr *);
-	ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+	ipv4_hdr = (struct rte_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 rte_ether_hdr *);
-	ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+	ipv4_hdr = (struct rte_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 rte_ether_hdr *);
-	ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+	ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);
 	x3 = ipv4_hdr->dst_addr;
 	ipv4_flag[0] &= pkt[3]->packet_type;
 
examples/l3fwd/l3fwd_lpm_neon.h +5 -5
index a3e42cfa7..d6c0ba64a 100644
@@ -18,27 +18,27 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP],
 		int32x4_t *dip,
 		uint32_t *ipv4_flag)
 {
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 	struct rte_ether_hdr *eth_hdr;
 	int32_t dst[FWDSTEP];
 
 	eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *);
-	ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+	ipv4_hdr = (struct rte_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 rte_ether_hdr *);
-	ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+	ipv4_hdr = (struct rte_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 rte_ether_hdr *);
-	ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+	ipv4_hdr = (struct rte_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 rte_ether_hdr *);
-	ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+	ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);
 	dst[3] = ipv4_hdr->dst_addr;
 	ipv4_flag[0] &= pkt[3]->packet_type;
 
examples/l3fwd/l3fwd_lpm_sse.h +5 -5
index 4603e0749..3f637a23d 100644
@@ -15,27 +15,27 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP],
 		__m128i *dip,
 		uint32_t *ipv4_flag)
 {
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 	struct rte_ether_hdr *eth_hdr;
 	uint32_t x0, x1, x2, x3;
 
 	eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *);
-	ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+	ipv4_hdr = (struct rte_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 rte_ether_hdr *);
-	ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+	ipv4_hdr = (struct rte_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 rte_ether_hdr *);
-	ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+	ipv4_hdr = (struct rte_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 rte_ether_hdr *);
-	ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+	ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);
 	x3 = ipv4_hdr->dst_addr;
 	ipv4_flag[0] &= pkt[3]->packet_type;
 
examples/l3fwd/l3fwd_neon.h +5 -5
index af2dc47ac..712c3a704 100644
@@ -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 rte_ether_hdr *)p[0] + 1),
+	rfc1812_process((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[0] + 1),
 		&dst_port[0], pkt[0]->packet_type);
-	rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[1] + 1),
+	rfc1812_process((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[1] + 1),
 		&dst_port[1], pkt[1]->packet_type);
-	rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[2] + 1),
+	rfc1812_process((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[2] + 1),
 		&dst_port[2], pkt[2]->packet_type);
-	rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1),
+	rfc1812_process((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1),
 		&dst_port[3], pkt[3]->packet_type);
 }
 
@@ -113,7 +113,7 @@ process_packet(struct rte_mbuf *pkt, uint16_t *dst_port)
 	ve = vreinterpretq_u32_s32(val_eth[dst_port[0]]);
 
 
-	rfc1812_process((struct ipv4_hdr *)(eth_hdr + 1), dst_port,
+	rfc1812_process((struct rte_ipv4_hdr *)(eth_hdr + 1), dst_port,
 			pkt->packet_type);
 
 	ve = vcopyq_laneq_u32(ve, 3, te, 3);
examples/l3fwd/l3fwd_sse.h +5 -5
index 3349f2747..5919f48b9 100644
@@ -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 rte_ether_hdr *)p[0] + 1),
+	rfc1812_process((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[0] + 1),
 		&dst_port[0], pkt[0]->packet_type);
-	rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[1] + 1),
+	rfc1812_process((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[1] + 1),
 		&dst_port[1], pkt[1]->packet_type);
-	rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[2] + 1),
+	rfc1812_process((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[2] + 1),
 		&dst_port[2], pkt[2]->packet_type);
-	rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1),
+	rfc1812_process((struct rte_ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1),
 		&dst_port[3], pkt[3]->packet_type);
 }
 
@@ -109,7 +109,7 @@ process_packet(struct rte_mbuf *pkt, uint16_t *dst_port)
 	te = _mm_loadu_si128((__m128i *)eth_hdr);
 	ve = val_eth[dst_port[0]];
 
-	rfc1812_process((struct ipv4_hdr *)(eth_hdr + 1), dst_port,
+	rfc1812_process((struct rte_ipv4_hdr *)(eth_hdr + 1), dst_port,
 			pkt->packet_type);
 
 	te =  _mm_blend_epi16(te, ve, MASK_ETH);
examples/load_balancer/runtime.c +2 -2
index c4e6b4ac8..ff76c8d5b 100644
@@ -495,7 +495,7 @@ app_lcore_worker(
 
 		for (j = 0; j < bsz_rd; j ++) {
 			struct rte_mbuf *pkt;
-			struct ipv4_hdr *ipv4_hdr;
+			struct rte_ipv4_hdr *ipv4_hdr;
 			uint32_t ipv4_dst, pos;
 			uint32_t port;
 
@@ -508,7 +508,7 @@ app_lcore_worker(
 
 			pkt = lp->mbuf_in.array[j];
 			ipv4_hdr = rte_pktmbuf_mtod_offset(pkt,
-							   struct ipv4_hdr *,
+							   struct rte_ipv4_hdr *,
 							   sizeof(struct rte_ether_hdr));
 			ipv4_dst = rte_be_to_cpu_32(ipv4_hdr->dst_addr);
 
examples/performance-thread/l3fwd-thread/main.c +55 -55

305 lines not on this page · raw message

examples/server_node_efd/node/node.c +2 -2
index 8bec351ec..44216f999 100644
@@ -266,7 +266,7 @@ transmit_packet(struct rte_mbuf *buf)
 static inline void
 handle_packets(struct rte_hash *h, struct rte_mbuf **bufs, uint16_t num_packets)
 {
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 	uint32_t ipv4_dst_ip[PKT_READ_SIZE];
 	const void *key_ptrs[PKT_READ_SIZE];
 	unsigned int i;
@@ -274,7 +274,7 @@ handle_packets(struct rte_hash *h, struct rte_mbuf **bufs, uint16_t num_packets)
 
 	for (i = 0; i < num_packets; i++) {
 		/* Handle IPv4 header.*/
-		ipv4_hdr = rte_pktmbuf_mtod_offset(bufs[i], struct ipv4_hdr *,
+		ipv4_hdr = rte_pktmbuf_mtod_offset(bufs[i], struct rte_ipv4_hdr *,
 				sizeof(struct rte_ether_hdr));
 		ipv4_dst_ip[i] = ipv4_hdr->dst_addr;
 		key_ptrs[i] = &ipv4_dst_ip[i];
examples/server_node_efd/server/main.c +2 -2
index a086c5a77..3e5295433 100644
@@ -247,12 +247,12 @@ process_packets(uint32_t port_num __rte_unused, struct rte_mbuf *pkts[],
 	efd_value_t data[RTE_EFD_BURST_MAX];
 	const void *key_ptrs[RTE_EFD_BURST_MAX];
 
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 	uint32_t ipv4_dst_ip[RTE_EFD_BURST_MAX];
 
 	for (i = 0; i < rx_count; i++) {
 		/* Handle IPv4 header.*/
-		ipv4_hdr = rte_pktmbuf_mtod_offset(pkts[i], struct ipv4_hdr *,
+		ipv4_hdr = rte_pktmbuf_mtod_offset(pkts[i], struct rte_ipv4_hdr *,
 				sizeof(struct rte_ether_hdr));
 		ipv4_dst_ip[i] = ipv4_hdr->dst_addr;
 		key_ptrs[i] = (void *)&ipv4_dst_ip[i];
examples/tep_termination/vxlan.c +16 -16
index 48a46d536..8088d9412 100644
@@ -31,8 +31,8 @@ static void
 parse_ethernet(struct rte_ether_hdr *eth_hdr, union tunnel_offload_info *info,
 		uint8_t *l4_proto)
 {
-	struct ipv4_hdr *ipv4_hdr;
-	struct ipv6_hdr *ipv6_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
+	struct rte_ipv6_hdr *ipv6_hdr;
 	uint16_t ethertype;
 
 	info->outer_l2_len = sizeof(struct rte_ether_hdr);
@@ -46,15 +46,15 @@ parse_ethernet(struct rte_ether_hdr *eth_hdr, union tunnel_offload_info *info,
 
 	switch (ethertype) {
 	case RTE_ETHER_TYPE_IPv4:
-		ipv4_hdr = (struct ipv4_hdr *)
+		ipv4_hdr = (struct rte_ipv4_hdr *)
 			((char *)eth_hdr + info->outer_l2_len);
-		info->outer_l3_len = sizeof(struct ipv4_hdr);
+		info->outer_l3_len = sizeof(struct rte_ipv4_hdr);
 		*l4_proto = ipv4_hdr->next_proto_id;
 		break;
 	case RTE_ETHER_TYPE_IPv6:
-		ipv6_hdr = (struct ipv6_hdr *)
+		ipv6_hdr = (struct rte_ipv6_hdr *)
 			((char *)eth_hdr + info->outer_l2_len);
-		info->outer_l3_len = sizeof(struct ipv6_hdr);
+		info->outer_l3_len = sizeof(struct rte_ipv6_hdr);
 		*l4_proto = ipv6_hdr->proto;
 		break;
 	default:
@@ -73,8 +73,8 @@ process_inner_cksums(struct rte_ether_hdr *eth_hdr, union tunnel_offload_info *i
 	void *l3_hdr = NULL;
 	uint8_t l4_proto;
 	uint16_t ethertype;
-	struct ipv4_hdr *ipv4_hdr;
-	struct ipv6_hdr *ipv6_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
+	struct rte_ipv6_hdr *ipv6_hdr;
 	struct udp_hdr *udp_hdr;
 	struct tcp_hdr *tcp_hdr;
 	struct sctp_hdr *sctp_hdr;
@@ -92,15 +92,15 @@ process_inner_cksums(struct rte_ether_hdr *eth_hdr, union tunnel_offload_info *i
 	l3_hdr = (char *)eth_hdr + info->l2_len;
 
 	if (ethertype == RTE_ETHER_TYPE_IPv4) {
-		ipv4_hdr = (struct ipv4_hdr *)l3_hdr;
+		ipv4_hdr = (struct rte_ipv4_hdr *)l3_hdr;
 		ipv4_hdr->hdr_checksum = 0;
 		ol_flags |= PKT_TX_IPV4;
 		ol_flags |= PKT_TX_IP_CKSUM;
-		info->l3_len = sizeof(struct ipv4_hdr);
+		info->l3_len = sizeof(struct rte_ipv4_hdr);
 		l4_proto = ipv4_hdr->next_proto_id;
 	} else if (ethertype == RTE_ETHER_TYPE_IPv6) {
-		ipv6_hdr = (struct ipv6_hdr *)l3_hdr;
-		info->l3_len = sizeof(struct ipv6_hdr);
+		ipv6_hdr = (struct rte_ipv6_hdr *)l3_hdr;
+		info->l3_len = sizeof(struct rte_ipv6_hdr);
 		l4_proto = ipv6_hdr->proto;
 		ol_flags |= PKT_TX_IPV6;
 	} else
@@ -176,10 +176,10 @@ encapsulation(struct rte_mbuf *m, uint8_t queue_id)
 
 	/*Allocate space for new ethernet, IPv4, UDP and VXLAN headers*/
 	struct rte_ether_hdr *pneth = (struct rte_ether_hdr *) rte_pktmbuf_prepend(m,
-		sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr)
+		sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv4_hdr)
 		+ sizeof(struct udp_hdr) + sizeof(struct rte_vxlan_hdr));
 
-	struct ipv4_hdr *ip = (struct ipv4_hdr *) &pneth[1];
+	struct rte_ipv4_hdr *ip = (struct rte_ipv4_hdr *) &pneth[1];
 	struct udp_hdr *udp = (struct udp_hdr *) &ip[1];
 	struct rte_vxlan_hdr *vxlan = (struct rte_vxlan_hdr *) &udp[1];
 
@@ -192,7 +192,7 @@ encapsulation(struct rte_mbuf *m, uint8_t queue_id)
 
 	/* copy in IP header */
 	ip = rte_memcpy(ip, &app_ip_hdr[vport_id],
-		sizeof(struct ipv4_hdr));
+		sizeof(struct rte_ipv4_hdr));
 	ip->total_length = rte_cpu_to_be_16(m->pkt_len
 				- sizeof(struct rte_ether_hdr));
 
@@ -210,7 +210,7 @@ encapsulation(struct rte_mbuf *m, uint8_t queue_id)
 	}
 
 	m->outer_l2_len = sizeof(struct rte_ether_hdr);
-	m->outer_l3_len = sizeof(struct ipv4_hdr);
+	m->outer_l3_len = sizeof(struct rte_ipv4_hdr);
 
 	ol_flags |= PKT_TX_TUNNEL_VXLAN;
 
examples/tep_termination/vxlan.h +1 -1
index 780ae73cc..689aea451 100644
@@ -16,7 +16,7 @@
 #define VXLAN_HF_VNI 0x08000000
 #define DEFAULT_VXLAN_PORT 4789
 
-extern struct ipv4_hdr app_ip_hdr[VXLAN_N_PORTS];
+extern struct rte_ipv4_hdr app_ip_hdr[VXLAN_N_PORTS];
 extern struct rte_ether_hdr app_l2_hdr[VXLAN_N_PORTS];
 extern uint8_t tx_checksum;
 extern uint16_t tso_segsz;
examples/tep_termination/vxlan_setup.c +2 -2
index 0b6b2d86e..b2c4155ee 100644
@@ -48,7 +48,7 @@
 /* VXLAN device */
 struct vxlan_conf vxdev;
 
-struct ipv4_hdr app_ip_hdr[VXLAN_N_PORTS];
+struct rte_ipv4_hdr app_ip_hdr[VXLAN_N_PORTS];
 struct rte_ether_hdr app_l2_hdr[VXLAN_N_PORTS];
 
 /* local VTEP IP address */
@@ -229,7 +229,7 @@ vxlan_link(struct vhost_dev *vdev, struct rte_mbuf *m)
 	int i, ret;
 	struct rte_ether_hdr *pkt_hdr;
 	uint64_t portid = vdev->vid;
-	struct ipv4_hdr *ip;
+	struct rte_ipv4_hdr *ip;
 
 	struct rte_eth_tunnel_filter_conf tunnel_filter_conf;
 
examples/vhost/main.c +1 -1
index b2865c9c2..d7ee4530e 100644
@@ -878,7 +878,7 @@ get_psd_sum(void *l3_hdr, uint64_t ol_flags)
 static void virtio_tx_offload(struct rte_mbuf *m)
 {
 	void *l3_hdr;
-	struct ipv4_hdr *ipv4_hdr = NULL;
+	struct rte_ipv4_hdr *ipv4_hdr = NULL;
 	struct tcp_hdr *tcp_hdr = NULL;
 	struct rte_ether_hdr *eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
lib/librte_ethdev/rte_flow.h +2 -2
index ee2d116dc..4e0a84aff 100644
@@ -621,7 +621,7 @@ static const struct rte_flow_item_vlan rte_flow_item_vlan_mask = {
  * Note: IPv4 options are handled by dedicated pattern items.
  */
 struct rte_flow_item_ipv4 {
-	struct ipv4_hdr hdr; /**< IPv4 header definition. */
+	struct rte_ipv4_hdr hdr; /**< IPv4 header definition. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_IPV4. */
@@ -643,7 +643,7 @@ static const struct rte_flow_item_ipv4 rte_flow_item_ipv4_mask = {
  * RTE_FLOW_ITEM_TYPE_IPV6_EXT.
  */
 struct rte_flow_item_ipv6 {
-	struct ipv6_hdr hdr; /**< IPv6 header definition. */
+	struct rte_ipv6_hdr hdr; /**< IPv6 header definition. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_IPV6. */
lib/librte_eventdev/rte_event_eth_rx_adapter.c +8 -8
index d06af0e75..14897c51c 100644
@@ -611,8 +611,8 @@ rxa_calc_wrr_sequence(struct rte_event_eth_rx_adapter *rx_adapter,
 }
 
 static inline void
-rxa_mtoip(struct rte_mbuf *m, struct ipv4_hdr **ipv4_hdr,
-	struct ipv6_hdr **ipv6_hdr)
+rxa_mtoip(struct rte_mbuf *m, struct rte_ipv4_hdr **ipv4_hdr,
+	struct rte_ipv6_hdr **ipv6_hdr)
 {
 	struct rte_ether_hdr *eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 	struct rte_vlan_hdr *vlan_hdr;
@@ -622,21 +622,21 @@ rxa_mtoip(struct rte_mbuf *m, struct ipv4_hdr **ipv4_hdr,
 
 	switch (eth_hdr->ether_type) {
 	case RTE_BE16(RTE_ETHER_TYPE_IPv4):
-		*ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
+		*ipv4_hdr = (struct rte_ipv4_hdr *)(eth_hdr + 1);
 		break;
 
 	case RTE_BE16(RTE_ETHER_TYPE_IPv6):
-		*ipv6_hdr = (struct ipv6_hdr *)(eth_hdr + 1);
+		*ipv6_hdr = (struct rte_ipv6_hdr *)(eth_hdr + 1);
 		break;
 
 	case RTE_BE16(RTE_ETHER_TYPE_VLAN):
 		vlan_hdr = (struct rte_vlan_hdr *)(eth_hdr + 1);
 		switch (vlan_hdr->eth_proto) {
 		case RTE_BE16(RTE_ETHER_TYPE_IPv4):
-			*ipv4_hdr = (struct ipv4_hdr *)(vlan_hdr + 1);
+			*ipv4_hdr = (struct rte_ipv4_hdr *)(vlan_hdr + 1);
 			break;
 		case RTE_BE16(RTE_ETHER_TYPE_IPv6):
-			*ipv6_hdr = (struct ipv6_hdr *)(vlan_hdr + 1);
+			*ipv6_hdr = (struct rte_ipv6_hdr *)(vlan_hdr + 1);
 			break;
 		default:
 			break;
@@ -656,8 +656,8 @@ rxa_do_softrss(struct rte_mbuf *m, const uint8_t *rss_key_be)
 	void *tuple;
 	struct rte_ipv4_tuple ipv4_tuple;
 	struct rte_ipv6_tuple ipv6_tuple;
-	struct ipv4_hdr *ipv4_hdr;
-	struct ipv6_hdr *ipv6_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
+	struct rte_ipv6_hdr *ipv6_hdr;
 
 	rxa_mtoip(m, &ipv4_hdr, &ipv6_hdr);
 
lib/librte_gro/gro_tcp4.c +4 -4
index 398b5b4cf..1c2fe713c 100644
@@ -180,10 +180,10 @@ insert_new_flow(struct gro_tcp4_tbl *tbl,
 static inline void
 update_header(struct gro_tcp4_item *item)
 {
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 	struct rte_mbuf *pkt = item->firstseg;
 
-	ipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
+	ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
 			pkt->l2_len);
 	ipv4_hdr->total_length = rte_cpu_to_be_16(pkt->pkt_len -
 			pkt->l2_len);
@@ -195,7 +195,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,
 		uint64_t start_time)
 {
 	struct rte_ether_hdr *eth_hdr;
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 	struct tcp_hdr *tcp_hdr;
 	uint32_t sent_seq;
 	uint16_t tcp_dl, ip_id, hdr_len, frag_off;
@@ -208,7 +208,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,
 	uint8_t find;
 
 	eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
-	ipv4_hdr = (struct ipv4_hdr *)((char *)eth_hdr + pkt->l2_len);
+	ipv4_hdr = (struct rte_ipv4_hdr *)((char *)eth_hdr + pkt->l2_len);
 	tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len);
 	hdr_len = pkt->l2_len + pkt->l3_len + pkt->l4_len;
 
lib/librte_gro/gro_tcp4.h +2 -2
index 4879e2400..e33b65083 100644
@@ -264,11 +264,11 @@ check_seq_option(struct gro_tcp4_item *item,
 		uint8_t is_atomic)
 {
 	struct rte_mbuf *pkt_orig = item->firstseg;
-	struct ipv4_hdr *iph_orig;
+	struct rte_ipv4_hdr *iph_orig;
 	struct tcp_hdr *tcph_orig;
 	uint16_t len, tcp_hl_orig;
 
-	iph_orig = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt_orig, char *) +
+	iph_orig = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt_orig, char *) +
 			l2_offset + pkt_orig->l2_len);
 	tcph_orig = (struct tcp_hdr *)((char *)iph_orig + pkt_orig->l3_len);
 	tcp_hl_orig = pkt_orig->l4_len;
lib/librte_gro/gro_vxlan_tcp4.c +6 -6
index baf3beffb..4426d82ad 100644
@@ -262,14 +262,14 @@ merge_two_vxlan_tcp4_packets(struct gro_vxlan_tcp4_item *item,
 static inline void
 update_vxlan_header(struct gro_vxlan_tcp4_item *item)
 {
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 	struct udp_hdr *udp_hdr;
 	struct rte_mbuf *pkt = item->inner_item.firstseg;
 	uint16_t len;
 
 	/* Update the outer IPv4 header. */
 	len = pkt->pkt_len - pkt->outer_l2_len;
-	ipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
+	ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
 			pkt->outer_l2_len);
 	ipv4_hdr->total_length = rte_cpu_to_be_16(len);
 
@@ -280,7 +280,7 @@ update_vxlan_header(struct gro_vxlan_tcp4_item *item)
 
 	/* Update the inner IPv4 header. */
 	len -= pkt->l2_len;
-	ipv4_hdr = (struct ipv4_hdr *)((char *)udp_hdr + pkt->l2_len);
+	ipv4_hdr = (struct rte_ipv4_hdr *)((char *)udp_hdr + pkt->l2_len);
 	ipv4_hdr->total_length = rte_cpu_to_be_16(len);
 }
 
@@ -290,7 +290,7 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt,
 		uint64_t start_time)
 {
 	struct rte_ether_hdr *outer_eth_hdr, *eth_hdr;
-	struct ipv4_hdr *outer_ipv4_hdr, *ipv4_hdr;
+	struct rte_ipv4_hdr *outer_ipv4_hdr, *ipv4_hdr;
 	struct tcp_hdr *tcp_hdr;
 	struct udp_hdr *udp_hdr;
 	struct rte_vxlan_hdr *vxlan_hdr;
@@ -306,7 +306,7 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt,
 	uint8_t find;
 
 	outer_eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
-	outer_ipv4_hdr = (struct ipv4_hdr *)((char *)outer_eth_hdr +
+	outer_ipv4_hdr = (struct rte_ipv4_hdr *)((char *)outer_eth_hdr +
 			pkt->outer_l2_len);
 	udp_hdr = (struct udp_hdr *)((char *)outer_ipv4_hdr +
 			pkt->outer_l3_len);
@@ -314,7 +314,7 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt,
 			sizeof(struct udp_hdr));
 	eth_hdr = (struct rte_ether_hdr *)((char *)vxlan_hdr +
 			sizeof(struct rte_vxlan_hdr));
-	ipv4_hdr = (struct ipv4_hdr *)((char *)udp_hdr + pkt->l2_len);
+	ipv4_hdr = (struct rte_ipv4_hdr *)((char *)udp_hdr + pkt->l2_len);
 	tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len);
 
 	/*
lib/librte_gso/gso_common.h +2 -2
index 6cd764ff5..ecce5da06 100644
@@ -98,9 +98,9 @@ update_tcp_header(struct rte_mbuf *pkt, uint16_t l4_offset, uint32_t sent_seq,
 static inline void
 update_ipv4_header(struct rte_mbuf *pkt, uint16_t l3_offset, uint16_t id)
 {
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 
-	ipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
+	ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
 			l3_offset);
 	ipv4_hdr->total_length = rte_cpu_to_be_16(pkt->pkt_len - l3_offset);
 	ipv4_hdr->packet_id = rte_cpu_to_be_16(id);
lib/librte_gso/gso_tcp4.c +4 -4
index fbd95f8f6..ad0cce6f9 100644
@@ -9,14 +9,14 @@ static void
 update_ipv4_tcp_headers(struct rte_mbuf *pkt, uint8_t ipid_delta,
 		struct rte_mbuf **segs, uint16_t nb_segs)
 {
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 	struct tcp_hdr *tcp_hdr;
 	uint32_t sent_seq;
 	uint16_t id, tail_idx, i;
 	uint16_t l3_offset = pkt->l2_len;
 	uint16_t l4_offset = l3_offset + pkt->l3_len;
 
-	ipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char*) +
+	ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char*) +
 			l3_offset);
 	tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len);
 	id = rte_be_to_cpu_16(ipv4_hdr->packet_id);
@@ -40,13 +40,13 @@ gso_tcp4_segment(struct rte_mbuf *pkt,
 		struct rte_mbuf **pkts_out,
 		uint16_t nb_pkts_out)
 {
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 	uint16_t pyld_unit_size, hdr_offset;
 	uint16_t frag_off;
 	int ret;
 
 	/* Don't process the fragmented packet */
-	ipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
+	ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
 			pkt->l2_len);
 	frag_off = rte_be_to_cpu_16(ipv4_hdr->fragment_offset);
 	if (unlikely(IS_FRAGMENTED(frag_off))) {
lib/librte_gso/gso_tunnel_tcp4.c +5 -5
index d39b46863..f5a19bc43 100644
@@ -9,7 +9,7 @@ static void
 update_tunnel_ipv4_tcp_headers(struct rte_mbuf *pkt, uint8_t ipid_delta,
 		struct rte_mbuf **segs, uint16_t nb_segs)
 {
-	struct ipv4_hdr *ipv4_hdr;
+	struct rte_ipv4_hdr *ipv4_hdr;
 	struct tcp_hdr *tcp_hdr;
 	uint32_t sent_seq;
 	uint16_t outer_id, inner_id, tail_idx, i;
@@ -23,12 +23,12 @@ update_tunnel_ipv4_tcp_headers(struct rte_mbuf *pkt, uint8_t ipid_delta,
 	tcp_offset = inner_ipv4_offset + pkt->l3_len;
 
 	/* Outer IPv4 header. */
-	ipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
+	ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
 			outer_ipv4_offset);
 	outer_id = rte_be_to_cpu_16(ipv4_hdr->packet_id);
 
 	/* Inner IPv4 header. */
-	ipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
+	ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
 			inner_ipv4_offset);
 	inner_id = rte_be_to_cpu_16(ipv4_hdr->packet_id);
 
@@ -60,12 +60,12 @@ gso_tunnel_tcp4_segment(struct rte_mbuf *pkt,
 		struct rte_mbuf **pkts_out,
 		uint16_t nb_pkts_out)
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

lib/librte_gso/gso_udp4.c +4 -4
index 927dee121..93e6f8e0d 100644

Lines of this file are not shown. View the raw message.

lib/librte_gso/rte_gso.h +2 -2
index 433f2c8bb..ee879968c 100644

Lines of this file are not shown. View the raw message.

lib/librte_hash/rte_thash.h +1 -1
index a6ddb7bf7..adbaf8f70 100644

Lines of this file are not shown. View the raw message.

lib/librte_ip_frag/rte_ip_frag.h +4 -4
index 7f425f610..148507a4d 100644

Lines of this file are not shown. View the raw message.

lib/librte_ip_frag/rte_ipv4_fragmentation.c +13 -13
index a96fb03e4..2c781724a 100644

Lines of this file are not shown. View the raw message.

lib/librte_ip_frag/rte_ipv4_reassembly.c +3 -3
index 4956b99ea..35f7d85cd 100644

Lines of this file are not shown. View the raw message.

lib/librte_ip_frag/rte_ipv6_fragmentation.c +13 -13
index 62a7e4e83..627d37c28 100644

Lines of this file are not shown. View the raw message.

lib/librte_ip_frag/rte_ipv6_reassembly.c +3 -3
index db249fe60..0d9e3a597 100644

Lines of this file are not shown. View the raw message.

lib/librte_net/rte_ip.h +10 -10
index f2a8904a2..986fd137c 100644

Lines of this file are not shown. View the raw message.

lib/librte_net/rte_net.c +9 -9
index 3ad16f0c4..dc2a66725 100644

Lines of this file are not shown. View the raw message.

lib/librte_net/rte_net.h +5 -5
index e59760a0a..84f8dfe1c 100644

Lines of this file are not shown. View the raw message.

lib/librte_pipeline/rte_table_action.c +25 -25

50 lines not on this page · raw message

lib/librte_port/rte_port_ras.c +2 -2
index c8b2e19bf..2e807e805 100644

Lines of this file are not shown. View the raw message.

lib/librte_vhost/virtio_net.c +5 -5
index e62fdf228..9736a7339 100644

Lines of this file are not shown. View the raw message.

test/test-pipeline/pipeline_acl.c +5 -5
index 8853d4376..ad939008a 100644

Lines of this file are not shown. View the raw message.

test/test-pipeline/pipeline_hash.c +4 -4
index 3e4a0a1bb..25fb2e0da 100644

Lines of this file are not shown. View the raw message.

test/test/packet_burst_generator.c +22 -22

44 lines not on this page · raw message

test/test/packet_burst_generator.h +3 -3
index 8489212d0..93efee1f5 100644

Lines of this file are not shown. View the raw message.

test/test/test_flow_classify.c +8 -8
index 3f06f3005..96e371691 100644

Lines of this file are not shown. View the raw message.

test/test/test_link_bonding.c +4 -4
index 2490d5dd2..924de81ae 100644

Lines of this file are not shown. View the raw message.

test/test/test_link_bonding_mode4.c +2 -2
index 6295b1874..fba629d43 100644

Lines of this file are not shown. View the raw message.

test/test/test_pmd_perf.c +1 -1
index c5515cc5c..3246b7ab6 100644

Lines of this file are not shown. View the raw message.

test/test/test_sched.c +2 -2
index f02e50882..1611fc64c 100644

Lines of this file are not shown. View the raw message.

test/test/test_thash.c +1 -1
index 61754a947..bf332c9e9 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.11.0

Part of the diff is not shown here. View the raw message.

#14 lore raw

RFC 11/14 net: add rte prefix to ip defines

In reply to Olivier Matz

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.

---
 app/test-pmd/flowgen.c                             |   4 +-
 app/test-pmd/testpmd.c                             |   8 +-
 .../prog_guide/packet_classif_access_ctrl.rst      |   6 +-
 doc/guides/sample_app_ug/ip_frag.rst               |  16 +--
 doc/guides/sample_app_ug/ip_reassembly.rst         |  16 +--
 doc/guides/sample_app_ug/ipv4_multicast.rst        |   2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c             |   4 +-
 drivers/net/ena/ena_ethdev.c                       |   2 +-
 drivers/net/i40e/i40e_flow.c                       |   4 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                     |   2 +-
 drivers/net/mlx5/mlx5_flow_verbs.c                 |  16 +--
 drivers/net/tap/tap_bpf_program.c                  |   6 +-
 drivers/net/vmxnet3/vmxnet3_rxtx.c                 |   4 +-
 examples/flow_classify/flow_classify.c             |   2 +-
 examples/ip_fragmentation/main.c                   |  16 +--
 examples/ip_reassembly/main.c                      |  16 +--
 examples/ipv4_multicast/main.c                     |  32 +++---
 examples/l2fwd-crypto/main.c                       |   4 +-
 examples/l3fwd-acl/main.c                          |   2 +-
 examples/l3fwd-power/main.c                        |  24 ++--
 examples/l3fwd-vf/main.c                           |  24 ++--
 examples/l3fwd/l3fwd_em.c                          |  20 ++--
 examples/l3fwd/l3fwd_lpm.c                         |  16 +--
 examples/performance-thread/l3fwd-thread/main.c    |  32 +++---
 lib/librte_gro/gro_tcp4.c                          |   2 +-
 lib/librte_gro/gro_vxlan_tcp4.c                    |   4 +-
 lib/librte_gso/gso_common.h                        |   4 +-
 lib/librte_ip_frag/rte_ip_frag.h                   |   4 +-
 lib/librte_ip_frag/rte_ipv4_fragmentation.c        |  16 +--
 lib/librte_ip_frag/rte_ipv4_reassembly.c           |   8 +-
 lib/librte_net/rte_ip.h                            |  50 ++++-----
 lib/librte_net/rte_net.c                           |   6 +-
 lib/librte_port/rte_port_ras.c                     |   4 +-
 test/test-acl/main.c                               |   2 +-
 test/test/test_acl.c                               |   8 +-
 test/test/test_acl.h                               | 122 ++++++++++-----------
 test/test/test_efd.c                               |  20 ++--
 test/test/test_flow_classify.c                     |   8 +-
 test/test/test_hash.c                              |  20 ++--
 test/test/test_link_bonding_mode4.c                |   4 +-
 test/test/test_lpm.c                               |  76 ++++++-------
 test/test/test_lpm_perf.c                          |  10 +-
 test/test/test_member.c                            |  20 ++--
 test/test/test_sched.c                             |   2 +-
 test/test/test_table_acl.c                         |   8 +-
 test/test/test_thash.c                             |  10 +-
 46 files changed, 343 insertions(+), 343 deletions(-)
app/test-pmd/flowgen.c +2 -2
index e62601541..0405fe9b6 100644
@@ -72,8 +72,8 @@
 
 /* hardcoded configuration (for now) */
 static unsigned cfg_n_flows	= 1024;
-static uint32_t cfg_ip_src	= IPv4(10, 254, 0, 0);
-static uint32_t cfg_ip_dst	= IPv4(10, 253, 0, 0);
+static uint32_t cfg_ip_src	= RTE_IPv4(10, 254, 0, 0);
+static uint32_t cfg_ip_dst	= RTE_IPv4(10, 253, 0, 0);
 static uint16_t cfg_udp_src	= 1000;
 static uint16_t cfg_udp_dst	= 1001;
 static struct rte_ether_addr cfg_ether_src	=
app/test-pmd/testpmd.c +4 -4
index 6b02c0c10..2576387a5 100644
@@ -454,8 +454,8 @@ struct vxlan_encap_conf vxlan_encap_conf = {
 	.vni = "\x00\x00\x00",
 	.udp_src = 0,
 	.udp_dst = RTE_BE16(4789),
-	.ipv4_src = IPv4(127, 0, 0, 1),
-	.ipv4_dst = IPv4(255, 255, 255, 255),
+	.ipv4_src = RTE_IPv4(127, 0, 0, 1),
+	.ipv4_dst = RTE_IPv4(255, 255, 255, 255),
 	.ipv6_src = "\x00\x00\x00\x00\x00\x00\x00\x00"
 		"\x00\x00\x00\x00\x00\x00\x00\x01",
 	.ipv6_dst = "\x00\x00\x00\x00\x00\x00\x00\x00"
@@ -469,8 +469,8 @@ struct nvgre_encap_conf nvgre_encap_conf = {
 	.select_ipv4 = 1,
 	.select_vlan = 0,
 	.tni = "\x00\x00\x00",
-	.ipv4_src = IPv4(127, 0, 0, 1),
-	.ipv4_dst = IPv4(255, 255, 255, 255),
+	.ipv4_src = RTE_IPv4(127, 0, 0, 1),
+	.ipv4_dst = RTE_IPv4(255, 255, 255, 255),
 	.ipv6_src = "\x00\x00\x00\x00\x00\x00\x00\x00"
 		"\x00\x00\x00\x00\x00\x00\x00\x01",
 	.ipv6_dst = "\x00\x00\x00\x00\x00\x00\x00\x00"
doc/guides/prog_guide/packet_classif_access_ctrl.rst +3 -3
index 6887e4dc6..010ec045d 100644
@@ -419,7 +419,7 @@ Classify with Multiple Categories
             .data = {.userdata = 1, .category_mask = 3, .priority = 1},
 
             /* destination IPv4 */
-            .field[2] = {.value.u32 = IPv4(192,168,0,0),. mask_range.u32 = 16,},
+            .field[2] = {.value.u32 = RTE_IPv4(192,168,0,0),. mask_range.u32 = 16,},
 
             /* source port */
             .field[3] = {.value.u16 = 0, .mask_range.u16 = 0xffff,},
@@ -433,7 +433,7 @@ Classify with Multiple Categories
             .data = {.userdata = 2, .category_mask = 1, .priority = 2},
 
             /* destination IPv4 */
-            .field[2] = {.value.u32 = IPv4(192,168,1,0),. mask_range.u32 = 24,},
+            .field[2] = {.value.u32 = RTE_IPv4(192,168,1,0),. mask_range.u32 = 24,},
 
             /* source port */
             .field[3] = {.value.u16 = 0, .mask_range.u16 = 0xffff,},
@@ -447,7 +447,7 @@ Classify with Multiple Categories
             .data = {.userdata = 3, .category_mask = 2, .priority = 3},
 
             /* source IPv4 */
-            .field[1] = {.value.u32 = IPv4(10,1,1,1),. mask_range.u32 = 32,},
+            .field[1] = {.value.u32 = RTE_IPv4(10,1,1,1),. mask_range.u32 = 32,},
 
             /* source port */
             .field[3] = {.value.u16 = 0, .mask_range.u16 = 0xffff,},
doc/guides/sample_app_ug/ip_frag.rst +8 -8
index 7914a977a..222bdd748 100644
@@ -104,14 +104,14 @@ The default l3fwd_ipv4_route_array table is:
 .. code-block:: c
 
     struct l3fwd_ipv4_route l3fwd_ipv4_route_array[] = {
-        {IPv4(100, 10, 0, 0), 16, 0},
-        {IPv4(100, 20, 0, 0), 16, 1},
-        {IPv4(100, 30, 0, 0), 16, 2},
-        {IPv4(100, 40, 0, 0), 16, 3},
-        {IPv4(100, 50, 0, 0), 16, 4},
-        {IPv4(100, 60, 0, 0), 16, 5},
-        {IPv4(100, 70, 0, 0), 16, 6},
-        {IPv4(100, 80, 0, 0), 16, 7},
+        {RTE_IPv4(100, 10, 0, 0), 16, 0},
+        {RTE_IPv4(100, 20, 0, 0), 16, 1},
+        {RTE_IPv4(100, 30, 0, 0), 16, 2},
+        {RTE_IPv4(100, 40, 0, 0), 16, 3},
+        {RTE_IPv4(100, 50, 0, 0), 16, 4},
+        {RTE_IPv4(100, 60, 0, 0), 16, 5},
+        {RTE_IPv4(100, 70, 0, 0), 16, 6},
+        {RTE_IPv4(100, 80, 0, 0), 16, 7},
     };
 
 The default l3fwd_ipv6_route_array table is:
doc/guides/sample_app_ug/ip_reassembly.rst +8 -8
index 18912cd2f..db303d362 100644
@@ -107,14 +107,14 @@ The default l3fwd_ipv4_route_array table is:
 .. code-block:: c
 
     struct l3fwd_ipv4_route l3fwd_ipv4_route_array[] = {
-        {IPv4(100, 10, 0, 0), 16, 0},
-        {IPv4(100, 20, 0, 0), 16, 1},
-        {IPv4(100, 30, 0, 0), 16, 2},
-        {IPv4(100, 40, 0, 0), 16, 3},
-        {IPv4(100, 50, 0, 0), 16, 4},
-        {IPv4(100, 60, 0, 0), 16, 5},
-        {IPv4(100, 70, 0, 0), 16, 6},
-        {IPv4(100, 80, 0, 0), 16, 7},
+        {RTE_IPv4(100, 10, 0, 0), 16, 0},
+        {RTE_IPv4(100, 20, 0, 0), 16, 1},
+        {RTE_IPv4(100, 30, 0, 0), 16, 2},
+        {RTE_IPv4(100, 40, 0, 0), 16, 3},
+        {RTE_IPv4(100, 50, 0, 0), 16, 4},
+        {RTE_IPv4(100, 60, 0, 0), 16, 5},
+        {RTE_IPv4(100, 70, 0, 0), 16, 6},
+        {RTE_IPv4(100, 80, 0, 0), 16, 7},
     };
 
 The default l3fwd_ipv6_route_array table is:
doc/guides/sample_app_ug/ipv4_multicast.rst +1 -1
index 0d89be96e..a6175b3eb 100644
@@ -155,7 +155,7 @@ if the routing table has any ports assigned to the destination address:
 
 .. code-block:: c
 
-    if (!IS_IPV4_MCAST(dest_addr) ||
+    if (!RTE_IS_IPV4_MCAST(dest_addr) ||
        (hash = rte_fbk_hash_lookup(mcast_hash, dest_addr)) <= 0 ||
        (port_mask = hash & enabled_port_mask) == 0) {
            rte_pktmbuf_free(m);
drivers/net/bonding/rte_eth_bond_pmd.c +2 -2
index 2aa94d7c2..dd7d3fb20 100644
@@ -856,8 +856,8 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
 			if (likely(rte_ipv4_frag_pkt_is_fragmented(ipv4_hdr)
 								== 0)) {
 				ip_hdr_offset = (ipv4_hdr->version_ihl
-					& IPV4_HDR_IHL_MASK) *
-					IPV4_IHL_MULTIPLIER;
+					& RTE_IPV4_HDR_IHL_MASK) *
+					RTE_IPV4_IHL_MULTIPLIER;
 
 				if (ipv4_hdr->next_proto_id == IPPROTO_TCP) {
 					tcp_hdr = (struct tcp_hdr *)
drivers/net/ena/ena_ethdev.c +1 -1
index 6cf4259fe..eaeed9fee 100644
@@ -1970,7 +1970,7 @@ eth_ena_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 						 m->l2_len);
 		frag_field = rte_be_to_cpu_16(ip_hdr->fragment_offset);
 
-		if ((frag_field & IPV4_HDR_DF_FLAG) != 0) {
+		if ((frag_field & RTE_IPV4_HDR_DF_FLAG) != 0) {
 			m->packet_type |= RTE_PTYPE_L4_NONFRAG;
 
 			/* If IPv4 header has DF flag enabled and TSO support is
drivers/net/i40e/i40e_flow.c +2 -2
index d7a1000d8..7d08078a6 100644
@@ -2607,8 +2607,8 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 				/* Check if it is fragment. */
 				frag_off = ipv4_spec->hdr.fragment_offset;
 				frag_off = rte_be_to_cpu_16(frag_off);
-				if (frag_off & IPV4_HDR_OFFSET_MASK ||
-				    frag_off & IPV4_HDR_MF_FLAG)
+				if (frag_off & RTE_IPV4_HDR_OFFSET_MASK ||
+				    frag_off & RTE_IPV4_HDR_MF_FLAG)
 					pctype = I40E_FILTER_PCTYPE_FRAG_IPV4;
 
 				/* Get the filter info */
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
index 46f3f5d5d..6d9224d4f 100644
@@ -4488,7 +4488,7 @@ ixgbe_get_rscctl_maxdesc(struct rte_mempool *pool)
 
 	/* MAXDESC * SRRCTL.BSIZEPKT must not exceed 64 KB minus one */
 	uint16_t maxdesc =
-		IPV4_MAX_PKT_LEN /
+		RTE_IPV4_MAX_PKT_LEN /
 			(mp_priv->mbuf_data_room_size - RTE_PKTMBUF_HEADROOM);
 
 	if (maxdesc >= 16)
drivers/net/mlx5/mlx5_flow_verbs.c +8 -8
index 4de4759e7..925e17157 100644
@@ -370,17 +370,17 @@ flow_verbs_translate_item_ipv6(const struct rte_flow_item *item,
 		vtc_flow_val = rte_be_to_cpu_32(spec->hdr.vtc_flow);
 		vtc_flow_mask = rte_be_to_cpu_32(mask->hdr.vtc_flow);
 		ipv6.val.flow_label =
-			rte_cpu_to_be_32((vtc_flow_val & IPV6_HDR_FL_MASK) >>
-					 IPV6_HDR_FL_SHIFT);
-		ipv6.val.traffic_class = (vtc_flow_val & IPV6_HDR_TC_MASK) >>
-					 IPV6_HDR_TC_SHIFT;
+			rte_cpu_to_be_32((vtc_flow_val & RTE_IPV6_HDR_FL_MASK) >>
+					 RTE_IPV6_HDR_FL_SHIFT);
+		ipv6.val.traffic_class = (vtc_flow_val & RTE_IPV6_HDR_TC_MASK) >>
+					 RTE_IPV6_HDR_TC_SHIFT;
 		ipv6.val.next_hdr = spec->hdr.proto;
 		ipv6.val.hop_limit = spec->hdr.hop_limits;
 		ipv6.mask.flow_label =
-			rte_cpu_to_be_32((vtc_flow_mask & IPV6_HDR_FL_MASK) >>
-					 IPV6_HDR_FL_SHIFT);
-		ipv6.mask.traffic_class = (vtc_flow_mask & IPV6_HDR_TC_MASK) >>
-					  IPV6_HDR_TC_SHIFT;
+			rte_cpu_to_be_32((vtc_flow_mask & RTE_IPV6_HDR_FL_MASK) >>
+					 RTE_IPV6_HDR_FL_SHIFT);
+		ipv6.mask.traffic_class = (vtc_flow_mask & RTE_IPV6_HDR_TC_MASK) >>
+					  RTE_IPV6_HDR_TC_SHIFT;
 		ipv6.mask.next_hdr = mask->hdr.proto;
 		ipv6.mask.hop_limit = mask->hdr.hop_limits;
 		/* Remove unwanted bits from values. */
drivers/net/tap/tap_bpf_program.c +3 -3
index db3ed8798..0886b0fb2 100644
@@ -19,7 +19,7 @@
 #include "tap_rss.h"
 
 /** Create IPv4 address */
-#define IPv4(a, b, c, d) ((__u32)(((a) & 0xff) << 24) | \
+#define RTE_IPv4(a, b, c, d) ((__u32)(((a) & 0xff) << 24) | \
 		(((b) & 0xff) << 16) | \
 		(((c) & 0xff) << 8)  | \
 		((d) & 0xff))
@@ -157,11 +157,11 @@ rss_l3_l4(struct __sk_buff *skb)
 		__u8 *src_dst_addr = data + off + offsetof(struct iphdr, saddr);
 		__u8 *src_dst_port = data + off + sizeof(struct iphdr);
 		struct ipv4_l3_l4_tuple v4_tuple = {
-			.src_addr = IPv4(*(src_dst_addr + 0),
+			.src_addr = RTE_IPv4(*(src_dst_addr + 0),
 					*(src_dst_addr + 1),
 					*(src_dst_addr + 2),
 					*(src_dst_addr + 3)),
-			.dst_addr = IPv4(*(src_dst_addr + 4),
+			.dst_addr = RTE_IPv4(*(src_dst_addr + 4),
 					*(src_dst_addr + 5),
 					*(src_dst_addr + 6),
 					*(src_dst_addr + 7)),
drivers/net/vmxnet3/vmxnet3_rxtx.c +2 -2
index 9f22d273c..3bbf9adf7 100644
@@ -682,8 +682,8 @@ vmxnet3_guess_mss(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd,
 					- sizeof(struct tcp_hdr);
 
 		ipv4_hdr = (struct rte_ipv4_hdr *)(ptr + hlen);
-		hlen += (ipv4_hdr->version_ihl & IPV4_HDR_IHL_MASK) *
-				IPV4_IHL_MULTIPLIER;
+		hlen += (ipv4_hdr->version_ihl & RTE_IPV4_HDR_IHL_MASK) *
+				RTE_IPV4_IHL_MULTIPLIER;
 	} else if (rcd->v6) {
 		if (unlikely(slen < hlen + sizeof(struct rte_ipv6_hdr)))
 			return hw->mtu - sizeof(struct rte_ipv6_hdr) -
examples/flow_classify/flow_classify.c +1 -1
index c75a410f4..e68d0f694 100644
@@ -379,7 +379,7 @@ parse_ipv4_net(char *in, uint32_t *addr, uint32_t *mask_len)
 	if (get_cb_field(&in, &m, 0, sizeof(uint32_t) * CHAR_BIT, 0))
 		return -EINVAL;
 
-	addr[0] = IPv4(a, b, c, d);
+	addr[0] = RTE_IPv4(a, b, c, d);
 	mask_len[0] = m;
 	return 0;
 }
examples/ip_fragmentation/main.c +8 -8
index 42b1d2cb0..6585323a2 100644
@@ -160,14 +160,14 @@ struct l3fwd_ipv4_route {
 };
 
 struct l3fwd_ipv4_route l3fwd_ipv4_route_array[] = {
-		{IPv4(100,10,0,0), 16, 0},
-		{IPv4(100,20,0,0), 16, 1},
-		{IPv4(100,30,0,0), 16, 2},
-		{IPv4(100,40,0,0), 16, 3},
-		{IPv4(100,50,0,0), 16, 4},
-		{IPv4(100,60,0,0), 16, 5},
-		{IPv4(100,70,0,0), 16, 6},
-		{IPv4(100,80,0,0), 16, 7},
+		{RTE_IPv4(100,10,0,0), 16, 0},
+		{RTE_IPv4(100,20,0,0), 16, 1},
+		{RTE_IPv4(100,30,0,0), 16, 2},
+		{RTE_IPv4(100,40,0,0), 16, 3},
+		{RTE_IPv4(100,50,0,0), 16, 4},
+		{RTE_IPv4(100,60,0,0), 16, 5},
+		{RTE_IPv4(100,70,0,0), 16, 6},
+		{RTE_IPv4(100,80,0,0), 16, 7},
 };
 
 /*
examples/ip_reassembly/main.c +8 -8
index 00a95e07a..97c499425 100644
@@ -190,14 +190,14 @@ struct l3fwd_ipv4_route {
 };
 
 struct l3fwd_ipv4_route l3fwd_ipv4_route_array[] = {
-		{IPv4(100,10,0,0), 16, 0},
-		{IPv4(100,20,0,0), 16, 1},
-		{IPv4(100,30,0,0), 16, 2},
-		{IPv4(100,40,0,0), 16, 3},
-		{IPv4(100,50,0,0), 16, 4},
-		{IPv4(100,60,0,0), 16, 5},
-		{IPv4(100,70,0,0), 16, 6},
-		{IPv4(100,80,0,0), 16, 7},
+		{RTE_IPv4(100,10,0,0), 16, 0},
+		{RTE_IPv4(100,20,0,0), 16, 1},
+		{RTE_IPv4(100,30,0,0), 16, 2},
+		{RTE_IPv4(100,40,0,0), 16, 3},
+		{RTE_IPv4(100,50,0,0), 16, 4},
+		{RTE_IPv4(100,60,0,0), 16, 5},
+		{RTE_IPv4(100,70,0,0), 16, 6},
+		{RTE_IPv4(100,80,0,0), 16, 7},
 };
 
 /*
examples/ipv4_multicast/main.c +16 -16
index c97c11e75..34306aebe 100644
@@ -138,21 +138,21 @@ struct mcast_group_params {
 };
 
 static struct mcast_group_params mcast_group_table[] = {
-		{IPv4(224,0,0,101), 0x1},
-		{IPv4(224,0,0,102), 0x2},
-		{IPv4(224,0,0,103), 0x3},
-		{IPv4(224,0,0,104), 0x4},
-		{IPv4(224,0,0,105), 0x5},
-		{IPv4(224,0,0,106), 0x6},
-		{IPv4(224,0,0,107), 0x7},
-		{IPv4(224,0,0,108), 0x8},
-		{IPv4(224,0,0,109), 0x9},
-		{IPv4(224,0,0,110), 0xA},
-		{IPv4(224,0,0,111), 0xB},
-		{IPv4(224,0,0,112), 0xC},
-		{IPv4(224,0,0,113), 0xD},
-		{IPv4(224,0,0,114), 0xE},
-		{IPv4(224,0,0,115), 0xF},
+		{RTE_IPv4(224,0,0,101), 0x1},
+		{RTE_IPv4(224,0,0,102), 0x2},
+		{RTE_IPv4(224,0,0,103), 0x3},
+		{RTE_IPv4(224,0,0,104), 0x4},
+		{RTE_IPv4(224,0,0,105), 0x5},
+		{RTE_IPv4(224,0,0,106), 0x6},
+		{RTE_IPv4(224,0,0,107), 0x7},
+		{RTE_IPv4(224,0,0,108), 0x8},
+		{RTE_IPv4(224,0,0,109), 0x9},
+		{RTE_IPv4(224,0,0,110), 0xA},
+		{RTE_IPv4(224,0,0,111), 0xB},
+		{RTE_IPv4(224,0,0,112), 0xC},
+		{RTE_IPv4(224,0,0,113), 0xD},
+		{RTE_IPv4(224,0,0,114), 0xE},
+		{RTE_IPv4(224,0,0,115), 0xF},
 };
 
 #define N_MCAST_GROUPS \
@@ -325,7 +325,7 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf)
 	 * Check that it is a valid multicast address and
 	 * we have some active ports assigned to it.
 	 */
-	if(!IS_IPV4_MCAST(dest_addr) ||
+	if(!RTE_IS_IPV4_MCAST(dest_addr) ||
 	    (hash = rte_fbk_hash_lookup(mcast_hash, dest_addr)) <= 0 ||
 	    (port_mask = hash & enabled_port_mask) == 0) {
 		rte_pktmbuf_free(m);
examples/l2fwd-crypto/main.c +2 -2
index 7dac6de2d..1fd6482b0 100644
@@ -400,8 +400,8 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m,
 	ip_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(m, char *) +
 			ipdata_offset);
 
-	ipdata_offset += (ip_hdr->version_ihl & IPV4_HDR_IHL_MASK)
-			* IPV4_IHL_MULTIPLIER;
+	ipdata_offset += (ip_hdr->version_ihl & RTE_IPV4_HDR_IHL_MASK)
+			* RTE_IPV4_IHL_MULTIPLIER;
 
 
 	/* Zero pad data to be crypto'd so it is block aligned */
examples/l3fwd-acl/main.c +1 -1
index b0e933e03..bad6aae8c 100644
@@ -897,7 +897,7 @@ parse_ipv4_net(const char *in, uint32_t *addr, uint32_t *mask_len)
 	GET_CB_FIELD(in, d, 0, UINT8_MAX, '/');
 	GET_CB_FIELD(in, m, 0, sizeof(uint32_t) * CHAR_BIT, 0);
 
-	addr[0] = IPv4(a, b, c, d);
+	addr[0] = RTE_IPv4(a, b, c, d);
 	mask_len[0] = m;
 
 	return 0;
examples/l3fwd-power/main.c +12 -12
index abbfcc29f..f78aeab53 100644
@@ -236,10 +236,10 @@ struct ipv6_l3fwd_route {
 };
 
 static struct ipv4_l3fwd_route ipv4_l3fwd_route_array[] = {
-	{{IPv4(100,10,0,1), IPv4(200,10,0,1), 101, 11, IPPROTO_TCP}, 0},
-	{{IPv4(100,20,0,2), IPv4(200,20,0,2), 102, 12, IPPROTO_TCP}, 1},
-	{{IPv4(100,30,0,3), IPv4(200,30,0,3), 103, 13, IPPROTO_TCP}, 2},
-	{{IPv4(100,40,0,4), IPv4(200,40,0,4), 104, 14, IPPROTO_TCP}, 3},
+	{{RTE_IPv4(100,10,0,1), RTE_IPv4(200,10,0,1), 101, 11, IPPROTO_TCP}, 0},
+	{{RTE_IPv4(100,20,0,2), RTE_IPv4(200,20,0,2), 102, 12, IPPROTO_TCP}, 1},
+	{{RTE_IPv4(100,30,0,3), RTE_IPv4(200,30,0,3), 103, 13, IPPROTO_TCP}, 2},
+	{{RTE_IPv4(100,40,0,4), RTE_IPv4(200,40,0,4), 104, 14, IPPROTO_TCP}, 3},
 };
 
 static struct ipv6_l3fwd_route ipv6_l3fwd_route_array[] = {
@@ -278,14 +278,14 @@ struct ipv4_l3fwd_route {
 };
 
 static struct ipv4_l3fwd_route ipv4_l3fwd_route_array[] = {
-	{IPv4(1,1,1,0), 24, 0},
-	{IPv4(2,1,1,0), 24, 1},
-	{IPv4(3,1,1,0), 24, 2},
-	{IPv4(4,1,1,0), 24, 3},
-	{IPv4(5,1,1,0), 24, 4},
-	{IPv4(6,1,1,0), 24, 5},
-	{IPv4(7,1,1,0), 24, 6},
-	{IPv4(8,1,1,0), 24, 7},
+	{RTE_IPv4(1,1,1,0), 24, 0},
+	{RTE_IPv4(2,1,1,0), 24, 1},
+	{RTE_IPv4(3,1,1,0), 24, 2},
+	{RTE_IPv4(4,1,1,0), 24, 3},
+	{RTE_IPv4(5,1,1,0), 24, 4},
+	{RTE_IPv4(6,1,1,0), 24, 5},
+	{RTE_IPv4(7,1,1,0), 24, 6},
+	{RTE_IPv4(8,1,1,0), 24, 7},
 };
 
 #define IPV4_L3FWD_NUM_ROUTES \
examples/l3fwd-vf/main.c +12 -12
index ebb2378dd..5e3809b8d 100644
@@ -201,10 +201,10 @@ struct l3fwd_route {
 };
 
 static struct l3fwd_route l3fwd_route_array[] = {
-	{{IPv4(100,10,0,1), IPv4(200,10,0,1), 101, 11, IPPROTO_TCP}, 0},
-	{{IPv4(100,20,0,2), IPv4(200,20,0,2), 102, 12, IPPROTO_TCP}, 1},
-	{{IPv4(100,30,0,3), IPv4(200,30,0,3), 103, 13, IPPROTO_TCP}, 2},
-	{{IPv4(100,40,0,4), IPv4(200,40,0,4), 104, 14, IPPROTO_TCP}, 3},
+	{{RTE_IPv4(100,10,0,1), RTE_IPv4(200,10,0,1), 101, 11, IPPROTO_TCP}, 0},
+	{{RTE_IPv4(100,20,0,2), RTE_IPv4(200,20,0,2), 102, 12, IPPROTO_TCP}, 1},
+	{{RTE_IPv4(100,30,0,3), RTE_IPv4(200,30,0,3), 103, 13, IPPROTO_TCP}, 2},
+	{{RTE_IPv4(100,40,0,4), RTE_IPv4(200,40,0,4), 104, 14, IPPROTO_TCP}, 3},
 };
 
 typedef struct rte_hash lookup_struct_t;
@@ -234,14 +234,14 @@ struct l3fwd_route {
 };
 
 static struct l3fwd_route l3fwd_route_array[] = {
-	{IPv4(1,1,1,0), 24, 0},
-	{IPv4(2,1,1,0), 24, 1},
-	{IPv4(3,1,1,0), 24, 2},
-	{IPv4(4,1,1,0), 24, 3},
-	{IPv4(5,1,1,0), 24, 4},
-	{IPv4(6,1,1,0), 24, 5},
-	{IPv4(7,1,1,0), 24, 6},
-	{IPv4(8,1,1,0), 24, 7},
+	{RTE_IPv4(1,1,1,0), 24, 0},
+	{RTE_IPv4(2,1,1,0), 24, 1},
+	{RTE_IPv4(3,1,1,0), 24, 2},
+	{RTE_IPv4(4,1,1,0), 24, 3},
+	{RTE_IPv4(5,1,1,0), 24, 4},
+	{RTE_IPv4(6,1,1,0), 24, 5},
+	{RTE_IPv4(7,1,1,0), 24, 6},
+	{RTE_IPv4(8,1,1,0), 24, 7},
 };
 
 #define L3FWD_NUM_ROUTES \
examples/l3fwd/l3fwd_em.c +10 -10
index fb55e196d..b0e08f842 100644
@@ -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[] = {
@@ -424,19 +424,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);
@@ -574,8 +574,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)
examples/l3fwd/l3fwd_lpm.c +8 -8
index 881b0c7c0..de9fd9ab3 100644
@@ -40,14 +40,14 @@ struct ipv6_l3fwd_lpm_route {
 };
 
 static struct ipv4_l3fwd_lpm_route ipv4_l3fwd_lpm_route_array[] = {
-	{IPv4(1, 1, 1, 0), 24, 0},
-	{IPv4(2, 1, 1, 0), 24, 1},
-	{IPv4(3, 1, 1, 0), 24, 2},
-	{IPv4(4, 1, 1, 0), 24, 3},
-	{IPv4(5, 1, 1, 0), 24, 4},
-	{IPv4(6, 1, 1, 0), 24, 5},
-	{IPv4(7, 1, 1, 0), 24, 6},
-	{IPv4(8, 1, 1, 0), 24, 7},
+	{RTE_IPv4(1, 1, 1, 0), 24, 0},
+	{RTE_IPv4(2, 1, 1, 0), 24, 1},
+	{RTE_IPv4(3, 1, 1, 0), 24, 2},
+	{RTE_IPv4(4, 1, 1, 0), 24, 3},
+	{RTE_IPv4(5, 1, 1, 0), 24, 4},
+	{RTE_IPv4(6, 1, 1, 0), 24, 5},
+	{RTE_IPv4(7, 1, 1, 0), 24, 6},
+	{RTE_IPv4(8, 1, 1, 0), 24, 7},
 };
 
 static struct ipv6_l3fwd_lpm_route ipv6_l3fwd_lpm_route_array[] = {
examples/performance-thread/l3fwd-thread/main.c +16 -16
index da5c66203..9b5684ea6 100644
@@ -380,10 +380,10 @@ struct ipv6_l3fwd_route {
 };
 
 static struct ipv4_l3fwd_route ipv4_l3fwd_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_route ipv6_l3fwd_route_array[] = {
@@ -503,14 +503,14 @@ struct ipv6_l3fwd_route {
 };
 
 static struct ipv4_l3fwd_route ipv4_l3fwd_route_array[] = {
-	{IPv4(1, 1, 1, 0), 24, 0},
-	{IPv4(2, 1, 1, 0), 24, 1},
-	{IPv4(3, 1, 1, 0), 24, 2},
-	{IPv4(4, 1, 1, 0), 24, 3},
-	{IPv4(5, 1, 1, 0), 24, 4},
-	{IPv4(6, 1, 1, 0), 24, 5},
-	{IPv4(7, 1, 1, 0), 24, 6},
-	{IPv4(8, 1, 1, 0), 24, 7},
+	{RTE_IPv4(1, 1, 1, 0), 24, 0},
+	{RTE_IPv4(2, 1, 1, 0), 24, 1},
+	{RTE_IPv4(3, 1, 1, 0), 24, 2},
+	{RTE_IPv4(4, 1, 1, 0), 24, 3},
+	{RTE_IPv4(5, 1, 1, 0), 24, 4},
+	{RTE_IPv4(6, 1, 1, 0), 24, 5},
+	{RTE_IPv4(7, 1, 1, 0), 24, 6},
+	{RTE_IPv4(8, 1, 1, 0), 24, 7},
 };
 
 static struct ipv6_l3fwd_route ipv6_l3fwd_route_array[] = {
@@ -3134,19 +3134,19 @@ populate_ipv4_many_flow_into_table(const struct rte_hash *h,
 		switch (i & (NUMBER_PORT_USED - 1)) {
 		case 0:
 			entry = ipv4_l3fwd_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_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_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_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);
lib/librte_gro/gro_tcp4.c +1 -1
index 1c2fe713c..3ed8cda02 100644
@@ -231,7 +231,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,
 	 * whose DF bit is 1, IPv4 ID is ignored.
 	 */
 	frag_off = rte_be_to_cpu_16(ipv4_hdr->fragment_offset);
-	is_atomic = (frag_off & IPV4_HDR_DF_FLAG) == IPV4_HDR_DF_FLAG;
+	is_atomic = (frag_off & RTE_IPV4_HDR_DF_FLAG) == RTE_IPV4_HDR_DF_FLAG;
 	ip_id = is_atomic ? 0 : rte_be_to_cpu_16(ipv4_hdr->packet_id);
 	sent_seq = rte_be_to_cpu_32(tcp_hdr->sent_seq);
 
lib/librte_gro/gro_vxlan_tcp4.c +2 -2
index 4426d82ad..80d2d5288 100644
@@ -339,11 +339,11 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt,
 	 * whose DF bit is 1, IPv4 ID is ignored.
 	 */
 	frag_off = rte_be_to_cpu_16(outer_ipv4_hdr->fragment_offset);
-	outer_is_atomic = (frag_off & IPV4_HDR_DF_FLAG) == IPV4_HDR_DF_FLAG;
+	outer_is_atomic = (frag_off & RTE_IPV4_HDR_DF_FLAG) == RTE_IPV4_HDR_DF_FLAG;
 	outer_ip_id = outer_is_atomic ? 0 :
 		rte_be_to_cpu_16(outer_ipv4_hdr->packet_id);
 	frag_off = rte_be_to_cpu_16(ipv4_hdr->fragment_offset);
-	is_atomic = (frag_off & IPV4_HDR_DF_FLAG) == IPV4_HDR_DF_FLAG;
+	is_atomic = (frag_off & RTE_IPV4_HDR_DF_FLAG) == RTE_IPV4_HDR_DF_FLAG;
 	ip_id = is_atomic ? 0 : rte_be_to_cpu_16(ipv4_hdr->packet_id);
 
 	sent_seq = rte_be_to_cpu_32(tcp_hdr->sent_seq);
lib/librte_gso/gso_common.h +2 -2
index ecce5da06..e5c8d83e7 100644
@@ -12,8 +12,8 @@
 #include <rte_tcp.h>
 #include <rte_udp.h>
 
-#define IS_FRAGMENTED(frag_off) (((frag_off) & IPV4_HDR_OFFSET_MASK) != 0 \
-		|| ((frag_off) & IPV4_HDR_MF_FLAG) == IPV4_HDR_MF_FLAG)
+#define IS_FRAGMENTED(frag_off) (((frag_off) & RTE_IPV4_HDR_OFFSET_MASK) != 0 \
+		|| ((frag_off) & RTE_IPV4_HDR_MF_FLAG) == RTE_IPV4_HDR_MF_FLAG)
 
 #define TCP_HDR_PSH_MASK ((uint8_t)0x08)
 #define TCP_HDR_FIN_MASK ((uint8_t)0x01)
lib/librte_ip_frag/rte_ip_frag.h +2 -2
index 148507a4d..28ba33dac 100644
@@ -299,8 +299,8 @@ rte_ipv4_frag_pkt_is_fragmented(const struct rte_ipv4_hdr * hdr) {
 	uint16_t flag_offset, ip_flag, ip_ofs;
 
 	flag_offset = rte_be_to_cpu_16(hdr->fragment_offset);
-	ip_ofs = (uint16_t)(flag_offset & IPV4_HDR_OFFSET_MASK);
-	ip_flag = (uint16_t)(flag_offset & IPV4_HDR_MF_FLAG);
+	ip_ofs = (uint16_t)(flag_offset & RTE_IPV4_HDR_OFFSET_MASK);
+	ip_flag = (uint16_t)(flag_offset & RTE_IPV4_HDR_MF_FLAG);
 
 	return ip_flag != 0 || ip_ofs  != 0;
 }
lib/librte_ip_frag/rte_ipv4_fragmentation.c +8 -8
index 2c781724a..f7c956ee1 100644
@@ -12,22 +12,22 @@
 #include "ip_frag_common.h"
 
 /* Fragment Offset */
-#define	IPV4_HDR_DF_SHIFT			14
-#define	IPV4_HDR_MF_SHIFT			13
-#define	IPV4_HDR_FO_SHIFT			3
+#define	RTE_IPV4_HDR_DF_SHIFT			14
+#define	RTE_IPV4_HDR_MF_SHIFT			13
+#define	RTE_IPV4_HDR_FO_SHIFT			3
 
-#define	IPV4_HDR_DF_MASK			(1 << IPV4_HDR_DF_SHIFT)
-#define	IPV4_HDR_MF_MASK			(1 << IPV4_HDR_MF_SHIFT)
+#define	IPV4_HDR_DF_MASK			(1 << RTE_IPV4_HDR_DF_SHIFT)
+#define	IPV4_HDR_MF_MASK			(1 << RTE_IPV4_HDR_MF_SHIFT)
 
-#define	IPV4_HDR_FO_ALIGN			(1 << IPV4_HDR_FO_SHIFT)
+#define	IPV4_HDR_FO_ALIGN			(1 << RTE_IPV4_HDR_FO_SHIFT)
 
 static inline void __fill_ipv4hdr_frag(struct rte_ipv4_hdr *dst,
 		const struct rte_ipv4_hdr *src, uint16_t len, uint16_t fofs,
 		uint16_t dofs, uint32_t mf)
 {
 	rte_memcpy(dst, src, sizeof(*dst));
-	fofs = (uint16_t)(fofs + (dofs >> IPV4_HDR_FO_SHIFT));
-	fofs = (uint16_t)(fofs | mf << IPV4_HDR_MF_SHIFT);
+	fofs = (uint16_t)(fofs + (dofs >> RTE_IPV4_HDR_FO_SHIFT));
+	fofs = (uint16_t)(fofs | mf << RTE_IPV4_HDR_MF_SHIFT);
 	dst->fragment_offset = rte_cpu_to_be_16(fofs);
 	dst->total_length = rte_cpu_to_be_16(len);
 	dst->hdr_checksum = 0;
lib/librte_ip_frag/rte_ipv4_reassembly.c +4 -4
index 35f7d85cd..97af349bb 100644
@@ -72,7 +72,7 @@ ipv4_frag_reassemble(struct ip_frag_pkt *fp)
 	ip_hdr->total_length = rte_cpu_to_be_16((uint16_t)(fp->total_size +
 		m->l3_len));
 	ip_hdr->fragment_offset = (uint16_t)(ip_hdr->fragment_offset &
-		rte_cpu_to_be_16(IPV4_HDR_DF_FLAG));
+		rte_cpu_to_be_16(RTE_IPV4_HDR_DF_FLAG));
 	ip_hdr->hdr_checksum = 0;
 
 	return m;
@@ -106,8 +106,8 @@ rte_ipv4_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
 	uint16_t flag_offset, ip_ofs, ip_flag;
 
 	flag_offset = rte_be_to_cpu_16(ip_hdr->fragment_offset);
-	ip_ofs = (uint16_t)(flag_offset & IPV4_HDR_OFFSET_MASK);
-	ip_flag = (uint16_t)(flag_offset & IPV4_HDR_MF_FLAG);
+	ip_ofs = (uint16_t)(flag_offset & RTE_IPV4_HDR_OFFSET_MASK);
+	ip_flag = (uint16_t)(flag_offset & RTE_IPV4_HDR_MF_FLAG);
 
 	psd = (unaligned_uint64_t *)&ip_hdr->src_addr;
 	/* use first 8 bytes only */
@@ -115,7 +115,7 @@ rte_ipv4_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
 	key.id = ip_hdr->packet_id;
 	key.key_len = IPV4_KEYLEN;
 
-	ip_ofs *= IPV4_HDR_OFFSET_UNITS;
+	ip_ofs *= RTE_IPV4_HDR_OFFSET_UNITS;
 	ip_len = (uint16_t)(rte_be_to_cpu_16(ip_hdr->total_length) -
 		mb->l3_len);
 
lib/librte_net/rte_ip.h +25 -25

87 lines not on this page · raw message

lib/librte_net/rte_net.c +3 -3
index dc2a66725..617395fe6 100644
@@ -296,7 +296,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,
 			return pkt_type;
 
 		if (ip4h->fragment_offset & rte_cpu_to_be_16(
-				IPV4_HDR_OFFSET_MASK | IPV4_HDR_MF_FLAG)) {
+				RTE_IPV4_HDR_OFFSET_MASK | RTE_IPV4_HDR_MF_FLAG)) {
 			pkt_type |= RTE_PTYPE_L4_FRAG;
 			hdr_lens->l4_len = 0;
 			return pkt_type;
@@ -427,8 +427,8 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,
 		if ((layers & RTE_PTYPE_INNER_L4_MASK) == 0)
 			return pkt_type;
 		if (ip4h->fragment_offset &
-				rte_cpu_to_be_16(IPV4_HDR_OFFSET_MASK |
-					IPV4_HDR_MF_FLAG)) {
+				rte_cpu_to_be_16(RTE_IPV4_HDR_OFFSET_MASK |
+					RTE_IPV4_HDR_MF_FLAG)) {
 			pkt_type |= RTE_PTYPE_INNER_L4_FRAG;
 			hdr_lens->inner_l4_len = 0;
 			return pkt_type;
lib/librte_port/rte_port_ras.c +2 -2
index 2e807e805..0d02f97e5 100644
@@ -155,8 +155,8 @@ process_ipv4(struct rte_port_ring_writer_ras *p, struct rte_mbuf *pkt)
 
 	/* Get "More fragments" flag and fragment offset */
 	uint16_t frag_field = rte_be_to_cpu_16(pkt_hdr->fragment_offset);
-	uint16_t frag_offset = (uint16_t)(frag_field & IPV4_HDR_OFFSET_MASK);
-	uint16_t frag_flag = (uint16_t)(frag_field & IPV4_HDR_MF_FLAG);
+	uint16_t frag_offset = (uint16_t)(frag_field & RTE_IPV4_HDR_OFFSET_MASK);
+	uint16_t frag_flag = (uint16_t)(frag_field & RTE_IPV4_HDR_MF_FLAG);
 
 	/* If it is a fragmented packet, then try to reassemble */
 	if ((frag_flag == 0) && (frag_offset == 0))
test/test-acl/main.c +1 -1
index 648525af5..4bf533cc0 100644
@@ -624,7 +624,7 @@ parse_ipv4_net(const char *in, uint32_t *addr, uint32_t *mask_len)
 	GET_CB_FIELD(in, d, 0, UINT8_MAX, '/');
 	GET_CB_FIELD(in, m, 0, sizeof(uint32_t) * CHAR_BIT, 0);
 
-	addr[0] = IPv4(a, b, c, d);
+	addr[0] = RTE_IPv4(a, b, c, d);
 	mask_len[0] = m;
 
 	return 0;
test/test/test_acl.c +4 -4
index b1f75d1bc..8663ff031 100644
@@ -515,15 +515,15 @@ test_build_ports_range(void)
 	static struct ipv4_7tuple test_data[] = {
 		{
 			.proto = 6,
-			.ip_src = IPv4(10, 1, 1, 1),
-			.ip_dst = IPv4(192, 168, 0, 33),
+			.ip_src = RTE_IPv4(10, 1, 1, 1),
+			.ip_dst = RTE_IPv4(192, 168, 0, 33),
 			.port_dst = 53,
 			.allow = 1,
 		},
 		{
 			.proto = 6,
-			.ip_src = IPv4(127, 84, 33, 1),
-			.ip_dst = IPv4(1, 2, 3, 4),
+			.ip_src = RTE_IPv4(127, 84, 33, 1),
+			.ip_dst = RTE_IPv4(1, 2, 3, 4),
 			.port_dst = 65281,
 			.allow = 1,
 		},
test/test/test_acl.h +61 -61

304 lines not on this page · raw message

test/test/test_efd.c +10 -10
index ced091aab..0f90c923a 100644
@@ -60,36 +60,36 @@ static void print_key_info(__attribute__((unused)) const char *msg,
 /* Keys used by unit test functions */
 static struct flow_key keys[5] = {
 	{
-		.ip_src = IPv4(0x03, 0x02, 0x01, 0x00),
-		.ip_dst = IPv4(0x07, 0x06, 0x05, 0x04),
+		.ip_src = RTE_IPv4(0x03, 0x02, 0x01, 0x00),
+		.ip_dst = RTE_IPv4(0x07, 0x06, 0x05, 0x04),
 		.port_src = 0x0908,
 		.port_dst = 0x0b0a,
 		.proto = 0x0c,
 	},
 	{
-		.ip_src = IPv4(0x13, 0x12, 0x11, 0x10),
-		.ip_dst = IPv4(0x17, 0x16, 0x15, 0x14),
+		.ip_src = RTE_IPv4(0x13, 0x12, 0x11, 0x10),
+		.ip_dst = RTE_IPv4(0x17, 0x16, 0x15, 0x14),
 		.port_src = 0x1918,
 		.port_dst = 0x1b1a,
 		.proto = 0x1c,
 	},
 	{
-		.ip_src = IPv4(0x23, 0x22, 0x21, 0x20),
-		.ip_dst = IPv4(0x27, 0x26, 0x25, 0x24),
+		.ip_src = RTE_IPv4(0x23, 0x22, 0x21, 0x20),
+		.ip_dst = RTE_IPv4(0x27, 0x26, 0x25, 0x24),
 		.port_src = 0x2928,
 		.port_dst = 0x2b2a,
 		.proto = 0x2c,
 	},
 	{
-		.ip_src = IPv4(0x33, 0x32, 0x31, 0x30),
-		.ip_dst = IPv4(0x37, 0x36, 0x35, 0x34),
+		.ip_src = RTE_IPv4(0x33, 0x32, 0x31, 0x30),
+		.ip_dst = RTE_IPv4(0x37, 0x36, 0x35, 0x34),
 		.port_src = 0x3938,
 		.port_dst = 0x3b3a,
 		.proto = 0x3c,
 	},
 	{
-		.ip_src = IPv4(0x43, 0x42, 0x41, 0x40),
-		.ip_dst = IPv4(0x47, 0x46, 0x45, 0x44),
+		.ip_src = RTE_IPv4(0x43, 0x42, 0x41, 0x40),
+		.ip_dst = RTE_IPv4(0x47, 0x46, 0x45, 0x44),
 		.port_src = 0x4948,
 		.port_dst = 0x4b4a,
 		.proto = 0x4c,
test/test/test_flow_classify.c +4 -4
index 96e371691..ad6c481fe 100644
@@ -95,7 +95,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {
  *  dst mask 255.255.255.00 / udp src is 32 dst is 33 / end"
  */
 static struct rte_flow_item_ipv4 ipv4_udp_spec_1 = {
-	{ 0, 0, 0, 0, 0, 0, IPPROTO_UDP, 0, IPv4(2, 2, 2, 3), IPv4(2, 2, 2, 7)}
+	{ 0, 0, 0, 0, 0, 0, IPPROTO_UDP, 0, RTE_IPv4(2, 2, 2, 3), RTE_IPv4(2, 2, 2, 7)}
 };
 static const struct rte_flow_item_ipv4 ipv4_mask_24 = {
 	.hdr = {
@@ -131,7 +131,7 @@ static struct rte_flow_item  end_item_bad = { -1, 0, 0, 0 };
  *  dst mask 255.255.255.00 / tcp src is 16 dst is 17 / end"
  */
 static struct rte_flow_item_ipv4 ipv4_tcp_spec_1 = {
-	{ 0, 0, 0, 0, 0, 0, IPPROTO_TCP, 0, IPv4(1, 2, 3, 4), IPv4(5, 6, 7, 8)}
+	{ 0, 0, 0, 0, 0, 0, IPPROTO_TCP, 0, RTE_IPv4(1, 2, 3, 4), RTE_IPv4(5, 6, 7, 8)}
 };
 
 static struct rte_flow_item_tcp tcp_spec_1 = {
@@ -149,8 +149,8 @@ static struct rte_flow_item  tcp_item_1 = { RTE_FLOW_ITEM_TYPE_TCP,
  *  dst mask 255.255.255.00 / sctp src is 16 dst is 17/ end"
  */
 static struct rte_flow_item_ipv4 ipv4_sctp_spec_1 = {
-	{ 0, 0, 0, 0, 0, 0, IPPROTO_SCTP, 0, IPv4(11, 12, 13, 14),
-	IPv4(15, 16, 17, 18)}
+	{ 0, 0, 0, 0, 0, 0, IPPROTO_SCTP, 0, RTE_IPv4(11, 12, 13, 14),
+	RTE_IPv4(15, 16, 17, 18)}
 };
 
 static struct rte_flow_item_sctp sctp_spec_1 = {
test/test/test_hash.c +10 -10
index b3db9fd10..2ba79b749 100644
@@ -106,32 +106,32 @@ static void print_key_info(__attribute__((unused)) const char *msg,
 
 /* Keys used by unit test functions */
 static struct flow_key keys[5] = { {
-	.ip_src = IPv4(0x03, 0x02, 0x01, 0x00),
-	.ip_dst = IPv4(0x07, 0x06, 0x05, 0x04),
+	.ip_src = RTE_IPv4(0x03, 0x02, 0x01, 0x00),
+	.ip_dst = RTE_IPv4(0x07, 0x06, 0x05, 0x04),
 	.port_src = 0x0908,
 	.port_dst = 0x0b0a,
 	.proto = 0x0c,
 }, {
-	.ip_src = IPv4(0x13, 0x12, 0x11, 0x10),
-	.ip_dst = IPv4(0x17, 0x16, 0x15, 0x14),
+	.ip_src = RTE_IPv4(0x13, 0x12, 0x11, 0x10),
+	.ip_dst = RTE_IPv4(0x17, 0x16, 0x15, 0x14),
 	.port_src = 0x1918,
 	.port_dst = 0x1b1a,
 	.proto = 0x1c,
 }, {
-	.ip_src = IPv4(0x23, 0x22, 0x21, 0x20),
-	.ip_dst = IPv4(0x27, 0x26, 0x25, 0x24),
+	.ip_src = RTE_IPv4(0x23, 0x22, 0x21, 0x20),
+	.ip_dst = RTE_IPv4(0x27, 0x26, 0x25, 0x24),
 	.port_src = 0x2928,
 	.port_dst = 0x2b2a,
 	.proto = 0x2c,
 }, {
-	.ip_src = IPv4(0x33, 0x32, 0x31, 0x30),
-	.ip_dst = IPv4(0x37, 0x36, 0x35, 0x34),
+	.ip_src = RTE_IPv4(0x33, 0x32, 0x31, 0x30),
+	.ip_dst = RTE_IPv4(0x37, 0x36, 0x35, 0x34),
 	.port_src = 0x3938,
 	.port_dst = 0x3b3a,
 	.proto = 0x3c,
 }, {
-	.ip_src = IPv4(0x43, 0x42, 0x41, 0x40),
-	.ip_dst = IPv4(0x47, 0x46, 0x45, 0x44),
+	.ip_src = RTE_IPv4(0x43, 0x42, 0x41, 0x40),
+	.ip_dst = RTE_IPv4(0x47, 0x46, 0x45, 0x44),
 	.port_src = 0x4948,
 	.port_dst = 0x4b4a,
 	.proto = 0x4c,
test/test/test_link_bonding_mode4.c +2 -2
index fba629d43..4968cd91c 100644
@@ -728,8 +728,8 @@ generate_packets(struct rte_ether_addr *src_mac,
 
 	uint16_t src_port = 10, dst_port = 20;
 
-	uint32_t ip_src[4] = { [0 ... 2] = 0xDEADBEEF, [3] = IPv4(192, 168, 0, 1) };
-	uint32_t ip_dst[4] = { [0 ... 2] = 0xFEEDFACE, [3] = IPv4(192, 168, 0, 2) };
+	uint32_t ip_src[4] = { [0 ... 2] = 0xDEADBEEF, [3] = RTE_IPv4(192, 168, 0, 1) };
+	uint32_t ip_dst[4] = { [0 ... 2] = 0xFEEDFACE, [3] = RTE_IPv4(192, 168, 0, 2) };
 
 	struct rte_ether_hdr pkt_eth_hdr;
 	struct udp_hdr pkt_udp_hdr;
test/test/test_lpm.c +38 -38

283 lines not on this page · raw message

test/test/test_lpm_perf.c +5 -5
index 3b98ce0c8..b54650367 100644
@@ -285,11 +285,11 @@ static void generate_large_route_rule_table(void)
 	 * they are 4 rules with private local IP address and 1 all-zeros prefix
 	 * with depth = 8.
 	 */
-	insert_rule_in_random_pos(IPv4(0, 0, 0, 0), 8);
-	insert_rule_in_random_pos(IPv4(10, 2, 23, 147), 32);
-	insert_rule_in_random_pos(IPv4(192, 168, 100, 10), 24);
-	insert_rule_in_random_pos(IPv4(192, 168, 25, 100), 24);
-	insert_rule_in_random_pos(IPv4(192, 168, 129, 124), 32);
+	insert_rule_in_random_pos(RTE_IPv4(0, 0, 0, 0), 8);
+	insert_rule_in_random_pos(RTE_IPv4(10, 2, 23, 147), 32);
+	insert_rule_in_random_pos(RTE_IPv4(192, 168, 100, 10), 24);
+	insert_rule_in_random_pos(RTE_IPv4(192, 168, 25, 100), 24);
+	insert_rule_in_random_pos(RTE_IPv4(192, 168, 129, 124), 32);
 }
 
 static void
test/test/test_member.c +10 -10
index e2a3932f2..53287fcaf 100644
@@ -41,36 +41,36 @@ struct flow_key {
 /* Keys used by unit test functions */
 static struct flow_key keys[NUM_SAMPLES] = {
 	{
-		.ip_src = IPv4(0x03, 0x02, 0x01, 0x00),
-		.ip_dst = IPv4(0x07, 0x06, 0x05, 0x04),
+		.ip_src = RTE_IPv4(0x03, 0x02, 0x01, 0x00),
+		.ip_dst = RTE_IPv4(0x07, 0x06, 0x05, 0x04),
 		.port_src = 0x0908,
 		.port_dst = 0x0b0a,
 		.proto = 0x0c,
 	},
 	{
-		.ip_src = IPv4(0x13, 0x12, 0x11, 0x10),
-		.ip_dst = IPv4(0x17, 0x16, 0x15, 0x14),
+		.ip_src = RTE_IPv4(0x13, 0x12, 0x11, 0x10),
+		.ip_dst = RTE_IPv4(0x17, 0x16, 0x15, 0x14),
 		.port_src = 0x1918,
 		.port_dst = 0x1b1a,
 		.proto = 0x1c,
 	},
 	{
-		.ip_src = IPv4(0x23, 0x22, 0x21, 0x20),
-		.ip_dst = IPv4(0x27, 0x26, 0x25, 0x24),
+		.ip_src = RTE_IPv4(0x23, 0x22, 0x21, 0x20),
+		.ip_dst = RTE_IPv4(0x27, 0x26, 0x25, 0x24),
 		.port_src = 0x2928,
 		.port_dst = 0x2b2a,
 		.proto = 0x2c,
 	},
 	{
-		.ip_src = IPv4(0x33, 0x32, 0x31, 0x30),
-		.ip_dst = IPv4(0x37, 0x36, 0x35, 0x34),
+		.ip_src = RTE_IPv4(0x33, 0x32, 0x31, 0x30),
+		.ip_dst = RTE_IPv4(0x37, 0x36, 0x35, 0x34),
 		.port_src = 0x3938,
 		.port_dst = 0x3b3a,
 		.proto = 0x3c,
 	},
 	{
-		.ip_src = IPv4(0x43, 0x42, 0x41, 0x40),
-		.ip_dst = IPv4(0x47, 0x46, 0x45, 0x44),
+		.ip_src = RTE_IPv4(0x43, 0x42, 0x41, 0x40),
+		.ip_dst = RTE_IPv4(0x47, 0x46, 0x45, 0x44),
 		.port_src = 0x4948,
 		.port_dst = 0x4b4a,
 		.proto = 0x4c,
test/test/test_sched.c +1 -1
index 1611fc64c..8b063d2e3 100644
@@ -92,7 +92,7 @@ prepare_pkt(struct rte_mbuf *mbuf)
 	vlan1->vlan_tci = rte_cpu_to_be_16(SUBPORT);
 	vlan2->vlan_tci = rte_cpu_to_be_16(PIPE);
 	eth_hdr->ether_type =  rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
-	ip_hdr->dst_addr = IPv4(0,0,TC,QUEUE);
+	ip_hdr->dst_addr = RTE_IPv4(0,0,TC,QUEUE);
 
 
 	rte_sched_port_pkt_write(mbuf, SUBPORT, PIPE, TC, QUEUE, e_RTE_METER_YELLOW);
test/test/test_table_acl.c +4 -4
index 33e2f6ee6..a851deaac 100644
@@ -6,7 +6,7 @@
 #include "test_table.h"
 #include "test_table_acl.h"
 
-#define IPv4(a, b, c, d) ((uint32_t)(((a) & 0xff) << 24) |		\
+#define RTE_IPv4(a, b, c, d) ((uint32_t)(((a) & 0xff) << 24) |		\
 	(((b) & 0xff) << 16) |						\
 	(((c) & 0xff) << 8) |						\
 	((d) & 0xff))
@@ -115,7 +115,7 @@ parse_ipv4_net(const char *in, uint32_t *addr, uint32_t *mask_len)
 	GET_CB_FIELD(in, d, 0, UINT8_MAX, '/');
 	GET_CB_FIELD(in, m, 0, sizeof(uint32_t) * CHAR_BIT, 0);
 
-	addr[0] = IPv4(a, b, c, d);
+	addr[0] = RTE_IPv4(a, b, c, d);
 	mask_len[0] = m;
 
 	return 0;
@@ -661,8 +661,8 @@ test_pipeline_single_filter(int expected_count)
 				sizeof(struct ipv4_5tuple));
 
 			five_tuple.proto = j;
-			five_tuple.ip_src = rte_bswap32(IPv4(192, 168, j, 1));
-			five_tuple.ip_dst = rte_bswap32(IPv4(10, 4, j, 1));
+			five_tuple.ip_src = rte_bswap32(RTE_IPv4(192, 168, j, 1));
+			five_tuple.ip_dst = rte_bswap32(RTE_IPv4(10, 4, j, 1));
 			five_tuple.port_src = rte_bswap16(100 + j);
 			five_tuple.port_dst = rte_bswap16(200 + j);
 
test/test/test_thash.c +5 -5
index bf332c9e9..3724ea5be 100644
@@ -59,15 +59,15 @@ struct test_thash_v6 {
 
 /*From 82599 Datasheet 7.1.2.8.3 RSS Verification Suite*/
 struct test_thash_v4 v4_tbl[] = {
-{IPv4(161, 142, 100, 80), IPv4(66, 9, 149, 187),
+{RTE_IPv4(161, 142, 100, 80), RTE_IPv4(66, 9, 149, 187),
 	1766, 2794, 0x323e8fc2, 0x51ccc178},
-{IPv4(65, 69, 140, 83), IPv4(199, 92, 111, 2),
+{RTE_IPv4(65, 69, 140, 83), RTE_IPv4(199, 92, 111, 2),
 	4739, 14230, 0xd718262a, 0xc626b0ea},
-{IPv4(12, 22, 207, 184), IPv4(24, 19, 198, 95),
+{RTE_IPv4(12, 22, 207, 184), RTE_IPv4(24, 19, 198, 95),
 	38024, 12898, 0xd2d0a5de, 0x5c2b394a},
-{IPv4(209, 142, 163, 6), IPv4(38, 27, 205, 30),
+{RTE_IPv4(209, 142, 163, 6), RTE_IPv4(38, 27, 205, 30),
 	2217, 48228, 0x82989176, 0xafc7327f},
-{IPv4(202, 188, 127, 2), IPv4(153, 39, 163, 191),
+{RTE_IPv4(202, 188, 127, 2), RTE_IPv4(153, 39, 163, 191),
 	1303, 44251, 0x5d1809c5, 0x10e828a2},
 };
 
Signature · 1 line
2.11.0
#15 lore raw

RFC 12/14 net: add rte prefix to sctp structure

In reply to Olivier Matz

Add 'rte_' prefix to structures:
- rename struct sctp_hdr as struct rte_sctp_hdr.

---
 app/test-pmd/csumonly.c            |  4 ++--
 drivers/net/avf/avf_rxtx.c         |  2 +-
 drivers/net/e1000/igb_rxtx.c       |  2 +-
 drivers/net/enic/enic_clsf.c       |  8 ++++----
 drivers/net/enic/enic_flow.c       |  4 ++--
 drivers/net/i40e/i40e_fdir.c       | 20 ++++++++++----------
 drivers/net/i40e/i40e_rxtx.c       |  2 +-
 drivers/net/ixgbe/ixgbe_rxtx.c     |  2 +-
 examples/tep_termination/vxlan.c   |  4 ++--
 lib/librte_ethdev/rte_flow.h       |  2 +-
 lib/librte_net/rte_net.c           |  4 ++--
 lib/librte_net/rte_sctp.h          |  2 +-
 lib/librte_vhost/virtio_net.c      |  4 ++--
 test/test/packet_burst_generator.c |  6 +++---
 test/test/packet_burst_generator.h |  2 +-
 test/test/test_flow_classify.c     |  2 +-
 16 files changed, 35 insertions(+), 35 deletions(-)
app/test-pmd/csumonly.c +2 -2
index 23f16bab3..d8b892941 100644
@@ -361,7 +361,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 	struct rte_ipv4_hdr *ipv4_hdr = l3_hdr;
 	struct udp_hdr *udp_hdr;
 	struct tcp_hdr *tcp_hdr;
-	struct sctp_hdr *sctp_hdr;
+	struct rte_sctp_hdr *sctp_hdr;
 	uint64_t ol_flags = 0;
 	uint32_t max_pkt_len, tso_segsz = 0;
 
@@ -428,7 +428,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 		if (info->gso_enable)
 			ol_flags |= PKT_TX_TCP_SEG;
 	} else if (info->l4_proto == IPPROTO_SCTP) {
-		sctp_hdr = (struct sctp_hdr *)((char *)l3_hdr + info->l3_len);
+		sctp_hdr = (struct rte_sctp_hdr *)((char *)l3_hdr + info->l3_len);
 		sctp_hdr->cksum = 0;
 		/* sctp payload must be a multiple of 4 to be
 		 * offloaded */
drivers/net/avf/avf_rxtx.c +1 -1
index 9203b74b8..157744937 100644
@@ -1422,7 +1422,7 @@ avf_txd_enable_checksum(uint64_t ol_flags,
 		break;
 	case PKT_TX_SCTP_CKSUM:
 		*td_cmd |= AVF_TX_DESC_CMD_L4T_EOFT_SCTP;
-		*td_offset |= (sizeof(struct sctp_hdr) >> 2) <<
+		*td_offset |= (sizeof(struct rte_sctp_hdr) >> 2) <<
 			      AVF_TX_DESC_LENGTH_L4_FC_LEN_SHIFT;
 		break;
 	case PKT_TX_UDP_CKSUM:
drivers/net/e1000/igb_rxtx.c +1 -1
index e0834ab58..8b6fddbd7 100644
@@ -295,7 +295,7 @@ igbe_set_xmit_ctx(struct igb_tx_queue* txq,
 		case PKT_TX_SCTP_CKSUM:
 			type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_SCTP |
 				E1000_ADVTXD_DTYP_CTXT | E1000_ADVTXD_DCMD_DEXT;
-			mss_l4len_idx |= sizeof(struct sctp_hdr) << E1000_ADVTXD_L4LEN_SHIFT;
+			mss_l4len_idx |= sizeof(struct rte_sctp_hdr) << E1000_ADVTXD_L4LEN_SHIFT;
 			break;
 		default:
 			type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_RSV |
drivers/net/enic/enic_clsf.c +4 -4
index ddfa52776..96a3aac87 100644
@@ -148,7 +148,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 		enic_set_layer(gp, FILTER_GENERIC_1_TCP, FILTER_GENERIC_1_L4,
 			       &tcp_mask, &tcp_val, sizeof(struct tcp_hdr));
 	} else if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_SCTP) {
-		struct sctp_hdr sctp_mask, sctp_val;
+		struct rte_sctp_hdr sctp_mask, sctp_val;
 		memset(&sctp_mask, 0, sizeof(sctp_mask));
 		memset(&sctp_val, 0, sizeof(sctp_val));
 
@@ -169,7 +169,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 		input->flow.ip4_flow.proto = 132;
 
 		enic_set_layer(gp, 0, FILTER_GENERIC_1_L4, &sctp_mask,
-			       &sctp_val, sizeof(struct sctp_hdr));
+			       &sctp_val, sizeof(struct rte_sctp_hdr));
 	}
 
 	if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_UDP ||
@@ -236,7 +236,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 		enic_set_layer(gp, FILTER_GENERIC_1_TCP, FILTER_GENERIC_1_L4,
 			       &tcp_mask, &tcp_val, sizeof(struct tcp_hdr));
 	} else if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_SCTP) {
-		struct sctp_hdr sctp_mask, sctp_val;
+		struct rte_sctp_hdr sctp_mask, sctp_val;
 		memset(&sctp_mask, 0, sizeof(sctp_mask));
 		memset(&sctp_val, 0, sizeof(sctp_val));
 
@@ -257,7 +257,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 		input->flow.ipv6_flow.proto = 132;
 
 		enic_set_layer(gp, 0, FILTER_GENERIC_1_L4, &sctp_mask,
-			       &sctp_val, sizeof(struct sctp_hdr));
+			       &sctp_val, sizeof(struct rte_sctp_hdr));
 	}
 
 	if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_UDP ||
drivers/net/enic/enic_flow.c +2 -2
index ede89c8f8..d3cbbd4c7 100644
@@ -833,9 +833,9 @@ enic_copy_item_sctp_v2(const struct rte_flow_item *item,
 		mask = &rte_flow_item_sctp_mask;
 
 	memcpy(gp->layer[FILTER_GENERIC_1_L4].mask, &mask->hdr,
-	       sizeof(struct sctp_hdr));
+	       sizeof(struct rte_sctp_hdr));
 	memcpy(gp->layer[FILTER_GENERIC_1_L4].val, &spec->hdr,
-	       sizeof(struct sctp_hdr));
+	       sizeof(struct rte_sctp_hdr));
 	return 0;
 }
 
drivers/net/i40e/i40e_fdir.c +10 -10
index b20f30fb4..14a82426e 100644
@@ -801,7 +801,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 	unsigned char *payload, *ptr;
 	struct udp_hdr *udp;
 	struct tcp_hdr *tcp;
-	struct sctp_hdr *sctp;
+	struct rte_sctp_hdr *sctp;
 	uint8_t size, dst = 0;
 	uint8_t i, pit_idx, set_idx = I40E_FLXPLD_L4_IDX; /* use l4 by default*/
 	int len;
@@ -841,8 +841,8 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 		break;
 
 	case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP:
-		sctp = (struct sctp_hdr *)(raw_pkt + len);
-		payload = (unsigned char *)sctp + sizeof(struct sctp_hdr);
+		sctp = (struct rte_sctp_hdr *)(raw_pkt + len);
+		payload = (unsigned char *)sctp + sizeof(struct rte_sctp_hdr);
 		/*
 		 * The source and destination fields in the transmitted packet
 		 * need to be presented in a reversed order with respect
@@ -886,8 +886,8 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 		break;
 
 	case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP:
-		sctp = (struct sctp_hdr *)(raw_pkt + len);
-		payload = (unsigned char *)sctp + sizeof(struct sctp_hdr);
+		sctp = (struct rte_sctp_hdr *)(raw_pkt + len);
+		payload = (unsigned char *)sctp + sizeof(struct rte_sctp_hdr);
 		/*
 		 * The source and destination fields in the transmitted packet
 		 * need to be presented in a reversed order with respect
@@ -1091,7 +1091,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 	unsigned char *ptr;
 	struct udp_hdr *udp;
 	struct tcp_hdr *tcp;
-	struct sctp_hdr *sctp;
+	struct rte_sctp_hdr *sctp;
 	struct rte_flow_item_gtp *gtp;
 	struct rte_ipv4_hdr *gtp_ipv4;
 	struct rte_ipv6_hdr *gtp_ipv6;
@@ -1138,8 +1138,8 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 		tcp->dst_port = fdir_input->flow.tcp4_flow.src_port;
 		tcp->data_off = I40E_FDIR_TCP_DEFAULT_DATAOFF;
 	} else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV4_SCTP) {
-		sctp = (struct sctp_hdr *)(raw_pkt + len);
-		payload = (unsigned char *)sctp + sizeof(struct sctp_hdr);
+		sctp = (struct rte_sctp_hdr *)(raw_pkt + len);
+		payload = (unsigned char *)sctp + sizeof(struct rte_sctp_hdr);
 		/**
 		 * The source and destination fields in the transmitted packet
 		 * need to be presented in a reversed order with respect
@@ -1175,8 +1175,8 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 		tcp->src_port = fdir_input->flow.udp6_flow.dst_port;
 		tcp->dst_port = fdir_input->flow.udp6_flow.src_port;
 	} else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_SCTP) {
-		sctp = (struct sctp_hdr *)(raw_pkt + len);
-		payload = (unsigned char *)sctp + sizeof(struct sctp_hdr);
+		sctp = (struct rte_sctp_hdr *)(raw_pkt + len);
+		payload = (unsigned char *)sctp + sizeof(struct rte_sctp_hdr);
 		/**
 		 * The source and destination fields in the transmitted packet
 		 * need to be presented in a reversed order with respect
drivers/net/i40e/i40e_rxtx.c +1 -1
index 1227a4daa..82bbac2ce 100644
@@ -303,7 +303,7 @@ i40e_txd_enable_checksum(uint64_t ol_flags,
 		break;
 	case PKT_TX_SCTP_CKSUM:
 		*td_cmd |= I40E_TX_DESC_CMD_L4T_EOFT_SCTP;
-		*td_offset |= (sizeof(struct sctp_hdr) >> 2) <<
+		*td_offset |= (sizeof(struct rte_sctp_hdr) >> 2) <<
 				I40E_TX_DESC_LENGTH_L4_FC_LEN_SHIFT;
 		break;
 	case PKT_TX_UDP_CKSUM:
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
index 6d9224d4f..eb41f5ed0 100644
@@ -432,7 +432,7 @@ ixgbe_set_xmit_ctx(struct ixgbe_tx_queue *txq,
 		case PKT_TX_SCTP_CKSUM:
 			type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_SCTP |
 				IXGBE_ADVTXD_DTYP_CTXT | IXGBE_ADVTXD_DCMD_DEXT;
-			mss_l4len_idx |= sizeof(struct sctp_hdr) << IXGBE_ADVTXD_L4LEN_SHIFT;
+			mss_l4len_idx |= sizeof(struct rte_sctp_hdr) << IXGBE_ADVTXD_L4LEN_SHIFT;
 			tx_offload_mask.l2_len |= ~0;
 			tx_offload_mask.l3_len |= ~0;
 			break;
examples/tep_termination/vxlan.c +2 -2
index 8088d9412..07a53abc3 100644
@@ -77,7 +77,7 @@ process_inner_cksums(struct rte_ether_hdr *eth_hdr, union tunnel_offload_info *i
 	struct rte_ipv6_hdr *ipv6_hdr;
 	struct udp_hdr *udp_hdr;
 	struct tcp_hdr *tcp_hdr;
-	struct sctp_hdr *sctp_hdr;
+	struct rte_sctp_hdr *sctp_hdr;
 	uint64_t ol_flags = 0;
 
 	info->l2_len = sizeof(struct rte_ether_hdr);
@@ -126,7 +126,7 @@ process_inner_cksums(struct rte_ether_hdr *eth_hdr, union tunnel_offload_info *i
 		tcp_hdr->cksum = get_psd_sum(l3_hdr, ethertype, ol_flags);
 
 	} else if (l4_proto == IPPROTO_SCTP) {
-		sctp_hdr = (struct sctp_hdr *)((char *)l3_hdr + info->l3_len);
+		sctp_hdr = (struct rte_sctp_hdr *)((char *)l3_hdr + info->l3_len);
 		sctp_hdr->cksum = 0;
 		ol_flags |= PKT_TX_SCTP_CKSUM;
 	}
lib/librte_ethdev/rte_flow.h +1 -1
index 4e0a84aff..23f7cb9b5 100644
@@ -723,7 +723,7 @@ static const struct rte_flow_item_tcp rte_flow_item_tcp_mask = {
  * Matches a SCTP header.
  */
 struct rte_flow_item_sctp {
-	struct sctp_hdr hdr; /**< SCTP header definition. */
+	struct rte_sctp_hdr hdr; /**< SCTP header definition. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_SCTP. */
lib/librte_net/rte_net.c +2 -2
index 617395fe6..3e9d2d23d 100644
@@ -351,7 +351,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,
 		hdr_lens->l4_len = (th->data_off & 0xf0) >> 2;
 		return pkt_type;
 	} else if ((pkt_type & RTE_PTYPE_L4_MASK) == RTE_PTYPE_L4_SCTP) {
-		hdr_lens->l4_len = sizeof(struct sctp_hdr);
+		hdr_lens->l4_len = sizeof(struct rte_sctp_hdr);
 		return pkt_type;
 	} else {
 		uint32_t prev_off = off;
@@ -487,7 +487,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,
 		hdr_lens->inner_l4_len = (th->data_off & 0xf0) >> 2;
 	} else if ((pkt_type & RTE_PTYPE_INNER_L4_MASK) ==
 			RTE_PTYPE_INNER_L4_SCTP) {
-		hdr_lens->inner_l4_len = sizeof(struct sctp_hdr);
+		hdr_lens->inner_l4_len = sizeof(struct rte_sctp_hdr);
 	} else {
 		hdr_lens->inner_l4_len = 0;
 	}
lib/librte_net/rte_sctp.h +1 -1
index bfb7165a6..b3661b0db 100644
@@ -23,7 +23,7 @@ extern "C" {
 /**
  * SCTP Header
  */
-struct sctp_hdr {
+struct rte_sctp_hdr {
 	uint16_t src_port; /**< Source port. */
 	uint16_t dst_port; /**< Destin port. */
 	uint32_t tag;      /**< Validation tag. */
lib/librte_vhost/virtio_net.c +2 -2
index 9736a7339..cbfc1a627 100644
@@ -252,7 +252,7 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr)
 						dgram_cksum));
 			break;
 		case PKT_TX_SCTP_CKSUM:
-			net_hdr->csum_offset = (offsetof(struct sctp_hdr,
+			net_hdr->csum_offset = (offsetof(struct rte_sctp_hdr,
 						cksum));
 			break;
 		}
@@ -1031,7 +1031,7 @@ vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m)
 				if (l4_proto == IPPROTO_UDP)
 					m->ol_flags |= PKT_TX_UDP_CKSUM;
 				break;
-			case (offsetof(struct sctp_hdr, cksum)):
+			case (offsetof(struct rte_sctp_hdr, cksum)):
 				if (l4_proto == IPPROTO_SCTP)
 					m->ol_flags |= PKT_TX_SCTP_CKSUM;
 				break;
test/test/packet_burst_generator.c +3 -3
index 886b5f8ac..9aa07e176 100644
@@ -121,7 +121,7 @@ initialize_tcp_header(struct tcp_hdr *tcp_hdr, uint16_t src_port,
 }
 
 uint16_t
-initialize_sctp_header(struct sctp_hdr *sctp_hdr, uint16_t src_port,
+initialize_sctp_header(struct rte_sctp_hdr *sctp_hdr, uint16_t src_port,
 		uint16_t dst_port, uint16_t pkt_data_len)
 {
 	uint16_t pkt_len;
@@ -394,7 +394,7 @@ generate_packet_burst_proto(struct rte_mempool *mp,
 				break;
 			case IPPROTO_SCTP:
 				copy_buf_to_pkt(proto_hdr,
-					sizeof(struct sctp_hdr), pkt,
+					sizeof(struct rte_sctp_hdr), pkt,
 					eth_hdr_size + sizeof(struct rte_ipv4_hdr));
 				break;
 			default:
@@ -416,7 +416,7 @@ generate_packet_burst_proto(struct rte_mempool *mp,
 				break;
 			case IPPROTO_SCTP:
 				copy_buf_to_pkt(proto_hdr,
-					sizeof(struct sctp_hdr), pkt,
+					sizeof(struct rte_sctp_hdr), pkt,
 					eth_hdr_size + sizeof(struct rte_ipv6_hdr));
 				break;
 			default:
test/test/packet_burst_generator.h +1 -1
index 93efee1f5..98185c162 100644
@@ -42,7 +42,7 @@ initialize_tcp_header(struct tcp_hdr *tcp_hdr, uint16_t src_port,
 		uint16_t dst_port, uint16_t pkt_data_len);
 
 uint16_t
-initialize_sctp_header(struct sctp_hdr *sctp_hdr, uint16_t src_port,
+initialize_sctp_header(struct rte_sctp_hdr *sctp_hdr, uint16_t src_port,
 		uint16_t dst_port, uint16_t pkt_data_len);
 
 uint16_t
test/test/test_flow_classify.c +1 -1
index ad6c481fe..85228486d 100644
@@ -565,7 +565,7 @@ init_ipv4_sctp_traffic(struct rte_mempool *mp,
 {
 	struct rte_ether_hdr pkt_eth_hdr;
 	struct rte_ipv4_hdr pkt_ipv4_hdr;
-	struct sctp_hdr pkt_sctp_hdr;
+	struct rte_sctp_hdr pkt_sctp_hdr;
 	uint32_t src_addr = IPV4_ADDR(11, 12, 13, 14);
 	uint32_t dst_addr = IPV4_ADDR(15, 16, 17, 18);
 	uint16_t src_port = 10;
Signature · 1 line
2.11.0
#16 lore raw

RFC 13/14 net: add rte prefix to tcp structure

In reply to Olivier Matz

Add 'rte_' prefix to structures:
- rename struct tcp_hdr as struct rte_tcp_hdr.

---
 app/test-pmd/csumonly.c                        | 12 ++++++------
 doc/guides/sample_app_ug/flow_classify.rst     |  4 ++--
 drivers/net/avf/avf_rxtx.c                     |  2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c         |  6 +++---
 drivers/net/dpaa/dpaa_rxtx.c                   |  2 +-
 drivers/net/e1000/em_rxtx.c                    |  2 +-
 drivers/net/e1000/igb_rxtx.c                   |  2 +-
 drivers/net/ena/ena_ethdev.c                   |  2 +-
 drivers/net/enic/enic_clsf.c                   |  8 ++++----
 drivers/net/enic/enic_flow.c                   | 14 +++++++-------
 drivers/net/i40e/i40e_fdir.c                   | 20 ++++++++++----------
 drivers/net/i40e/i40e_rxtx.c                   |  2 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                 |  2 +-
 drivers/net/mlx5/mlx5_flow.c                   |  8 ++++----
 drivers/net/mlx5/mlx5_flow_tcf.c               |  4 ++--
 drivers/net/qede/qede_filter.c                 | 12 ++++++------
 drivers/net/sfc/sfc_ef10_tx.c                  |  4 ++--
 drivers/net/sfc/sfc_tso.c                      |  4 ++--
 drivers/net/softnic/rte_eth_softnic_pipeline.c |  8 ++++----
 drivers/net/tap/rte_eth_tap.c                  |  2 +-
 drivers/net/virtio/virtio_rxtx.c               |  4 ++--
 drivers/net/vmxnet3/vmxnet3_rxtx.c             | 14 +++++++-------
 examples/flow_classify/flow_classify.c         |  4 ++--
 examples/ip_pipeline/pipeline.c                |  8 ++++----
 examples/l3fwd-power/main.c                    |  8 ++++----
 examples/l3fwd-vf/main.c                       |  4 ++--
 examples/tep_termination/vxlan.c               |  4 ++--
 examples/vhost/main.c                          |  4 ++--
 lib/librte_ethdev/rte_flow.h                   |  2 +-
 lib/librte_gro/gro_tcp4.c                      |  4 ++--
 lib/librte_gro/gro_tcp4.h                      |  8 ++++----
 lib/librte_gro/gro_vxlan_tcp4.c                |  6 +++---
 lib/librte_gso/gso_common.h                    |  4 ++--
 lib/librte_gso/gso_tcp4.c                      |  4 ++--
 lib/librte_gso/gso_tunnel_tcp4.c               |  4 ++--
 lib/librte_gso/rte_gso.h                       |  2 +-
 lib/librte_net/rte_net.c                       |  8 ++++----
 lib/librte_net/rte_net.h                       |  6 +++---
 lib/librte_net/rte_tcp.h                       |  2 +-
 lib/librte_pipeline/rte_table_action.c         |  8 ++++----
 lib/librte_vhost/virtio_net.c                  |  6 +++---
 test/test/packet_burst_generator.c             | 10 +++++-----
 test/test/packet_burst_generator.h             |  2 +-
 test/test/test_flow_classify.c                 |  6 +++---
 44 files changed, 126 insertions(+), 126 deletions(-)
app/test-pmd/csumonly.c +6 -6
index d8b892941..bcff65eee 100644
@@ -102,14 +102,14 @@ get_udptcp_checksum(void *l3_hdr, void *l4_hdr, uint16_t ethertype)
 static void
 parse_ipv4(struct rte_ipv4_hdr *ipv4_hdr, struct testpmd_offload_info *info)
 {
-	struct tcp_hdr *tcp_hdr;
+	struct rte_tcp_hdr *tcp_hdr;
 
 	info->l3_len = (ipv4_hdr->version_ihl & 0x0f) * 4;
 	info->l4_proto = ipv4_hdr->next_proto_id;
 
 	/* only fill l4_len for TCP, it's useful for TSO */
 	if (info->l4_proto == IPPROTO_TCP) {
-		tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + info->l3_len);
+		tcp_hdr = (struct rte_tcp_hdr *)((char *)ipv4_hdr + info->l3_len);
 		info->l4_len = (tcp_hdr->data_off & 0xf0) >> 2;
 	} else
 		info->l4_len = 0;
@@ -119,14 +119,14 @@ parse_ipv4(struct rte_ipv4_hdr *ipv4_hdr, struct testpmd_offload_info *info)
 static void
 parse_ipv6(struct rte_ipv6_hdr *ipv6_hdr, struct testpmd_offload_info *info)
 {
-	struct tcp_hdr *tcp_hdr;
+	struct rte_tcp_hdr *tcp_hdr;
 
 	info->l3_len = sizeof(struct rte_ipv6_hdr);
 	info->l4_proto = ipv6_hdr->proto;
 
 	/* only fill l4_len for TCP, it's useful for TSO */
 	if (info->l4_proto == IPPROTO_TCP) {
-		tcp_hdr = (struct tcp_hdr *)((char *)ipv6_hdr + info->l3_len);
+		tcp_hdr = (struct rte_tcp_hdr *)((char *)ipv6_hdr + info->l3_len);
 		info->l4_len = (tcp_hdr->data_off & 0xf0) >> 2;
 	} else
 		info->l4_len = 0;
@@ -360,7 +360,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 {
 	struct rte_ipv4_hdr *ipv4_hdr = l3_hdr;
 	struct udp_hdr *udp_hdr;
-	struct tcp_hdr *tcp_hdr;
+	struct rte_tcp_hdr *tcp_hdr;
 	struct rte_sctp_hdr *sctp_hdr;
 	uint64_t ol_flags = 0;
 	uint32_t max_pkt_len, tso_segsz = 0;
@@ -414,7 +414,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 		if (info->gso_enable)
 			ol_flags |= PKT_TX_UDP_SEG;
 	} else if (info->l4_proto == IPPROTO_TCP) {
-		tcp_hdr = (struct tcp_hdr *)((char *)l3_hdr + info->l3_len);
+		tcp_hdr = (struct rte_tcp_hdr *)((char *)l3_hdr + info->l3_len);
 		tcp_hdr->cksum = 0;
 		if (tso_segsz)
 			ol_flags |= PKT_TX_TCP_SEG;
doc/guides/sample_app_ug/flow_classify.rst +2 -2
index 8172a96c4..1b354c31a 100644
@@ -126,7 +126,7 @@ initialisation of the ``Flow Classify`` application..
             .input_index = SRCP_DESTP_INPUT_IPV4,
             .offset = sizeof(struct rte_ether_hdr) +
                 sizeof(struct rte_ipv4_hdr) +
-                offsetof(struct tcp_hdr, src_port),
+                offsetof(struct rte_tcp_hdr, src_port),
         },
         {
              /* rte_flow uses a bit mask for protocol ports */
@@ -136,7 +136,7 @@ initialisation of the ``Flow Classify`` application..
              .input_index = SRCP_DESTP_INPUT_IPV4,
              .offset = sizeof(struct rte_ether_hdr) +
                  sizeof(struct rte_ipv4_hdr) +
-                 offsetof(struct tcp_hdr, dst_port),
+                 offsetof(struct rte_tcp_hdr, dst_port),
         },
     };
 
drivers/net/avf/avf_rxtx.c +1 -1
index 157744937..d3a63e6c0 100644
@@ -1417,7 +1417,7 @@ avf_txd_enable_checksum(uint64_t ol_flags,
 	switch (ol_flags & PKT_TX_L4_MASK) {
 	case PKT_TX_TCP_CKSUM:
 		*td_cmd |= AVF_TX_DESC_CMD_L4T_EOFT_TCP;
-		*td_offset |= (sizeof(struct tcp_hdr) >> 2) <<
+		*td_offset |= (sizeof(struct rte_tcp_hdr) >> 2) <<
 			      AVF_TX_DESC_LENGTH_L4_FC_LEN_SHIFT;
 		break;
 	case PKT_TX_SCTP_CKSUM:
drivers/net/bonding/rte_eth_bond_pmd.c +3 -3
index dd7d3fb20..8a6d52ea9 100644
@@ -835,7 +835,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
 	int i;
 
 	struct udp_hdr *udp_hdr;
-	struct tcp_hdr *tcp_hdr;
+	struct rte_tcp_hdr *tcp_hdr;
 	uint32_t hash, l3hash, l4hash;
 
 	for (i = 0; i < nb_pkts; i++) {
@@ -860,7 +860,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
 					RTE_IPV4_IHL_MULTIPLIER;
 
 				if (ipv4_hdr->next_proto_id == IPPROTO_TCP) {
-					tcp_hdr = (struct tcp_hdr *)
+					tcp_hdr = (struct rte_tcp_hdr *)
 						((char *)ipv4_hdr +
 							ip_hdr_offset);
 					l4hash = HASH_L4_PORTS(tcp_hdr);
@@ -878,7 +878,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
 			l3hash = ipv6_hash(ipv6_hdr);
 
 			if (ipv6_hdr->proto == IPPROTO_TCP) {
-				tcp_hdr = (struct tcp_hdr *)(ipv6_hdr + 1);
+				tcp_hdr = (struct rte_tcp_hdr *)(ipv6_hdr + 1);
 				l4hash = HASH_L4_PORTS(tcp_hdr);
 			} else if (ipv6_hdr->proto == IPPROTO_UDP) {
 				udp_hdr = (struct udp_hdr *)(ipv6_hdr + 1);
drivers/net/dpaa/dpaa_rxtx.c +1 -1
index 9aa31ad42..fb7f3cd52 100644
@@ -218,7 +218,7 @@ static inline void dpaa_checksum(struct rte_mbuf *mbuf)
 		ipv6_hdr = (struct rte_ipv6_hdr *)l3_hdr;
 
 	if ((mbuf->packet_type & RTE_PTYPE_L4_MASK) == RTE_PTYPE_L4_TCP) {
-		struct tcp_hdr *tcp_hdr = (struct tcp_hdr *)(l3_hdr +
+		struct rte_tcp_hdr *tcp_hdr = (struct rte_tcp_hdr *)(l3_hdr +
 					  mbuf->l3_len);
 		tcp_hdr->cksum = 0;
 		if (eth_hdr->ether_type == htons(RTE_ETHER_TYPE_IPv4))
drivers/net/e1000/em_rxtx.c +1 -1
index 84c0c537b..27146607c 100644
@@ -247,7 +247,7 @@ em_set_xmit_ctx(struct em_tx_queue* txq,
 		break;
 	case PKT_TX_TCP_CKSUM:
 		ctx.upper_setup.tcp_fields.tucso = (uint8_t)(ipcse +
-				offsetof(struct tcp_hdr, cksum));
+				offsetof(struct rte_tcp_hdr, cksum));
 		cmd_len |= E1000_TXD_CMD_TCP;
 		cmp_mask |= TX_MACIP_LEN_CMP_MASK;
 		break;
drivers/net/e1000/igb_rxtx.c +1 -1
index 8b6fddbd7..9046d21a9 100644
@@ -290,7 +290,7 @@ igbe_set_xmit_ctx(struct igb_tx_queue* txq,
 		case PKT_TX_TCP_CKSUM:
 			type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_TCP |
 				E1000_ADVTXD_DTYP_CTXT | E1000_ADVTXD_DCMD_DEXT;
-			mss_l4len_idx |= sizeof(struct tcp_hdr) << E1000_ADVTXD_L4LEN_SHIFT;
+			mss_l4len_idx |= sizeof(struct rte_tcp_hdr) << E1000_ADVTXD_L4LEN_SHIFT;
 			break;
 		case PKT_TX_SCTP_CKSUM:
 			type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_SCTP |
drivers/net/ena/ena_ethdev.c +1 -1
index eaeed9fee..198d731c9 100644
@@ -74,7 +74,7 @@
 #define TEST_BIT(val, bit_shift) (val & (1UL << bit_shift))
 
 #define GET_L4_HDR_LEN(mbuf)					\
-	((rte_pktmbuf_mtod_offset(mbuf,	struct tcp_hdr *,	\
+	((rte_pktmbuf_mtod_offset(mbuf,	struct rte_tcp_hdr *,	\
 		mbuf->l3_len + mbuf->l2_len)->data_off) >> 4)
 
 #define ENA_RX_RSS_TABLE_LOG_SIZE  7
drivers/net/enic/enic_clsf.c +4 -4
index 96a3aac87..c9d898044 100644
@@ -132,7 +132,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 		enic_set_layer(gp, FILTER_GENERIC_1_UDP, FILTER_GENERIC_1_L4,
 			       &udp_mask, &udp_val, sizeof(struct udp_hdr));
 	} else if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_TCP) {
-		struct tcp_hdr tcp_mask, tcp_val;
+		struct rte_tcp_hdr tcp_mask, tcp_val;
 		memset(&tcp_mask, 0, sizeof(tcp_mask));
 		memset(&tcp_val, 0, sizeof(tcp_val));
 
@@ -146,7 +146,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 		}
 
 		enic_set_layer(gp, FILTER_GENERIC_1_TCP, FILTER_GENERIC_1_L4,
-			       &tcp_mask, &tcp_val, sizeof(struct tcp_hdr));
+			       &tcp_mask, &tcp_val, sizeof(struct rte_tcp_hdr));
 	} else if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_SCTP) {
 		struct rte_sctp_hdr sctp_mask, sctp_val;
 		memset(&sctp_mask, 0, sizeof(sctp_mask));
@@ -221,7 +221,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 		enic_set_layer(gp, FILTER_GENERIC_1_UDP, FILTER_GENERIC_1_L4,
 			       &udp_mask, &udp_val, sizeof(struct udp_hdr));
 	} else if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_TCP) {
-		struct tcp_hdr tcp_mask, tcp_val;
+		struct rte_tcp_hdr tcp_mask, tcp_val;
 		memset(&tcp_mask, 0, sizeof(tcp_mask));
 		memset(&tcp_val, 0, sizeof(tcp_val));
 
@@ -234,7 +234,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 			tcp_val.dst_port = input->flow.tcp6_flow.dst_port;
 		}
 		enic_set_layer(gp, FILTER_GENERIC_1_TCP, FILTER_GENERIC_1_L4,
-			       &tcp_mask, &tcp_val, sizeof(struct tcp_hdr));
+			       &tcp_mask, &tcp_val, sizeof(struct rte_tcp_hdr));
 	} else if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_SCTP) {
 		struct rte_sctp_hdr sctp_mask, sctp_val;
 		memset(&sctp_mask, 0, sizeof(sctp_mask));
drivers/net/enic/enic_flow.c +7 -7
index d3cbbd4c7..fd5b2d190 100644
@@ -448,7 +448,7 @@ enic_copy_item_tcp_v1(const struct rte_flow_item *item,
 	const struct rte_flow_item_tcp *spec = item->spec;
 	const struct rte_flow_item_tcp *mask = item->mask;
 	struct filter_ipv4_5tuple *enic_5tup = &enic_filter->u.ipv4;
-	struct tcp_hdr supported_mask = {
+	struct rte_tcp_hdr supported_mask = {
 		.src_port = 0xffff,
 		.dst_port = 0xffff,
 	};
@@ -785,19 +785,19 @@ enic_copy_item_tcp_v2(const struct rte_flow_item *item,
 
 	if (*inner_ofst == 0) {
 		memcpy(gp->layer[FILTER_GENERIC_1_L4].mask, &mask->hdr,
-		       sizeof(struct tcp_hdr));
+		       sizeof(struct rte_tcp_hdr));
 		memcpy(gp->layer[FILTER_GENERIC_1_L4].val, &spec->hdr,
-		       sizeof(struct tcp_hdr));
+		       sizeof(struct rte_tcp_hdr));
 	} else {
 		/* Inner IPv6 header. Mask/Val start at *inner_ofst into L5 */
-		if ((*inner_ofst + sizeof(struct tcp_hdr)) >
+		if ((*inner_ofst + sizeof(struct rte_tcp_hdr)) >
 		     FILTER_GENERIC_1_KEY_LEN)
 			return ENOTSUP;
 		memcpy(&gp->layer[FILTER_GENERIC_1_L5].mask[*inner_ofst],
-		       mask, sizeof(struct tcp_hdr));
+		       mask, sizeof(struct rte_tcp_hdr));
 		memcpy(&gp->layer[FILTER_GENERIC_1_L5].val[*inner_ofst],
-		       spec, sizeof(struct tcp_hdr));
-		*inner_ofst += sizeof(struct tcp_hdr);
+		       spec, sizeof(struct rte_tcp_hdr));
+		*inner_ofst += sizeof(struct rte_tcp_hdr);
 	}
 	return 0;
 }
drivers/net/i40e/i40e_fdir.c +10 -10
index 14a82426e..46dfa79b7 100644
@@ -800,7 +800,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 {
 	unsigned char *payload, *ptr;
 	struct udp_hdr *udp;
-	struct tcp_hdr *tcp;
+	struct rte_tcp_hdr *tcp;
 	struct rte_sctp_hdr *sctp;
 	uint8_t size, dst = 0;
 	uint8_t i, pit_idx, set_idx = I40E_FLXPLD_L4_IDX; /* use l4 by default*/
@@ -828,8 +828,8 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 		break;
 
 	case RTE_ETH_FLOW_NONFRAG_IPV4_TCP:
-		tcp = (struct tcp_hdr *)(raw_pkt + len);
-		payload = (unsigned char *)tcp + sizeof(struct tcp_hdr);
+		tcp = (struct rte_tcp_hdr *)(raw_pkt + len);
+		payload = (unsigned char *)tcp + sizeof(struct rte_tcp_hdr);
 		/*
 		 * The source and destination fields in the transmitted packet
 		 * need to be presented in a reversed order with respect
@@ -873,8 +873,8 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 		break;
 
 	case RTE_ETH_FLOW_NONFRAG_IPV6_TCP:
-		tcp = (struct tcp_hdr *)(raw_pkt + len);
-		payload = (unsigned char *)tcp + sizeof(struct tcp_hdr);
+		tcp = (struct rte_tcp_hdr *)(raw_pkt + len);
+		payload = (unsigned char *)tcp + sizeof(struct rte_tcp_hdr);
 		/*
 		 * The source and destination fields in the transmitted packet
 		 * need to be presented in a reversed order with respect
@@ -1090,7 +1090,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 	unsigned char *payload = NULL;
 	unsigned char *ptr;
 	struct udp_hdr *udp;
-	struct tcp_hdr *tcp;
+	struct rte_tcp_hdr *tcp;
 	struct rte_sctp_hdr *sctp;
 	struct rte_flow_item_gtp *gtp;
 	struct rte_ipv4_hdr *gtp_ipv4;
@@ -1127,8 +1127,8 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 		udp->dst_port = fdir_input->flow.udp4_flow.src_port;
 		udp->dgram_len = rte_cpu_to_be_16(I40E_FDIR_UDP_DEFAULT_LEN);
 	} else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV4_TCP) {
-		tcp = (struct tcp_hdr *)(raw_pkt + len);
-		payload = (unsigned char *)tcp + sizeof(struct tcp_hdr);
+		tcp = (struct rte_tcp_hdr *)(raw_pkt + len);
+		payload = (unsigned char *)tcp + sizeof(struct rte_tcp_hdr);
 		/**
 		 * The source and destination fields in the transmitted packet
 		 * need to be presented in a reversed order with respect
@@ -1164,8 +1164,8 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 		udp->dst_port = fdir_input->flow.udp6_flow.src_port;
 		udp->dgram_len = rte_cpu_to_be_16(I40E_FDIR_IPv6_PAYLOAD_LEN);
 	} else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_TCP) {
-		tcp = (struct tcp_hdr *)(raw_pkt + len);
-		payload = (unsigned char *)tcp + sizeof(struct tcp_hdr);
+		tcp = (struct rte_tcp_hdr *)(raw_pkt + len);
+		payload = (unsigned char *)tcp + sizeof(struct rte_tcp_hdr);
 		/**
 		 * The source and destination fields in the transmitted packet
 		 * need to be presented in a reversed order with respect
drivers/net/i40e/i40e_rxtx.c +1 -1
index 82bbac2ce..e5f18538f 100644
@@ -298,7 +298,7 @@ i40e_txd_enable_checksum(uint64_t ol_flags,
 	switch (ol_flags & PKT_TX_L4_MASK) {
 	case PKT_TX_TCP_CKSUM:
 		*td_cmd |= I40E_TX_DESC_CMD_L4T_EOFT_TCP;
-		*td_offset |= (sizeof(struct tcp_hdr) >> 2) <<
+		*td_offset |= (sizeof(struct rte_tcp_hdr) >> 2) <<
 				I40E_TX_DESC_LENGTH_L4_FC_LEN_SHIFT;
 		break;
 	case PKT_TX_SCTP_CKSUM:
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
index eb41f5ed0..036acaa14 100644
@@ -425,7 +425,7 @@ ixgbe_set_xmit_ctx(struct ixgbe_tx_queue *txq,
 		case PKT_TX_TCP_CKSUM:
 			type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP |
 				IXGBE_ADVTXD_DTYP_CTXT | IXGBE_ADVTXD_DCMD_DEXT;
-			mss_l4len_idx |= sizeof(struct tcp_hdr) << IXGBE_ADVTXD_L4LEN_SHIFT;
+			mss_l4len_idx |= sizeof(struct rte_tcp_hdr) << IXGBE_ADVTXD_L4LEN_SHIFT;
 			tx_offload_mask.l2_len |= ~0;
 			tx_offload_mask.l3_len |= ~0;
 			break;
drivers/net/mlx5/mlx5_flow.c +4 -4
index d99e2c526..76af6a8b6 100644
@@ -2563,11 +2563,11 @@ mlx5_fdir_filter_convert(struct rte_eth_dev *dev,
 		};
 		break;
 	case RTE_ETH_FLOW_NONFRAG_IPV4_TCP:
-		attributes->l4.tcp.hdr = (struct tcp_hdr){
+		attributes->l4.tcp.hdr = (struct rte_tcp_hdr){
 			.src_port = input->flow.tcp4_flow.src_port,
 			.dst_port = input->flow.tcp4_flow.dst_port,
 		};
-		attributes->l4_mask.tcp.hdr = (struct tcp_hdr){
+		attributes->l4_mask.tcp.hdr = (struct rte_tcp_hdr){
 			.src_port = mask->src_port_mask,
 			.dst_port = mask->dst_port_mask,
 		};
@@ -2593,11 +2593,11 @@ mlx5_fdir_filter_convert(struct rte_eth_dev *dev,
 		};
 		break;
 	case RTE_ETH_FLOW_NONFRAG_IPV6_TCP:
-		attributes->l4.tcp.hdr = (struct tcp_hdr){
+		attributes->l4.tcp.hdr = (struct rte_tcp_hdr){
 			.src_port = input->flow.tcp6_flow.src_port,
 			.dst_port = input->flow.tcp6_flow.dst_port,
 		};
-		attributes->l4_mask.tcp.hdr = (struct tcp_hdr){
+		attributes->l4_mask.tcp.hdr = (struct rte_tcp_hdr){
 			.src_port = mask->src_port_mask,
 			.dst_port = mask->dst_port_mask,
 		};
drivers/net/mlx5/mlx5_flow_tcf.c +2 -2
index f287762a4..7cfc72cdf 100644
@@ -452,8 +452,8 @@ flow_tcf_pedit_key_set_tp_port(const struct rte_flow_action *actions,
 	/* offset of src/dst port is same for TCP and UDP */
 	p_parser->keys[idx].off =
 		actions->type == RTE_FLOW_ACTION_TYPE_SET_TP_SRC ?
-		offsetof(struct tcp_hdr, src_port) :
-		offsetof(struct tcp_hdr, dst_port);
+		offsetof(struct rte_tcp_hdr, src_port) :
+		offsetof(struct rte_tcp_hdr, dst_port);
 	p_parser->keys[idx].mask = 0xFFFF0000;
 	p_parser->keys[idx].val =
 		(__u32)((const struct rte_flow_action_set_tp *)
drivers/net/qede/qede_filter.c +6 -6
index 34299b993..cd762cddb 100644
@@ -460,7 +460,7 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev,
 	struct rte_ipv4_hdr *ip;
 	struct rte_ipv6_hdr *ip6;
 	struct udp_hdr *udp;
-	struct tcp_hdr *tcp;
+	struct rte_tcp_hdr *tcp;
 	uint16_t len;
 
 	raw_pkt = (uint8_t *)buff;
@@ -496,13 +496,13 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev,
 			ip->total_length += sizeof(struct udp_hdr);
 			params->udp = true;
 		} else { /* TCP */
-			tcp = (struct tcp_hdr *)(raw_pkt + len);
+			tcp = (struct rte_tcp_hdr *)(raw_pkt + len);
 			tcp->src_port = arfs->tuple.src_port;
 			tcp->dst_port = arfs->tuple.dst_port;
 			tcp->data_off = QEDE_FDIR_TCP_DEFAULT_DATAOFF;
-			len += sizeof(struct tcp_hdr);
+			len += sizeof(struct rte_tcp_hdr);
 			/* adjust ip total_length */
-			ip->total_length += sizeof(struct tcp_hdr);
+			ip->total_length += sizeof(struct rte_tcp_hdr);
 			params->tcp = true;
 		}
 		break;
@@ -528,11 +528,11 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev,
 			len += sizeof(struct udp_hdr);
 			params->udp = true;
 		} else { /* TCP */
-			tcp = (struct tcp_hdr *)(raw_pkt + len);
+			tcp = (struct rte_tcp_hdr *)(raw_pkt + len);
 			tcp->src_port = arfs->tuple.src_port;
 			tcp->dst_port = arfs->tuple.dst_port;
 			tcp->data_off = QEDE_FDIR_TCP_DEFAULT_DATAOFF;
-			len += sizeof(struct tcp_hdr);
+			len += sizeof(struct rte_tcp_hdr);
 			params->tcp = true;
 		}
 		break;
drivers/net/sfc/sfc_ef10_tx.c +2 -2
index e52de8ebd..06dc5b6e4 100644
@@ -329,7 +329,7 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg,
 	size_t header_len = m_seg->l2_len + m_seg->l3_len + m_seg->l4_len;
 	/* Offset of the payload in the last segment that contains the header */
 	size_t in_off = 0;
-	const struct tcp_hdr *th;
+	const struct rte_tcp_hdr *th;
 	uint16_t packet_id;
 	uint32_t sent_seq;
 	uint8_t *hdr_addr;
@@ -437,7 +437,7 @@ sfc_ef10_xmit_tso_pkt(struct sfc_ef10_txq * const txq, struct rte_mbuf *m_seg,
 		return EINVAL;
 	}
 
-	th = (const struct tcp_hdr *)(hdr_addr + tcph_off);
+	th = (const struct rte_tcp_hdr *)(hdr_addr + tcph_off);
 	rte_memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t));
 	sent_seq = rte_be_to_cpu_32(sent_seq);
 
drivers/net/sfc/sfc_tso.c +2 -2
index cfa5c037a..2675ee19e 100644
@@ -95,7 +95,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,
 	       unsigned int *pkt_descs, size_t *pkt_len)
 {
 	uint8_t *tsoh;
-	const struct tcp_hdr *th;
+	const struct rte_tcp_hdr *th;
 	efsys_dma_addr_t header_paddr;
 	uint16_t packet_id;
 	uint32_t sent_seq;
@@ -158,7 +158,7 @@ sfc_efx_tso_do(struct sfc_efx_txq *txq, unsigned int idx,
 	}
 
 	/* Handle TCP header */
-	th = (const struct tcp_hdr *)(tsoh + tcph_off);
+	th = (const struct rte_tcp_hdr *)(tsoh + tcph_off);
 
 	rte_memcpy(&sent_seq, &th->sent_seq, sizeof(uint32_t));
 	sent_seq = rte_be_to_cpu_32(sent_seq);
drivers/net/softnic/rte_eth_softnic_pipeline.c +4 -4
index 4e6735c75..9e85f461b 100644
@@ -620,7 +620,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = {
 		.field_index = 3,
 		.input_index = 3,
 		.offset = sizeof(struct rte_ipv4_hdr) +
-			offsetof(struct tcp_hdr, src_port),
+			offsetof(struct rte_tcp_hdr, src_port),
 	},
 
 	/* Destination Port */
@@ -630,7 +630,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = {
 		.field_index = 4,
 		.input_index = 3,
 		.offset = sizeof(struct rte_ipv4_hdr) +
-			offsetof(struct tcp_hdr, dst_port),
+			offsetof(struct rte_tcp_hdr, dst_port),
 	},
 };
 
@@ -717,7 +717,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.field_index = 9,
 		.input_index = 9,
 		.offset = sizeof(struct rte_ipv6_hdr) +
-			offsetof(struct tcp_hdr, src_port),
+			offsetof(struct rte_tcp_hdr, src_port),
 	},
 
 	/* Destination Port */
@@ -727,7 +727,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.field_index = 10,
 		.input_index = 9,
 		.offset = sizeof(struct rte_ipv6_hdr) +
-			offsetof(struct tcp_hdr, dst_port),
+			offsetof(struct rte_tcp_hdr, dst_port),
 	},
 };
 
drivers/net/tap/rte_eth_tap.c +1 -1
index 3d7f56a9a..dd19f0119 100644
@@ -475,7 +475,7 @@ tap_tx_l3_cksum(char *packet, uint64_t ol_flags, unsigned int l2_len,
 		if ((ol_flags & PKT_TX_L4_MASK) == PKT_TX_UDP_CKSUM)
 			*l4_cksum = &((struct udp_hdr *)l4_hdr)->dgram_cksum;
 		else if ((ol_flags & PKT_TX_L4_MASK) == PKT_TX_TCP_CKSUM)
-			*l4_cksum = &((struct tcp_hdr *)l4_hdr)->cksum;
+			*l4_cksum = &((struct rte_tcp_hdr *)l4_hdr)->cksum;
 		else
 			return;
 		**l4_cksum = 0;
drivers/net/virtio/virtio_rxtx.c +2 -2
index b36450871..429beded8 100644
@@ -318,7 +318,7 @@ virtio_tso_fix_cksum(struct rte_mbuf *m)
 			m->l4_len)) {
 		struct rte_ipv4_hdr *iph;
 		struct rte_ipv6_hdr *ip6h;
-		struct tcp_hdr *th;
+		struct rte_tcp_hdr *th;
 		uint16_t prev_cksum, new_cksum, ip_len, ip_paylen;
 		uint32_t tmp;
 
@@ -373,7 +373,7 @@ virtqueue_xmit_offload(struct virtio_net_hdr *hdr,
 
 		case PKT_TX_TCP_CKSUM:
 			hdr->csum_start = cookie->l2_len + cookie->l3_len;
-			hdr->csum_offset = offsetof(struct tcp_hdr, cksum);
+			hdr->csum_offset = offsetof(struct rte_tcp_hdr, cksum);
 			hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
 			break;
 
drivers/net/vmxnet3/vmxnet3_rxtx.c +7 -7
index 3bbf9adf7..8726eabb9 100644
@@ -539,7 +539,7 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 
 			switch (txm->ol_flags & PKT_TX_L4_MASK) {
 			case PKT_TX_TCP_CKSUM:
-				gdesc->txd.msscof = gdesc->txd.hlen + offsetof(struct tcp_hdr, cksum);
+				gdesc->txd.msscof = gdesc->txd.hlen + offsetof(struct rte_tcp_hdr, cksum);
 				break;
 			case PKT_TX_UDP_CKSUM:
 				gdesc->txd.msscof = gdesc->txd.hlen + offsetof(struct udp_hdr, dgram_cksum);
@@ -667,7 +667,7 @@ vmxnet3_guess_mss(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd,
 	uint32_t hlen, slen;
 	struct rte_ipv4_hdr *ipv4_hdr;
 	struct rte_ipv6_hdr *ipv6_hdr;
-	struct tcp_hdr *tcp_hdr;
+	struct rte_tcp_hdr *tcp_hdr;
 	char *ptr;
 
 	RTE_ASSERT(rcd->tcp);
@@ -679,7 +679,7 @@ vmxnet3_guess_mss(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd,
 	if (rcd->v4) {
 		if (unlikely(slen < hlen + sizeof(struct rte_ipv4_hdr)))
 			return hw->mtu - sizeof(struct rte_ipv4_hdr)
-					- sizeof(struct tcp_hdr);
+					- sizeof(struct rte_tcp_hdr);
 
 		ipv4_hdr = (struct rte_ipv4_hdr *)(ptr + hlen);
 		hlen += (ipv4_hdr->version_ihl & RTE_IPV4_HDR_IHL_MASK) *
@@ -687,7 +687,7 @@ vmxnet3_guess_mss(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd,
 	} else if (rcd->v6) {
 		if (unlikely(slen < hlen + sizeof(struct rte_ipv6_hdr)))
 			return hw->mtu - sizeof(struct rte_ipv6_hdr) -
-					sizeof(struct tcp_hdr);
+					sizeof(struct rte_tcp_hdr);
 
 		ipv6_hdr = (struct rte_ipv6_hdr *)(ptr + hlen);
 		hlen += sizeof(struct rte_ipv6_hdr);
@@ -699,11 +699,11 @@ vmxnet3_guess_mss(struct vmxnet3_hw *hw, const Vmxnet3_RxCompDesc *rcd,
 		}
 	}
 
-	if (unlikely(slen < hlen + sizeof(struct tcp_hdr)))
-		return hw->mtu - hlen - sizeof(struct tcp_hdr) +
+	if (unlikely(slen < hlen + sizeof(struct rte_tcp_hdr)))
+		return hw->mtu - hlen - sizeof(struct rte_tcp_hdr) +
 				sizeof(struct rte_ether_hdr);
 
-	tcp_hdr = (struct tcp_hdr *)(ptr + hlen);
+	tcp_hdr = (struct rte_tcp_hdr *)(ptr + hlen);
 	hlen += (tcp_hdr->data_off & 0xf0) >> 2;
 
 	if (rxm->udata64 > 1)
examples/flow_classify/flow_classify.c +2 -2
index e68d0f694..75a66fd5b 100644
@@ -133,7 +133,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {
 		.input_index = SRCP_DESTP_INPUT_IPV4,
 		.offset = sizeof(struct rte_ether_hdr) +
 			sizeof(struct rte_ipv4_hdr) +
-			offsetof(struct tcp_hdr, src_port),
+			offsetof(struct rte_tcp_hdr, src_port),
 	},
 	{
 		/* rte_flow uses a bit mask for protocol ports */
@@ -143,7 +143,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {
 		.input_index = SRCP_DESTP_INPUT_IPV4,
 		.offset = sizeof(struct rte_ether_hdr) +
 			sizeof(struct rte_ipv4_hdr) +
-			offsetof(struct tcp_hdr, dst_port),
+			offsetof(struct rte_tcp_hdr, dst_port),
 	},
 };
 
examples/ip_pipeline/pipeline.c +4 -4
index 1e44fe37c..e0a8e9a6b 100644
@@ -664,7 +664,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = {
 		.field_index = 3,
 		.input_index = 3,
 		.offset = sizeof(struct rte_ipv4_hdr) +
-			offsetof(struct tcp_hdr, src_port),
+			offsetof(struct rte_tcp_hdr, src_port),
 	},
 
 	/* Destination Port */
@@ -674,7 +674,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv4[] = {
 		.field_index = 4,
 		.input_index = 3,
 		.offset = sizeof(struct rte_ipv4_hdr) +
-			offsetof(struct tcp_hdr, dst_port),
+			offsetof(struct rte_tcp_hdr, dst_port),
 	},
 };
 
@@ -761,7 +761,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.field_index = 9,
 		.input_index = 9,
 		.offset = sizeof(struct rte_ipv6_hdr) +
-			offsetof(struct tcp_hdr, src_port),
+			offsetof(struct rte_tcp_hdr, src_port),
 	},
 
 	/* Destination Port */
@@ -771,7 +771,7 @@ static const struct rte_acl_field_def table_acl_field_format_ipv6[] = {
 		.field_index = 10,
 		.input_index = 9,
 		.offset = sizeof(struct rte_ipv6_hdr) +
-			offsetof(struct tcp_hdr, dst_port),
+			offsetof(struct rte_tcp_hdr, dst_port),
 	},
 };
 
examples/l3fwd-power/main.c +4 -4
index f78aeab53..72d2c53e1 100644
@@ -485,7 +485,7 @@ get_ipv4_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,
 		lookup_struct_t * ipv4_l3fwd_lookup_struct)
 {
 	struct ipv4_5tuple key;
-	struct tcp_hdr *tcp;
+	struct rte_tcp_hdr *tcp;
 	struct udp_hdr *udp;
 	int ret = 0;
 
@@ -495,7 +495,7 @@ get_ipv4_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,
 
 	switch (ipv4_hdr->next_proto_id) {
 	case IPPROTO_TCP:
-		tcp = (struct tcp_hdr *)((unsigned char *)ipv4_hdr +
+		tcp = (struct rte_tcp_hdr *)((unsigned char *)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);
@@ -524,7 +524,7 @@ get_ipv6_dst_port(struct rte_ipv6_hdr *ipv6_hdr, uint16_t portid,
 			lookup_struct_t *ipv6_l3fwd_lookup_struct)
 {
 	struct ipv6_5tuple key;
-	struct tcp_hdr *tcp;
+	struct rte_tcp_hdr *tcp;
 	struct udp_hdr *udp;
 	int ret = 0;
 
@@ -535,7 +535,7 @@ get_ipv6_dst_port(struct rte_ipv6_hdr *ipv6_hdr, uint16_t portid,
 
 	switch (ipv6_hdr->proto) {
 	case IPPROTO_TCP:
-		tcp = (struct tcp_hdr *)((unsigned char *) ipv6_hdr +
+		tcp = (struct rte_tcp_hdr *)((unsigned char *) ipv6_hdr +
 					sizeof(struct rte_ipv6_hdr));
 		key.port_dst = rte_be_to_cpu_16(tcp->dst_port);
 		key.port_src = rte_be_to_cpu_16(tcp->src_port);
examples/l3fwd-vf/main.c +2 -2
index 5e3809b8d..d57ac262b 100644
@@ -366,7 +366,7 @@ get_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,
 	      lookup_struct_t *l3fwd_lookup_struct)
 {
 	struct ipv4_5tuple key;
-	struct tcp_hdr *tcp;
+	struct rte_tcp_hdr *tcp;
 	struct udp_hdr *udp;
 	int ret = 0;
 
@@ -376,7 +376,7 @@ get_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,
 
 	switch (ipv4_hdr->next_proto_id) {
 	case IPPROTO_TCP:
-		tcp = (struct tcp_hdr *)((unsigned char *) ipv4_hdr +
+		tcp = (struct rte_tcp_hdr *)((unsigned char *) 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);
examples/tep_termination/vxlan.c +2 -2
index 07a53abc3..261332adf 100644
@@ -76,7 +76,7 @@ process_inner_cksums(struct rte_ether_hdr *eth_hdr, union tunnel_offload_info *i
 	struct rte_ipv4_hdr *ipv4_hdr;
 	struct rte_ipv6_hdr *ipv6_hdr;
 	struct udp_hdr *udp_hdr;
-	struct tcp_hdr *tcp_hdr;
+	struct rte_tcp_hdr *tcp_hdr;
 	struct rte_sctp_hdr *sctp_hdr;
 	uint64_t ol_flags = 0;
 
@@ -112,7 +112,7 @@ process_inner_cksums(struct rte_ether_hdr *eth_hdr, union tunnel_offload_info *i
 		udp_hdr->dgram_cksum = get_psd_sum(l3_hdr,
 				ethertype, ol_flags);
 	} else if (l4_proto == IPPROTO_TCP) {
-		tcp_hdr = (struct tcp_hdr *)((char *)l3_hdr + info->l3_len);
+		tcp_hdr = (struct rte_tcp_hdr *)((char *)l3_hdr + info->l3_len);
 		/* Put PKT_TX_TCP_SEG bit setting before get_psd_sum(), because
 		 * it depends on PKT_TX_TCP_SEG to calculate pseudo-header
 		 * checksum.
examples/vhost/main.c +2 -2
index d7ee4530e..a973cb4b1 100644
@@ -879,7 +879,7 @@ static void virtio_tx_offload(struct rte_mbuf *m)
 {
 	void *l3_hdr;
 	struct rte_ipv4_hdr *ipv4_hdr = NULL;
-	struct tcp_hdr *tcp_hdr = NULL;
+	struct rte_tcp_hdr *tcp_hdr = NULL;
 	struct rte_ether_hdr *eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
 	l3_hdr = (char *)eth_hdr + m->l2_len;
@@ -890,7 +890,7 @@ static void virtio_tx_offload(struct rte_mbuf *m)
 		m->ol_flags |= PKT_TX_IP_CKSUM;
 	}
 
-	tcp_hdr = (struct tcp_hdr *)((char *)l3_hdr + m->l3_len);
+	tcp_hdr = (struct rte_tcp_hdr *)((char *)l3_hdr + m->l3_len);
 	tcp_hdr->cksum = get_psd_sum(l3_hdr, m->ol_flags);
 }
 
lib/librte_ethdev/rte_flow.h +1 -1
index 23f7cb9b5..cea95b98a 100644
@@ -704,7 +704,7 @@ static const struct rte_flow_item_udp rte_flow_item_udp_mask = {
  * Matches a TCP header.
  */
 struct rte_flow_item_tcp {
-	struct tcp_hdr hdr; /**< TCP header definition. */
+	struct rte_tcp_hdr hdr; /**< TCP header definition. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_TCP. */
lib/librte_gro/gro_tcp4.c +2 -2
index 3ed8cda02..73dbb8dd5 100644
@@ -196,7 +196,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,
 {
 	struct rte_ether_hdr *eth_hdr;
 	struct rte_ipv4_hdr *ipv4_hdr;
-	struct tcp_hdr *tcp_hdr;
+	struct rte_tcp_hdr *tcp_hdr;
 	uint32_t sent_seq;
 	uint16_t tcp_dl, ip_id, hdr_len, frag_off;
 	uint8_t is_atomic;
@@ -209,7 +209,7 @@ gro_tcp4_reassemble(struct rte_mbuf *pkt,
 
 	eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
 	ipv4_hdr = (struct rte_ipv4_hdr *)((char *)eth_hdr + pkt->l2_len);
-	tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len);
+	tcp_hdr = (struct rte_tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len);
 	hdr_len = pkt->l2_len + pkt->l3_len + pkt->l4_len;
 
 	/*
lib/librte_gro/gro_tcp4.h +4 -4
index e33b65083..63f06bec4 100644
@@ -255,7 +255,7 @@ merge_two_tcp4_packets(struct gro_tcp4_item *item,
  */
 static inline int
 check_seq_option(struct gro_tcp4_item *item,
-		struct tcp_hdr *tcph,
+		struct rte_tcp_hdr *tcph,
 		uint32_t sent_seq,
 		uint16_t ip_id,
 		uint16_t tcp_hl,
@@ -265,16 +265,16 @@ check_seq_option(struct gro_tcp4_item *item,
 {
 	struct rte_mbuf *pkt_orig = item->firstseg;
 	struct rte_ipv4_hdr *iph_orig;
-	struct tcp_hdr *tcph_orig;
+	struct rte_tcp_hdr *tcph_orig;
 	uint16_t len, tcp_hl_orig;
 
 	iph_orig = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt_orig, char *) +
 			l2_offset + pkt_orig->l2_len);
-	tcph_orig = (struct tcp_hdr *)((char *)iph_orig + pkt_orig->l3_len);
+	tcph_orig = (struct rte_tcp_hdr *)((char *)iph_orig + pkt_orig->l3_len);
 	tcp_hl_orig = pkt_orig->l4_len;
 
 	/* Check if TCP option fields equal */
-	len = RTE_MAX(tcp_hl, tcp_hl_orig) - sizeof(struct tcp_hdr);
+	len = RTE_MAX(tcp_hl, tcp_hl_orig) - sizeof(struct rte_tcp_hdr);
 	if ((tcp_hl != tcp_hl_orig) || ((len > 0) &&
 				(memcmp(tcph + 1, tcph_orig + 1,
 					len) != 0)))
lib/librte_gro/gro_vxlan_tcp4.c +3 -3
index 80d2d5288..3cfe20f75 100644
@@ -207,7 +207,7 @@ is_same_vxlan_tcp4_flow(struct vxlan_tcp4_flow_key k1,
 
 static inline int
 check_vxlan_seq_option(struct gro_vxlan_tcp4_item *item,
-		struct tcp_hdr *tcp_hdr,
+		struct rte_tcp_hdr *tcp_hdr,
 		uint32_t sent_seq,
 		uint16_t outer_ip_id,
 		uint16_t ip_id,
@@ -291,7 +291,7 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt,
 {
 	struct rte_ether_hdr *outer_eth_hdr, *eth_hdr;
 	struct rte_ipv4_hdr *outer_ipv4_hdr, *ipv4_hdr;
-	struct tcp_hdr *tcp_hdr;
+	struct rte_tcp_hdr *tcp_hdr;
 	struct udp_hdr *udp_hdr;
 	struct rte_vxlan_hdr *vxlan_hdr;
 	uint32_t sent_seq;
@@ -315,7 +315,7 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt,
 	eth_hdr = (struct rte_ether_hdr *)((char *)vxlan_hdr +
 			sizeof(struct rte_vxlan_hdr));
 	ipv4_hdr = (struct rte_ipv4_hdr *)((char *)udp_hdr + pkt->l2_len);
-	tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len);
+	tcp_hdr = (struct rte_tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len);
 
 	/*
 	 * Don't process the packet which has FIN, SYN, RST, PSH, URG,
lib/librte_gso/gso_common.h +2 -2
index e5c8d83e7..a35030153 100644
@@ -71,9 +71,9 @@ static inline void
 update_tcp_header(struct rte_mbuf *pkt, uint16_t l4_offset, uint32_t sent_seq,
 		uint8_t non_tail)
 {
-	struct tcp_hdr *tcp_hdr;
+	struct rte_tcp_hdr *tcp_hdr;
 
-	tcp_hdr = (struct tcp_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
+	tcp_hdr = (struct rte_tcp_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
 			l4_offset);
 	tcp_hdr->sent_seq = rte_cpu_to_be_32(sent_seq);
 	if (likely(non_tail))
lib/librte_gso/gso_tcp4.c +2 -2
index ad0cce6f9..ade172ac7 100644
@@ -10,7 +10,7 @@ update_ipv4_tcp_headers(struct rte_mbuf *pkt, uint8_t ipid_delta,
 		struct rte_mbuf **segs, uint16_t nb_segs)
 {
 	struct rte_ipv4_hdr *ipv4_hdr;
-	struct tcp_hdr *tcp_hdr;
+	struct rte_tcp_hdr *tcp_hdr;
 	uint32_t sent_seq;
 	uint16_t id, tail_idx, i;
 	uint16_t l3_offset = pkt->l2_len;
@@ -18,7 +18,7 @@ update_ipv4_tcp_headers(struct rte_mbuf *pkt, uint8_t ipid_delta,
 
 	ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char*) +
 			l3_offset);
-	tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len);
+	tcp_hdr = (struct rte_tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len);
 	id = rte_be_to_cpu_16(ipv4_hdr->packet_id);
 	sent_seq = rte_be_to_cpu_32(tcp_hdr->sent_seq);
 	tail_idx = nb_segs - 1;
lib/librte_gso/gso_tunnel_tcp4.c +2 -2
index f5a19bc43..e0384c26d 100644
@@ -10,7 +10,7 @@ update_tunnel_ipv4_tcp_headers(struct rte_mbuf *pkt, uint8_t ipid_delta,
 		struct rte_mbuf **segs, uint16_t nb_segs)
 {
 	struct rte_ipv4_hdr *ipv4_hdr;
-	struct tcp_hdr *tcp_hdr;
+	struct rte_tcp_hdr *tcp_hdr;
 	uint32_t sent_seq;
 	uint16_t outer_id, inner_id, tail_idx, i;
 	uint16_t outer_ipv4_offset, inner_ipv4_offset;
@@ -32,7 +32,7 @@ update_tunnel_ipv4_tcp_headers(struct rte_mbuf *pkt, uint8_t ipid_delta,
 			inner_ipv4_offset);
 	inner_id = rte_be_to_cpu_16(ipv4_hdr->packet_id);
 
-	tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len);
+	tcp_hdr = (struct rte_tcp_hdr *)((char *)ipv4_hdr + pkt->l3_len);
 	sent_seq = rte_be_to_cpu_32(tcp_hdr->sent_seq);
 	tail_idx = nb_segs - 1;
 
lib/librte_gso/rte_gso.h +1 -1
index ee879968c..8f65adf1c 100644
@@ -19,7 +19,7 @@ extern "C" {
 
 /* Minimum GSO segment size for TCP based packets. */
 #define RTE_GSO_SEG_SIZE_MIN (sizeof(struct rte_ether_hdr) + \
-		sizeof(struct rte_ipv4_hdr) + sizeof(struct tcp_hdr) + 1)
+		sizeof(struct rte_ipv4_hdr) + sizeof(struct rte_tcp_hdr) + 1)
 
 /* Minimum GSO segment size for UDP based packets. */
 #define RTE_GSO_UDP_SEG_SIZE_MIN (sizeof(struct rte_ether_hdr) + \
lib/librte_net/rte_net.c +4 -4
index 3e9d2d23d..9712c75ac 100644
@@ -341,8 +341,8 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,
 		hdr_lens->l4_len = sizeof(struct udp_hdr);
 		return pkt_type;
 	} else if ((pkt_type & RTE_PTYPE_L4_MASK) == RTE_PTYPE_L4_TCP) {
-		const struct tcp_hdr *th;
-		struct tcp_hdr th_copy;
+		const struct rte_tcp_hdr *th;
+		struct rte_tcp_hdr th_copy;
 
 		th = rte_pktmbuf_read(m, off, sizeof(*th), &th_copy);
 		if (unlikely(th == NULL))
@@ -477,8 +477,8 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,
 		hdr_lens->inner_l4_len = sizeof(struct udp_hdr);
 	} else if ((pkt_type & RTE_PTYPE_INNER_L4_MASK) ==
 			RTE_PTYPE_INNER_L4_TCP) {
-		const struct tcp_hdr *th;
-		struct tcp_hdr th_copy;
+		const struct rte_tcp_hdr *th;
+		struct rte_tcp_hdr th_copy;
 
 		th = rte_pktmbuf_read(m, off, sizeof(*th), &th_copy);
 		if (unlikely(th == NULL))
lib/librte_net/rte_net.h +3 -3
index 84f8dfe1c..4c27f4611 100644
@@ -114,7 +114,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
 {
 	struct rte_ipv4_hdr *ipv4_hdr;
 	struct rte_ipv6_hdr *ipv6_hdr;
-	struct tcp_hdr *tcp_hdr;
+	struct rte_tcp_hdr *tcp_hdr;
 	struct udp_hdr *udp_hdr;
 	uint64_t inner_l3_offset = m->l2_len;
 
@@ -149,7 +149,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
 			(ol_flags & PKT_TX_TCP_SEG)) {
 		if (ol_flags & PKT_TX_IPV4) {
 			/* non-TSO tcp or TSO */
-			tcp_hdr = (struct tcp_hdr *)((char *)ipv4_hdr +
+			tcp_hdr = (struct rte_tcp_hdr *)((char *)ipv4_hdr +
 					m->l3_len);
 			tcp_hdr->cksum = rte_ipv4_phdr_cksum(ipv4_hdr,
 					ol_flags);
@@ -157,7 +157,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
 			ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv6_hdr *,
 					inner_l3_offset);
 			/* non-TSO tcp or TSO */
-			tcp_hdr = rte_pktmbuf_mtod_offset(m, struct tcp_hdr *,
+			tcp_hdr = rte_pktmbuf_mtod_offset(m, struct rte_tcp_hdr *,
 					inner_l3_offset + m->l3_len);
 			tcp_hdr->cksum = rte_ipv6_phdr_cksum(ipv6_hdr,
 					ol_flags);
lib/librte_net/rte_tcp.h +1 -1
index 91f58987b..4bcda5565 100644
@@ -23,7 +23,7 @@ extern "C" {
 /**
  * TCP Header
  */
-struct tcp_hdr {
+struct rte_tcp_hdr {
 	uint16_t src_port;  /**< TCP source port. */
 	uint16_t dst_port;  /**< TCP destination port. */
 	uint32_t sent_seq;  /**< TX data sequence number. */
lib/librte_pipeline/rte_table_action.c +4 -4
index c7b04d6f5..15bbdd674 100644
@@ -1293,7 +1293,7 @@ pkt_ipv4_work_nat(struct rte_ipv4_hdr *ip,
 {
 	if (cfg->source_nat) {
 		if (cfg->proto == 0x6) {
-			struct tcp_hdr *tcp = (struct tcp_hdr *) &ip[1];
+			struct rte_tcp_hdr *tcp = (struct rte_tcp_hdr *) &ip[1];
 			uint16_t ip_cksum, tcp_cksum;
 
 			ip_cksum = nat_ipv4_checksum_update(ip->hdr_checksum,
@@ -1332,7 +1332,7 @@ pkt_ipv4_work_nat(struct rte_ipv4_hdr *ip,
 		}
 	} else {
 		if (cfg->proto == 0x6) {
-			struct tcp_hdr *tcp = (struct tcp_hdr *) &ip[1];
+			struct rte_tcp_hdr *tcp = (struct rte_tcp_hdr *) &ip[1];
 			uint16_t ip_cksum, tcp_cksum;
 
 			ip_cksum = nat_ipv4_checksum_update(ip->hdr_checksum,
@@ -1379,7 +1379,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip,
 {
 	if (cfg->source_nat) {
 		if (cfg->proto == 0x6) {
-			struct tcp_hdr *tcp = (struct tcp_hdr *) &ip[1];
+			struct rte_tcp_hdr *tcp = (struct rte_tcp_hdr *) &ip[1];
 			uint16_t tcp_cksum;
 
 			tcp_cksum = nat_ipv6_tcp_udp_checksum_update(tcp->cksum,
@@ -1407,7 +1407,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip,
 		}
 	} else {
 		if (cfg->proto == 0x6) {
-			struct tcp_hdr *tcp = (struct tcp_hdr *) &ip[1];
+			struct rte_tcp_hdr *tcp = (struct rte_tcp_hdr *) &ip[1];
 			uint16_t tcp_cksum;
 
 			tcp_cksum = nat_ipv6_tcp_udp_checksum_update(tcp->cksum,
lib/librte_vhost/virtio_net.c +3 -3
index cbfc1a627..11e76386c 100644
@@ -244,7 +244,7 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr)
 
 		switch (csum_l4) {
 		case PKT_TX_TCP_CKSUM:
-			net_hdr->csum_offset = (offsetof(struct tcp_hdr,
+			net_hdr->csum_offset = (offsetof(struct rte_tcp_hdr,
 						cksum));
 			break;
 		case PKT_TX_UDP_CKSUM:
@@ -1014,7 +1014,7 @@ vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m)
 {
 	uint16_t l4_proto = 0;
 	void *l4_hdr = NULL;
-	struct tcp_hdr *tcp_hdr = NULL;
+	struct rte_tcp_hdr *tcp_hdr = NULL;
 
 	if (hdr->flags == 0 && hdr->gso_type == VIRTIO_NET_HDR_GSO_NONE)
 		return;
@@ -1023,7 +1023,7 @@ vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m)
 	if (hdr->flags == VIRTIO_NET_HDR_F_NEEDS_CSUM) {
 		if (hdr->csum_start == (m->l2_len + m->l3_len)) {
 			switch (hdr->csum_offset) {
-			case (offsetof(struct tcp_hdr, cksum)):
+			case (offsetof(struct rte_tcp_hdr, cksum)):
 				if (l4_proto == IPPROTO_TCP)
 					m->ol_flags |= PKT_TX_TCP_CKSUM;
 				break;
test/test/packet_burst_generator.c +5 -5
index 9aa07e176..5730f8129 100644
@@ -106,14 +106,14 @@ initialize_udp_header(struct udp_hdr *udp_hdr, uint16_t src_port,
 }
 
 uint16_t
-initialize_tcp_header(struct tcp_hdr *tcp_hdr, uint16_t src_port,
+initialize_tcp_header(struct rte_tcp_hdr *tcp_hdr, uint16_t src_port,
 		uint16_t dst_port, uint16_t pkt_data_len)
 {
 	uint16_t pkt_len;
 
-	pkt_len = (uint16_t) (pkt_data_len + sizeof(struct tcp_hdr));
+	pkt_len = (uint16_t) (pkt_data_len + sizeof(struct rte_tcp_hdr));
 
-	memset(tcp_hdr, 0, sizeof(struct tcp_hdr));
+	memset(tcp_hdr, 0, sizeof(struct rte_tcp_hdr));
 	tcp_hdr->src_port = rte_cpu_to_be_16(src_port);
 	tcp_hdr->dst_port = rte_cpu_to_be_16(dst_port);
 
@@ -389,7 +389,7 @@ generate_packet_burst_proto(struct rte_mempool *mp,
 				break;
 			case IPPROTO_TCP:
 				copy_buf_to_pkt(proto_hdr,
-					sizeof(struct tcp_hdr), pkt,
+					sizeof(struct rte_tcp_hdr), pkt,
 					eth_hdr_size + sizeof(struct rte_ipv4_hdr));
 				break;
 			case IPPROTO_SCTP:
@@ -411,7 +411,7 @@ generate_packet_burst_proto(struct rte_mempool *mp,
 				break;
 			case IPPROTO_TCP:
 				copy_buf_to_pkt(proto_hdr,
-					sizeof(struct tcp_hdr), pkt,
+					sizeof(struct rte_tcp_hdr), pkt,
 					eth_hdr_size + sizeof(struct rte_ipv6_hdr));
 				break;
 			case IPPROTO_SCTP:
test/test/packet_burst_generator.h +1 -1
index 98185c162..5cfe0c600 100644
@@ -38,7 +38,7 @@ initialize_udp_header(struct udp_hdr *udp_hdr, uint16_t src_port,
 		uint16_t dst_port, uint16_t pkt_data_len);
 
 uint16_t
-initialize_tcp_header(struct tcp_hdr *tcp_hdr, uint16_t src_port,
+initialize_tcp_header(struct rte_tcp_hdr *tcp_hdr, uint16_t src_port,
 		uint16_t dst_port, uint16_t pkt_data_len);
 
 uint16_t
test/test/test_flow_classify.c +3 -3
index 85228486d..1a79326b8 100644
@@ -74,7 +74,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {
 		.input_index = SRCP_DESTP_INPUT_IPV4,
 		.offset = sizeof(struct rte_ether_hdr) +
 			sizeof(struct rte_ipv4_hdr) +
-			offsetof(struct tcp_hdr, src_port),
+			offsetof(struct rte_tcp_hdr, src_port),
 	},
 	{
 		/* rte_flow uses a bit mask for protocol ports */
@@ -84,7 +84,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {
 		.input_index = SRCP_DESTP_INPUT_IPV4,
 		.offset = sizeof(struct rte_ether_hdr) +
 			sizeof(struct rte_ipv4_hdr) +
-			offsetof(struct tcp_hdr, dst_port),
+			offsetof(struct rte_tcp_hdr, dst_port),
 	},
 };
 
@@ -528,7 +528,7 @@ init_ipv4_tcp_traffic(struct rte_mempool *mp,
 {
 	struct rte_ether_hdr pkt_eth_hdr;
 	struct rte_ipv4_hdr pkt_ipv4_hdr;
-	struct tcp_hdr pkt_tcp_hdr;
+	struct rte_tcp_hdr pkt_tcp_hdr;
 	uint32_t src_addr = IPV4_ADDR(1, 2, 3, 4);
 	uint32_t dst_addr = IPV4_ADDR(5, 6, 7, 8);
 	uint16_t src_port = 16;
Signature · 1 line
2.11.0
#17 lore raw

RFC 14/14 net: add rte prefix to udp structure

In reply to Olivier Matz

Add 'rte_' prefix to structures:
- rename struct udp_hdr as struct rte_udp_hdr.

---
 app/test-pmd/csumonly.c                | 20 ++++++++++----------
 app/test-pmd/flowgen.c                 |  4 ++--
 app/test-pmd/txonly.c                  |  8 ++++----
 app/test-pmd/util.c                    |  6 +++---
 drivers/net/avf/avf_rxtx.c             |  2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c |  6 +++---
 drivers/net/dpaa/dpaa_rxtx.c           |  2 +-
 drivers/net/e1000/em_rxtx.c            |  2 +-
 drivers/net/e1000/igb_rxtx.c           |  2 +-
 drivers/net/enic/enic_clsf.c           |  8 ++++----
 drivers/net/enic/enic_flow.c           | 14 +++++++-------
 drivers/net/i40e/i40e_fdir.c           | 24 ++++++++++++------------
 drivers/net/i40e/i40e_rxtx.c           |  2 +-
 drivers/net/ixgbe/ixgbe_rxtx.c         |  2 +-
 drivers/net/mlx5/mlx5_flow.c           |  8 ++++----
 drivers/net/qede/qede_filter.c         | 14 +++++++-------
 drivers/net/tap/rte_eth_tap.c          |  2 +-
 drivers/net/virtio/virtio_rxtx.c       |  2 +-
 drivers/net/vmxnet3/vmxnet3_rxtx.c     |  2 +-
 examples/l3fwd-power/main.c            |  8 ++++----
 examples/l3fwd-vf/main.c               |  4 ++--
 examples/tep_termination/vxlan.c       | 16 ++++++++--------
 lib/librte_ethdev/rte_flow.h           |  2 +-
 lib/librte_gro/gro_vxlan_tcp4.c        | 10 +++++-----
 lib/librte_gso/gso_common.h            |  4 ++--
 lib/librte_gso/rte_gso.h               |  2 +-
 lib/librte_net/rte_ether.h             |  4 ++--
 lib/librte_net/rte_net.c               |  4 ++--
 lib/librte_net/rte_net.h               |  6 +++---
 lib/librte_net/rte_udp.h               |  2 +-
 lib/librte_pipeline/rte_table_action.c | 32 ++++++++++++++++----------------
 lib/librte_vhost/virtio_net.c          |  6 +++---
 test/test/packet_burst_generator.c     | 12 ++++++------
 test/test/packet_burst_generator.h     |  4 ++--
 test/test/test_flow_classify.c         |  2 +-
 test/test/test_link_bonding.c          |  4 ++--
 test/test/test_link_bonding_mode4.c    |  2 +-
 test/test/test_pmd_perf.c              |  2 +-
 38 files changed, 128 insertions(+), 128 deletions(-)
app/test-pmd/csumonly.c +10 -10
index bcff65eee..532d1e569 100644
@@ -172,7 +172,7 @@ parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info *info)
 
 /* Parse a vxlan header */
 static void
-parse_vxlan(struct udp_hdr *udp_hdr,
+parse_vxlan(struct rte_udp_hdr *udp_hdr,
 	    struct testpmd_offload_info *info,
 	    uint32_t pkt_type)
 {
@@ -192,7 +192,7 @@ parse_vxlan(struct udp_hdr *udp_hdr,
 	info->outer_l4_proto = info->l4_proto;
 
 	eth_hdr = (struct rte_ether_hdr *)((char *)udp_hdr +
-		sizeof(struct udp_hdr) +
+		sizeof(struct rte_udp_hdr) +
 		sizeof(struct rte_vxlan_hdr));
 
 	parse_ethernet(eth_hdr, info);
@@ -201,7 +201,7 @@ parse_vxlan(struct udp_hdr *udp_hdr,
 
 /* Parse a vxlan-gpe header */
 static void
-parse_vxlan_gpe(struct udp_hdr *udp_hdr,
+parse_vxlan_gpe(struct rte_udp_hdr *udp_hdr,
 	    struct testpmd_offload_info *info)
 {
 	struct rte_ether_hdr *eth_hdr;
@@ -215,7 +215,7 @@ parse_vxlan_gpe(struct udp_hdr *udp_hdr,
 		return;
 
 	vxlan_gpe_hdr = (struct rte_vxlan_gpe_hdr *)((char *)udp_hdr +
-				sizeof(struct udp_hdr));
+				sizeof(struct rte_udp_hdr));
 
 	if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto ==
 	    RTE_VXLAN_GPE_TYPE_IPV4) {
@@ -359,7 +359,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 	uint64_t tx_offloads)
 {
 	struct rte_ipv4_hdr *ipv4_hdr = l3_hdr;
-	struct udp_hdr *udp_hdr;
+	struct rte_udp_hdr *udp_hdr;
 	struct rte_tcp_hdr *tcp_hdr;
 	struct rte_sctp_hdr *sctp_hdr;
 	uint64_t ol_flags = 0;
@@ -399,7 +399,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
 		return 0; /* packet type not supported, nothing to do */
 
 	if (info->l4_proto == IPPROTO_UDP) {
-		udp_hdr = (struct udp_hdr *)((char *)l3_hdr + info->l3_len);
+		udp_hdr = (struct rte_udp_hdr *)((char *)l3_hdr + info->l3_len);
 		/* do not recalculate udp cksum if it was 0 */
 		if (udp_hdr->dgram_cksum != 0) {
 			udp_hdr->dgram_cksum = 0;
@@ -451,7 +451,7 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
 {
 	struct rte_ipv4_hdr *ipv4_hdr = outer_l3_hdr;
 	struct rte_ipv6_hdr *ipv6_hdr = outer_l3_hdr;
-	struct udp_hdr *udp_hdr;
+	struct rte_udp_hdr *udp_hdr;
 	uint64_t ol_flags = 0;
 
 	if (info->outer_ethertype == _htons(RTE_ETHER_TYPE_IPv4)) {
@@ -474,7 +474,7 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
 		return ol_flags;
 	}
 
-	udp_hdr = (struct udp_hdr *)((char *)outer_l3_hdr + info->outer_l3_len);
+	udp_hdr = (struct rte_udp_hdr *)((char *)outer_l3_hdr + info->outer_l3_len);
 
 	/* outer UDP checksum is done in software. In the other side, for
 	 * UDP tunneling, like VXLAN or Geneve, outer UDP checksum can be
@@ -772,9 +772,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 		/* check if it's a supported tunnel */
 		if (txp->parse_tunnel) {
 			if (info.l4_proto == IPPROTO_UDP) {
-				struct udp_hdr *udp_hdr;
+				struct rte_udp_hdr *udp_hdr;
 
-				udp_hdr = (struct udp_hdr *)((char *)l3_hdr +
+				udp_hdr = (struct rte_udp_hdr *)((char *)l3_hdr +
 					info.l3_len);
 				parse_vxlan_gpe(udp_hdr, &info);
 				if (info.is_tunnel) {
app/test-pmd/flowgen.c +2 -2
index 0405fe9b6..0a202467b 100644
@@ -121,7 +121,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)
 	struct rte_mbuf  *pkt;
 	struct rte_ether_hdr *eth_hdr;
 	struct rte_ipv4_hdr *ip_hdr;
-	struct udp_hdr *udp_hdr;
+	struct rte_udp_hdr *udp_hdr;
 	uint16_t vlan_tci, vlan_tci_outer;
 	uint64_t ol_flags;
 	uint16_t nb_rx;
@@ -193,7 +193,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)
 						 sizeof(*ip_hdr));
 
 		/* Initialize UDP header. */
-		udp_hdr = (struct udp_hdr *)(ip_hdr + 1);
+		udp_hdr = (struct rte_udp_hdr *)(ip_hdr + 1);
 		udp_hdr->src_port	= rte_cpu_to_be_16(cfg_udp_src);
 		udp_hdr->dst_port	= rte_cpu_to_be_16(cfg_udp_dst);
 		udp_hdr->dgram_cksum	= 0; /* No UDP checksum. */
app/test-pmd/txonly.c +4 -4
index 5d76e471e..dd70d96a8 100644
@@ -52,7 +52,7 @@
 #define IP_VHL_DEF (IP_VERSION | IP_HDRLEN)
 
 static struct rte_ipv4_hdr  pkt_ip_hdr;  /**< IP header of transmitted packets. */
-static struct udp_hdr pkt_udp_hdr; /**< UDP header of transmitted packets. */
+static struct rte_udp_hdr pkt_udp_hdr; /**< UDP header of transmitted packets. */
 
 static void
 copy_buf_to_pkt_segs(void* buf, unsigned len, struct rte_mbuf *pkt,
@@ -93,7 +93,7 @@ copy_buf_to_pkt(void* buf, unsigned len, struct rte_mbuf *pkt, unsigned offset)
 
 static void
 setup_pkt_udp_ip_headers(struct rte_ipv4_hdr *ip_hdr,
-			 struct udp_hdr *udp_hdr,
+			 struct rte_udp_hdr *udp_hdr,
 			 uint16_t pkt_data_len)
 {
 	uint16_t *ptr16;
@@ -103,7 +103,7 @@ setup_pkt_udp_ip_headers(struct rte_ipv4_hdr *ip_hdr,
 	/*
 	 * Initialize UDP header.
 	 */
-	pkt_len = (uint16_t) (pkt_data_len + sizeof(struct udp_hdr));
+	pkt_len = (uint16_t) (pkt_data_len + sizeof(struct rte_udp_hdr));
 	udp_hdr->src_port = rte_cpu_to_be_16(UDP_SRC_PORT);
 	udp_hdr->dst_port = rte_cpu_to_be_16(UDP_DST_PORT);
 	udp_hdr->dgram_len      = RTE_CPU_TO_BE_16(pkt_len);
@@ -298,7 +298,7 @@ tx_only_begin(__attribute__((unused)) portid_t pi)
 
 	pkt_data_len = (uint16_t) (tx_pkt_length - (sizeof(struct rte_ether_hdr) +
 						    sizeof(struct rte_ipv4_hdr) +
-						    sizeof(struct udp_hdr)));
+						    sizeof(struct rte_udp_hdr)));
 	setup_pkt_udp_ip_headers(&pkt_ip_hdr, &pkt_udp_hdr, pkt_data_len);
 }
 
app/test-pmd/util.c +3 -3
index fe8b18bd3..cd0495802 100644
@@ -104,7 +104,7 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],
 		if (is_encapsulation) {
 			struct rte_ipv4_hdr *ipv4_hdr;
 			struct rte_ipv6_hdr *ipv6_hdr;
-			struct udp_hdr *udp_hdr;
+			struct rte_udp_hdr *udp_hdr;
 			uint8_t l2_len;
 			uint8_t l3_len;
 			uint8_t l4_len;
@@ -129,9 +129,9 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],
 			}
 			if (l4_proto == IPPROTO_UDP) {
 				udp_hdr = rte_pktmbuf_mtod_offset(mb,
-				struct udp_hdr *,
+				struct rte_udp_hdr *,
 				l2_len + l3_len);
-				l4_len = sizeof(struct udp_hdr);
+				l4_len = sizeof(struct rte_udp_hdr);
 				vxlan_hdr = rte_pktmbuf_mtod_offset(mb,
 				struct rte_vxlan_hdr *,
 				l2_len + l3_len + l4_len);
drivers/net/avf/avf_rxtx.c +1 -1
index d3a63e6c0..5aebbd3fe 100644
@@ -1427,7 +1427,7 @@ avf_txd_enable_checksum(uint64_t ol_flags,
 		break;
 	case PKT_TX_UDP_CKSUM:
 		*td_cmd |= AVF_TX_DESC_CMD_L4T_EOFT_UDP;
-		*td_offset |= (sizeof(struct udp_hdr) >> 2) <<
+		*td_offset |= (sizeof(struct rte_udp_hdr) >> 2) <<
 			      AVF_TX_DESC_LENGTH_L4_FC_LEN_SHIFT;
 		break;
 	default:
drivers/net/bonding/rte_eth_bond_pmd.c +3 -3
index 8a6d52ea9..a1409cdb3 100644
@@ -834,7 +834,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
 	size_t vlan_offset;
 	int i;
 
-	struct udp_hdr *udp_hdr;
+	struct rte_udp_hdr *udp_hdr;
 	struct rte_tcp_hdr *tcp_hdr;
 	uint32_t hash, l3hash, l4hash;
 
@@ -866,7 +866,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
 					l4hash = HASH_L4_PORTS(tcp_hdr);
 				} else if (ipv4_hdr->next_proto_id ==
 								IPPROTO_UDP) {
-					udp_hdr = (struct udp_hdr *)
+					udp_hdr = (struct rte_udp_hdr *)
 						((char *)ipv4_hdr +
 							ip_hdr_offset);
 					l4hash = HASH_L4_PORTS(udp_hdr);
@@ -881,7 +881,7 @@ burst_xmit_l34_hash(struct rte_mbuf **buf, uint16_t nb_pkts,
 				tcp_hdr = (struct rte_tcp_hdr *)(ipv6_hdr + 1);
 				l4hash = HASH_L4_PORTS(tcp_hdr);
 			} else if (ipv6_hdr->proto == IPPROTO_UDP) {
-				udp_hdr = (struct udp_hdr *)(ipv6_hdr + 1);
+				udp_hdr = (struct rte_udp_hdr *)(ipv6_hdr + 1);
 				l4hash = HASH_L4_PORTS(udp_hdr);
 			}
 		}
drivers/net/dpaa/dpaa_rxtx.c +1 -1
index fb7f3cd52..a50cc4cd6 100644
@@ -229,7 +229,7 @@ static inline void dpaa_checksum(struct rte_mbuf *mbuf)
 							       tcp_hdr);
 	} else if ((mbuf->packet_type & RTE_PTYPE_L4_MASK) ==
 		   RTE_PTYPE_L4_UDP) {
-		struct udp_hdr *udp_hdr = (struct udp_hdr *)(l3_hdr +
+		struct rte_udp_hdr *udp_hdr = (struct rte_udp_hdr *)(l3_hdr +
 							     mbuf->l3_len);
 		udp_hdr->dgram_cksum = 0;
 		if (eth_hdr->ether_type == htons(RTE_ETHER_TYPE_IPv4))
drivers/net/e1000/em_rxtx.c +1 -1
index 27146607c..e81ac204b 100644
@@ -242,7 +242,7 @@ em_set_xmit_ctx(struct em_tx_queue* txq,
 	switch (flags & PKT_TX_L4_MASK) {
 	case PKT_TX_UDP_CKSUM:
 		ctx.upper_setup.tcp_fields.tucso = (uint8_t)(ipcse +
-				offsetof(struct udp_hdr, dgram_cksum));
+				offsetof(struct rte_udp_hdr, dgram_cksum));
 		cmp_mask |= TX_MACIP_LEN_CMP_MASK;
 		break;
 	case PKT_TX_TCP_CKSUM:
drivers/net/e1000/igb_rxtx.c +1 -1
index 9046d21a9..acf6b98e3 100644
@@ -285,7 +285,7 @@ igbe_set_xmit_ctx(struct igb_tx_queue* txq,
 		case PKT_TX_UDP_CKSUM:
 			type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_UDP |
 				E1000_ADVTXD_DTYP_CTXT | E1000_ADVTXD_DCMD_DEXT;
-			mss_l4len_idx |= sizeof(struct udp_hdr) << E1000_ADVTXD_L4LEN_SHIFT;
+			mss_l4len_idx |= sizeof(struct rte_udp_hdr) << E1000_ADVTXD_L4LEN_SHIFT;
 			break;
 		case PKT_TX_TCP_CKSUM:
 			type_tucmd_mlhl |= E1000_ADVTXD_TUCMD_L4T_TCP |
drivers/net/enic/enic_clsf.c +4 -4
index c9d898044..faab12d92 100644
@@ -116,7 +116,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 	memset(gp, 0, sizeof(*gp));
 
 	if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_UDP) {
-		struct udp_hdr udp_mask, udp_val;
+		struct rte_udp_hdr udp_mask, udp_val;
 		memset(&udp_mask, 0, sizeof(udp_mask));
 		memset(&udp_val, 0, sizeof(udp_val));
 
@@ -130,7 +130,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 		}
 
 		enic_set_layer(gp, FILTER_GENERIC_1_UDP, FILTER_GENERIC_1_L4,
-			       &udp_mask, &udp_val, sizeof(struct udp_hdr));
+			       &udp_mask, &udp_val, sizeof(struct rte_udp_hdr));
 	} else if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV4_TCP) {
 		struct rte_tcp_hdr tcp_mask, tcp_val;
 		memset(&tcp_mask, 0, sizeof(tcp_mask));
@@ -206,7 +206,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 	}
 
 	if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_UDP) {
-		struct udp_hdr udp_mask, udp_val;
+		struct rte_udp_hdr udp_mask, udp_val;
 		memset(&udp_mask, 0, sizeof(udp_mask));
 		memset(&udp_val, 0, sizeof(udp_val));
 
@@ -219,7 +219,7 @@ copy_fltr_v2(struct filter_v2 *fltr, struct rte_eth_fdir_input *input,
 			udp_val.dst_port = input->flow.udp6_flow.dst_port;
 		}
 		enic_set_layer(gp, FILTER_GENERIC_1_UDP, FILTER_GENERIC_1_L4,
-			       &udp_mask, &udp_val, sizeof(struct udp_hdr));
+			       &udp_mask, &udp_val, sizeof(struct rte_udp_hdr));
 	} else if (input->flow_type == RTE_ETH_FLOW_NONFRAG_IPV6_TCP) {
 		struct rte_tcp_hdr tcp_mask, tcp_val;
 		memset(&tcp_mask, 0, sizeof(tcp_mask));
drivers/net/enic/enic_flow.c +7 -7
index fd5b2d190..2787bc895 100644
@@ -397,7 +397,7 @@ enic_copy_item_udp_v1(const struct rte_flow_item *item,
 	const struct rte_flow_item_udp *spec = item->spec;
 	const struct rte_flow_item_udp *mask = item->mask;
 	struct filter_ipv4_5tuple *enic_5tup = &enic_filter->u.ipv4;
-	struct udp_hdr supported_mask = {
+	struct rte_udp_hdr supported_mask = {
 		.src_port = 0xffff,
 		.dst_port = 0xffff,
 	};
@@ -735,19 +735,19 @@ enic_copy_item_udp_v2(const struct rte_flow_item *item,
 
 	if (*inner_ofst == 0) {
 		memcpy(gp->layer[FILTER_GENERIC_1_L4].mask, &mask->hdr,
-		       sizeof(struct udp_hdr));
+		       sizeof(struct rte_udp_hdr));
 		memcpy(gp->layer[FILTER_GENERIC_1_L4].val, &spec->hdr,
-		       sizeof(struct udp_hdr));
+		       sizeof(struct rte_udp_hdr));
 	} else {
 		/* Inner IPv6 header. Mask/Val start at *inner_ofst into L5 */
-		if ((*inner_ofst + sizeof(struct udp_hdr)) >
+		if ((*inner_ofst + sizeof(struct rte_udp_hdr)) >
 		     FILTER_GENERIC_1_KEY_LEN)
 			return ENOTSUP;
 		memcpy(&gp->layer[FILTER_GENERIC_1_L5].mask[*inner_ofst],
-		       mask, sizeof(struct udp_hdr));
+		       mask, sizeof(struct rte_udp_hdr));
 		memcpy(&gp->layer[FILTER_GENERIC_1_L5].val[*inner_ofst],
-		       spec, sizeof(struct udp_hdr));
-		*inner_ofst += sizeof(struct udp_hdr);
+		       spec, sizeof(struct rte_udp_hdr));
+		*inner_ofst += sizeof(struct rte_udp_hdr);
 	}
 	return 0;
 }
drivers/net/i40e/i40e_fdir.c +12 -12
index 46dfa79b7..40f25febf 100644
@@ -799,7 +799,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 			     unsigned char *raw_pkt)
 {
 	unsigned char *payload, *ptr;
-	struct udp_hdr *udp;
+	struct rte_udp_hdr *udp;
 	struct rte_tcp_hdr *tcp;
 	struct rte_sctp_hdr *sctp;
 	uint8_t size, dst = 0;
@@ -815,8 +815,8 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 	/* fill the L4 head */
 	switch (fdir_input->flow_type) {
 	case RTE_ETH_FLOW_NONFRAG_IPV4_UDP:
-		udp = (struct udp_hdr *)(raw_pkt + len);
-		payload = (unsigned char *)udp + sizeof(struct udp_hdr);
+		udp = (struct rte_udp_hdr *)(raw_pkt + len);
+		payload = (unsigned char *)udp + sizeof(struct rte_udp_hdr);
 		/*
 		 * The source and destination fields in the transmitted packet
 		 * need to be presented in a reversed order with respect
@@ -860,8 +860,8 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 		break;
 
 	case RTE_ETH_FLOW_NONFRAG_IPV6_UDP:
-		udp = (struct udp_hdr *)(raw_pkt + len);
-		payload = (unsigned char *)udp + sizeof(struct udp_hdr);
+		udp = (struct rte_udp_hdr *)(raw_pkt + len);
+		payload = (unsigned char *)udp + sizeof(struct rte_udp_hdr);
 		/*
 		 * The source and destination fields in the transmitted packet
 		 * need to be presented in a reversed order with respect
@@ -1089,7 +1089,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 {
 	unsigned char *payload = NULL;
 	unsigned char *ptr;
-	struct udp_hdr *udp;
+	struct rte_udp_hdr *udp;
 	struct rte_tcp_hdr *tcp;
 	struct rte_sctp_hdr *sctp;
 	struct rte_flow_item_gtp *gtp;
@@ -1116,8 +1116,8 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 
 	/* fill the L4 head */
 	if (pctype == I40E_FILTER_PCTYPE_NONF_IPV4_UDP) {
-		udp = (struct udp_hdr *)(raw_pkt + len);
-		payload = (unsigned char *)udp + sizeof(struct udp_hdr);
+		udp = (struct rte_udp_hdr *)(raw_pkt + len);
+		payload = (unsigned char *)udp + sizeof(struct rte_udp_hdr);
 		/**
 		 * The source and destination fields in the transmitted packet
 		 * need to be presented in a reversed order with respect
@@ -1153,8 +1153,8 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 		payload = raw_pkt + len;
 		set_idx = I40E_FLXPLD_L3_IDX;
 	} else if (pctype == I40E_FILTER_PCTYPE_NONF_IPV6_UDP) {
-		udp = (struct udp_hdr *)(raw_pkt + len);
-		payload = (unsigned char *)udp + sizeof(struct udp_hdr);
+		udp = (struct rte_udp_hdr *)(raw_pkt + len);
+		payload = (unsigned char *)udp + sizeof(struct rte_udp_hdr);
 		/**
 		 * The source and destination fields in the transmitted packet
 		 * need to be presented in a reversed order with respect
@@ -1206,12 +1206,12 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 		    cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV4 ||
 		    cus_pctype->index == I40E_CUSTOMIZED_GTPU_IPV6 ||
 		    cus_pctype->index == I40E_CUSTOMIZED_GTPU) {
-			udp = (struct udp_hdr *)(raw_pkt + len);
+			udp = (struct rte_udp_hdr *)(raw_pkt + len);
 			udp->dgram_len =
 				rte_cpu_to_be_16(I40E_FDIR_UDP_DEFAULT_LEN);
 
 			gtp = (struct rte_flow_item_gtp *)
-				((unsigned char *)udp + sizeof(struct udp_hdr));
+				((unsigned char *)udp + sizeof(struct rte_udp_hdr));
 			gtp->msg_len =
 				rte_cpu_to_be_16(I40E_FDIR_GTP_DEFAULT_LEN);
 			gtp->teid = fdir_input->flow.gtp_flow.teid;
drivers/net/i40e/i40e_rxtx.c +1 -1
index e5f18538f..df7b7dc6d 100644
@@ -308,7 +308,7 @@ i40e_txd_enable_checksum(uint64_t ol_flags,
 		break;
 	case PKT_TX_UDP_CKSUM:
 		*td_cmd |= I40E_TX_DESC_CMD_L4T_EOFT_UDP;
-		*td_offset |= (sizeof(struct udp_hdr) >> 2) <<
+		*td_offset |= (sizeof(struct rte_udp_hdr) >> 2) <<
 				I40E_TX_DESC_LENGTH_L4_FC_LEN_SHIFT;
 		break;
 	default:
drivers/net/ixgbe/ixgbe_rxtx.c +1 -1
index 036acaa14..1f77257e1 100644
@@ -418,7 +418,7 @@ ixgbe_set_xmit_ctx(struct ixgbe_tx_queue *txq,
 		case PKT_TX_UDP_CKSUM:
 			type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_UDP |
 				IXGBE_ADVTXD_DTYP_CTXT | IXGBE_ADVTXD_DCMD_DEXT;
-			mss_l4len_idx |= sizeof(struct udp_hdr) << IXGBE_ADVTXD_L4LEN_SHIFT;
+			mss_l4len_idx |= sizeof(struct rte_udp_hdr) << IXGBE_ADVTXD_L4LEN_SHIFT;
 			tx_offload_mask.l2_len |= ~0;
 			tx_offload_mask.l3_len |= ~0;
 			break;
drivers/net/mlx5/mlx5_flow.c +4 -4
index 76af6a8b6..c8c32658d 100644
@@ -2548,11 +2548,11 @@ mlx5_fdir_filter_convert(struct rte_eth_dev *dev,
 	/* Handle L4. */
 	switch (fdir_filter->input.flow_type) {
 	case RTE_ETH_FLOW_NONFRAG_IPV4_UDP:
-		attributes->l4.udp.hdr = (struct udp_hdr){
+		attributes->l4.udp.hdr = (struct rte_udp_hdr){
 			.src_port = input->flow.udp4_flow.src_port,
 			.dst_port = input->flow.udp4_flow.dst_port,
 		};
-		attributes->l4_mask.udp.hdr = (struct udp_hdr){
+		attributes->l4_mask.udp.hdr = (struct rte_udp_hdr){
 			.src_port = mask->src_port_mask,
 			.dst_port = mask->dst_port_mask,
 		};
@@ -2578,11 +2578,11 @@ mlx5_fdir_filter_convert(struct rte_eth_dev *dev,
 		};
 		break;
 	case RTE_ETH_FLOW_NONFRAG_IPV6_UDP:
-		attributes->l4.udp.hdr = (struct udp_hdr){
+		attributes->l4.udp.hdr = (struct rte_udp_hdr){
 			.src_port = input->flow.udp6_flow.src_port,
 			.dst_port = input->flow.udp6_flow.dst_port,
 		};
-		attributes->l4_mask.udp.hdr = (struct udp_hdr){
+		attributes->l4_mask.udp.hdr = (struct rte_udp_hdr){
 			.src_port = mask->src_port_mask,
 			.dst_port = mask->dst_port_mask,
 		};
drivers/net/qede/qede_filter.c +7 -7
index cd762cddb..33eb9fc39 100644
@@ -459,7 +459,7 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev,
 	uint8_t *raw_pkt;
 	struct rte_ipv4_hdr *ip;
 	struct rte_ipv6_hdr *ip6;
-	struct udp_hdr *udp;
+	struct rte_udp_hdr *udp;
 	struct rte_tcp_hdr *tcp;
 	uint16_t len;
 
@@ -487,13 +487,13 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev,
 		raw_pkt = (uint8_t *)buff;
 		/* UDP */
 		if (arfs->tuple.ip_proto == IPPROTO_UDP) {
-			udp = (struct udp_hdr *)(raw_pkt + len);
+			udp = (struct rte_udp_hdr *)(raw_pkt + len);
 			udp->dst_port = arfs->tuple.dst_port;
 			udp->src_port = arfs->tuple.src_port;
-			udp->dgram_len = sizeof(struct udp_hdr);
-			len += sizeof(struct udp_hdr);
+			udp->dgram_len = sizeof(struct rte_udp_hdr);
+			len += sizeof(struct rte_udp_hdr);
 			/* adjust ip total_length */
-			ip->total_length += sizeof(struct udp_hdr);
+			ip->total_length += sizeof(struct rte_udp_hdr);
 			params->udp = true;
 		} else { /* TCP */
 			tcp = (struct rte_tcp_hdr *)(raw_pkt + len);
@@ -522,10 +522,10 @@ qede_arfs_construct_pkt(struct rte_eth_dev *eth_dev,
 		raw_pkt = (uint8_t *)buff;
 		/* UDP */
 		if (arfs->tuple.ip_proto == IPPROTO_UDP) {
-			udp = (struct udp_hdr *)(raw_pkt + len);
+			udp = (struct rte_udp_hdr *)(raw_pkt + len);
 			udp->src_port = arfs->tuple.src_port;
 			udp->dst_port = arfs->tuple.dst_port;
-			len += sizeof(struct udp_hdr);
+			len += sizeof(struct rte_udp_hdr);
 			params->udp = true;
 		} else { /* TCP */
 			tcp = (struct rte_tcp_hdr *)(raw_pkt + len);
drivers/net/tap/rte_eth_tap.c +1 -1
index dd19f0119..6af14193d 100644
@@ -473,7 +473,7 @@ tap_tx_l3_cksum(char *packet, uint64_t ol_flags, unsigned int l2_len,
 
 		l4_hdr = packet + l2_len + l3_len;
 		if ((ol_flags & PKT_TX_L4_MASK) == PKT_TX_UDP_CKSUM)
-			*l4_cksum = &((struct udp_hdr *)l4_hdr)->dgram_cksum;
+			*l4_cksum = &((struct rte_udp_hdr *)l4_hdr)->dgram_cksum;
 		else if ((ol_flags & PKT_TX_L4_MASK) == PKT_TX_TCP_CKSUM)
 			*l4_cksum = &((struct rte_tcp_hdr *)l4_hdr)->cksum;
 		else
drivers/net/virtio/virtio_rxtx.c +1 -1
index 429beded8..ce00a6b58 100644
@@ -366,7 +366,7 @@ virtqueue_xmit_offload(struct virtio_net_hdr *hdr,
 		switch (cookie->ol_flags & PKT_TX_L4_MASK) {
 		case PKT_TX_UDP_CKSUM:
 			hdr->csum_start = cookie->l2_len + cookie->l3_len;
-			hdr->csum_offset = offsetof(struct udp_hdr,
+			hdr->csum_offset = offsetof(struct rte_udp_hdr,
 				dgram_cksum);
 			hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
 			break;
drivers/net/vmxnet3/vmxnet3_rxtx.c +1 -1
index 8726eabb9..4f5594c6b 100644
@@ -542,7 +542,7 @@ vmxnet3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 				gdesc->txd.msscof = gdesc->txd.hlen + offsetof(struct rte_tcp_hdr, cksum);
 				break;
 			case PKT_TX_UDP_CKSUM:
-				gdesc->txd.msscof = gdesc->txd.hlen + offsetof(struct udp_hdr, dgram_cksum);
+				gdesc->txd.msscof = gdesc->txd.hlen + offsetof(struct rte_udp_hdr, dgram_cksum);
 				break;
 			default:
 				PMD_TX_LOG(WARNING, "requested cksum offload not supported %#llx",
examples/l3fwd-power/main.c +4 -4
index 72d2c53e1..0e50f55c6 100644
@@ -486,7 +486,7 @@ get_ipv4_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,
 {
 	struct ipv4_5tuple key;
 	struct rte_tcp_hdr *tcp;
-	struct udp_hdr *udp;
+	struct rte_udp_hdr *udp;
 	int ret = 0;
 
 	key.ip_dst = rte_be_to_cpu_32(ipv4_hdr->dst_addr);
@@ -502,7 +502,7 @@ get_ipv4_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,
 		break;
 
 	case IPPROTO_UDP:
-		udp = (struct udp_hdr *)((unsigned char *)ipv4_hdr +
+		udp = (struct rte_udp_hdr *)((unsigned char *)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);
@@ -525,7 +525,7 @@ get_ipv6_dst_port(struct rte_ipv6_hdr *ipv6_hdr, uint16_t portid,
 {
 	struct ipv6_5tuple key;
 	struct rte_tcp_hdr *tcp;
-	struct udp_hdr *udp;
+	struct rte_udp_hdr *udp;
 	int ret = 0;
 
 	memcpy(key.ip_dst, ipv6_hdr->dst_addr, IPV6_ADDR_LEN);
@@ -542,7 +542,7 @@ get_ipv6_dst_port(struct rte_ipv6_hdr *ipv6_hdr, uint16_t portid,
 		break;
 
 	case IPPROTO_UDP:
-		udp = (struct udp_hdr *)((unsigned char *) ipv6_hdr +
+		udp = (struct rte_udp_hdr *)((unsigned char *) ipv6_hdr +
 					sizeof(struct rte_ipv6_hdr));
 		key.port_dst = rte_be_to_cpu_16(udp->dst_port);
 		key.port_src = rte_be_to_cpu_16(udp->src_port);
examples/l3fwd-vf/main.c +2 -2
index d57ac262b..0ef469c29 100644
@@ -367,7 +367,7 @@ get_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,
 {
 	struct ipv4_5tuple key;
 	struct rte_tcp_hdr *tcp;
-	struct udp_hdr *udp;
+	struct rte_udp_hdr *udp;
 	int ret = 0;
 
 	key.ip_dst = rte_be_to_cpu_32(ipv4_hdr->dst_addr);
@@ -383,7 +383,7 @@ get_dst_port(struct rte_ipv4_hdr *ipv4_hdr, uint16_t portid,
 		break;
 
 	case IPPROTO_UDP:
-		udp = (struct udp_hdr *)((unsigned char *) ipv4_hdr +
+		udp = (struct rte_udp_hdr *)((unsigned char *) 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);
examples/tep_termination/vxlan.c +8 -8
index 261332adf..166cd8a31 100644
@@ -75,7 +75,7 @@ process_inner_cksums(struct rte_ether_hdr *eth_hdr, union tunnel_offload_info *i
 	uint16_t ethertype;
 	struct rte_ipv4_hdr *ipv4_hdr;
 	struct rte_ipv6_hdr *ipv6_hdr;
-	struct udp_hdr *udp_hdr;
+	struct rte_udp_hdr *udp_hdr;
 	struct rte_tcp_hdr *tcp_hdr;
 	struct rte_sctp_hdr *sctp_hdr;
 	uint64_t ol_flags = 0;
@@ -107,7 +107,7 @@ process_inner_cksums(struct rte_ether_hdr *eth_hdr, union tunnel_offload_info *i
 		return 0; /* packet type not supported, nothing to do */
 
 	if (l4_proto == IPPROTO_UDP) {
-		udp_hdr = (struct udp_hdr *)((char *)l3_hdr + info->l3_len);
+		udp_hdr = (struct rte_udp_hdr *)((char *)l3_hdr + info->l3_len);
 		ol_flags |= PKT_TX_UDP_CKSUM;
 		udp_hdr->dgram_cksum = get_psd_sum(l3_hdr,
 				ethertype, ol_flags);
@@ -139,7 +139,7 @@ decapsulation(struct rte_mbuf *pkt)
 {
 	uint8_t l4_proto = 0;
 	uint16_t outer_header_len;
-	struct udp_hdr *udp_hdr;
+	struct rte_udp_hdr *udp_hdr;
 	union tunnel_offload_info info = { .data = 0 };
 	struct rte_ether_hdr *phdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
 
@@ -148,7 +148,7 @@ decapsulation(struct rte_mbuf *pkt)
 	if (l4_proto != IPPROTO_UDP)
 		return -1;
 
-	udp_hdr = (struct udp_hdr *)((char *)phdr +
+	udp_hdr = (struct rte_udp_hdr *)((char *)phdr +
 		info.outer_l2_len + info.outer_l3_len);
 
 	/** check udp destination port, 4789 is the default vxlan port
@@ -158,7 +158,7 @@ decapsulation(struct rte_mbuf *pkt)
 		(pkt->packet_type & RTE_PTYPE_TUNNEL_MASK) == 0)
 		return -1;
 	outer_header_len = info.outer_l2_len + info.outer_l3_len
-		+ sizeof(struct udp_hdr) + sizeof(struct rte_vxlan_hdr);
+		+ sizeof(struct rte_udp_hdr) + sizeof(struct rte_vxlan_hdr);
 
 	rte_pktmbuf_adj(pkt, outer_header_len);
 
@@ -177,10 +177,10 @@ encapsulation(struct rte_mbuf *m, uint8_t queue_id)
 	/*Allocate space for new ethernet, IPv4, UDP and VXLAN headers*/
 	struct rte_ether_hdr *pneth = (struct rte_ether_hdr *) rte_pktmbuf_prepend(m,
 		sizeof(struct rte_ether_hdr) + sizeof(struct rte_ipv4_hdr)
-		+ sizeof(struct udp_hdr) + sizeof(struct rte_vxlan_hdr));
+		+ sizeof(struct rte_udp_hdr) + sizeof(struct rte_vxlan_hdr));
 
 	struct rte_ipv4_hdr *ip = (struct rte_ipv4_hdr *) &pneth[1];
-	struct udp_hdr *udp = (struct udp_hdr *) &ip[1];
+	struct rte_udp_hdr *udp = (struct rte_udp_hdr *) &ip[1];
 	struct rte_vxlan_hdr *vxlan = (struct rte_vxlan_hdr *) &udp[1];
 
 	/* convert TX queue ID to vport ID */
@@ -224,7 +224,7 @@ encapsulation(struct rte_mbuf *m, uint8_t queue_id)
 	/*UDP HEADER*/
 	udp->dgram_cksum = 0;
 	udp->dgram_len = rte_cpu_to_be_16(old_len
-				+ sizeof(struct udp_hdr)
+				+ sizeof(struct rte_udp_hdr)
 				+ sizeof(struct rte_vxlan_hdr));
 
 	udp->dst_port = rte_cpu_to_be_16(vxdev.dst_port);
lib/librte_ethdev/rte_flow.h +1 -1
index cea95b98a..c27d590a1 100644
@@ -685,7 +685,7 @@ static const struct rte_flow_item_icmp rte_flow_item_icmp_mask = {
  * Matches a UDP header.
  */
 struct rte_flow_item_udp {
-	struct udp_hdr hdr; /**< UDP header definition. */
+	struct rte_udp_hdr hdr; /**< UDP header definition. */
 };
 
 /** Default mask for RTE_FLOW_ITEM_TYPE_UDP. */
lib/librte_gro/gro_vxlan_tcp4.c +5 -5
index 3cfe20f75..a2b30e3de 100644
@@ -263,7 +263,7 @@ static inline void
 update_vxlan_header(struct gro_vxlan_tcp4_item *item)
 {
 	struct rte_ipv4_hdr *ipv4_hdr;
-	struct udp_hdr *udp_hdr;
+	struct rte_udp_hdr *udp_hdr;
 	struct rte_mbuf *pkt = item->inner_item.firstseg;
 	uint16_t len;
 
@@ -275,7 +275,7 @@ update_vxlan_header(struct gro_vxlan_tcp4_item *item)
 
 	/* Update the outer UDP header. */
 	len -= pkt->outer_l3_len;
-	udp_hdr = (struct udp_hdr *)((char *)ipv4_hdr + pkt->outer_l3_len);
+	udp_hdr = (struct rte_udp_hdr *)((char *)ipv4_hdr + pkt->outer_l3_len);
 	udp_hdr->dgram_len = rte_cpu_to_be_16(len);
 
 	/* Update the inner IPv4 header. */
@@ -292,7 +292,7 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt,
 	struct rte_ether_hdr *outer_eth_hdr, *eth_hdr;
 	struct rte_ipv4_hdr *outer_ipv4_hdr, *ipv4_hdr;
 	struct rte_tcp_hdr *tcp_hdr;
-	struct udp_hdr *udp_hdr;
+	struct rte_udp_hdr *udp_hdr;
 	struct rte_vxlan_hdr *vxlan_hdr;
 	uint32_t sent_seq;
 	uint16_t tcp_dl, frag_off, outer_ip_id, ip_id;
@@ -308,10 +308,10 @@ gro_vxlan_tcp4_reassemble(struct rte_mbuf *pkt,
 	outer_eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
 	outer_ipv4_hdr = (struct rte_ipv4_hdr *)((char *)outer_eth_hdr +
 			pkt->outer_l2_len);
-	udp_hdr = (struct udp_hdr *)((char *)outer_ipv4_hdr +
+	udp_hdr = (struct rte_udp_hdr *)((char *)outer_ipv4_hdr +
 			pkt->outer_l3_len);
 	vxlan_hdr = (struct rte_vxlan_hdr *)((char *)udp_hdr +
-			sizeof(struct udp_hdr));
+			sizeof(struct rte_udp_hdr));
 	eth_hdr = (struct rte_ether_hdr *)((char *)vxlan_hdr +
 			sizeof(struct rte_vxlan_hdr));
 	ipv4_hdr = (struct rte_ipv4_hdr *)((char *)udp_hdr + pkt->l2_len);
lib/librte_gso/gso_common.h +2 -2
index a35030153..48ad1686f 100644
@@ -46,9 +46,9 @@
 static inline void
 update_udp_header(struct rte_mbuf *pkt, uint16_t udp_offset)
 {
-	struct udp_hdr *udp_hdr;
+	struct rte_udp_hdr *udp_hdr;
 
-	udp_hdr = (struct udp_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
+	udp_hdr = (struct rte_udp_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
 			udp_offset);
 	udp_hdr->dgram_len = rte_cpu_to_be_16(pkt->pkt_len - udp_offset);
 }
lib/librte_gso/rte_gso.h +1 -1
index 8f65adf1c..3aab297f4 100644
@@ -23,7 +23,7 @@ extern "C" {
 
 /* Minimum GSO segment size for UDP based packets. */
 #define RTE_GSO_UDP_SEG_SIZE_MIN (sizeof(struct rte_ether_hdr) + \
-		sizeof(struct rte_ipv4_hdr) + sizeof(struct udp_hdr) + 1)
+		sizeof(struct rte_ipv4_hdr) + sizeof(struct rte_udp_hdr) + 1)
 
 /* GSO flags for rte_gso_ctx. */
 #define RTE_GSO_FLAG_IPID_FIXED (1ULL << 0)
lib/librte_net/rte_ether.h +2 -2
index f279cf33c..737a2614d 100644
@@ -307,7 +307,7 @@ struct rte_vxlan_hdr {
 #define RTE_ETHER_TYPE_TEB  0x6558 /**< Transparent Ethernet Bridging. */
 #define RTE_ETHER_TYPE_LLDP 0x88CC /**< LLDP Protocol. */
 
-#define RTE_ETHER_VXLAN_HLEN (sizeof(struct udp_hdr) + sizeof(struct rte_vxlan_hdr))
+#define RTE_ETHER_VXLAN_HLEN (sizeof(struct rte_udp_hdr) + sizeof(struct rte_vxlan_hdr))
 /**< VXLAN tunnel header length. */
 
 /**
@@ -331,7 +331,7 @@ struct rte_vxlan_gpe_hdr {
 #define RTE_VXLAN_GPE_TYPE_GBP  6 /**< GBP Protocol. */
 #define RTE_VXLAN_GPE_TYPE_VBNG 7 /**< vBNG Protocol. */
 
-#define RTE_ETHER_VXLAN_GPE_HLEN (sizeof(struct udp_hdr) + \
+#define RTE_ETHER_VXLAN_GPE_HLEN (sizeof(struct rte_udp_hdr) + \
 			      sizeof(struct rte_vxlan_gpe_hdr))
 /**< VXLAN-GPE tunnel header length. */
 
lib/librte_net/rte_net.c +2 -2
index 9712c75ac..ffd15eaf3 100644
@@ -338,7 +338,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,
 	}
 
 	if ((pkt_type & RTE_PTYPE_L4_MASK) == RTE_PTYPE_L4_UDP) {
-		hdr_lens->l4_len = sizeof(struct udp_hdr);
+		hdr_lens->l4_len = sizeof(struct rte_udp_hdr);
 		return pkt_type;
 	} else if ((pkt_type & RTE_PTYPE_L4_MASK) == RTE_PTYPE_L4_TCP) {
 		const struct rte_tcp_hdr *th;
@@ -474,7 +474,7 @@ uint32_t rte_net_get_ptype(const struct rte_mbuf *m,
 	}
 
 	if ((pkt_type & RTE_PTYPE_INNER_L4_MASK) == RTE_PTYPE_INNER_L4_UDP) {
-		hdr_lens->inner_l4_len = sizeof(struct udp_hdr);
+		hdr_lens->inner_l4_len = sizeof(struct rte_udp_hdr);
 	} else if ((pkt_type & RTE_PTYPE_INNER_L4_MASK) ==
 			RTE_PTYPE_INNER_L4_TCP) {
 		const struct rte_tcp_hdr *th;
lib/librte_net/rte_net.h +3 -3
index 4c27f4611..d67d6ab19 100644
@@ -115,7 +115,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
 	struct rte_ipv4_hdr *ipv4_hdr;
 	struct rte_ipv6_hdr *ipv6_hdr;
 	struct rte_tcp_hdr *tcp_hdr;
-	struct udp_hdr *udp_hdr;
+	struct rte_udp_hdr *udp_hdr;
 	uint64_t inner_l3_offset = m->l2_len;
 
 	if ((ol_flags & PKT_TX_OUTER_IP_CKSUM) ||
@@ -132,7 +132,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
 
 	if ((ol_flags & PKT_TX_UDP_CKSUM) == PKT_TX_UDP_CKSUM) {
 		if (ol_flags & PKT_TX_IPV4) {
-			udp_hdr = (struct udp_hdr *)((char *)ipv4_hdr +
+			udp_hdr = (struct rte_udp_hdr *)((char *)ipv4_hdr +
 					m->l3_len);
 			udp_hdr->dgram_cksum = rte_ipv4_phdr_cksum(ipv4_hdr,
 					ol_flags);
@@ -140,7 +140,7 @@ rte_net_intel_cksum_flags_prepare(struct rte_mbuf *m, uint64_t ol_flags)
 			ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct rte_ipv6_hdr *,
 					inner_l3_offset);
 			/* non-TSO udp */
-			udp_hdr = rte_pktmbuf_mtod_offset(m, struct udp_hdr *,
+			udp_hdr = rte_pktmbuf_mtod_offset(m, struct rte_udp_hdr *,
 					inner_l3_offset + m->l3_len);
 			udp_hdr->dgram_cksum = rte_ipv6_phdr_cksum(ipv6_hdr,
 					ol_flags);
lib/librte_net/rte_udp.h +1 -1
index ba033955c..1c3437c5f 100644
@@ -23,7 +23,7 @@ extern "C" {
 /**
  * UDP Header
  */
-struct udp_hdr {
+struct rte_udp_hdr {
 	uint16_t src_port;    /**< UDP source port. */
 	uint16_t dst_port;    /**< UDP destination port. */
 	uint16_t dgram_len;   /**< UDP datagram length */
lib/librte_pipeline/rte_table_action.c +16 -16
index 15bbdd674..36cefcf31 100644
@@ -505,7 +505,7 @@ struct encap_pppoe_data {
 struct encap_vxlan_ipv4_data {
 	struct rte_ether_hdr ether;
 	struct rte_ipv4_hdr ipv4;
-	struct udp_hdr udp;
+	struct rte_udp_hdr udp;
 	struct rte_vxlan_hdr vxlan;
 } __attribute__((__packed__));
 
@@ -513,14 +513,14 @@ struct encap_vxlan_ipv4_vlan_data {
 	struct rte_ether_hdr ether;
 	struct rte_vlan_hdr vlan;
 	struct rte_ipv4_hdr ipv4;
-	struct udp_hdr udp;
+	struct rte_udp_hdr udp;
 	struct rte_vxlan_hdr vxlan;
 } __attribute__((__packed__));
 
 struct encap_vxlan_ipv6_data {
 	struct rte_ether_hdr ether;
 	struct rte_ipv6_hdr ipv6;
-	struct udp_hdr udp;
+	struct rte_udp_hdr udp;
 	struct rte_vxlan_hdr vxlan;
 } __attribute__((__packed__));
 
@@ -528,7 +528,7 @@ struct encap_vxlan_ipv6_vlan_data {
 	struct rte_ether_hdr ether;
 	struct rte_vlan_hdr vlan;
 	struct rte_ipv6_hdr ipv6;
-	struct udp_hdr udp;
+	struct rte_udp_hdr udp;
 	struct rte_vxlan_hdr vxlan;
 } __attribute__((__packed__));
 
@@ -963,13 +963,13 @@ pkt_work_encap_vxlan_ipv4(struct rte_mbuf *mbuf,
 	ether_length = (uint16_t)mbuf->pkt_len;
 	ipv4_total_length = ether_length +
 		(sizeof(struct rte_vxlan_hdr) +
-		sizeof(struct udp_hdr) +
+		sizeof(struct rte_udp_hdr) +
 		sizeof(struct rte_ipv4_hdr));
 	ipv4_hdr_cksum = encap_vxlan_ipv4_checksum_update(vxlan_tbl->ipv4.hdr_checksum,
 		rte_htons(ipv4_total_length));
 	udp_length = ether_length +
 		(sizeof(struct rte_vxlan_hdr) +
-		sizeof(struct udp_hdr));
+		sizeof(struct rte_udp_hdr));
 
 	vxlan_pkt = encap(ether, vxlan_tbl, sizeof(*vxlan_tbl));
 	vxlan_pkt->ipv4.total_length = rte_htons(ipv4_total_length);
@@ -993,13 +993,13 @@ pkt_work_encap_vxlan_ipv4_vlan(struct rte_mbuf *mbuf,
 	ether_length = (uint16_t)mbuf->pkt_len;
 	ipv4_total_length = ether_length +
 		(sizeof(struct rte_vxlan_hdr) +
-		sizeof(struct udp_hdr) +
+		sizeof(struct rte_udp_hdr) +
 		sizeof(struct rte_ipv4_hdr));
 	ipv4_hdr_cksum = encap_vxlan_ipv4_checksum_update(vxlan_tbl->ipv4.hdr_checksum,
 		rte_htons(ipv4_total_length));
 	udp_length = ether_length +
 		(sizeof(struct rte_vxlan_hdr) +
-		sizeof(struct udp_hdr));
+		sizeof(struct rte_udp_hdr));
 
 	vxlan_pkt = encap(ether, vxlan_tbl, sizeof(*vxlan_tbl));
 	vxlan_pkt->ipv4.total_length = rte_htons(ipv4_total_length);
@@ -1023,10 +1023,10 @@ pkt_work_encap_vxlan_ipv6(struct rte_mbuf *mbuf,
 	ether_length = (uint16_t)mbuf->pkt_len;
 	ipv6_payload_length = ether_length +
 		(sizeof(struct rte_vxlan_hdr) +
-		sizeof(struct udp_hdr));
+		sizeof(struct rte_udp_hdr));
 	udp_length = ether_length +
 		(sizeof(struct rte_vxlan_hdr) +
-		sizeof(struct udp_hdr));
+		sizeof(struct rte_udp_hdr));
 
 	vxlan_pkt = encap(ether, vxlan_tbl, sizeof(*vxlan_tbl));
 	vxlan_pkt->ipv6.payload_len = rte_htons(ipv6_payload_length);
@@ -1049,10 +1049,10 @@ pkt_work_encap_vxlan_ipv6_vlan(struct rte_mbuf *mbuf,
 	ether_length = (uint16_t)mbuf->pkt_len;
 	ipv6_payload_length = ether_length +
 		(sizeof(struct rte_vxlan_hdr) +
-		sizeof(struct udp_hdr));
+		sizeof(struct rte_udp_hdr));
 	udp_length = ether_length +
 		(sizeof(struct rte_vxlan_hdr) +
-		sizeof(struct udp_hdr));
+		sizeof(struct rte_udp_hdr));
 
 	vxlan_pkt = encap(ether, vxlan_tbl, sizeof(*vxlan_tbl));
 	vxlan_pkt->ipv6.payload_len = rte_htons(ipv6_payload_length);
@@ -1311,7 +1311,7 @@ pkt_ipv4_work_nat(struct rte_ipv4_hdr *ip,
 			tcp->src_port = data->port;
 			tcp->cksum = tcp_cksum;
 		} else {
-			struct udp_hdr *udp = (struct udp_hdr *) &ip[1];
+			struct rte_udp_hdr *udp = (struct rte_udp_hdr *) &ip[1];
 			uint16_t ip_cksum, udp_cksum;
 
 			ip_cksum = nat_ipv4_checksum_update(ip->hdr_checksum,
@@ -1350,7 +1350,7 @@ pkt_ipv4_work_nat(struct rte_ipv4_hdr *ip,
 			tcp->dst_port = data->port;
 			tcp->cksum = tcp_cksum;
 		} else {
-			struct udp_hdr *udp = (struct udp_hdr *) &ip[1];
+			struct rte_udp_hdr *udp = (struct rte_udp_hdr *) &ip[1];
 			uint16_t ip_cksum, udp_cksum;
 
 			ip_cksum = nat_ipv4_checksum_update(ip->hdr_checksum,
@@ -1392,7 +1392,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip,
 			tcp->src_port = data->port;
 			tcp->cksum = tcp_cksum;
 		} else {
-			struct udp_hdr *udp = (struct udp_hdr *) &ip[1];
+			struct rte_udp_hdr *udp = (struct rte_udp_hdr *) &ip[1];
 			uint16_t udp_cksum;
 
 			udp_cksum = nat_ipv6_tcp_udp_checksum_update(udp->dgram_cksum,
@@ -1420,7 +1420,7 @@ pkt_ipv6_work_nat(struct rte_ipv6_hdr *ip,
 			tcp->dst_port = data->port;
 			tcp->cksum = tcp_cksum;
 		} else {
-			struct udp_hdr *udp = (struct udp_hdr *) &ip[1];
+			struct rte_udp_hdr *udp = (struct rte_udp_hdr *) &ip[1];
 			uint16_t udp_cksum;
 
 			udp_cksum = nat_ipv6_tcp_udp_checksum_update(udp->dgram_cksum,
lib/librte_vhost/virtio_net.c +3 -3
index 11e76386c..eaa078a8d 100644
@@ -248,7 +248,7 @@ virtio_enqueue_offload(struct rte_mbuf *m_buf, struct virtio_net_hdr *net_hdr)
 						cksum));
 			break;
 		case PKT_TX_UDP_CKSUM:
-			net_hdr->csum_offset = (offsetof(struct udp_hdr,
+			net_hdr->csum_offset = (offsetof(struct rte_udp_hdr,
 						dgram_cksum));
 			break;
 		case PKT_TX_SCTP_CKSUM:
@@ -1027,7 +1027,7 @@ vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m)
 				if (l4_proto == IPPROTO_TCP)
 					m->ol_flags |= PKT_TX_TCP_CKSUM;
 				break;
-			case (offsetof(struct udp_hdr, dgram_cksum)):
+			case (offsetof(struct rte_udp_hdr, dgram_cksum)):
 				if (l4_proto == IPPROTO_UDP)
 					m->ol_flags |= PKT_TX_UDP_CKSUM;
 				break;
@@ -1053,7 +1053,7 @@ vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m)
 		case VIRTIO_NET_HDR_GSO_UDP:
 			m->ol_flags |= PKT_TX_UDP_SEG;
 			m->tso_segsz = hdr->gso_size;
-			m->l4_len = sizeof(struct udp_hdr);
+			m->l4_len = sizeof(struct rte_udp_hdr);
 			break;
 		default:
 			RTE_LOG(WARNING, VHOST_DATA,
test/test/packet_burst_generator.c +6 -6
index 5730f8129..305ed3d0d 100644
@@ -90,12 +90,12 @@ initialize_arp_header(struct rte_arp_hdr *arp_hdr, struct rte_ether_addr *src_ma
 }
 
 uint16_t
-initialize_udp_header(struct udp_hdr *udp_hdr, uint16_t src_port,
+initialize_udp_header(struct rte_udp_hdr *udp_hdr, uint16_t src_port,
 		uint16_t dst_port, uint16_t pkt_data_len)
 {
 	uint16_t pkt_len;
 
-	pkt_len = (uint16_t) (pkt_data_len + sizeof(struct udp_hdr));
+	pkt_len = (uint16_t) (pkt_data_len + sizeof(struct rte_udp_hdr));
 
 	udp_hdr->src_port = rte_cpu_to_be_16(src_port);
 	udp_hdr->dst_port = rte_cpu_to_be_16(dst_port);
@@ -126,7 +126,7 @@ initialize_sctp_header(struct rte_sctp_hdr *sctp_hdr, uint16_t src_port,
 {
 	uint16_t pkt_len;
 
-	pkt_len = (uint16_t) (pkt_data_len + sizeof(struct udp_hdr));
+	pkt_len = (uint16_t) (pkt_data_len + sizeof(struct rte_udp_hdr));
 
 	sctp_hdr->src_port = rte_cpu_to_be_16(src_port);
 	sctp_hdr->dst_port = rte_cpu_to_be_16(dst_port);
@@ -257,7 +257,7 @@ initialize_ipv4_header_proto(struct rte_ipv4_hdr *ip_hdr, uint32_t src_addr,
 int
 generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst,
 		struct rte_ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr,
-		uint8_t ipv4, struct udp_hdr *udp_hdr, int nb_pkt_per_burst,
+		uint8_t ipv4, struct rte_udp_hdr *udp_hdr, int nb_pkt_per_burst,
 		uint8_t pkt_len, uint8_t nb_pkt_segs)
 {
 	int i, nb_pkt = 0;
@@ -384,7 +384,7 @@ generate_packet_burst_proto(struct rte_mempool *mp,
 			switch (proto) {
 			case IPPROTO_UDP:
 				copy_buf_to_pkt(proto_hdr,
-					sizeof(struct udp_hdr), pkt,
+					sizeof(struct rte_udp_hdr), pkt,
 					eth_hdr_size + sizeof(struct rte_ipv4_hdr));
 				break;
 			case IPPROTO_TCP:
@@ -406,7 +406,7 @@ generate_packet_burst_proto(struct rte_mempool *mp,
 			switch (proto) {
 			case IPPROTO_UDP:
 				copy_buf_to_pkt(proto_hdr,
-					sizeof(struct udp_hdr), pkt,
+					sizeof(struct rte_udp_hdr), pkt,
 					eth_hdr_size + sizeof(struct rte_ipv6_hdr));
 				break;
 			case IPPROTO_TCP:
test/test/packet_burst_generator.h +2 -2
index 5cfe0c600..1ad444b2c 100644
@@ -34,7 +34,7 @@ initialize_arp_header(struct rte_arp_hdr *arp_hdr, struct rte_ether_addr *src_ma
 		uint32_t opcode);
 
 uint16_t
-initialize_udp_header(struct udp_hdr *udp_hdr, uint16_t src_port,
+initialize_udp_header(struct rte_udp_hdr *udp_hdr, uint16_t src_port,
 		uint16_t dst_port, uint16_t pkt_data_len);
 
 uint16_t
@@ -60,7 +60,7 @@ initialize_ipv4_header_proto(struct rte_ipv4_hdr *ip_hdr, uint32_t src_addr,
 int
 generate_packet_burst(struct rte_mempool *mp, struct rte_mbuf **pkts_burst,
 		struct rte_ether_hdr *eth_hdr, uint8_t vlan_enabled, void *ip_hdr,
-		uint8_t ipv4, struct udp_hdr *udp_hdr, int nb_pkt_per_burst,
+		uint8_t ipv4, struct rte_udp_hdr *udp_hdr, int nb_pkt_per_burst,
 		uint8_t pkt_len, uint8_t nb_pkt_segs);
 
 int
test/test/test_flow_classify.c +1 -1
index 1a79326b8..a9d32cd37 100644
@@ -491,7 +491,7 @@ init_ipv4_udp_traffic(struct rte_mempool *mp,
 {
 	struct rte_ether_hdr pkt_eth_hdr;
 	struct rte_ipv4_hdr pkt_ipv4_hdr;
-	struct udp_hdr pkt_udp_hdr;
+	struct rte_udp_hdr pkt_udp_hdr;
 	uint32_t src_addr = IPV4_ADDR(2, 2, 2, 3);
 	uint32_t dst_addr = IPV4_ADDR(2, 2, 2, 7);
 	uint16_t src_port = 32;
test/test/test_link_bonding.c +2 -2
index 924de81ae..7d3d19034 100644
@@ -80,13 +80,13 @@ struct link_bonding_unittest_params {
 	struct rte_ether_hdr *pkt_eth_hdr;
 	struct rte_ipv4_hdr *pkt_ipv4_hdr;
 	struct rte_ipv6_hdr *pkt_ipv6_hdr;
-	struct udp_hdr *pkt_udp_hdr;
+	struct rte_udp_hdr *pkt_udp_hdr;
 
 };
 
 static struct rte_ipv4_hdr pkt_ipv4_hdr;
 static struct rte_ipv6_hdr pkt_ipv6_hdr;
-static struct udp_hdr pkt_udp_hdr;
+static struct rte_udp_hdr pkt_udp_hdr;
 
 static struct link_bonding_unittest_params default_params  = {
 	.bonded_port_id = -1,
test/test/test_link_bonding_mode4.c +1 -1
index 4968cd91c..e3eab892c 100644
@@ -732,7 +732,7 @@ generate_packets(struct rte_ether_addr *src_mac,
 	uint32_t ip_dst[4] = { [0 ... 2] = 0xFEEDFACE, [3] = RTE_IPv4(192, 168, 0, 2) };
 
 	struct rte_ether_hdr pkt_eth_hdr;
-	struct udp_hdr pkt_udp_hdr;
+	struct rte_udp_hdr pkt_udp_hdr;
 	union {
 		struct rte_ipv4_hdr v4;
 		struct rte_ipv6_hdr v6;
test/test/test_pmd_perf.c +1 -1
index 3246b7ab6..b5635900b 100644
@@ -184,7 +184,7 @@ init_traffic(struct rte_mempool *mp,
 {
 	struct rte_ether_hdr pkt_eth_hdr;
 	struct rte_ipv4_hdr pkt_ipv4_hdr;
-	struct udp_hdr pkt_udp_hdr;
+	struct rte_udp_hdr pkt_udp_hdr;
 	uint32_t pktlen;
 	static uint8_t src_mac[] = { 0x00, 0xFF, 0xAA, 0xFF, 0xAA, 0xFF };
 	static uint8_t dst_mac[] = { 0x00, 0xAA, 0xFF, 0xAA, 0xFF, 0xAA };
Signature · 1 line
2.11.0
#19 lore raw
In reply to Olivier Matz
Quoted 37 lines · Olivier Matz

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Therefore, it is clear that doing this would break the compilation of many external applications.

Another drawback we need to take in account: it will make the backport of patches more difficult, although this is something that could be tempered by a script.

Quoted 5 lines

While it is obviously better to have a good namespace convention, we need to identify the issues we have today before deciding it's worth doing the change.

Comments?

I did not see the deprecation notice in the patches below, but I could have missed it.

Quoted 383 lines

Things that are missing in RFC:
- test with FreeBSD
- manually fix some indentation issues

Olivier Matz (14):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure

app/pdump/main.c                                   |   2 +-
app/test-eventdev/test_perf_common.c               |   2 +-
app/test-eventdev/test_pipeline_common.c           |   2 +-
app/test-pmd/cmdline.c                             |  66 ++---
app/test-pmd/cmdline_flow.c                        |  10 +-
app/test-pmd/config.c                              |  34 +--
app/test-pmd/csumonly.c                            | 156 +++++-----
app/test-pmd/flowgen.c                             |  30 +-
app/test-pmd/icmpecho.c                            | 120 ++++----
app/test-pmd/ieee1588fwd.c                         |  18 +-
app/test-pmd/macfwd.c                              |  12 +-
app/test-pmd/macswap.c                             |  16 +-
app/test-pmd/parameters.c                          |   6 +-
app/test-pmd/testpmd.c                             |  22 +-
app/test-pmd/testpmd.h                             |  18 +-
app/test-pmd/txonly.c                              |  36 +--
app/test-pmd/util.c                                |  34 +--
doc/guides/prog_guide/bbdev.rst                    |   6 +-
.../prog_guide/packet_classif_access_ctrl.rst      |  18 +-
doc/guides/prog_guide/rte_flow.rst                 |   4 +-
doc/guides/sample_app_ug/flow_classify.rst         |  28 +-
doc/guides/sample_app_ug/flow_filtering.rst        |   6 +-
doc/guides/sample_app_ug/ip_frag.rst               |  16 +-
doc/guides/sample_app_ug/ip_reassembly.rst         |  16 +-
doc/guides/sample_app_ug/ipv4_multicast.rst        |  16 +-
doc/guides/sample_app_ug/l2_forward_job_stats.rst  |   6 +-
.../sample_app_ug/l2_forward_real_virtual.rst      |   6 +-
doc/guides/sample_app_ug/l3_forward.rst            |  12 +-
doc/guides/sample_app_ug/link_status_intr.rst      |   6 +-
doc/guides/sample_app_ug/ptpclient.rst             |   6 +-
doc/guides/sample_app_ug/rxtx_callbacks.rst        |   2 +-
doc/guides/sample_app_ug/server_node_efd.rst       |  12 +-
doc/guides/sample_app_ug/skeleton.rst              |   4 +-
doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst   |   4 +-
drivers/bus/dpaa/base/fman/fman.c                  |   2 +-
drivers/bus/dpaa/base/fman/fman_hw.c               |   2 +-
drivers/bus/dpaa/include/fman.h                    |   2 +-
drivers/bus/dpaa/include/netcfg.h                  |   4 +-
drivers/net/af_packet/rte_eth_af_packet.c          |   2 +-
drivers/net/ark/ark_ethdev.c                       |  16 +-
drivers/net/ark/ark_ext.h                          |   4 +-
drivers/net/ark/ark_global.h                       |   4 +-
drivers/net/atlantic/atl_ethdev.c                  |  20 +-
drivers/net/atlantic/hw_atl/hw_atl_utils.c         |   8 +-
drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c    |   4 +-
drivers/net/avf/avf.h                              |   4 +-
drivers/net/avf/avf_ethdev.c                       |  50 ++--
drivers/net/avf/avf_rxtx.c                         |  14 +-
drivers/net/avf/avf_vchnl.c                        |   8 +-
drivers/net/avf/base/avf_adminq_cmd.h              |   4 +-
drivers/net/avf/base/avf_common.c                  |  12 +-
drivers/net/avf/base/avf_prototype.h               |   4 +-
drivers/net/avp/avp_ethdev.c                       |  20 +-
drivers/net/avp/rte_avp_common.h                   |   2 +-
drivers/net/axgbe/axgbe_dev.c                      |   4 +-
drivers/net/axgbe/axgbe_ethdev.c                   |  10 +-
drivers/net/axgbe/axgbe_ethdev.h                   |   4 +-
drivers/net/axgbe/axgbe_rxtx.c                     |   2 +-
drivers/net/bnx2x/bnx2x.c                          |  16 +-
drivers/net/bnx2x/bnx2x_ethdev.c                   |   4 +-
drivers/net/bnx2x/bnx2x_ethdev.h                   |   2 +-
drivers/net/bnx2x/bnx2x_vfpf.c                     |   8 +-
drivers/net/bnx2x/bnx2x_vfpf.h                     |   2 +-
drivers/net/bnx2x/ecore_sp.h                       |   2 +-
drivers/net/bnxt/bnxt.h                            |   4 +-
drivers/net/bnxt/bnxt_ethdev.c                     |  70 ++---
drivers/net/bnxt/bnxt_filter.c                     |   4 +-
drivers/net/bnxt/bnxt_filter.h                     |   8 +-
drivers/net/bnxt/bnxt_flow.c                       |  26 +-
drivers/net/bnxt/bnxt_hwrm.c                       |  40 +--
drivers/net/bnxt/bnxt_hwrm.h                       |   2 +-
drivers/net/bnxt/bnxt_ring.c                       |   8 +-
drivers/net/bnxt/bnxt_rxq.c                        |   2 +-
drivers/net/bnxt/bnxt_rxr.c                        |   2 +-
drivers/net/bnxt/bnxt_vnic.c                       |   2 +-
drivers/net/bnxt/rte_pmd_bnxt.c                    |  14 +-
drivers/net/bnxt/rte_pmd_bnxt.h                    |   4 +-
drivers/net/bonding/rte_eth_bond.h                 |   2 +-
drivers/net/bonding/rte_eth_bond_8023ad.c          |  26 +-
drivers/net/bonding/rte_eth_bond_8023ad.h          |  10 +-
drivers/net/bonding/rte_eth_bond_alb.c             |  78 ++---
drivers/net/bonding/rte_eth_bond_alb.h             |  10 +-
drivers/net/bonding/rte_eth_bond_api.c             |   2 +-
drivers/net/bonding/rte_eth_bond_args.c            |   2 +-
drivers/net/bonding/rte_eth_bond_pmd.c             | 194 ++++++-------
drivers/net/bonding/rte_eth_bond_private.h         |   6 +-
drivers/net/cxgbe/base/adapter.h                   |   6 +-
drivers/net/cxgbe/base/t4_hw.c                     |   8 +-
drivers/net/cxgbe/cxgbe.h                          |   4 +-
drivers/net/cxgbe/cxgbe_ethdev.c                   |  14 +-
drivers/net/cxgbe/cxgbe_filter.h                   |   2 +-
drivers/net/cxgbe/cxgbe_flow.c                     |  10 +-
drivers/net/cxgbe/cxgbe_main.c                     |   4 +-
drivers/net/cxgbe/cxgbe_pfvf.h                     |   2 +-
drivers/net/cxgbe/cxgbevf_main.c                   |   2 +-
drivers/net/cxgbe/l2t.c                            |   8 +-
drivers/net/cxgbe/l2t.h                            |   2 +-
drivers/net/cxgbe/mps_tcam.c                       |  14 +-
drivers/net/cxgbe/mps_tcam.h                       |   4 +-
drivers/net/cxgbe/sge.c                            |   8 +-
drivers/net/dpaa/dpaa_ethdev.c                     |  20 +-
drivers/net/dpaa/dpaa_rxtx.c                       |  22 +-
drivers/net/dpaa2/dpaa2_ethdev.c                   |  36 +--
drivers/net/e1000/e1000_ethdev.h                   |   2 +-
drivers/net/e1000/em_ethdev.c                      |  34 +--
drivers/net/e1000/em_rxtx.c                        |  22 +-
drivers/net/e1000/igb_ethdev.c                     |  70 ++---
drivers/net/e1000/igb_flow.c                       |  12 +-
drivers/net/e1000/igb_pf.c                         |  16 +-
drivers/net/e1000/igb_rxtx.c                       |  18 +-
drivers/net/ena/ena_ethdev.c                       |  16 +-
drivers/net/ena/ena_ethdev.h                       |   2 +-
drivers/net/enetc/base/enetc_hw.h                  |   4 +-
drivers/net/enetc/enetc_ethdev.c                   |   6 +-
drivers/net/enic/enic.h                            |   2 +-
drivers/net/enic/enic_clsf.c                       |  40 +--
drivers/net/enic/enic_ethdev.c                     |   4 +-
drivers/net/enic/enic_flow.c                       | 100 +++----
drivers/net/enic/enic_main.c                       |   2 +-
drivers/net/enic/enic_res.c                        |   4 +-
drivers/net/failsafe/failsafe.c                    |   6 +-
drivers/net/failsafe/failsafe_args.c               |   4 +-
drivers/net/failsafe/failsafe_ether.c              |   6 +-
drivers/net/failsafe/failsafe_ops.c                |   6 +-
drivers/net/failsafe/failsafe_private.h            |   4 +-
drivers/net/fm10k/fm10k.h                          |   2 +-
drivers/net/fm10k/fm10k_ethdev.c                   |  18 +-
drivers/net/i40e/base/i40e_adminq_cmd.h            |   4 +-
drivers/net/i40e/base/i40e_common.c                |  12 +-
drivers/net/i40e/base/i40e_prototype.h             |   4 +-
drivers/net/i40e/i40e_ethdev.c                     | 134 ++++-----
drivers/net/i40e/i40e_ethdev.h                     |  22 +-
drivers/net/i40e/i40e_ethdev_vf.c                  |  60 ++--
drivers/net/i40e/i40e_fdir.c                       | 126 ++++----
drivers/net/i40e/i40e_flow.c                       |  58 ++--
drivers/net/i40e/i40e_pf.c                         |  18 +-
drivers/net/i40e/i40e_rxtx.c                       |  28 +-
drivers/net/i40e/i40e_vf_representor.c             |   2 +-
drivers/net/i40e/rte_pmd_i40e.c                    |  30 +-
drivers/net/i40e/rte_pmd_i40e.h                    |   8 +-
drivers/net/ixgbe/ixgbe_ethdev.c                   |  94 +++---
drivers/net/ixgbe/ixgbe_ethdev.h                   |   2 +-
drivers/net/ixgbe/ixgbe_flow.c                     |  22 +-
drivers/net/ixgbe/ixgbe_pf.c                       |  14 +-
drivers/net/ixgbe/ixgbe_rxtx.c                     |  14 +-
drivers/net/ixgbe/ixgbe_vf_representor.c           |   4 +-
drivers/net/ixgbe/rte_pmd_ixgbe.c                  |  10 +-
drivers/net/ixgbe/rte_pmd_ixgbe.h                  |   2 +-
drivers/net/kni/rte_eth_kni.c                      |   4 +-
drivers/net/liquidio/lio_ethdev.c                  |  22 +-
drivers/net/mlx4/mlx4.c                            |   4 +-
drivers/net/mlx4/mlx4.h                            |   8 +-
drivers/net/mlx4/mlx4_ethdev.c                     |   8 +-
drivers/net/mlx4/mlx4_flow.c                       |  14 +-
drivers/net/mlx4/mlx4_rxtx.c                       |   2 +-
drivers/net/mlx5/mlx5.c                            |   4 +-
drivers/net/mlx5/mlx5.h                            |  14 +-
drivers/net/mlx5/mlx5_flow.c                       |  22 +-
drivers/net/mlx5/mlx5_flow_tcf.c                   |  40 +--
drivers/net/mlx5/mlx5_flow_verbs.c                 |  26 +-
drivers/net/mlx5/mlx5_mac.c                        |  18 +-
drivers/net/mlx5/mlx5_nl.c                         |  28 +-
drivers/net/mlx5/mlx5_rxtx.c                       |   6 +-
drivers/net/mlx5/mlx5_rxtx.h                       |   2 +-
drivers/net/mlx5/mlx5_rxtx_vec_neon.h              |   8 +-
drivers/net/mlx5/mlx5_rxtx_vec_sse.h               |  10 +-
drivers/net/mlx5/mlx5_trigger.c                    |   6 +-
drivers/net/mvneta/mvneta_ethdev.c                 |  22 +-
drivers/net/mvneta/mvneta_ethdev.h                 |   2 +-
drivers/net/mvpp2/mrvl_ethdev.c                    |  22 +-
drivers/net/mvpp2/mrvl_ethdev.h                    |   2 +-
drivers/net/mvpp2/mrvl_flow.c                      |   4 +-
drivers/net/netvsc/hn_ethdev.c                     |   4 +-
drivers/net/netvsc/hn_nvs.c                        |   2 +-
drivers/net/netvsc/hn_rndis.c                      |   2 +-
drivers/net/netvsc/hn_rxtx.c                       |  12 +-
drivers/net/netvsc/hn_var.h                        |   4 +-
drivers/net/netvsc/hn_vf.c                         |  12 +-
drivers/net/nfp/nfp_net.c                          |  20 +-
drivers/net/nfp/nfp_net_pmd.h                      |   2 +-
drivers/net/null/rte_eth_null.c                    |   6 +-
drivers/net/octeontx/octeontx_ethdev.c             |   8 +-
drivers/net/octeontx/octeontx_ethdev.h             |   2 +-
drivers/net/pcap/rte_eth_pcap.c                    |  22 +-
drivers/net/qede/base/bcm_osal.h                   |   2 +-
drivers/net/qede/base/ecore_dev.c                  |   4 +-
drivers/net/qede/qede_ethdev.c                     |  58 ++--
drivers/net/qede/qede_ethdev.h                     |   6 +-
drivers/net/qede/qede_filter.c                     |  66 ++---
drivers/net/qede/qede_if.h                         |   4 +-
drivers/net/qede/qede_main.c                       |   6 +-
drivers/net/qede/qede_rxtx.c                       |  32 +-
drivers/net/qede/qede_rxtx.h                       |   2 +-
drivers/net/ring/rte_eth_ring.c                    |   4 +-
drivers/net/sfc/sfc.h                              |   2 +-
drivers/net/sfc/sfc_ef10_tx.c                      |   8 +-
drivers/net/sfc/sfc_ethdev.c                       |  20 +-
drivers/net/sfc/sfc_flow.c                         |  12 +-
drivers/net/sfc/sfc_port.c                         |   8 +-
drivers/net/sfc/sfc_tso.c                          |   8 +-
drivers/net/softnic/parser.c                       |  18 +-
drivers/net/softnic/parser.h                       |   2 +-
drivers/net/softnic/rte_eth_softnic.c              |   2 +-
drivers/net/softnic/rte_eth_softnic_pipeline.c     |  40 +--
drivers/net/szedata2/rte_eth_szedata2.c            |   8 +-
drivers/net/tap/rte_eth_tap.c                      |  58 ++--
drivers/net/tap/rte_eth_tap.h                      |   2 +-
drivers/net/tap/tap_bpf_program.c                  |  14 +-
drivers/net/tap/tap_flow.c                         |  12 +-
drivers/net/thunderx/base/nicvf_mbox.c             |   4 +-
drivers/net/thunderx/base/nicvf_plat.h             |   2 +-
drivers/net/thunderx/nicvf_ethdev.c                |  18 +-
drivers/net/thunderx/nicvf_struct.h                |   2 +-
drivers/net/vdev_netvsc/vdev_netvsc.c              |  16 +-
drivers/net/vhost/rte_eth_vhost.c                  |  12 +-
drivers/net/virtio/virtio_ethdev.c                 |  70 ++---
drivers/net/virtio/virtio_pci.h                    |   4 +-
drivers/net/virtio/virtio_rxtx.c                   |  28 +-
drivers/net/virtio/virtio_user/vhost_kernel_tap.c  |   2 +-
drivers/net/virtio/virtio_user/virtio_user_dev.c   |   6 +-
drivers/net/virtio/virtio_user/virtio_user_dev.h   |   2 +-
drivers/net/virtio/virtio_user_ethdev.c            |   8 +-
drivers/net/virtio/virtqueue.h                     |   2 +-
drivers/net/vmxnet3/vmxnet3_ethdev.c               |  12 +-
drivers/net/vmxnet3/vmxnet3_ethdev.h               |   2 +-
drivers/net/vmxnet3/vmxnet3_rxtx.c                 |  44 +--
examples/bbdev_app/main.c                          |  40 +--
examples/bond/main.c                               |  78 ++---
examples/distributor/main.c                        |   4 +-
examples/ethtool/ethtool-app/ethapp.c              |   8 +-
examples/ethtool/ethtool-app/main.c                |  10 +-
examples/ethtool/lib/rte_ethtool.c                 |   8 +-
examples/ethtool/lib/rte_ethtool.h                 |   6 +-
examples/eventdev_pipeline/main.c                  |   4 +-
examples/eventdev_pipeline/pipeline_common.h       |  10 +-
examples/flow_classify/flow_classify.c             |  30 +-
examples/flow_filtering/main.c                     |  10 +-
examples/ip_fragmentation/main.c                   |  62 ++--
examples/ip_pipeline/cli.c                         |   2 +-
examples/ip_pipeline/kni.c                         |   2 +-
examples/ip_pipeline/parser.c                      |  18 +-
examples/ip_pipeline/parser.h                      |   2 +-
examples/ip_pipeline/pipeline.c                    |  40 +--
examples/ip_reassembly/main.c                      |  50 ++--
examples/ipsec-secgw/esp.c                         |  42 +--
examples/ipsec-secgw/ipsec-secgw.c                 |  38 +--
examples/ipsec-secgw/sa.c                          |   6 +-
examples/ipv4_multicast/main.c                     |  58 ++--
examples/kni/main.c                                |  14 +-
examples/l2fwd-cat/l2fwd-cat.c                     |   4 +-
examples/l2fwd-crypto/main.c                       |  26 +-
examples/l2fwd-jobstats/main.c                     |   8 +-
examples/l2fwd-keepalive/main.c                    |   8 +-
examples/l2fwd/main.c                              |   8 +-
examples/l3fwd-acl/main.c                          | 102 +++----
examples/l3fwd-power/main.c                        | 100 +++----
examples/l3fwd-vf/main.c                           |  68 ++---
examples/l3fwd/l3fwd.h                             |   8 +-
examples/l3fwd/l3fwd_altivec.h                     |  14 +-
examples/l3fwd/l3fwd_common.h                      |   4 +-
examples/l3fwd/l3fwd_em.c                          |  44 +--
examples/l3fwd/l3fwd_em.h                          |  20 +-
examples/l3fwd/l3fwd_em_hlm.h                      |  16 +-
examples/l3fwd/l3fwd_em_hlm_neon.h                 |  16 +-
examples/l3fwd/l3fwd_em_hlm_sse.h                  |  16 +-
examples/l3fwd/l3fwd_em_sequential.h               |  16 +-
examples/l3fwd/l3fwd_lpm.c                         |  50 ++--
examples/l3fwd/l3fwd_lpm.h                         |  20 +-
examples/l3fwd/l3fwd_lpm_altivec.h                 |  20 +-
examples/l3fwd/l3fwd_lpm_neon.h                    |  30 +-
examples/l3fwd/l3fwd_lpm_sse.h                     |  20 +-
examples/l3fwd/l3fwd_neon.h                        |  14 +-
examples/l3fwd/l3fwd_sse.h                         |  14 +-
examples/l3fwd/main.c                              |  20 +-
examples/link_status_interrupt/main.c              |   8 +-
examples/load_balancer/runtime.c                   |   6 +-
.../client_server_mp/mp_server/main.c              |   2 +-
examples/packet_ordering/main.c                    |   2 +-
examples/performance-thread/l3fwd-thread/main.c    | 322 ++++++++++-----------
examples/ptpclient/ptpclient.c                     |  32 +-
examples/qos_meter/main.c                          |   4 +-
examples/qos_sched/init.c                          |   2 +-
examples/quota_watermark/qw/main.c                 |   8 +-
examples/rxtx_callbacks/main.c                     |   4 +-
examples/server_node_efd/node/node.c               |   6 +-
examples/server_node_efd/server/main.c             |   8 +-
examples/skeleton/basicfwd.c                       |   4 +-
examples/tep_termination/main.c                    |   2 +-
examples/tep_termination/main.h                    |   2 +-
examples/tep_termination/vxlan.c                   | 108 +++----
examples/tep_termination/vxlan.h                   |   8 +-
examples/tep_termination/vxlan_setup.c             |  30 +-
examples/tep_termination/vxlan_setup.h             |   2 +-
examples/vhost/main.c                              |  40 +--
examples/vhost/main.h                              |   2 +-
examples/vm_power_manager/channel_monitor.c        |   2 +-
.../guest_cli/vm_power_cli_guest.c                 |   2 +-
examples/vm_power_manager/main.c                   |   6 +-
examples/vmdq/main.c                               |  12 +-
examples/vmdq_dcb/main.c                           |  12 +-
lib/librte_cmdline/cmdline_parse_etheraddr.c       |  33 +--
lib/librte_ethdev/rte_eth_ctrl.h                   |  12 +-
lib/librte_ethdev/rte_ethdev.c                     |  56 ++--
lib/librte_ethdev/rte_ethdev.h                     |  12 +-
lib/librte_ethdev/rte_ethdev_core.h                |  12 +-
lib/librte_ethdev/rte_flow.h                       |  32 +-
lib/librte_eventdev/rte_event_eth_rx_adapter.c     |  32 +-
lib/librte_gro/gro_tcp4.c                          |  26 +-
lib/librte_gro/gro_tcp4.h                          |  20 +-
lib/librte_gro/gro_vxlan_tcp4.c                    |  64 ++--
lib/librte_gro/gro_vxlan_tcp4.h                    |   6 +-
lib/librte_gso/gso_common.h                        |  16 +-
lib/librte_gso/gso_tcp4.c                          |  12 +-
lib/librte_gso/gso_tunnel_tcp4.c                   |  14 +-
lib/librte_gso/gso_udp4.c                          |   8 +-
lib/librte_gso/rte_gso.h                           |   8 +-
lib/librte_hash/rte_thash.h                        |   2 +-
lib/librte_ip_frag/rte_ip_frag.h                   |  12 +-
lib/librte_ip_frag/rte_ipv4_fragmentation.c        |  42 +--
lib/librte_ip_frag/rte_ipv4_reassembly.c           |  14 +-
lib/librte_ip_frag/rte_ipv6_fragmentation.c        |  26 +-
lib/librte_ip_frag/rte_ipv6_reassembly.c           |   6 +-
lib/librte_kni/rte_kni.c                           |   4 +-
lib/librte_kni/rte_kni.h                           |   2 +-
lib/librte_net/rte_arp.c                           |  32 +-
lib/librte_net/rte_arp.h                           |  36 +--
lib/librte_net/rte_esp.h                           |   2 +-
lib/librte_net/rte_ether.h                         | 178 ++++++------
lib/librte_net/rte_gre.h                           |   2 +-
lib/librte_net/rte_icmp.h                          |   6 +-
lib/librte_net/rte_ip.h                            |  70 ++---
lib/librte_net/rte_net.c                           |  90 +++---
lib/librte_net/rte_net.h                           |  22 +-
lib/librte_net/rte_sctp.h                          |   2 +-
lib/librte_net/rte_tcp.h                           |   2 +-
lib/librte_net/rte_udp.h                           |   2 +-
lib/librte_pipeline/rte_table_action.c             | 210 +++++++-------
lib/librte_pipeline/rte_table_action.h             |   4 +-
lib/librte_port/rte_port_ras.c                     |   8 +-
lib/librte_port/rte_port_source_sink.c             |   6 +-
lib/librte_vhost/vhost.h                           |   2 +-
lib/librte_vhost/virtio_net.c                      |  42 +--
test/test-acl/main.c                               |   2 +-
test/test-pipeline/pipeline_acl.c                  |  16 +-
test/test-pipeline/pipeline_hash.c                 |  12 +-
test/test/packet_burst_generator.c                 | 126 ++++----
test/test/packet_burst_generator.h                 |  26 +-
test/test/test_acl.c                               |   8 +-
test/test/test_acl.h                               | 122 ++++----
test/test/test_cmdline_etheraddr.c                 |  16 +-
test/test/test_efd.c                               |  20 +-
test/test/test_event_eth_rx_adapter.c              |   2 +-
test/test/test_event_eth_tx_adapter.c              |   2 +-
test/test/test_flow_classify.c                     |  68 ++---
test/test/test_hash.c                              |  20 +-
test/test/test_link_bonding.c                      | 284 +++++++++---------
test/test/test_link_bonding_mode4.c                | 116 ++++----
test/test/test_link_bonding_rssconf.c              |   6 +-
test/test/test_lpm.c                               |  76 ++---
test/test/test_lpm_perf.c                          |  10 +-
Quoted 12 lines
test/test/test_member.c                            |  20 +-
test/test/test_pmd_perf.c                          |  20 +-
test/test/test_sched.c                             |  20 +-
test/test/test_table_acl.c                         |   8 +-
test/test/test_thash.c                             |  12 +-
test/test/virtual_pmd.c                            |   6 +-
test/test/virtual_pmd.h                            |   2 +-
367 files changed, 3906 insertions(+), 3913 deletions(-)
Signature · 1 line
2.11.0

Regards,
Keith

#20 lore raw

Hi,

Quoted 37 lines · Keith
Quoted 37 lines · Olivier Matz

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Therefore, it is clear that doing this would break the compilation of many external applications.

Another drawback we need to take in account: it will make the backport of patches more difficult, although this is something that could be tempered by a script.

Quoted 7 lines
Quoted 5 lines

While it is obviously better to have a good namespace convention, we need to identify the issues we have today before deciding it's worth doing the change.

Comments?

I did not see the deprecation notice in the patches below, but I could have missed it.

I will send it only if we reach a consensus about the need to apply the patchset.

Regards
Olivier

#21 lore raw
In reply to Olivier Matz
Quoted 421 lines · On Wed, 24 Oct 2018 10:18:19 +0200 Olivier Matz <[email protected]> wrote:

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Therefore, it is clear that doing this would break the compilation of many external applications.

Another drawback we need to take in account: it will make the backport of patches more difficult, although this is something that could be tempered by a script.

While it is obviously better to have a good namespace convention, we need to identify the issues we have today before deciding it's worth doing the change.

Comments?

Things that are missing in RFC:
- test with FreeBSD
- manually fix some indentation issues

Olivier Matz (14):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure

 app/pdump/main.c                                   |   2 +-
 app/test-eventdev/test_perf_common.c               |   2 +-
 app/test-eventdev/test_pipeline_common.c           |   2 +-
 app/test-pmd/cmdline.c                             |  66 ++---
 app/test-pmd/cmdline_flow.c                        |  10 +-
 app/test-pmd/config.c                              |  34 +--
 app/test-pmd/csumonly.c                            | 156 +++++-----
 app/test-pmd/flowgen.c                             |  30 +-
 app/test-pmd/icmpecho.c                            | 120 ++++----
 app/test-pmd/ieee1588fwd.c                         |  18 +-
 app/test-pmd/macfwd.c                              |  12 +-
 app/test-pmd/macswap.c                             |  16 +-
 app/test-pmd/parameters.c                          |   6 +-
 app/test-pmd/testpmd.c                             |  22 +-
 app/test-pmd/testpmd.h                             |  18 +-
 app/test-pmd/txonly.c                              |  36 +--
 app/test-pmd/util.c                                |  34 +--
 doc/guides/prog_guide/bbdev.rst                    |   6 +-
 .../prog_guide/packet_classif_access_ctrl.rst      |  18 +-
 doc/guides/prog_guide/rte_flow.rst                 |   4 +-
 doc/guides/sample_app_ug/flow_classify.rst         |  28 +-
 doc/guides/sample_app_ug/flow_filtering.rst        |   6 +-
 doc/guides/sample_app_ug/ip_frag.rst               |  16 +-
 doc/guides/sample_app_ug/ip_reassembly.rst         |  16 +-
 doc/guides/sample_app_ug/ipv4_multicast.rst        |  16 +-
 doc/guides/sample_app_ug/l2_forward_job_stats.rst  |   6 +-
 .../sample_app_ug/l2_forward_real_virtual.rst      |   6 +-
 doc/guides/sample_app_ug/l3_forward.rst            |  12 +-
 doc/guides/sample_app_ug/link_status_intr.rst      |   6 +-
 doc/guides/sample_app_ug/ptpclient.rst             |   6 +-
 doc/guides/sample_app_ug/rxtx_callbacks.rst        |   2 +-
 doc/guides/sample_app_ug/server_node_efd.rst       |  12 +-
 doc/guides/sample_app_ug/skeleton.rst              |   4 +-
 doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst   |   4 +-
 drivers/bus/dpaa/base/fman/fman.c                  |   2 +-
 drivers/bus/dpaa/base/fman/fman_hw.c               |   2 +-
 drivers/bus/dpaa/include/fman.h                    |   2 +-
 drivers/bus/dpaa/include/netcfg.h                  |   4 +-
 drivers/net/af_packet/rte_eth_af_packet.c          |   2 +-
 drivers/net/ark/ark_ethdev.c                       |  16 +-
 drivers/net/ark/ark_ext.h                          |   4 +-
 drivers/net/ark/ark_global.h                       |   4 +-
 drivers/net/atlantic/atl_ethdev.c                  |  20 +-
 drivers/net/atlantic/hw_atl/hw_atl_utils.c         |   8 +-
 drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c    |   4 +-
 drivers/net/avf/avf.h                              |   4 +-
 drivers/net/avf/avf_ethdev.c                       |  50 ++--
 drivers/net/avf/avf_rxtx.c                         |  14 +-
 drivers/net/avf/avf_vchnl.c                        |   8 +-
 drivers/net/avf/base/avf_adminq_cmd.h              |   4 +-
 drivers/net/avf/base/avf_common.c                  |  12 +-
 drivers/net/avf/base/avf_prototype.h               |   4 +-
 drivers/net/avp/avp_ethdev.c                       |  20 +-
 drivers/net/avp/rte_avp_common.h                   |   2 +-
 drivers/net/axgbe/axgbe_dev.c                      |   4 +-
 drivers/net/axgbe/axgbe_ethdev.c                   |  10 +-
 drivers/net/axgbe/axgbe_ethdev.h                   |   4 +-
 drivers/net/axgbe/axgbe_rxtx.c                     |   2 +-
 drivers/net/bnx2x/bnx2x.c                          |  16 +-
 drivers/net/bnx2x/bnx2x_ethdev.c                   |   4 +-
 drivers/net/bnx2x/bnx2x_ethdev.h                   |   2 +-
 drivers/net/bnx2x/bnx2x_vfpf.c                     |   8 +-
 drivers/net/bnx2x/bnx2x_vfpf.h                     |   2 +-
 drivers/net/bnx2x/ecore_sp.h                       |   2 +-
 drivers/net/bnxt/bnxt.h                            |   4 +-
 drivers/net/bnxt/bnxt_ethdev.c                     |  70 ++---
 drivers/net/bnxt/bnxt_filter.c                     |   4 +-
 drivers/net/bnxt/bnxt_filter.h                     |   8 +-
 drivers/net/bnxt/bnxt_flow.c                       |  26 +-
 drivers/net/bnxt/bnxt_hwrm.c                       |  40 +--
 drivers/net/bnxt/bnxt_hwrm.h                       |   2 +-
 drivers/net/bnxt/bnxt_ring.c                       |   8 +-
 drivers/net/bnxt/bnxt_rxq.c                        |   2 +-
 drivers/net/bnxt/bnxt_rxr.c                        |   2 +-
 drivers/net/bnxt/bnxt_vnic.c                       |   2 +-
 drivers/net/bnxt/rte_pmd_bnxt.c                    |  14 +-
 drivers/net/bnxt/rte_pmd_bnxt.h                    |   4 +-
 drivers/net/bonding/rte_eth_bond.h                 |   2 +-
 drivers/net/bonding/rte_eth_bond_8023ad.c          |  26 +-
 drivers/net/bonding/rte_eth_bond_8023ad.h          |  10 +-
 drivers/net/bonding/rte_eth_bond_alb.c             |  78 ++---
 drivers/net/bonding/rte_eth_bond_alb.h             |  10 +-
 drivers/net/bonding/rte_eth_bond_api.c             |   2 +-
 drivers/net/bonding/rte_eth_bond_args.c            |   2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c             | 194 ++++++-------
 drivers/net/bonding/rte_eth_bond_private.h         |   6 +-
 drivers/net/cxgbe/base/adapter.h                   |   6 +-
 drivers/net/cxgbe/base/t4_hw.c                     |   8 +-
 drivers/net/cxgbe/cxgbe.h                          |   4 +-
 drivers/net/cxgbe/cxgbe_ethdev.c                   |  14 +-
 drivers/net/cxgbe/cxgbe_filter.h                   |   2 +-
 drivers/net/cxgbe/cxgbe_flow.c                     |  10 +-
 drivers/net/cxgbe/cxgbe_main.c                     |   4 +-
 drivers/net/cxgbe/cxgbe_pfvf.h                     |   2 +-
 drivers/net/cxgbe/cxgbevf_main.c                   |   2 +-
 drivers/net/cxgbe/l2t.c                            |   8 +-
 drivers/net/cxgbe/l2t.h                            |   2 +-
 drivers/net/cxgbe/mps_tcam.c                       |  14 +-
 drivers/net/cxgbe/mps_tcam.h                       |   4 +-
 drivers/net/cxgbe/sge.c                            |   8 +-
 drivers/net/dpaa/dpaa_ethdev.c                     |  20 +-
 drivers/net/dpaa/dpaa_rxtx.c                       |  22 +-
 drivers/net/dpaa2/dpaa2_ethdev.c                   |  36 +--
 drivers/net/e1000/e1000_ethdev.h                   |   2 +-
 drivers/net/e1000/em_ethdev.c                      |  34 +--
 drivers/net/e1000/em_rxtx.c                        |  22 +-
 drivers/net/e1000/igb_ethdev.c                     |  70 ++---
 drivers/net/e1000/igb_flow.c                       |  12 +-
 drivers/net/e1000/igb_pf.c                         |  16 +-
 drivers/net/e1000/igb_rxtx.c                       |  18 +-
 drivers/net/ena/ena_ethdev.c                       |  16 +-
 drivers/net/ena/ena_ethdev.h                       |   2 +-
 drivers/net/enetc/base/enetc_hw.h                  |   4 +-
 drivers/net/enetc/enetc_ethdev.c                   |   6 +-
 drivers/net/enic/enic.h                            |   2 +-
 drivers/net/enic/enic_clsf.c                       |  40 +--
 drivers/net/enic/enic_ethdev.c                     |   4 +-
 drivers/net/enic/enic_flow.c                       | 100 +++----
 drivers/net/enic/enic_main.c                       |   2 +-
 drivers/net/enic/enic_res.c                        |   4 +-
 drivers/net/failsafe/failsafe.c                    |   6 +-
 drivers/net/failsafe/failsafe_args.c               |   4 +-
 drivers/net/failsafe/failsafe_ether.c              |   6 +-
 drivers/net/failsafe/failsafe_ops.c                |   6 +-
 drivers/net/failsafe/failsafe_private.h            |   4 +-
 drivers/net/fm10k/fm10k.h                          |   2 +-
 drivers/net/fm10k/fm10k_ethdev.c                   |  18 +-
 drivers/net/i40e/base/i40e_adminq_cmd.h            |   4 +-
 drivers/net/i40e/base/i40e_common.c                |  12 +-
 drivers/net/i40e/base/i40e_prototype.h             |   4 +-
 drivers/net/i40e/i40e_ethdev.c                     | 134 ++++-----
 drivers/net/i40e/i40e_ethdev.h                     |  22 +-
 drivers/net/i40e/i40e_ethdev_vf.c                  |  60 ++--
 drivers/net/i40e/i40e_fdir.c                       | 126 ++++----
 drivers/net/i40e/i40e_flow.c                       |  58 ++--
 drivers/net/i40e/i40e_pf.c                         |  18 +-
 drivers/net/i40e/i40e_rxtx.c                       |  28 +-
 drivers/net/i40e/i40e_vf_representor.c             |   2 +-
 drivers/net/i40e/rte_pmd_i40e.c                    |  30 +-
 drivers/net/i40e/rte_pmd_i40e.h                    |   8 +-
 drivers/net/ixgbe/ixgbe_ethdev.c                   |  94 +++---
 drivers/net/ixgbe/ixgbe_ethdev.h                   |   2 +-
 drivers/net/ixgbe/ixgbe_flow.c                     |  22 +-
 drivers/net/ixgbe/ixgbe_pf.c                       |  14 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                     |  14 +-
 drivers/net/ixgbe/ixgbe_vf_representor.c           |   4 +-
 drivers/net/ixgbe/rte_pmd_ixgbe.c                  |  10 +-
 drivers/net/ixgbe/rte_pmd_ixgbe.h                  |   2 +-
 drivers/net/kni/rte_eth_kni.c                      |   4 +-
 drivers/net/liquidio/lio_ethdev.c                  |  22 +-
 drivers/net/mlx4/mlx4.c                            |   4 +-
 drivers/net/mlx4/mlx4.h                            |   8 +-
 drivers/net/mlx4/mlx4_ethdev.c                     |   8 +-
 drivers/net/mlx4/mlx4_flow.c                       |  14 +-
 drivers/net/mlx4/mlx4_rxtx.c                       |   2 +-
 drivers/net/mlx5/mlx5.c                            |   4 +-
 drivers/net/mlx5/mlx5.h                            |  14 +-
 drivers/net/mlx5/mlx5_flow.c                       |  22 +-
 drivers/net/mlx5/mlx5_flow_tcf.c                   |  40 +--
 drivers/net/mlx5/mlx5_flow_verbs.c                 |  26 +-
 drivers/net/mlx5/mlx5_mac.c                        |  18 +-
 drivers/net/mlx5/mlx5_nl.c                         |  28 +-
 drivers/net/mlx5/mlx5_rxtx.c                       |   6 +-
 drivers/net/mlx5/mlx5_rxtx.h                       |   2 +-
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h              |   8 +-
 drivers/net/mlx5/mlx5_rxtx_vec_sse.h               |  10 +-
 drivers/net/mlx5/mlx5_trigger.c                    |   6 +-
 drivers/net/mvneta/mvneta_ethdev.c                 |  22 +-
 drivers/net/mvneta/mvneta_ethdev.h                 |   2 +-
 drivers/net/mvpp2/mrvl_ethdev.c                    |  22 +-
 drivers/net/mvpp2/mrvl_ethdev.h                    |   2 +-
 drivers/net/mvpp2/mrvl_flow.c                      |   4 +-
 drivers/net/netvsc/hn_ethdev.c                     |   4 +-
 drivers/net/netvsc/hn_nvs.c                        |   2 +-
 drivers/net/netvsc/hn_rndis.c                      |   2 +-
 drivers/net/netvsc/hn_rxtx.c                       |  12 +-
 drivers/net/netvsc/hn_var.h                        |   4 +-
 drivers/net/netvsc/hn_vf.c                         |  12 +-
 drivers/net/nfp/nfp_net.c                          |  20 +-
 drivers/net/nfp/nfp_net_pmd.h                      |   2 +-
 drivers/net/null/rte_eth_null.c                    |   6 +-
 drivers/net/octeontx/octeontx_ethdev.c             |   8 +-
 drivers/net/octeontx/octeontx_ethdev.h             |   2 +-
 drivers/net/pcap/rte_eth_pcap.c                    |  22 +-
 drivers/net/qede/base/bcm_osal.h                   |   2 +-
 drivers/net/qede/base/ecore_dev.c                  |   4 +-
 drivers/net/qede/qede_ethdev.c                     |  58 ++--
 drivers/net/qede/qede_ethdev.h                     |   6 +-
 drivers/net/qede/qede_filter.c                     |  66 ++---
 drivers/net/qede/qede_if.h                         |   4 +-
 drivers/net/qede/qede_main.c                       |   6 +-
 drivers/net/qede/qede_rxtx.c                       |  32 +-
 drivers/net/qede/qede_rxtx.h                       |   2 +-
 drivers/net/ring/rte_eth_ring.c                    |   4 +-
 drivers/net/sfc/sfc.h                              |   2 +-
 drivers/net/sfc/sfc_ef10_tx.c                      |   8 +-
 drivers/net/sfc/sfc_ethdev.c                       |  20 +-
 drivers/net/sfc/sfc_flow.c                         |  12 +-
 drivers/net/sfc/sfc_port.c                         |   8 +-
 drivers/net/sfc/sfc_tso.c                          |   8 +-
 drivers/net/softnic/parser.c                       |  18 +-
 drivers/net/softnic/parser.h                       |   2 +-
 drivers/net/softnic/rte_eth_softnic.c              |   2 +-
 drivers/net/softnic/rte_eth_softnic_pipeline.c     |  40 +--
 drivers/net/szedata2/rte_eth_szedata2.c            |   8 +-
 drivers/net/tap/rte_eth_tap.c                      |  58 ++--
 drivers/net/tap/rte_eth_tap.h                      |   2 +-
 drivers/net/tap/tap_bpf_program.c                  |  14 +-
 drivers/net/tap/tap_flow.c                         |  12 +-
 drivers/net/thunderx/base/nicvf_mbox.c             |   4 +-
 drivers/net/thunderx/base/nicvf_plat.h             |   2 +-
 drivers/net/thunderx/nicvf_ethdev.c                |  18 +-
 drivers/net/thunderx/nicvf_struct.h                |   2 +-
 drivers/net/vdev_netvsc/vdev_netvsc.c              |  16 +-
 drivers/net/vhost/rte_eth_vhost.c                  |  12 +-
 drivers/net/virtio/virtio_ethdev.c                 |  70 ++---
 drivers/net/virtio/virtio_pci.h                    |   4 +-
 drivers/net/virtio/virtio_rxtx.c                   |  28 +-
 drivers/net/virtio/virtio_user/vhost_kernel_tap.c  |   2 +-
 drivers/net/virtio/virtio_user/virtio_user_dev.c   |   6 +-
 drivers/net/virtio/virtio_user/virtio_user_dev.h   |   2 +-
 drivers/net/virtio/virtio_user_ethdev.c            |   8 +-
 drivers/net/virtio/virtqueue.h                     |   2 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c               |  12 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.h               |   2 +-
 drivers/net/vmxnet3/vmxnet3_rxtx.c                 |  44 +--
 examples/bbdev_app/main.c                          |  40 +--
 examples/bond/main.c                               |  78 ++---
 examples/distributor/main.c                        |   4 +-
 examples/ethtool/ethtool-app/ethapp.c              |   8 +-
 examples/ethtool/ethtool-app/main.c                |  10 +-
 examples/ethtool/lib/rte_ethtool.c                 |   8 +-
 examples/ethtool/lib/rte_ethtool.h                 |   6 +-
 examples/eventdev_pipeline/main.c                  |   4 +-
 examples/eventdev_pipeline/pipeline_common.h       |  10 +-
 examples/flow_classify/flow_classify.c             |  30 +-
 examples/flow_filtering/main.c                     |  10 +-
 examples/ip_fragmentation/main.c                   |  62 ++--
 examples/ip_pipeline/cli.c                         |   2 +-
 examples/ip_pipeline/kni.c                         |   2 +-
 examples/ip_pipeline/parser.c                      |  18 +-
 examples/ip_pipeline/parser.h                      |   2 +-
 examples/ip_pipeline/pipeline.c                    |  40 +--
 examples/ip_reassembly/main.c                      |  50 ++--
 examples/ipsec-secgw/esp.c                         |  42 +--
 examples/ipsec-secgw/ipsec-secgw.c                 |  38 +--
 examples/ipsec-secgw/sa.c                          |   6 +-
 examples/ipv4_multicast/main.c                     |  58 ++--
 examples/kni/main.c                                |  14 +-
 examples/l2fwd-cat/l2fwd-cat.c                     |   4 +-
 examples/l2fwd-crypto/main.c                       |  26 +-
 examples/l2fwd-jobstats/main.c                     |   8 +-
 examples/l2fwd-keepalive/main.c                    |   8 +-
 examples/l2fwd/main.c                              |   8 +-
 examples/l3fwd-acl/main.c                          | 102 +++----
 examples/l3fwd-power/main.c                        | 100 +++----
 examples/l3fwd-vf/main.c                           |  68 ++---
 examples/l3fwd/l3fwd.h                             |   8 +-
 examples/l3fwd/l3fwd_altivec.h                     |  14 +-
 examples/l3fwd/l3fwd_common.h                      |   4 +-
 examples/l3fwd/l3fwd_em.c                          |  44 +--
 examples/l3fwd/l3fwd_em.h                          |  20 +-
 examples/l3fwd/l3fwd_em_hlm.h                      |  16 +-
 examples/l3fwd/l3fwd_em_hlm_neon.h                 |  16 +-
 examples/l3fwd/l3fwd_em_hlm_sse.h                  |  16 +-
 examples/l3fwd/l3fwd_em_sequential.h               |  16 +-
 examples/l3fwd/l3fwd_lpm.c                         |  50 ++--
 examples/l3fwd/l3fwd_lpm.h                         |  20 +-
 examples/l3fwd/l3fwd_lpm_altivec.h                 |  20 +-
 examples/l3fwd/l3fwd_lpm_neon.h                    |  30 +-
 examples/l3fwd/l3fwd_lpm_sse.h                     |  20 +-
 examples/l3fwd/l3fwd_neon.h                        |  14 +-
 examples/l3fwd/l3fwd_sse.h                         |  14 +-
 examples/l3fwd/main.c                              |  20 +-
 examples/link_status_interrupt/main.c              |   8 +-
 examples/load_balancer/runtime.c                   |   6 +-
 .../client_server_mp/mp_server/main.c              |   2 +-
 examples/packet_ordering/main.c                    |   2 +-
 examples/performance-thread/l3fwd-thread/main.c    | 322 ++++++++++-----------
 examples/ptpclient/ptpclient.c                     |  32 +-
 examples/qos_meter/main.c                          |   4 +-
 examples/qos_sched/init.c                          |   2 +-
 examples/quota_watermark/qw/main.c                 |   8 +-
 examples/rxtx_callbacks/main.c                     |   4 +-
 examples/server_node_efd/node/node.c               |   6 +-
 examples/server_node_efd/server/main.c             |   8 +-
 examples/skeleton/basicfwd.c                       |   4 +-
 examples/tep_termination/main.c                    |   2 +-
 examples/tep_termination/main.h                    |   2 +-
 examples/tep_termination/vxlan.c                   | 108 +++----
 examples/tep_termination/vxlan.h                   |   8 +-
 examples/tep_termination/vxlan_setup.c             |  30 +-
 examples/tep_termination/vxlan_setup.h             |   2 +-
 examples/vhost/main.c                              |  40 +--
 examples/vhost/main.h                              |   2 +-
 examples/vm_power_manager/channel_monitor.c        |   2 +-
 .../guest_cli/vm_power_cli_guest.c                 |   2 +-
 examples/vm_power_manager/main.c                   |   6 +-
 examples/vmdq/main.c                               |  12 +-
 examples/vmdq_dcb/main.c                           |  12 +-
 lib/librte_cmdline/cmdline_parse_etheraddr.c       |  33 +--
 lib/librte_ethdev/rte_eth_ctrl.h                   |  12 +-
 lib/librte_ethdev/rte_ethdev.c                     |  56 ++--
 lib/librte_ethdev/rte_ethdev.h                     |  12 +-
 lib/librte_ethdev/rte_ethdev_core.h                |  12 +-
 lib/librte_ethdev/rte_flow.h                       |  32 +-
 lib/librte_eventdev/rte_event_eth_rx_adapter.c     |  32 +-
 lib/librte_gro/gro_tcp4.c                          |  26 +-
 lib/librte_gro/gro_tcp4.h                          |  20 +-
 lib/librte_gro/gro_vxlan_tcp4.c                    |  64 ++--
 lib/librte_gro/gro_vxlan_tcp4.h                    |   6 +-
 lib/librte_gso/gso_common.h                        |  16 +-
 lib/librte_gso/gso_tcp4.c                          |  12 +-
 lib/librte_gso/gso_tunnel_tcp4.c                   |  14 +-
 lib/librte_gso/gso_udp4.c                          |   8 +-
 lib/librte_gso/rte_gso.h                           |   8 +-
 lib/librte_hash/rte_thash.h                        |   2 +-
 lib/librte_ip_frag/rte_ip_frag.h                   |  12 +-
 lib/librte_ip_frag/rte_ipv4_fragmentation.c        |  42 +--
 lib/librte_ip_frag/rte_ipv4_reassembly.c           |  14 +-
 lib/librte_ip_frag/rte_ipv6_fragmentation.c        |  26 +-
 lib/librte_ip_frag/rte_ipv6_reassembly.c           |   6 +-
 lib/librte_kni/rte_kni.c                           |   4 +-
 lib/librte_kni/rte_kni.h                           |   2 +-
 lib/librte_net/rte_arp.c                           |  32 +-
 lib/librte_net/rte_arp.h                           |  36 +--
 lib/librte_net/rte_esp.h                           |   2 +-
 lib/librte_net/rte_ether.h                         | 178 ++++++------
 lib/librte_net/rte_gre.h                           |   2 +-
 lib/librte_net/rte_icmp.h                          |   6 +-
 lib/librte_net/rte_ip.h                            |  70 ++---
 lib/librte_net/rte_net.c                           |  90 +++---
 lib/librte_net/rte_net.h                           |  22 +-
 lib/librte_net/rte_sctp.h                          |   2 +-
 lib/librte_net/rte_tcp.h                           |   2 +-
 lib/librte_net/rte_udp.h                           |   2 +-
 lib/librte_pipeline/rte_table_action.c             | 210 +++++++-------
 lib/librte_pipeline/rte_table_action.h             |   4 +-
 lib/librte_port/rte_port_ras.c                     |   8 +-
 lib/librte_port/rte_port_source_sink.c             |   6 +-
 lib/librte_vhost/vhost.h                           |   2 +-
 lib/librte_vhost/virtio_net.c                      |  42 +--
 test/test-acl/main.c                               |   2 +-
 test/test-pipeline/pipeline_acl.c                  |  16 +-
 test/test-pipeline/pipeline_hash.c                 |  12 +-
 test/test/packet_burst_generator.c                 | 126 ++++----
 test/test/packet_burst_generator.h                 |  26 +-
 test/test/test_acl.c                               |   8 +-
 test/test/test_acl.h                               | 122 ++++----
 test/test/test_cmdline_etheraddr.c                 |  16 +-
 test/test/test_efd.c                               |  20 +-
 test/test/test_event_eth_rx_adapter.c              |   2 +-
 test/test/test_event_eth_tx_adapter.c              |   2 +-
 test/test/test_flow_classify.c                     |  68 ++---
 test/test/test_hash.c                              |  20 +-
 test/test/test_link_bonding.c                      | 284 +++++++++---------
 test/test/test_link_bonding_mode4.c                | 116 ++++----
 test/test/test_link_bonding_rssconf.c              |   6 +-
 test/test/test_lpm.c                               |  76 ++---
 test/test/test_lpm_perf.c                          |  10 +-
Quoted 9 lines
 test/test/test_member.c                            |  20 +-
 test/test/test_pmd_perf.c                          |  20 +-
 test/test/test_sched.c                             |  20 +-
 test/test/test_table_acl.c                         |   8 +-
 test/test/test_thash.c                             |  12 +-
 test/test/virtual_pmd.c                            |   6 +-
 test/test/virtual_pmd.h                            |   2 +-
 367 files changed, 3906 insertions(+), 3913 deletions(-)

The Linux network developers and Glibc have already agreed on how to handle overlap. Perhaps that policy could be used/extended rather than breaking every userspace application.

#22 lore raw
In reply to Olivier Matz
Quoted 26 lines · Olivier Matz

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Quoted 3 lines

Therefore, it is clear that doing this would break the compilation of many external applications.

Can you clarify a bit as to why we can't keep around compatibility versions of the headers, alongside the new versions? I'm not following the logic above. Can we not introduce completely new headers with the replacements while leaving the old ones intact?

/Bruce

#23 lore raw

Hi,

Quoted 27 lines · Bruce Richardson
Quoted 26 lines · Olivier Matz

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Quoted 8 lines
Quoted 3 lines

Therefore, it is clear that doing this would break the compilation of many external applications.

Can you clarify a bit as to why we can't keep around compatibility versions of the headers, alongside the new versions? I'm not following the logic above. Can we not introduce completely new headers with the replacements while leaving the old ones intact?

This is something I tried to do, it is not in the RFC because it was not satisfying, but you can find it there:

http://git.droids-corp.org/?p=dpdk.git;a=commitdiff;h=ba1e8e498306

With this patch, the usage of unprefixed structures, defines and functions in rte net is still possible by an external application, except if RTE_NET_NO_COMPAT is defined.

However, functions and structures that are not in librte_net (the examples from my previous mail, quoted above) use the rte_ prefixed structures in their prototypes. For instance, an application that use rte_eth_macaddr_get() will no compile anymore because it will pass a (struct ether_addr *) instead of a (struct rte_ether_addr *).

I don't see any good mean to fix this. Maybe we can do something with defines, but I don't think it is possible to provide both APIs for functions like rte_eth_macaddr_get(). I'm also not convinced it will be that helpful. At the end, if the patchset is applied, we want the applications to switch to the new API. To ease the transition, we can provide a script to patch an application, very similar to the one I use to generate the patchset.

Olivier

#24 lore raw
Quoted 54 lines · Olivier Matz

Hi,

Quoted 27 lines · Bruce Richardson
Quoted 26 lines · Olivier Matz

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Quoted 8 lines
Quoted 3 lines

Therefore, it is clear that doing this would break the compilation of many external applications.

Can you clarify a bit as to why we can't keep around compatibility versions of the headers, alongside the new versions? I'm not following the logic above. Can we not introduce completely new headers with the replacements while leaving the old ones intact?

This is something I tried to do, it is not in the RFC because it was not satisfying, but you can find it there:

http://git.droids-corp.org/?p=dpdk.git;a=commitdiff;h=ba1e8e498306

With this patch, the usage of unprefixed structures, defines and functions in rte net is still possible by an external application, except if RTE_NET_NO_COMPAT is defined.

However, functions and structures that are not in librte_net (the examples from my previous mail, quoted above) use the rte_ prefixed structures in their prototypes. For instance, an application that use rte_eth_macaddr_get() will no compile anymore because it will pass a (struct ether_addr *) instead of a (struct rte_ether_addr *).

Quoted 8 lines

I don't see any good mean to fix this. Maybe we can do something with defines, but I don't think it is possible to provide both APIs for functions like rte_eth_macaddr_get(). I'm also not convinced it will be that helpful. At the end, if the patchset is applied, we want the applications to switch to the new API. To ease the transition, we can provide a script to patch an application, very similar to the one I use to generate the patchset.

Out of interest, about how many non rte_net functions are we talking about here?

#25 lore raw
Quoted 64 lines · Bruce Richardson
Quoted 54 lines · Olivier Matz

Hi,

Quoted 27 lines · Bruce Richardson
Quoted 26 lines · Olivier Matz

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Quoted 8 lines
Quoted 3 lines

Therefore, it is clear that doing this would break the compilation of many external applications.

Can you clarify a bit as to why we can't keep around compatibility versions of the headers, alongside the new versions? I'm not following the logic above. Can we not introduce completely new headers with the replacements while leaving the old ones intact?

This is something I tried to do, it is not in the RFC because it was not satisfying, but you can find it there:

http://git.droids-corp.org/?p=dpdk.git;a=commitdiff;h=ba1e8e498306

With this patch, the usage of unprefixed structures, defines and functions in rte net is still possible by an external application, except if RTE_NET_NO_COMPAT is defined.

However, functions and structures that are not in librte_net (the examples from my previous mail, quoted above) use the rte_ prefixed structures in their prototypes. For instance, an application that use rte_eth_macaddr_get() will no compile anymore because it will pass a (struct ether_addr *) instead of a (struct rte_ether_addr *).

Quoted 8 lines

I don't see any good mean to fix this. Maybe we can do something with defines, but I don't think it is possible to provide both APIs for functions like rte_eth_macaddr_get(). I'm also not convinced it will be that helpful. At the end, if the patchset is applied, we want the applications to switch to the new API. To ease the transition, we can provide a script to patch an application, very similar to the one I use to generate the patchset.

Quoted 1 line

Out of interest, about how many non rte_net functions are we talking about here?

I didn't count, but many. And not only functions, also structures.

To give an idea, here is the output of:
git diff origin/master..HEAD lib/ | filterdiff -i '*.h' -x 'a/lib/librte_net/*'

  diff --git a/lib/librte_ethdev/rte_eth_ctrl.h b/lib/librte_ethdev/rte_eth_ctrl.h
  index 5ea8ae24c..821d971cd 100644
  --- a/lib/librte_ethdev/rte_eth_ctrl.h
  +++ b/lib/librte_ethdev/rte_eth_ctrl.h
  @@ -110,7 +110,7 @@ struct rte_eth_mac_filter {
   	uint8_t is_vf; /**< 1 for VF, 0 for port dev */
   	uint16_t dst_id; /**< VF ID, available when is_vf is 1*/
   	enum rte_mac_filter_type filter_type; /**< MAC filter type */
  -	struct ether_addr mac_addr;
  +	struct rte_ether_addr mac_addr;
   };
   /**
  @@ -126,7 +126,7 @@ struct rte_eth_mac_filter {
    * RTE_ETH_FILTER_DELETE and RTE_ETH_FILTER_GET operations.
    */
   struct rte_eth_ethertype_filter {
  -	struct ether_addr mac_addr;   /**< Mac address to match. */
  +	struct rte_ether_addr mac_addr;   /**< Mac address to match. */
   	uint16_t ether_type;          /**< Ether type to match */
   	uint16_t flags;               /**< Flags from RTE_ETHTYPE_FLAGS_* */
   	uint16_t queue;               /**< Queue assigned to when match*/
  @@ -265,8 +265,8 @@ enum rte_tunnel_iptype {
    * Tunneling Packet filter configuration.
    */
   struct rte_eth_tunnel_filter_conf {
  -	struct ether_addr outer_mac;    /**< Outer MAC address to match. */
  -	struct ether_addr inner_mac;    /**< Inner MAC address to match. */
  +	struct rte_ether_addr outer_mac;    /**< Outer MAC address to match. */
  +	struct rte_ether_addr inner_mac;    /**< Inner MAC address to match. */
   	uint16_t inner_vlan;            /**< Inner VLAN to match. */
   	enum rte_tunnel_iptype ip_type; /**< IP address type. */
   	/** Outer destination IP address to match if ETH_TUNNEL_FILTER_OIP
  @@ -473,7 +473,7 @@ struct rte_eth_sctpv6_flow {
    * A structure used to define the input for MAC VLAN flow
    */
   struct rte_eth_mac_vlan_flow {
  -	struct ether_addr mac_addr;  /**< Mac address to match. */
  +	struct rte_ether_addr mac_addr;  /**< Mac address to match. */
   };
   
   /**
  @@ -493,7 +493,7 @@ struct rte_eth_tunnel_flow {
   	enum rte_eth_fdir_tunnel_type tunnel_type; /**< Tunnel type to match. */
   	/** Tunnel ID to match. TNI, VNI... in big endian. */
   	uint32_t tunnel_id;
  -	struct ether_addr mac_addr;                /**< Mac address to match. */
  +	struct rte_ether_addr mac_addr;                /**< Mac address to match. */
   };

/**
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index fb40c89e0..5deb4e38e 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -2159,7 +2159,7 @@ int rte_eth_dev_set_rx_queue_stats_mapping(uint16_t port_id,
* A pointer to a structure of type *ether_addr* to be filled with
* the Ethernet address of the Ethernet device.
*/
-void rte_eth_macaddr_get(uint16_t port_id, struct ether_addr *mac_addr); +void rte_eth_macaddr_get(uint16_t port_id, struct rte_ether_addr *mac_addr);

/**
* Retrieve the contextual information of an Ethernet device.
@@ -2843,7 +2843,7 @@ int rte_eth_dev_priority_flow_ctrl_set(uint16_t port_id,
* - (-ENOSPC) if no more MAC addresses can be added.
* - (-EINVAL) if MAC address is invalid.
*/
-int rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *mac_addr, +int rte_eth_dev_mac_addr_add(uint16_t port_id, struct rte_ether_addr *mac_addr,
uint32_t pool);

/**
@@ -2859,7 +2859,7 @@ int rte_eth_dev_mac_addr_add(uint16_t port_id, struct ether_addr *mac_addr,
* - (-ENODEV) if *port* invalid.
* - (-EADDRINUSE) if attempting to remove the default MAC address
*/
-int rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *mac_addr); +int rte_eth_dev_mac_addr_remove(uint16_t port_id, struct rte_ether_addr *mac_addr);

/**
* Set the default MAC address.
@@ -2875,7 +2875,7 @@ int rte_eth_dev_mac_addr_remove(uint16_t port_id, struct ether_addr *mac_addr);
* - (-EINVAL) if MAC address is invalid.
*/
int rte_eth_dev_default_mac_addr_set(uint16_t port_id,
- struct ether_addr *mac_addr);
+ struct rte_ether_addr *mac_addr);

/**
* Update Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
@@ -2936,7 +2936,7 @@ int rte_eth_dev_rss_reta_query(uint16_t port_id,
* - (-EIO) if device is removed.
* - (-EINVAL) if bad parameter.
*/
-int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct ether_addr *addr, +int rte_eth_dev_uc_hash_table_set(uint16_t port_id, struct rte_ether_addr *addr,
uint8_t on);

    /**

@@ -3479,7 +3479,7 @@ rte_eth_dev_get_module_eeprom(uint16_t port_id,
* - (-ENOSPC) if *port_id* has not enough multicast filtering resources.
*/
int rte_eth_dev_set_mc_addr_list(uint16_t port_id,
- struct ether_addr *mc_addr_set,
+ struct rte_ether_addr *mc_addr_set,
uint32_t nb_mc_addr);

   /**
  diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
  index 0d28fd902..fa518620e 100644
  --- a/lib/librte_ethdev/rte_ethdev_core.h
  +++ b/lib/librte_ethdev/rte_ethdev_core.h
  @@ -250,17 +250,17 @@ typedef void (*eth_mac_addr_remove_t)(struct rte_eth_dev *dev, uint32_t index);
   /**< @internal Remove MAC address from receive address register */

typedef int (*eth_mac_addr_add_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr,
+ struct rte_ether_addr *mac_addr,
uint32_t index,
uint32_t vmdq);
/**< @internal Set a MAC address into Receive Address Address Register */

typedef int (*eth_mac_addr_set_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr);
+ struct rte_ether_addr *mac_addr);
/**< @internal Set a MAC address into Receive Address Address Register */

typedef int (*eth_uc_hash_table_set_t)(struct rte_eth_dev *dev,
- struct ether_addr *mac_addr,
+ struct rte_ether_addr *mac_addr,
uint8_t on);
/**< @internal Set a Unicast Hash bitmap */

@@ -292,7 +292,7 @@ typedef int (*eth_udp_tunnel_port_del_t)(struct rte_eth_dev *dev,
/**< @internal Delete tunneling UDP port */

typedef int (*eth_set_mc_addr_list_t)(struct rte_eth_dev *dev,
- struct ether_addr *mc_addr_set,
+ struct rte_ether_addr *mc_addr_set,
uint32_t nb_mc_addr);
/**< @internal set the list of multicast addresses on an Ethernet device */

@@ -597,10 +597,10 @@ struct rte_eth_dev_data {
/**< Common rx buffer size handled by all queues */

   	uint64_t rx_mbuf_alloc_failed; /**< RX ring mbuf allocation failures. */
  -	struct ether_addr* mac_addrs;/**< Device Ethernet Link address. */
  +	struct rte_ether_addr* mac_addrs;/**< Device Ethernet Link address. */
   	uint64_t mac_pool_sel[ETH_NUM_RECEIVE_MAC_ADDR];
   	/** bitmap array of associating Ethernet MAC addresses to pools */
  -	struct ether_addr* hash_mac_addrs;
  +	struct rte_ether_addr* hash_mac_addrs;
   	/** Device Ethernet MAC addresses of hash filtering. */
   	uint16_t port_id;           /**< Device [external] port identifier. */
   	__extension__
  diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h
  index 26e2fcfa0..c27d590a1 100644
  --- a/lib/librte_ethdev/rte_flow.h
  +++ b/lib/librte_ethdev/rte_flow.h
  @@ -577,8 +577,8 @@ static const struct rte_flow_item_raw rte_flow_item_raw_mask = {
    * same order as on the wire.
    */
   struct rte_flow_item_eth {
  -	struct ether_addr dst; /**< Destination MAC. */
  -	struct ether_addr src; /**< Source MAC. */
  +	struct rte_ether_addr dst; /**< Destination MAC. */
  +	struct rte_ether_addr src; /**< Source MAC. */
   	rte_be16_t type; /**< EtherType or TPID. */
   };

@@ -597,7 +597,7 @@ static const struct rte_flow_item_eth rte_flow_item_eth_mask = {
* Matches an 802.1Q/ad VLAN tag.
*
* The corresponding standard outer EtherType (TPID) values are
- * ETHER_TYPE_VLAN or ETHER_TYPE_QINQ. It can be overridden by the preceding
+ * RTE_ETHER_TYPE_VLAN or RTE_ETHER_TYPE_QINQ. It can be overridden by the preceding
* pattern item.
*/
struct rte_flow_item_vlan {
@@ -621,7 +621,7 @@ static const struct rte_flow_item_vlan rte_flow_item_vlan_mask = {
* Note: IPv4 options are handled by dedicated pattern items.
*/
struct rte_flow_item_ipv4 {
- struct ipv4_hdr hdr; /**< IPv4 header definition. */
+ struct rte_ipv4_hdr hdr; /**< IPv4 header definition. */
};

   /** Default mask for RTE_FLOW_ITEM_TYPE_IPV4. */
  @@ -643,7 +643,7 @@ static const struct rte_flow_item_ipv4 rte_flow_item_ipv4_mask = {
    * RTE_FLOW_ITEM_TYPE_IPV6_EXT.
    */
   struct rte_flow_item_ipv6 {
  -	struct ipv6_hdr hdr; /**< IPv6 header definition. */
  +	struct rte_ipv6_hdr hdr; /**< IPv6 header definition. */
   };
   
   /** Default mask for RTE_FLOW_ITEM_TYPE_IPV6. */
  @@ -666,7 +666,7 @@ static const struct rte_flow_item_ipv6 rte_flow_item_ipv6_mask = {
    * Matches an ICMP header.
    */
   struct rte_flow_item_icmp {
  -	struct icmp_hdr hdr; /**< ICMP header definition. */
  +	struct rte_icmp_hdr hdr; /**< ICMP header definition. */
   };
   
   /** Default mask for RTE_FLOW_ITEM_TYPE_ICMP. */
  @@ -685,7 +685,7 @@ static const struct rte_flow_item_icmp rte_flow_item_icmp_mask = {
    * Matches a UDP header.
    */
   struct rte_flow_item_udp {
  -	struct udp_hdr hdr; /**< UDP header definition. */
  +	struct rte_udp_hdr hdr; /**< UDP header definition. */
   };
   
   /** Default mask for RTE_FLOW_ITEM_TYPE_UDP. */
  @@ -704,7 +704,7 @@ static const struct rte_flow_item_udp rte_flow_item_udp_mask = {
    * Matches a TCP header.
    */
   struct rte_flow_item_tcp {
  -	struct tcp_hdr hdr; /**< TCP header definition. */
  +	struct rte_tcp_hdr hdr; /**< TCP header definition. */
   };
   
   /** Default mask for RTE_FLOW_ITEM_TYPE_TCP. */
  @@ -723,7 +723,7 @@ static const struct rte_flow_item_tcp rte_flow_item_tcp_mask = {
    * Matches a SCTP header.
    */
   struct rte_flow_item_sctp {
  -	struct sctp_hdr hdr; /**< SCTP header definition. */
  +	struct rte_sctp_hdr hdr; /**< SCTP header definition. */
   };

/** Default mask for RTE_FLOW_ITEM_TYPE_SCTP. */
@@ -761,7 +761,7 @@ static const struct rte_flow_item_vxlan rte_flow_item_vxlan_mask = {
* Matches a E-tag header.
*
* The corresponding standard outer EtherType (TPID) value is
- * ETHER_TYPE_ETAG. It can be overridden by the preceding pattern item.
+ * RTE_ETHER_TYPE_ETAG. It can be overridden by the preceding pattern item.

    */

struct rte_flow_item_e_tag {
/**
@@ -908,7 +908,7 @@ static const struct rte_flow_item_gtp rte_flow_item_gtp_mask = {
* Matches an ESP header.
*/
struct rte_flow_item_esp {
- struct esp_hdr hdr; /**< ESP header definition. */
+ struct rte_esp_hdr hdr; /**< ESP header definition. */
};

   /** Default mask for RTE_FLOW_ITEM_TYPE_ESP. */
  @@ -974,9 +974,9 @@ struct rte_flow_item_arp_eth_ipv4 {
   	uint8_t hln; /**< Hardware address length, normally 6. */
   	uint8_t pln; /**< Protocol address length, normally 4. */
   	rte_be16_t op; /**< Opcode (1 for request, 2 for reply). */
  -	struct ether_addr sha; /**< Sender hardware address. */
  +	struct rte_ether_addr sha; /**< Sender hardware address. */
   	rte_be32_t spa; /**< Sender IPv4 address. */
  -	struct ether_addr tha; /**< Target hardware address. */
  +	struct rte_ether_addr tha; /**< Target hardware address. */
   	rte_be32_t tpa; /**< Target IPv4 address. */
   };
  @@ -1120,7 +1120,7 @@ rte_flow_item_icmp6_nd_opt_mask = {
   struct rte_flow_item_icmp6_nd_opt_sla_eth {
   	uint8_t type; /**< ND option type, normally 1. */
   	uint8_t length; /**< ND option length, normally 1. */
  -	struct ether_addr sla; /**< Source Ethernet LLA. */
  +	struct rte_ether_addr sla; /**< Source Ethernet LLA. */
   };
   /** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_SLA_ETH. */
  @@ -1145,7 +1145,7 @@ rte_flow_item_icmp6_nd_opt_sla_eth_mask = {
   struct rte_flow_item_icmp6_nd_opt_tla_eth {
   	uint8_t type; /**< ND option type, normally 2. */
   	uint8_t length; /**< ND option length, normally 1. */
  -	struct ether_addr tla; /**< Target Ethernet LLA. */
  +	struct rte_ether_addr tla; /**< Target Ethernet LLA. */
   };
   
   /** Default mask for RTE_FLOW_ITEM_TYPE_ICMP6_ND_OPT_TLA_ETH. */
  @@ -2036,7 +2036,7 @@ struct rte_flow_action_set_ttl {
    * Set MAC address from the matched flow
    */
   struct rte_flow_action_set_mac {
  -	uint8_t mac_addr[ETHER_ADDR_LEN];
  +	uint8_t mac_addr[RTE_ETHER_ADDR_LEN];
   };
   
   /*
  diff --git a/lib/librte_gro/gro_tcp4.h b/lib/librte_gro/gro_tcp4.h
  index 6bb30cdb9..63f06bec4 100644
  --- a/lib/librte_gro/gro_tcp4.h
  +++ b/lib/librte_gro/gro_tcp4.h
  @@ -19,8 +19,8 @@

/* Header fields representing a TCP/IPv4 flow */ struct tcp4_flow_key {
- struct ether_addr eth_saddr;
- struct ether_addr eth_daddr;
+ struct rte_ether_addr eth_saddr;
+ struct rte_ether_addr eth_daddr;
uint32_t ip_src_addr;
uint32_t ip_dst_addr;

@@ -182,8 +182,8 @@ uint32_t gro_tcp4_tbl_pkt_count(void *tbl);
static inline int
is_same_tcp4_flow(struct tcp4_flow_key k1, struct tcp4_flow_key k2) {
- return (is_same_ether_addr(&k1.eth_saddr, &k2.eth_saddr) &&
- is_same_ether_addr(&k1.eth_daddr, &k2.eth_daddr) &&
+ return (rte_is_same_ether_addr(&k1.eth_saddr, &k2.eth_saddr) &&
+ rte_is_same_ether_addr(&k1.eth_daddr, &k2.eth_daddr) &&
(k1.ip_src_addr == k2.ip_src_addr) && (k1.ip_dst_addr == k2.ip_dst_addr) && (k1.recv_ack == k2.recv_ack) &&
@@ -255,7 +255,7 @@ merge_two_tcp4_packets(struct gro_tcp4_item *item,

    */

static inline int
check_seq_option(struct gro_tcp4_item *item,
- struct tcp_hdr *tcph,
+ struct rte_tcp_hdr *tcph,
uint32_t sent_seq,
uint16_t ip_id,
uint16_t tcp_hl,
@@ -264,17 +264,17 @@ check_seq_option(struct gro_tcp4_item *item,
uint8_t is_atomic)
{
struct rte_mbuf *pkt_orig = item->firstseg;
- struct ipv4_hdr *iph_orig;
- struct tcp_hdr *tcph_orig;
+ struct rte_ipv4_hdr *iph_orig;
+ struct rte_tcp_hdr *tcph_orig;
uint16_t len, tcp_hl_orig;

  -	iph_orig = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt_orig, char *) +
  +	iph_orig = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt_orig, char *) +
   			l2_offset + pkt_orig->l2_len);
  -	tcph_orig = (struct tcp_hdr *)((char *)iph_orig + pkt_orig->l3_len);
  +	tcph_orig = (struct rte_tcp_hdr *)((char *)iph_orig + pkt_orig->l3_len);
   	tcp_hl_orig = pkt_orig->l4_len;
   	/* Check if TCP option fields equal */
  -	len = RTE_MAX(tcp_hl, tcp_hl_orig) - sizeof(struct tcp_hdr);
  +	len = RTE_MAX(tcp_hl, tcp_hl_orig) - sizeof(struct rte_tcp_hdr);
   	if ((tcp_hl != tcp_hl_orig) || ((len > 0) &&
   				(memcmp(tcph + 1, tcph_orig + 1,
   					len) != 0)))
  diff --git a/lib/librte_gro/gro_vxlan_tcp4.h b/lib/librte_gro/gro_vxlan_tcp4.h
  index 0cafb9211..7832942a6 100644
  --- a/lib/librte_gro/gro_vxlan_tcp4.h
  +++ b/lib/librte_gro/gro_vxlan_tcp4.h
  @@ -12,10 +12,10 @@
   /* Header fields representing a VxLAN flow */
   struct vxlan_tcp4_flow_key {
   	struct tcp4_flow_key inner_key;
  -	struct vxlan_hdr vxlan_hdr;
  +	struct rte_vxlan_hdr vxlan_hdr;

- struct ether_addr outer_eth_saddr;
- struct ether_addr outer_eth_daddr;
+ struct rte_ether_addr outer_eth_saddr;
+ struct rte_ether_addr outer_eth_daddr;

   	uint32_t outer_ip_src_addr;
   	uint32_t outer_ip_dst_addr;
  diff --git a/lib/librte_gso/gso_common.h b/lib/librte_gso/gso_common.h
  index 6cd764ff5..48ad1686f 100644
  --- a/lib/librte_gso/gso_common.h
  +++ b/lib/librte_gso/gso_common.h
  @@ -12,8 +12,8 @@
   #include <rte_tcp.h>
   #include <rte_udp.h>
  -#define IS_FRAGMENTED(frag_off) (((frag_off) & IPV4_HDR_OFFSET_MASK) != 0 \
  -		|| ((frag_off) & IPV4_HDR_MF_FLAG) == IPV4_HDR_MF_FLAG)
  +#define IS_FRAGMENTED(frag_off) (((frag_off) & RTE_IPV4_HDR_OFFSET_MASK) != 0 \
  +		|| ((frag_off) & RTE_IPV4_HDR_MF_FLAG) == RTE_IPV4_HDR_MF_FLAG)
   #define TCP_HDR_PSH_MASK ((uint8_t)0x08)
   #define TCP_HDR_FIN_MASK ((uint8_t)0x01)
  @@ -46,9 +46,9 @@
   static inline void
   update_udp_header(struct rte_mbuf *pkt, uint16_t udp_offset)
   {
  -	struct udp_hdr *udp_hdr;
  +	struct rte_udp_hdr *udp_hdr;
  -	udp_hdr = (struct udp_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
  +	udp_hdr = (struct rte_udp_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
   			udp_offset);
   	udp_hdr->dgram_len = rte_cpu_to_be_16(pkt->pkt_len - udp_offset);
   }
  @@ -71,9 +71,9 @@ static inline void
   update_tcp_header(struct rte_mbuf *pkt, uint16_t l4_offset, uint32_t sent_seq,
   		uint8_t non_tail)
   {
  -	struct tcp_hdr *tcp_hdr;
  +	struct rte_tcp_hdr *tcp_hdr;
   
  -	tcp_hdr = (struct tcp_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
  +	tcp_hdr = (struct rte_tcp_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
   			l4_offset);
   	tcp_hdr->sent_seq = rte_cpu_to_be_32(sent_seq);
   	if (likely(non_tail))
  @@ -98,9 +98,9 @@ update_tcp_header(struct rte_mbuf *pkt, uint16_t l4_offset, uint32_t sent_seq,
   static inline void
   update_ipv4_header(struct rte_mbuf *pkt, uint16_t l3_offset, uint16_t id)
   {
  -	struct ipv4_hdr *ipv4_hdr;
  +	struct rte_ipv4_hdr *ipv4_hdr;
   
  -	ipv4_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
  +	ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
   			l3_offset);
   	ipv4_hdr->total_length = rte_cpu_to_be_16(pkt->pkt_len - l3_offset);
   	ipv4_hdr->packet_id = rte_cpu_to_be_16(id);
  diff --git a/lib/librte_gso/rte_gso.h b/lib/librte_gso/rte_gso.h
  index a626a11e3..3aab297f4 100644
  --- a/lib/librte_gso/rte_gso.h
  +++ b/lib/librte_gso/rte_gso.h
  @@ -18,12 +18,12 @@ extern "C" {
   #include <rte_mbuf.h>
   /* Minimum GSO segment size for TCP based packets. */
  -#define RTE_GSO_SEG_SIZE_MIN (sizeof(struct ether_hdr) + \
  -		sizeof(struct ipv4_hdr) + sizeof(struct tcp_hdr) + 1)
  +#define RTE_GSO_SEG_SIZE_MIN (sizeof(struct rte_ether_hdr) + \
  +		sizeof(struct rte_ipv4_hdr) + sizeof(struct rte_tcp_hdr) + 1)
   
   /* Minimum GSO segment size for UDP based packets. */
  -#define RTE_GSO_UDP_SEG_SIZE_MIN (sizeof(struct ether_hdr) + \
  -		sizeof(struct ipv4_hdr) + sizeof(struct udp_hdr) + 1)
  +#define RTE_GSO_UDP_SEG_SIZE_MIN (sizeof(struct rte_ether_hdr) + \
  +		sizeof(struct rte_ipv4_hdr) + sizeof(struct rte_udp_hdr) + 1)
   
   /* GSO flags for rte_gso_ctx. */
   #define RTE_GSO_FLAG_IPID_FIXED (1ULL << 0)
  diff --git a/lib/librte_hash/rte_thash.h b/lib/librte_hash/rte_thash.h
  index a6ddb7bf7..adbaf8f70 100644
  --- a/lib/librte_hash/rte_thash.h
  +++ b/lib/librte_hash/rte_thash.h
  @@ -168,7 +168,7 @@ rte_convert_rss_key(const uint32_t *orig, uint32_t *targ, int len)
    *   Pointer to rte_ipv6_tuple structure
    */
   static inline void
  -rte_thash_load_v6_addrs(const struct ipv6_hdr *orig, union rte_thash_tuple *targ)
  +rte_thash_load_v6_addrs(const struct rte_ipv6_hdr *orig, union rte_thash_tuple *targ)
   {
   #ifdef RTE_ARCH_X86
   	__m128i ipv6 = _mm_loadu_si128((const __m128i *)orig->src_addr);
  diff --git a/lib/librte_ip_frag/rte_ip_frag.h b/lib/librte_ip_frag/rte_ip_frag.h
  index 7f425f610..28ba33dac 100644
  --- a/lib/librte_ip_frag/rte_ip_frag.h
  +++ b/lib/librte_ip_frag/rte_ip_frag.h
  @@ -210,7 +210,7 @@ rte_ipv6_fragment_packet(struct rte_mbuf *pkt_in,
    */
   struct rte_mbuf *rte_ipv6_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
   		struct rte_ip_frag_death_row *dr,
  -		struct rte_mbuf *mb, uint64_t tms, struct ipv6_hdr *ip_hdr,
  +		struct rte_mbuf *mb, uint64_t tms, struct rte_ipv6_hdr *ip_hdr,
   		struct ipv6_extension_fragment *frag_hdr);

/**
@@ -225,7 +225,7 @@ struct rte_mbuf *rte_ipv6_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
* present.
*/
static inline struct ipv6_extension_fragment *
-rte_ipv6_frag_get_ipv6_fragment_header(struct ipv6_hdr *hdr) +rte_ipv6_frag_get_ipv6_fragment_header(struct rte_ipv6_hdr *hdr)
{
if (hdr->proto == IPPROTO_FRAGMENT) {
return (struct ipv6_extension_fragment *) ++hdr;
@@ -284,7 +284,7 @@ int32_t rte_ipv4_fragment_packet(struct rte_mbuf *pkt_in,

    */

struct rte_mbuf * rte_ipv4_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
struct rte_ip_frag_death_row *dr,
- struct rte_mbuf *mb, uint64_t tms, struct ipv4_hdr *ip_hdr);
+ struct rte_mbuf *mb, uint64_t tms, struct rte_ipv4_hdr *ip_hdr);

/**
* Check if the IPv4 packet is fragmented
@@ -295,12 +295,12 @@ struct rte_mbuf * rte_ipv4_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
* 1 if fragmented, 0 if not fragmented
*/
static inline int
-rte_ipv4_frag_pkt_is_fragmented(const struct ipv4_hdr * hdr) { +rte_ipv4_frag_pkt_is_fragmented(const struct rte_ipv4_hdr * hdr) {
uint16_t flag_offset, ip_flag, ip_ofs;

   	flag_offset = rte_be_to_cpu_16(hdr->fragment_offset);
  -	ip_ofs = (uint16_t)(flag_offset & IPV4_HDR_OFFSET_MASK);
  -	ip_flag = (uint16_t)(flag_offset & IPV4_HDR_MF_FLAG);
  +	ip_ofs = (uint16_t)(flag_offset & RTE_IPV4_HDR_OFFSET_MASK);
  +	ip_flag = (uint16_t)(flag_offset & RTE_IPV4_HDR_MF_FLAG);
   
   	return ip_flag != 0 || ip_ofs  != 0;
   }
  diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h
  index 601abdfc6..ce86b19a2 100644
  --- a/lib/librte_kni/rte_kni.h
  +++ b/lib/librte_kni/rte_kni.h
  @@ -68,7 +68,7 @@ struct rte_kni_conf {

__extension__
uint8_t force_bind : 1; /* Flag to bind kernel thread */
- char mac_addr[ETHER_ADDR_LEN]; /* MAC address assigned to KNI */
+ char mac_addr[RTE_ETHER_ADDR_LEN]; /* MAC address assigned to KNI */
uint16_t mtu;
};

  diff --git a/lib/librte_pipeline/rte_table_action.h b/lib/librte_pipeline/rte_table_action.h
  index c96061291..400bd5e2c 100644
  --- a/lib/librte_pipeline/rte_table_action.h
  +++ b/lib/librte_pipeline/rte_table_action.h
  @@ -384,8 +384,8 @@ enum rte_table_action_encap_type {
   /** Pre-computed Ethernet header fields for encapsulation action. */
   struct rte_table_action_ether_hdr {
  -	struct ether_addr da; /**< Destination address. */
  -	struct ether_addr sa; /**< Source address. */
  +	struct rte_ether_addr da; /**< Destination address. */
  +	struct rte_ether_addr sa; /**< Source address. */
   };
   
   /** Pre-computed VLAN header fields for encapsulation action. */
  diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h
  index b4abad30c..064ebb951 100644
  --- a/lib/librte_vhost/vhost.h
  +++ b/lib/librte_vhost/vhost.h
  @@ -356,7 +356,7 @@ struct virtio_net {
   	uint64_t		log_size;
   	uint64_t		log_base;
   	uint64_t		log_addr;
  -	struct ether_addr	mac;
  +	struct rte_ether_addr	mac;
   	uint16_t		mtu;

struct vhost_device_ops const *notify_ops;

#26 lore raw
In reply to Olivier Matz
Quoted 421 lines · On Wed, 24 Oct 2018 10:18:19 +0200 Olivier Matz <[email protected]> wrote:

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Therefore, it is clear that doing this would break the compilation of many external applications.

Another drawback we need to take in account: it will make the backport of patches more difficult, although this is something that could be tempered by a script.

While it is obviously better to have a good namespace convention, we need to identify the issues we have today before deciding it's worth doing the change.

Comments?

Things that are missing in RFC:
- test with FreeBSD
- manually fix some indentation issues

Olivier Matz (14):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure

 app/pdump/main.c                                   |   2 +-
 app/test-eventdev/test_perf_common.c               |   2 +-
 app/test-eventdev/test_pipeline_common.c           |   2 +-
 app/test-pmd/cmdline.c                             |  66 ++---
 app/test-pmd/cmdline_flow.c                        |  10 +-
 app/test-pmd/config.c                              |  34 +--
 app/test-pmd/csumonly.c                            | 156 +++++-----
 app/test-pmd/flowgen.c                             |  30 +-
 app/test-pmd/icmpecho.c                            | 120 ++++----
 app/test-pmd/ieee1588fwd.c                         |  18 +-
 app/test-pmd/macfwd.c                              |  12 +-
 app/test-pmd/macswap.c                             |  16 +-
 app/test-pmd/parameters.c                          |   6 +-
 app/test-pmd/testpmd.c                             |  22 +-
 app/test-pmd/testpmd.h                             |  18 +-
 app/test-pmd/txonly.c                              |  36 +--
 app/test-pmd/util.c                                |  34 +--
 doc/guides/prog_guide/bbdev.rst                    |   6 +-
 .../prog_guide/packet_classif_access_ctrl.rst      |  18 +-
 doc/guides/prog_guide/rte_flow.rst                 |   4 +-
 doc/guides/sample_app_ug/flow_classify.rst         |  28 +-
 doc/guides/sample_app_ug/flow_filtering.rst        |   6 +-
 doc/guides/sample_app_ug/ip_frag.rst               |  16 +-
 doc/guides/sample_app_ug/ip_reassembly.rst         |  16 +-
 doc/guides/sample_app_ug/ipv4_multicast.rst        |  16 +-
 doc/guides/sample_app_ug/l2_forward_job_stats.rst  |   6 +-
 .../sample_app_ug/l2_forward_real_virtual.rst      |   6 +-
 doc/guides/sample_app_ug/l3_forward.rst            |  12 +-
 doc/guides/sample_app_ug/link_status_intr.rst      |   6 +-
 doc/guides/sample_app_ug/ptpclient.rst             |   6 +-
 doc/guides/sample_app_ug/rxtx_callbacks.rst        |   2 +-
 doc/guides/sample_app_ug/server_node_efd.rst       |  12 +-
 doc/guides/sample_app_ug/skeleton.rst              |   4 +-
 doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst   |   4 +-
 drivers/bus/dpaa/base/fman/fman.c                  |   2 +-
 drivers/bus/dpaa/base/fman/fman_hw.c               |   2 +-
 drivers/bus/dpaa/include/fman.h                    |   2 +-
 drivers/bus/dpaa/include/netcfg.h                  |   4 +-
 drivers/net/af_packet/rte_eth_af_packet.c          |   2 +-
 drivers/net/ark/ark_ethdev.c                       |  16 +-
 drivers/net/ark/ark_ext.h                          |   4 +-
 drivers/net/ark/ark_global.h                       |   4 +-
 drivers/net/atlantic/atl_ethdev.c                  |  20 +-
 drivers/net/atlantic/hw_atl/hw_atl_utils.c         |   8 +-
 drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c    |   4 +-
 drivers/net/avf/avf.h                              |   4 +-
 drivers/net/avf/avf_ethdev.c                       |  50 ++--
 drivers/net/avf/avf_rxtx.c                         |  14 +-
 drivers/net/avf/avf_vchnl.c                        |   8 +-
 drivers/net/avf/base/avf_adminq_cmd.h              |   4 +-
 drivers/net/avf/base/avf_common.c                  |  12 +-
 drivers/net/avf/base/avf_prototype.h               |   4 +-
 drivers/net/avp/avp_ethdev.c                       |  20 +-
 drivers/net/avp/rte_avp_common.h                   |   2 +-
 drivers/net/axgbe/axgbe_dev.c                      |   4 +-
 drivers/net/axgbe/axgbe_ethdev.c                   |  10 +-
 drivers/net/axgbe/axgbe_ethdev.h                   |   4 +-
 drivers/net/axgbe/axgbe_rxtx.c                     |   2 +-
 drivers/net/bnx2x/bnx2x.c                          |  16 +-
 drivers/net/bnx2x/bnx2x_ethdev.c                   |   4 +-
 drivers/net/bnx2x/bnx2x_ethdev.h                   |   2 +-
 drivers/net/bnx2x/bnx2x_vfpf.c                     |   8 +-
 drivers/net/bnx2x/bnx2x_vfpf.h                     |   2 +-
 drivers/net/bnx2x/ecore_sp.h                       |   2 +-
 drivers/net/bnxt/bnxt.h                            |   4 +-
 drivers/net/bnxt/bnxt_ethdev.c                     |  70 ++---
 drivers/net/bnxt/bnxt_filter.c                     |   4 +-
 drivers/net/bnxt/bnxt_filter.h                     |   8 +-
 drivers/net/bnxt/bnxt_flow.c                       |  26 +-
 drivers/net/bnxt/bnxt_hwrm.c                       |  40 +--
 drivers/net/bnxt/bnxt_hwrm.h                       |   2 +-
 drivers/net/bnxt/bnxt_ring.c                       |   8 +-
 drivers/net/bnxt/bnxt_rxq.c                        |   2 +-
 drivers/net/bnxt/bnxt_rxr.c                        |   2 +-
 drivers/net/bnxt/bnxt_vnic.c                       |   2 +-
 drivers/net/bnxt/rte_pmd_bnxt.c                    |  14 +-
 drivers/net/bnxt/rte_pmd_bnxt.h                    |   4 +-
 drivers/net/bonding/rte_eth_bond.h                 |   2 +-
 drivers/net/bonding/rte_eth_bond_8023ad.c          |  26 +-
 drivers/net/bonding/rte_eth_bond_8023ad.h          |  10 +-
 drivers/net/bonding/rte_eth_bond_alb.c             |  78 ++---
 drivers/net/bonding/rte_eth_bond_alb.h             |  10 +-
 drivers/net/bonding/rte_eth_bond_api.c             |   2 +-
 drivers/net/bonding/rte_eth_bond_args.c            |   2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c             | 194 ++++++-------
 drivers/net/bonding/rte_eth_bond_private.h         |   6 +-
 drivers/net/cxgbe/base/adapter.h                   |   6 +-
 drivers/net/cxgbe/base/t4_hw.c                     |   8 +-
 drivers/net/cxgbe/cxgbe.h                          |   4 +-
 drivers/net/cxgbe/cxgbe_ethdev.c                   |  14 +-
 drivers/net/cxgbe/cxgbe_filter.h                   |   2 +-
 drivers/net/cxgbe/cxgbe_flow.c                     |  10 +-
 drivers/net/cxgbe/cxgbe_main.c                     |   4 +-
 drivers/net/cxgbe/cxgbe_pfvf.h                     |   2 +-
 drivers/net/cxgbe/cxgbevf_main.c                   |   2 +-
 drivers/net/cxgbe/l2t.c                            |   8 +-
 drivers/net/cxgbe/l2t.h                            |   2 +-
 drivers/net/cxgbe/mps_tcam.c                       |  14 +-
 drivers/net/cxgbe/mps_tcam.h                       |   4 +-
 drivers/net/cxgbe/sge.c                            |   8 +-
 drivers/net/dpaa/dpaa_ethdev.c                     |  20 +-
 drivers/net/dpaa/dpaa_rxtx.c                       |  22 +-
 drivers/net/dpaa2/dpaa2_ethdev.c                   |  36 +--
 drivers/net/e1000/e1000_ethdev.h                   |   2 +-
 drivers/net/e1000/em_ethdev.c                      |  34 +--
 drivers/net/e1000/em_rxtx.c                        |  22 +-
 drivers/net/e1000/igb_ethdev.c                     |  70 ++---
 drivers/net/e1000/igb_flow.c                       |  12 +-
 drivers/net/e1000/igb_pf.c                         |  16 +-
 drivers/net/e1000/igb_rxtx.c                       |  18 +-
 drivers/net/ena/ena_ethdev.c                       |  16 +-
 drivers/net/ena/ena_ethdev.h                       |   2 +-
 drivers/net/enetc/base/enetc_hw.h                  |   4 +-
 drivers/net/enetc/enetc_ethdev.c                   |   6 +-
 drivers/net/enic/enic.h                            |   2 +-
 drivers/net/enic/enic_clsf.c                       |  40 +--
 drivers/net/enic/enic_ethdev.c                     |   4 +-
 drivers/net/enic/enic_flow.c                       | 100 +++----
 drivers/net/enic/enic_main.c                       |   2 +-
 drivers/net/enic/enic_res.c                        |   4 +-
 drivers/net/failsafe/failsafe.c                    |   6 +-
 drivers/net/failsafe/failsafe_args.c               |   4 +-
 drivers/net/failsafe/failsafe_ether.c              |   6 +-
 drivers/net/failsafe/failsafe_ops.c                |   6 +-
 drivers/net/failsafe/failsafe_private.h            |   4 +-
 drivers/net/fm10k/fm10k.h                          |   2 +-
 drivers/net/fm10k/fm10k_ethdev.c                   |  18 +-
 drivers/net/i40e/base/i40e_adminq_cmd.h            |   4 +-
 drivers/net/i40e/base/i40e_common.c                |  12 +-
 drivers/net/i40e/base/i40e_prototype.h             |   4 +-
 drivers/net/i40e/i40e_ethdev.c                     | 134 ++++-----
 drivers/net/i40e/i40e_ethdev.h                     |  22 +-
 drivers/net/i40e/i40e_ethdev_vf.c                  |  60 ++--
 drivers/net/i40e/i40e_fdir.c                       | 126 ++++----
 drivers/net/i40e/i40e_flow.c                       |  58 ++--
 drivers/net/i40e/i40e_pf.c                         |  18 +-
 drivers/net/i40e/i40e_rxtx.c                       |  28 +-
 drivers/net/i40e/i40e_vf_representor.c             |   2 +-
 drivers/net/i40e/rte_pmd_i40e.c                    |  30 +-
 drivers/net/i40e/rte_pmd_i40e.h                    |   8 +-
 drivers/net/ixgbe/ixgbe_ethdev.c                   |  94 +++---
 drivers/net/ixgbe/ixgbe_ethdev.h                   |   2 +-
 drivers/net/ixgbe/ixgbe_flow.c                     |  22 +-
 drivers/net/ixgbe/ixgbe_pf.c                       |  14 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                     |  14 +-
 drivers/net/ixgbe/ixgbe_vf_representor.c           |   4 +-
 drivers/net/ixgbe/rte_pmd_ixgbe.c                  |  10 +-
 drivers/net/ixgbe/rte_pmd_ixgbe.h                  |   2 +-
 drivers/net/kni/rte_eth_kni.c                      |   4 +-
 drivers/net/liquidio/lio_ethdev.c                  |  22 +-
 drivers/net/mlx4/mlx4.c                            |   4 +-
 drivers/net/mlx4/mlx4.h                            |   8 +-
 drivers/net/mlx4/mlx4_ethdev.c                     |   8 +-
 drivers/net/mlx4/mlx4_flow.c                       |  14 +-
 drivers/net/mlx4/mlx4_rxtx.c                       |   2 +-
 drivers/net/mlx5/mlx5.c                            |   4 +-
 drivers/net/mlx5/mlx5.h                            |  14 +-
 drivers/net/mlx5/mlx5_flow.c                       |  22 +-
 drivers/net/mlx5/mlx5_flow_tcf.c                   |  40 +--
 drivers/net/mlx5/mlx5_flow_verbs.c                 |  26 +-
 drivers/net/mlx5/mlx5_mac.c                        |  18 +-
 drivers/net/mlx5/mlx5_nl.c                         |  28 +-
 drivers/net/mlx5/mlx5_rxtx.c                       |   6 +-
 drivers/net/mlx5/mlx5_rxtx.h                       |   2 +-
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h              |   8 +-
 drivers/net/mlx5/mlx5_rxtx_vec_sse.h               |  10 +-
 drivers/net/mlx5/mlx5_trigger.c                    |   6 +-
 drivers/net/mvneta/mvneta_ethdev.c                 |  22 +-
 drivers/net/mvneta/mvneta_ethdev.h                 |   2 +-
 drivers/net/mvpp2/mrvl_ethdev.c                    |  22 +-
 drivers/net/mvpp2/mrvl_ethdev.h                    |   2 +-
 drivers/net/mvpp2/mrvl_flow.c                      |   4 +-
 drivers/net/netvsc/hn_ethdev.c                     |   4 +-
 drivers/net/netvsc/hn_nvs.c                        |   2 +-
 drivers/net/netvsc/hn_rndis.c                      |   2 +-
 drivers/net/netvsc/hn_rxtx.c                       |  12 +-
 drivers/net/netvsc/hn_var.h                        |   4 +-
 drivers/net/netvsc/hn_vf.c                         |  12 +-
 drivers/net/nfp/nfp_net.c                          |  20 +-
 drivers/net/nfp/nfp_net_pmd.h                      |   2 +-
 drivers/net/null/rte_eth_null.c                    |   6 +-
 drivers/net/octeontx/octeontx_ethdev.c             |   8 +-
 drivers/net/octeontx/octeontx_ethdev.h             |   2 +-
 drivers/net/pcap/rte_eth_pcap.c                    |  22 +-
 drivers/net/qede/base/bcm_osal.h                   |   2 +-
 drivers/net/qede/base/ecore_dev.c                  |   4 +-
 drivers/net/qede/qede_ethdev.c                     |  58 ++--
 drivers/net/qede/qede_ethdev.h                     |   6 +-
 drivers/net/qede/qede_filter.c                     |  66 ++---
 drivers/net/qede/qede_if.h                         |   4 +-
 drivers/net/qede/qede_main.c                       |   6 +-
 drivers/net/qede/qede_rxtx.c                       |  32 +-
 drivers/net/qede/qede_rxtx.h                       |   2 +-
 drivers/net/ring/rte_eth_ring.c                    |   4 +-
 drivers/net/sfc/sfc.h                              |   2 +-
 drivers/net/sfc/sfc_ef10_tx.c                      |   8 +-
 drivers/net/sfc/sfc_ethdev.c                       |  20 +-
 drivers/net/sfc/sfc_flow.c                         |  12 +-
 drivers/net/sfc/sfc_port.c                         |   8 +-
 drivers/net/sfc/sfc_tso.c                          |   8 +-
 drivers/net/softnic/parser.c                       |  18 +-
 drivers/net/softnic/parser.h                       |   2 +-
 drivers/net/softnic/rte_eth_softnic.c              |   2 +-
 drivers/net/softnic/rte_eth_softnic_pipeline.c     |  40 +--
 drivers/net/szedata2/rte_eth_szedata2.c            |   8 +-
 drivers/net/tap/rte_eth_tap.c                      |  58 ++--
 drivers/net/tap/rte_eth_tap.h                      |   2 +-
 drivers/net/tap/tap_bpf_program.c                  |  14 +-
 drivers/net/tap/tap_flow.c                         |  12 +-
 drivers/net/thunderx/base/nicvf_mbox.c             |   4 +-
 drivers/net/thunderx/base/nicvf_plat.h             |   2 +-
 drivers/net/thunderx/nicvf_ethdev.c                |  18 +-
 drivers/net/thunderx/nicvf_struct.h                |   2 +-
 drivers/net/vdev_netvsc/vdev_netvsc.c              |  16 +-
 drivers/net/vhost/rte_eth_vhost.c                  |  12 +-
 drivers/net/virtio/virtio_ethdev.c                 |  70 ++---
 drivers/net/virtio/virtio_pci.h                    |   4 +-
 drivers/net/virtio/virtio_rxtx.c                   |  28 +-
 drivers/net/virtio/virtio_user/vhost_kernel_tap.c  |   2 +-
 drivers/net/virtio/virtio_user/virtio_user_dev.c   |   6 +-
 drivers/net/virtio/virtio_user/virtio_user_dev.h   |   2 +-
 drivers/net/virtio/virtio_user_ethdev.c            |   8 +-
 drivers/net/virtio/virtqueue.h                     |   2 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c               |  12 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.h               |   2 +-
 drivers/net/vmxnet3/vmxnet3_rxtx.c                 |  44 +--
 examples/bbdev_app/main.c                          |  40 +--
 examples/bond/main.c                               |  78 ++---
 examples/distributor/main.c                        |   4 +-
 examples/ethtool/ethtool-app/ethapp.c              |   8 +-
 examples/ethtool/ethtool-app/main.c                |  10 +-
 examples/ethtool/lib/rte_ethtool.c                 |   8 +-
 examples/ethtool/lib/rte_ethtool.h                 |   6 +-
 examples/eventdev_pipeline/main.c                  |   4 +-
 examples/eventdev_pipeline/pipeline_common.h       |  10 +-
 examples/flow_classify/flow_classify.c             |  30 +-
 examples/flow_filtering/main.c                     |  10 +-
 examples/ip_fragmentation/main.c                   |  62 ++--
 examples/ip_pipeline/cli.c                         |   2 +-
 examples/ip_pipeline/kni.c                         |   2 +-
 examples/ip_pipeline/parser.c                      |  18 +-
 examples/ip_pipeline/parser.h                      |   2 +-
 examples/ip_pipeline/pipeline.c                    |  40 +--
 examples/ip_reassembly/main.c                      |  50 ++--
 examples/ipsec-secgw/esp.c                         |  42 +--
 examples/ipsec-secgw/ipsec-secgw.c                 |  38 +--
 examples/ipsec-secgw/sa.c                          |   6 +-
 examples/ipv4_multicast/main.c                     |  58 ++--
 examples/kni/main.c                                |  14 +-
 examples/l2fwd-cat/l2fwd-cat.c                     |   4 +-
 examples/l2fwd-crypto/main.c                       |  26 +-
 examples/l2fwd-jobstats/main.c                     |   8 +-
 examples/l2fwd-keepalive/main.c                    |   8 +-
 examples/l2fwd/main.c                              |   8 +-
 examples/l3fwd-acl/main.c                          | 102 +++----
 examples/l3fwd-power/main.c                        | 100 +++----
 examples/l3fwd-vf/main.c                           |  68 ++---
 examples/l3fwd/l3fwd.h                             |   8 +-
 examples/l3fwd/l3fwd_altivec.h                     |  14 +-
 examples/l3fwd/l3fwd_common.h                      |   4 +-
 examples/l3fwd/l3fwd_em.c                          |  44 +--
 examples/l3fwd/l3fwd_em.h                          |  20 +-
 examples/l3fwd/l3fwd_em_hlm.h                      |  16 +-
 examples/l3fwd/l3fwd_em_hlm_neon.h                 |  16 +-
 examples/l3fwd/l3fwd_em_hlm_sse.h                  |  16 +-
 examples/l3fwd/l3fwd_em_sequential.h               |  16 +-
 examples/l3fwd/l3fwd_lpm.c                         |  50 ++--
 examples/l3fwd/l3fwd_lpm.h                         |  20 +-
 examples/l3fwd/l3fwd_lpm_altivec.h                 |  20 +-
 examples/l3fwd/l3fwd_lpm_neon.h                    |  30 +-
 examples/l3fwd/l3fwd_lpm_sse.h                     |  20 +-
 examples/l3fwd/l3fwd_neon.h                        |  14 +-
 examples/l3fwd/l3fwd_sse.h                         |  14 +-
 examples/l3fwd/main.c                              |  20 +-
 examples/link_status_interrupt/main.c              |   8 +-
 examples/load_balancer/runtime.c                   |   6 +-
 .../client_server_mp/mp_server/main.c              |   2 +-
 examples/packet_ordering/main.c                    |   2 +-
 examples/performance-thread/l3fwd-thread/main.c    | 322 ++++++++++-----------
 examples/ptpclient/ptpclient.c                     |  32 +-
 examples/qos_meter/main.c                          |   4 +-
 examples/qos_sched/init.c                          |   2 +-
 examples/quota_watermark/qw/main.c                 |   8 +-
 examples/rxtx_callbacks/main.c                     |   4 +-
 examples/server_node_efd/node/node.c               |   6 +-
 examples/server_node_efd/server/main.c             |   8 +-
 examples/skeleton/basicfwd.c                       |   4 +-
 examples/tep_termination/main.c                    |   2 +-
 examples/tep_termination/main.h                    |   2 +-
 examples/tep_termination/vxlan.c                   | 108 +++----
 examples/tep_termination/vxlan.h                   |   8 +-
 examples/tep_termination/vxlan_setup.c             |  30 +-
 examples/tep_termination/vxlan_setup.h             |   2 +-
 examples/vhost/main.c                              |  40 +--
 examples/vhost/main.h                              |   2 +-
 examples/vm_power_manager/channel_monitor.c        |   2 +-
 .../guest_cli/vm_power_cli_guest.c                 |   2 +-
 examples/vm_power_manager/main.c                   |   6 +-
 examples/vmdq/main.c                               |  12 +-
 examples/vmdq_dcb/main.c                           |  12 +-
 lib/librte_cmdline/cmdline_parse_etheraddr.c       |  33 +--
 lib/librte_ethdev/rte_eth_ctrl.h                   |  12 +-
 lib/librte_ethdev/rte_ethdev.c                     |  56 ++--
 lib/librte_ethdev/rte_ethdev.h                     |  12 +-
 lib/librte_ethdev/rte_ethdev_core.h                |  12 +-
 lib/librte_ethdev/rte_flow.h                       |  32 +-
 lib/librte_eventdev/rte_event_eth_rx_adapter.c     |  32 +-
 lib/librte_gro/gro_tcp4.c                          |  26 +-
 lib/librte_gro/gro_tcp4.h                          |  20 +-
 lib/librte_gro/gro_vxlan_tcp4.c                    |  64 ++--
 lib/librte_gro/gro_vxlan_tcp4.h                    |   6 +-
 lib/librte_gso/gso_common.h                        |  16 +-
 lib/librte_gso/gso_tcp4.c                          |  12 +-
 lib/librte_gso/gso_tunnel_tcp4.c                   |  14 +-
 lib/librte_gso/gso_udp4.c                          |   8 +-
 lib/librte_gso/rte_gso.h                           |   8 +-
 lib/librte_hash/rte_thash.h                        |   2 +-
 lib/librte_ip_frag/rte_ip_frag.h                   |  12 +-
 lib/librte_ip_frag/rte_ipv4_fragmentation.c        |  42 +--
 lib/librte_ip_frag/rte_ipv4_reassembly.c           |  14 +-
 lib/librte_ip_frag/rte_ipv6_fragmentation.c        |  26 +-
 lib/librte_ip_frag/rte_ipv6_reassembly.c           |   6 +-
 lib/librte_kni/rte_kni.c                           |   4 +-
 lib/librte_kni/rte_kni.h                           |   2 +-
 lib/librte_net/rte_arp.c                           |  32 +-
 lib/librte_net/rte_arp.h                           |  36 +--
 lib/librte_net/rte_esp.h                           |   2 +-
 lib/librte_net/rte_ether.h                         | 178 ++++++------
 lib/librte_net/rte_gre.h                           |   2 +-
 lib/librte_net/rte_icmp.h                          |   6 +-
 lib/librte_net/rte_ip.h                            |  70 ++---
 lib/librte_net/rte_net.c                           |  90 +++---
 lib/librte_net/rte_net.h                           |  22 +-
 lib/librte_net/rte_sctp.h                          |   2 +-
 lib/librte_net/rte_tcp.h                           |   2 +-
 lib/librte_net/rte_udp.h                           |   2 +-
 lib/librte_pipeline/rte_table_action.c             | 210 +++++++-------
 lib/librte_pipeline/rte_table_action.h             |   4 +-
 lib/librte_port/rte_port_ras.c                     |   8 +-
 lib/librte_port/rte_port_source_sink.c             |   6 +-
 lib/librte_vhost/vhost.h                           |   2 +-
 lib/librte_vhost/virtio_net.c                      |  42 +--
 test/test-acl/main.c                               |   2 +-
 test/test-pipeline/pipeline_acl.c                  |  16 +-
 test/test-pipeline/pipeline_hash.c                 |  12 +-
 test/test/packet_burst_generator.c                 | 126 ++++----
 test/test/packet_burst_generator.h                 |  26 +-
 test/test/test_acl.c                               |   8 +-
 test/test/test_acl.h                               | 122 ++++----
 test/test/test_cmdline_etheraddr.c                 |  16 +-
 test/test/test_efd.c                               |  20 +-
 test/test/test_event_eth_rx_adapter.c              |   2 +-
 test/test/test_event_eth_tx_adapter.c              |   2 +-
 test/test/test_flow_classify.c                     |  68 ++---
 test/test/test_hash.c                              |  20 +-
 test/test/test_link_bonding.c                      | 284 +++++++++---------
 test/test/test_link_bonding_mode4.c                | 116 ++++----
 test/test/test_link_bonding_rssconf.c              |   6 +-
 test/test/test_lpm.c                               |  76 ++---
 test/test/test_lpm_perf.c                          |  10 +-
Quoted 9 lines
 test/test/test_member.c                            |  20 +-
 test/test/test_pmd_perf.c                          |  20 +-
 test/test/test_sched.c                             |  20 +-
 test/test/test_table_acl.c                         |   8 +-
 test/test/test_thash.c                             |  12 +-
 test/test/virtual_pmd.c                            |   6 +-
 test/test/virtual_pmd.h                            |   2 +-
 367 files changed, 3906 insertions(+), 3913 deletions(-)

Since BSD structures are available on Linux and BSD why is DPDK reinventing? There is no value in doing that.

#27 lore raw

Hi Stephen,

Quoted 65 lines · Stephen Hemminger
Quoted 45 lines · On Wed, 24 Oct 2018 10:18:19 +0200 Olivier Matz <[email protected]> wrote:

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Therefore, it is clear that doing this would break the compilation of many external applications.

Another drawback we need to take in account: it will make the backport of patches more difficult, although this is something that could be tempered by a script.

While it is obviously better to have a good namespace convention, we need to identify the issues we have today before deciding it's worth doing the change.

Comments?

Things that are missing in RFC:
- test with FreeBSD
- manually fix some indentation issues

Quoted 16 lines

Olivier Matz (14):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure

Quoted 4 lines

Since BSD structures are available on Linux and BSD why is DPDK reinventing? There is no value in doing that.

From what I see, some structures or defines are a bit different in Linux

and FreeBSD. Examples:

/* Linux */

	struct ether_addr
	{
	  u_int8_t ether_addr_octet[ETH_ALEN];
	} __attribute__ ((__packed__));

/* FreeBSD */

	struct ether_addr {
	        u_char octet[ETHER_ADDR_LEN];
	} __packed;

That's true the compat between Linux and FreeBSD is better than before in glibc. For instance with 7011c2622fe3 ("Remove __FAVOR_BSD.") added in 2013 (glibc 2.19). It seems that MUSL also supports BSD network structures.

So, I agree that using BSD structure looks possible, at least for ip/ip6/tcp/udp/icmp/... structures and defines. I think we would still need to provide some network structures for less usual protocols.

The question is: are we confident that the support of network BSD struct/defines/funcs is good enough in all libc we (will) want to use? Since DPDK is a network software, it is not that odd to provide our own network structures, because we will have control on them.

Olivier

#28 lore raw
In reply to Olivier Matz
Quoted 33 lines · On 10/24/2018 9:18 AM, olivier.matz at 6wind.com (Olivier Matz) wrote:

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Therefore, it is clear that doing this would break the compilation of many external applications.

Another drawback we need to take in account: it will make the backport of patches more difficult, although this is something that could be tempered by a script.

Quoted 5 lines

While it is obviously better to have a good namespace convention, we need to identify the issues we have today before deciding it's worth doing the change.

Comments?

Is there an consensus about the patchset? There was a decision on techboard to go with this change (adding rte_ prefix) [1].

This is something that will affect DPDK consumers. Since many APIs are changing most probably will break API compatibility for many libraries.

Meanwhile the conflict with the libc headers mentioned a few times in the past, this is something we need to fix.

There are a few comments reluctant to this big modification, but what I understand from Olivier's response both using BSD defines or having compatibility headers in DPDK won't solve the problem completely.

And assuming we will continue with this solution, another question is do we still want to push in 19.02 scope? (And from process point of view I think a deprecation notice is not merged for this change in 18.11 scope.)

With the prediction of 19.05 will be big and already break API/ABI for some libraries, can we push this into 19.05 as an early merge into repo?

And I think this patch will affect LTS releases and will break auto backporting for many fixes because it touches many places, so pushing this change even to next LTS (19.11) can be an option.

Olivier, Thomas,

What do you think about postponing this to 19.05 or even 19.11 ?

[1]
https://mails.dpdk.org/archives/dev/2018-October/116695.html

Quoted 22 lines

Things that are missing in RFC:
- test with FreeBSD
- manually fix some indentation issues

Olivier Matz (14):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure

#29 lore raw
Quoted 66 lines · On Thu, 20 Dec 2018 21:59:37 +0000 Ferruh Yigit <[email protected]> wrote:
Quoted 33 lines · On 10/24/2018 9:18 AM, olivier.matz at 6wind.com (Olivier Matz) wrote:

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Therefore, it is clear that doing this would break the compilation of many external applications.

Another drawback we need to take in account: it will make the backport of patches more difficult, although this is something that could be tempered by a script.

Quoted 5 lines

While it is obviously better to have a good namespace convention, we need to identify the issues we have today before deciding it's worth doing the change.

Comments?

Is there an consensus about the patchset? There was a decision on techboard to go with this change (adding rte_ prefix) [1].

This is something that will affect DPDK consumers. Since many APIs are changing most probably will break API compatibility for many libraries.

Meanwhile the conflict with the libc headers mentioned a few times in the past, this is something we need to fix.

There are a few comments reluctant to this big modification, but what I understand from Olivier's response both using BSD defines or having compatibility headers in DPDK won't solve the problem completely.

And assuming we will continue with this solution, another question is do we still want to push in 19.02 scope? (And from process point of view I think a deprecation notice is not merged for this change in 18.11 scope.)

With the prediction of 19.05 will be big and already break API/ABI for some libraries, can we push this into 19.05 as an early merge into repo?

And I think this patch will affect LTS releases and will break auto backporting for many fixes because it touches many places, so pushing this change even to next LTS (19.11) can be an option.

Quoted 33 lines

Olivier, Thomas,

What do you think about postponing this to 19.05 or even 19.11 ?

[1]
https://mails.dpdk.org/archives/dev/2018-October/116695.html

Quoted 22 lines

Things that are missing in RFC:
- test with FreeBSD
- manually fix some indentation issues

Olivier Matz (14):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure

Sigh. Another case where DPDK has to reinvent something because we can't figure out how to do dependent libraries correctly. I would have rather just using the existing Linux, BSD definitions and fixing the DPDK code.

It is probably the only viable compromise, but it adds to long term maintenance, and breaks DPDK applications. Neither of which is a good thing.

Should this be done by marking the old structure deprecated first? Ideally, spread over three releases: first, tell the users in the documentation it is coming; second, mark the old structures as deprecated causing compiler warnings; third, remove the old definitions. Doing at once is introducing user pain for no gain.

#30 lore raw
Quoted 116 lines · Stephen Hemminger
Quoted 66 lines · On Thu, 20 Dec 2018 21:59:37 +0000 Ferruh Yigit <[email protected]> wrote:
Quoted 33 lines · On 10/24/2018 9:18 AM, olivier.matz at 6wind.com (Olivier Matz) wrote:

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Therefore, it is clear that doing this would break the compilation of many external applications.

Another drawback we need to take in account: it will make the backport of patches more difficult, although this is something that could be tempered by a script.

Quoted 5 lines

While it is obviously better to have a good namespace convention, we need to identify the issues we have today before deciding it's worth doing the change.

Comments?

Is there an consensus about the patchset? There was a decision on techboard to go with this change (adding rte_ prefix) [1].

This is something that will affect DPDK consumers. Since many APIs are changing most probably will break API compatibility for many libraries.

Meanwhile the conflict with the libc headers mentioned a few times in the past, this is something we need to fix.

There are a few comments reluctant to this big modification, but what I understand from Olivier's response both using BSD defines or having compatibility headers in DPDK won't solve the problem completely.

And assuming we will continue with this solution, another question is do we still want to push in 19.02 scope? (And from process point of view I think a deprecation notice is not merged for this change in 18.11 scope.)

With the prediction of 19.05 will be big and already break API/ABI for some libraries, can we push this into 19.05 as an early merge into repo?

And I think this patch will affect LTS releases and will break auto backporting for many fixes because it touches many places, so pushing this change even to next LTS (19.11) can be an option.

Quoted 33 lines

Olivier, Thomas,

What do you think about postponing this to 19.05 or even 19.11 ?

[1]
https://mails.dpdk.org/archives/dev/2018-October/116695.html

Quoted 22 lines

Things that are missing in RFC:
- test with FreeBSD
- manually fix some indentation issues

Olivier Matz (14):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure

Sigh. Another case where DPDK has to reinvent something because we can't figure out how to do dependent libraries correctly. I would have rather just using the existing Linux, BSD definitions and fixing the DPDK code.

It is probably the only viable compromise, but it adds to long term maintenance, and breaks DPDK applications. Neither of which is a good thing.

Quoted 5 lines

Should this be done by marking the old structure deprecated first? Ideally, spread over three releases: first, tell the users in the documentation it is coming; second, mark the old structures as deprecated causing compiler warnings; third, remove the old definitions. Doing at once is introducing user pain for no gain.

+1

Regards,
Keith

#31 lore raw
Quoted 116 lines · Keith
Quoted 116 lines · Stephen Hemminger
Quoted 66 lines · On Thu, 20 Dec 2018 21:59:37 +0000 Ferruh Yigit <[email protected]> wrote:
Quoted 33 lines · On 10/24/2018 9:18 AM, olivier.matz at 6wind.com (Olivier Matz) wrote:

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Therefore, it is clear that doing this would break the compilation of many external applications.

Another drawback we need to take in account: it will make the backport of patches more difficult, although this is something that could be tempered by a script.

Quoted 5 lines

While it is obviously better to have a good namespace convention, we need to identify the issues we have today before deciding it's worth doing the change.

Comments?

Is there an consensus about the patchset? There was a decision on techboard to go with this change (adding rte_ prefix) [1].

This is something that will affect DPDK consumers. Since many APIs are changing most probably will break API compatibility for many libraries.

Meanwhile the conflict with the libc headers mentioned a few times in the past, this is something we need to fix.

There are a few comments reluctant to this big modification, but what I understand from Olivier's response both using BSD defines or having compatibility headers in DPDK won't solve the problem completely.

And assuming we will continue with this solution, another question is do we still want to push in 19.02 scope? (And from process point of view I think a deprecation notice is not merged for this change in 18.11 scope.)

With the prediction of 19.05 will be big and already break API/ABI for some libraries, can we push this into 19.05 as an early merge into repo?

And I think this patch will affect LTS releases and will break auto backporting for many fixes because it touches many places, so pushing this change even to next LTS (19.11) can be an option.

Quoted 33 lines

Olivier, Thomas,

What do you think about postponing this to 19.05 or even 19.11 ?

[1]
https://mails.dpdk.org/archives/dev/2018-October/116695.html

Quoted 22 lines

Things that are missing in RFC:
- test with FreeBSD
- manually fix some indentation issues

Olivier Matz (14):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure

Sigh. Another case where DPDK has to reinvent something because we can't figure out how to do dependent libraries correctly. I would have rather just using the existing Linux, BSD definitions and fixing the DPDK code.

It is probably the only viable compromise, but it adds to long term maintenance, and breaks DPDK applications. Neither of which is a good thing.

Quoted 7 lines
Quoted 5 lines

Should this be done by marking the old structure deprecated first? Ideally, spread over three releases: first, tell the users in the documentation it is coming; second, mark the old structures as deprecated causing compiler warnings; third, remove the old definitions. Doing at once is introducing user pain for no gain.

+1

With the current timeline, readiness of the patch and comments, at least it won't able to make this release, I will update the patchset status as 'Deferred'

Should we discuss this again in techboard?

#32 lore raw

Hi,

Quoted 108 lines · Ferruh Yigit
Quoted 107 lines · Keith
Quoted 107 lines · Stephen Hemminger
Quoted 99 lines · On Thu, 20 Dec 2018 21:59:37 +0000 Ferruh Yigit <[email protected]> wrote:
Quoted 33 lines · On 10/24/2018 9:18 AM, olivier.matz at 6wind.com (Olivier Matz) wrote:

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Therefore, it is clear that doing this would break the compilation of many external applications.

Another drawback we need to take in account: it will make the backport of patches more difficult, although this is something that could be tempered by a script.

Quoted 5 lines

While it is obviously better to have a good namespace convention, we need to identify the issues we have today before deciding it's worth doing the change.

Comments?

Is there an consensus about the patchset? There was a decision on techboard to go with this change (adding rte_ prefix) [1].

This is something that will affect DPDK consumers. Since many APIs are changing most probably will break API compatibility for many libraries.

Meanwhile the conflict with the libc headers mentioned a few times in the past, this is something we need to fix.

There are a few comments reluctant to this big modification, but what I understand from Olivier's response both using BSD defines or having compatibility headers in DPDK won't solve the problem completely.

And assuming we will continue with this solution, another question is do we still want to push in 19.02 scope? (And from process point of view I think a deprecation notice is not merged for this change in 18.11 scope.)

With the prediction of 19.05 will be big and already break API/ABI for some libraries, can we push this into 19.05 as an early merge into repo?

And I think this patch will affect LTS releases and will break auto backporting for many fixes because it touches many places, so pushing this change even to next LTS (19.11) can be an option.

Olivier, Thomas,

What do you think about postponing this to 19.05 or even 19.11 ?

[1]
https://mails.dpdk.org/archives/dev/2018-October/116695.html

Quoted 22 lines

Things that are missing in RFC:
- test with FreeBSD
- manually fix some indentation issues

Olivier Matz (14):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Sigh. Another case where DPDK has to reinvent something because we can't figure out how to do dependent libraries correctly. I would have rather just using the existing Linux, BSD definitions and fixing the DPDK code.

It is not that simple. As I said in [1], there are still some differences between gnu libc and freebsd libc. Unfortunatly, the struct ether_addr is one of the most important in dpdk, because it is widely used in APIs (drivers).

We can find others differences, for instance in constant definitions in if_arp.h. I also see that some structures are packed in freebsd but not in glibc (ex: icmp6), this could have performance impact.

Many protocols that are currently defined in dpdk are missing in glibc:
esp, sctp, gre, mpls, ... so we will at least need rte_ structures for these protocols.

Supporting other OSes or libc in the future could also increase the gaps.

For these reasons think it is reasonable to have a consistent set of network structures in dpdk.

[1] https://mails.dpdk.org/archives/dev/2018-October/117258.html

Quoted 11 lines
Quoted 11 lines
Quoted 9 lines

It is probably the only viable compromise, but it adds to long term maintenance, and breaks DPDK applications. Neither of which is a good thing.

Should this be done by marking the old structure deprecated first? Ideally, spread over three releases: first, tell the users in the documentation it is coming; second, mark the old structures as deprecated causing compiler warnings; third, remove the old definitions. Doing at once is introducing user pain for no gain.

+1

Annoucing the change before doing it is obvious. Marking the old structures as deprecated before removing them is maybe doable (to be checked that it does not cause conflicts with new structures), but it means the conflict with libc headers that we are trying to solve will remain for one more version, for a limited gain.

Quoted 4 lines

With the current timeline, readiness of the patch and comments, at least it won't able to make this release, I will update the patchset status as 'Deferred'

Should we discuss this again in techboard?

We should surely weigh the pros and cons. Especially the additional backport troubles it can bring.

Are many people bothered by the current conflict with the libc headers?

Olivier

#33 lore raw
Quoted 160 lines · Olivier Matz

Hi,

Quoted 108 lines · Ferruh Yigit
Quoted 107 lines · Keith
Quoted 107 lines · Stephen Hemminger
Quoted 99 lines · On Thu, 20 Dec 2018 21:59:37 +0000 Ferruh Yigit <[email protected]> wrote:
Quoted 33 lines · On 10/24/2018 9:18 AM, olivier.matz at 6wind.com (Olivier Matz) wrote:

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Therefore, it is clear that doing this would break the compilation of many external applications.

Another drawback we need to take in account: it will make the backport of patches more difficult, although this is something that could be tempered by a script.

Quoted 5 lines

While it is obviously better to have a good namespace convention, we need to identify the issues we have today before deciding it's worth doing the change.

Comments?

Is there an consensus about the patchset? There was a decision on techboard to go with this change (adding rte_ prefix) [1].

This is something that will affect DPDK consumers. Since many APIs are changing most probably will break API compatibility for many libraries.

Meanwhile the conflict with the libc headers mentioned a few times in the past, this is something we need to fix.

There are a few comments reluctant to this big modification, but what I understand from Olivier's response both using BSD defines or having compatibility headers in DPDK won't solve the problem completely.

And assuming we will continue with this solution, another question is do we still want to push in 19.02 scope? (And from process point of view I think a deprecation notice is not merged for this change in 18.11 scope.)

With the prediction of 19.05 will be big and already break API/ABI for some libraries, can we push this into 19.05 as an early merge into repo?

And I think this patch will affect LTS releases and will break auto backporting for many fixes because it touches many places, so pushing this change even to next LTS (19.11) can be an option.

Olivier, Thomas,

What do you think about postponing this to 19.05 or even 19.11 ?

[1]
https://mails.dpdk.org/archives/dev/2018-October/116695.html

Quoted 22 lines

Things that are missing in RFC:
- test with FreeBSD
- manually fix some indentation issues

Olivier Matz (14):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Sigh. Another case where DPDK has to reinvent something because we can't figure out how to do dependent libraries correctly. I would have rather just using the existing Linux, BSD definitions and fixing the DPDK code.

It is not that simple. As I said in [1], there are still some differences between gnu libc and freebsd libc. Unfortunatly, the struct ether_addr is one of the most important in dpdk, because it is widely used in APIs (drivers).

We can find others differences, for instance in constant definitions in if_arp.h. I also see that some structures are packed in freebsd but not in glibc (ex: icmp6), this could have performance impact.

Many protocols that are currently defined in dpdk are missing in glibc:
esp, sctp, gre, mpls, ... so we will at least need rte_ structures for these protocols.

Supporting other OSes or libc in the future could also increase the gaps.

For these reasons think it is reasonable to have a consistent set of network structures in dpdk.

[1] https://mails.dpdk.org/archives/dev/2018-October/117258.html

Quoted 11 lines
Quoted 11 lines
Quoted 9 lines

It is probably the only viable compromise, but it adds to long term maintenance, and breaks DPDK applications. Neither of which is a good thing.

Should this be done by marking the old structure deprecated first? Ideally, spread over three releases: first, tell the users in the documentation it is coming; second, mark the old structures as deprecated causing compiler warnings; third, remove the old definitions. Doing at once is introducing user pain for no gain.

+1

Annoucing the change before doing it is obvious. Marking the old structures as deprecated before removing them is maybe doable (to be checked that it does not cause conflicts with new structures), but it means the conflict with libc headers that we are trying to solve will remain for one more version, for a limited gain.

Quoted 3 lines

With the current timeline, readiness of the patch and comments, at least it won't able to make this release, I will update the patchset status as 'Deferred'

Quoted 6 lines
Quoted 1 line

Should we discuss this again in techboard?

We should surely weigh the pros and cons. Especially the additional backport troubles it can bring.

Are many people bothered by the current conflict with the libc headers?

This is still open.

If we will get these patchset, I suggest it getting early in the 19.05, patch is mechanical but it is huge and will affect almost all other patches under development. So I am not really for pushing this close to RC.

Is there any way to decide on this week, at worst next week?

Thanks,
ferruh

#34 lore raw
Quoted 168 lines · Ferruh
Quoted 160 lines · Olivier Matz

Hi,

Quoted 108 lines · Ferruh Yigit
Quoted 107 lines · Keith
Quoted 107 lines · Stephen Hemminger
Quoted 99 lines · On Thu, 20 Dec 2018 21:59:37 +0000 Ferruh Yigit <[email protected]> wrote:
Quoted 33 lines · On 10/24/2018 9:18 AM, olivier.matz at 6wind.com (Olivier Matz) wrote:

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Therefore, it is clear that doing this would break the compilation of many external applications.

Another drawback we need to take in account: it will make the backport of patches more difficult, although this is something that could be tempered by a script.

Quoted 5 lines

While it is obviously better to have a good namespace convention, we need to identify the issues we have today before deciding it's worth doing the change.

Comments?

Is there an consensus about the patchset? There was a decision on techboard to go with this change (adding rte_ prefix) [1].

This is something that will affect DPDK consumers. Since many APIs are changing most probably will break API compatibility for many libraries.

Meanwhile the conflict with the libc headers mentioned a few times in the past, this is something we need to fix.

There are a few comments reluctant to this big modification, but what I understand from Olivier's response both using BSD defines or having compatibility headers in DPDK won't solve the problem completely.

And assuming we will continue with this solution, another question is do we still want to push in 19.02 scope? (And from process point of view I think a deprecation notice is not merged for this change in 18.11 scope.)

With the prediction of 19.05 will be big and already break API/ABI for some libraries, can we push this into 19.05 as an early merge into repo?

And I think this patch will affect LTS releases and will break auto backporting for many fixes because it touches many places, so pushing this change even to next LTS (19.11) can be an option.

Olivier, Thomas,

What do you think about postponing this to 19.05 or even 19.11 ?

[1]
https://mails.dpdk.org/archives/dev/2018-October/116695.html

Quoted 22 lines

Things that are missing in RFC:
- test with FreeBSD
- manually fix some indentation issues

Olivier Matz (14):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Sigh. Another case where DPDK has to reinvent something because we can't figure out how to do dependent libraries correctly. I would have rather just using the existing Linux, BSD definitions and fixing the DPDK code.

It is not that simple. As I said in [1], there are still some differences between gnu libc and freebsd libc. Unfortunatly, the struct ether_addr is one of the most important in dpdk, because it is widely used in APIs (drivers).

We can find others differences, for instance in constant definitions in if_arp.h. I also see that some structures are packed in freebsd but not in glibc (ex: icmp6), this could have performance impact.

Many protocols that are currently defined in dpdk are missing in glibc:
esp, sctp, gre, mpls, ... so we will at least need rte_ structures for these protocols.

Supporting other OSes or libc in the future could also increase the gaps.

For these reasons think it is reasonable to have a consistent set of network structures in dpdk.

[1] https://mails.dpdk.org/archives/dev/2018-October/117258.html

Quoted 11 lines
Quoted 11 lines
Quoted 9 lines

It is probably the only viable compromise, but it adds to long term maintenance, and breaks DPDK applications. Neither of which is a good thing.

Should this be done by marking the old structure deprecated first? Ideally, spread over three releases: first, tell the users in the documentation it is coming; second, mark the old structures as deprecated causing compiler warnings; third, remove the old definitions. Doing at once is introducing user pain for no gain.

+1

Annoucing the change before doing it is obvious. Marking the old structures as deprecated before removing them is maybe doable (to be checked that it does not cause conflicts with new structures), but it means the conflict with libc headers that we are trying to solve will remain for one more version, for a limited gain.

Quoted 3 lines

With the current timeline, readiness of the patch and comments, at least it won't able to make this release, I will update the patchset status as 'Deferred'

Quoted 6 lines
Quoted 1 line

Should we discuss this again in techboard?

We should surely weigh the pros and cons. Especially the additional backport troubles it can bring.

Are many people bothered by the current conflict with the libc headers?

Quoted 7 lines

This is still open.

If we will get these patchset, I suggest it getting early in the 19.05, patch is mechanical but it is huge and will affect almost all other patches under development. So I am not really for pushing this close to RC.

Is there any way to decide on this week, at worst next week?

This has been discussed in techboard meeting and decided to go with this patch. But we are missing the deprecation notice for this.

Olivier,

Can you send a deprecation notice for this in the scope of the 19.05? And can we target the actual patch for very early days of the 19.08?

Thanks,
ferruh

#35 lore raw
Quoted 177 lines · Ferruh Yigit
Quoted 168 lines · Ferruh
Quoted 160 lines · Olivier Matz

Hi,

Quoted 108 lines · Ferruh Yigit
Quoted 107 lines · Keith
Quoted 107 lines · Stephen Hemminger
Quoted 99 lines · On Thu, 20 Dec 2018 21:59:37 +0000 Ferruh Yigit <[email protected]> wrote:
Quoted 33 lines · On 10/24/2018 9:18 AM, olivier.matz at 6wind.com (Olivier Matz) wrote:

This RFC targets 19.02.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences. This was discussed in [1], and more recently at the techboard.

Before sending the deprecation notice (target for this is 18.11), here is a draft that can be discussed.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

One question I'm asking is how can we manage the transition. Initially, I hoped it was possible to have a compat layer during one release (supporting both prefixed and unprefixed names), but now that the patch is done, it seems the impact is too big, and impacts too many libraries.

Few examples:
- rte_eth_macaddr_get/add/remove() use a (struct rte_ether_addr *)
- many rte_flow structures use the rte_ prefixed net structures
- the mac field of virtio_net structure is rte_ether_addr
- the first arg of rte_thash_load_v6_addrs is (struct rte_ipv6_hdr *)
...

Therefore, it is clear that doing this would break the compilation of many external applications.

Another drawback we need to take in account: it will make the backport of patches more difficult, although this is something that could be tempered by a script.

Quoted 5 lines

While it is obviously better to have a good namespace convention, we need to identify the issues we have today before deciding it's worth doing the change.

Comments?

Is there an consensus about the patchset? There was a decision on techboard to go with this change (adding rte_ prefix) [1].

This is something that will affect DPDK consumers. Since many APIs are changing most probably will break API compatibility for many libraries.

Meanwhile the conflict with the libc headers mentioned a few times in the past, this is something we need to fix.

There are a few comments reluctant to this big modification, but what I understand from Olivier's response both using BSD defines or having compatibility headers in DPDK won't solve the problem completely.

And assuming we will continue with this solution, another question is do we still want to push in 19.02 scope? (And from process point of view I think a deprecation notice is not merged for this change in 18.11 scope.)

With the prediction of 19.05 will be big and already break API/ABI for some libraries, can we push this into 19.05 as an early merge into repo?

And I think this patch will affect LTS releases and will break auto backporting for many fixes because it touches many places, so pushing this change even to next LTS (19.11) can be an option.

Olivier, Thomas,

What do you think about postponing this to 19.05 or even 19.11 ?

[1]
https://mails.dpdk.org/archives/dev/2018-October/116695.html

Quoted 22 lines

Things that are missing in RFC:
- test with FreeBSD
- manually fix some indentation issues

Olivier Matz (14):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Sigh. Another case where DPDK has to reinvent something because we can't figure out how to do dependent libraries correctly. I would have rather just using the existing Linux, BSD definitions and fixing the DPDK code.

It is not that simple. As I said in [1], there are still some differences between gnu libc and freebsd libc. Unfortunatly, the struct ether_addr is one of the most important in dpdk, because it is widely used in APIs (drivers).

We can find others differences, for instance in constant definitions in if_arp.h. I also see that some structures are packed in freebsd but not in glibc (ex: icmp6), this could have performance impact.

Many protocols that are currently defined in dpdk are missing in glibc:
esp, sctp, gre, mpls, ... so we will at least need rte_ structures for these protocols.

Supporting other OSes or libc in the future could also increase the gaps.

For these reasons think it is reasonable to have a consistent set of network structures in dpdk.

[1] https://mails.dpdk.org/archives/dev/2018-October/117258.html

Quoted 11 lines
Quoted 11 lines
Quoted 9 lines

It is probably the only viable compromise, but it adds to long term maintenance, and breaks DPDK applications. Neither of which is a good thing.

Should this be done by marking the old structure deprecated first? Ideally, spread over three releases: first, tell the users in the documentation it is coming; second, mark the old structures as deprecated causing compiler warnings; third, remove the old definitions. Doing at once is introducing user pain for no gain.

+1

Annoucing the change before doing it is obvious. Marking the old structures as deprecated before removing them is maybe doable (to be checked that it does not cause conflicts with new structures), but it means the conflict with libc headers that we are trying to solve will remain for one more version, for a limited gain.

Quoted 3 lines

With the current timeline, readiness of the patch and comments, at least it won't able to make this release, I will update the patchset status as 'Deferred'

Quoted 6 lines
Quoted 1 line

Should we discuss this again in techboard?

We should surely weigh the pros and cons. Especially the additional backport troubles it can bring.

Are many people bothered by the current conflict with the libc headers?

Quoted 7 lines

This is still open.

If we will get these patchset, I suggest it getting early in the 19.05, patch is mechanical but it is huge and will affect almost all other patches under development. So I am not really for pushing this close to RC.

Is there any way to decide on this week, at worst next week?

Quoted 9 lines

This has been discussed in techboard meeting and decided to go with this patch. But we are missing the deprecation notice for this.

Olivier,

Can you send a deprecation notice for this in the scope of the 19.05? And can we target the actual patch for very early days of the 19.08?

Hi Ferruh,

OK, will do. Thank you.

Olivier

#36 lore raw

v2 cover prefix network structures

In reply to Olivier Matz

This RFC targets 19.08.

The rte_net headers conflict with the libc headers, because some definitions are duplicated, sometimes with few differences.

This RFC adds the rte_ (or RTE_) prefix to all structures, functions and defines in rte_net library. This is a big changeset, that will break the API of many functions, but not the ABI.

This was discussed in [1], and recently requested by the techboard [2].

v2:
* rebase on top of v19.05-rc1

[1] http://mails.dpdk.org/archives/dev/2018-January/087384.html
[2] http://mails.dpdk.org/archives/dev/2019-February/125033.html

Olivier Matz (14):
net: add rte prefix to arp structures
net: add rte prefix to arp defines
net: add rte prefix to ether structures
net: add rte prefix to ether functions
net: add rte prefix to ether defines
net: add rte prefix to esp structure
net: add rte prefix to gre structure
net: add rte prefix to icmp structure
net: add rte prefix to icmp defines
net: add rte prefix to ip structure
net: add rte prefix to ip defines
net: add rte prefix to sctp structure
net: add rte prefix to tcp structure
net: add rte prefix to udp structure

 app/pdump/main.c                                   |   2 +-
 app/test-acl/main.c                                |   2 +-
 app/test-eventdev/test_perf_common.c               |   2 +-
 app/test-eventdev/test_pipeline_common.c           |   2 +-
 app/test-pipeline/pipeline_acl.c                   |  16 +-
 app/test-pipeline/pipeline_hash.c                  |  12 +-
 app/test-pmd/cmdline.c                             |  90 +++---
 app/test-pmd/cmdline_flow.c                        |  86 +++---
 app/test-pmd/config.c                              |  34 +--
 app/test-pmd/csumonly.c                            | 160 +++++-----
 app/test-pmd/flowgen.c                             |  30 +-
 app/test-pmd/icmpecho.c                            | 120 ++++----
 app/test-pmd/ieee1588fwd.c                         |  18 +-
 app/test-pmd/macfwd.c                              |  12 +-
 app/test-pmd/macswap.h                             |  12 +-
 app/test-pmd/macswap_common.h                      |   4 +-
 app/test-pmd/macswap_neon.h                        |  12 +-
 app/test-pmd/macswap_sse.h                         |  12 +-
 app/test-pmd/parameters.c                          |   6 +-
 app/test-pmd/testpmd.c                             |  22 +-
 app/test-pmd/testpmd.h                             |  30 +-
 app/test-pmd/txonly.c                              |  44 +--
 app/test-pmd/util.c                                |  34 +--
 app/test/packet_burst_generator.c                  | 126 ++++----
 app/test/packet_burst_generator.h                  |  26 +-
 app/test/test_acl.c                                |   8 +-
 app/test/test_acl.h                                | 122 ++++----
 app/test/test_cmdline_etheraddr.c                  |  16 +-
 app/test/test_efd.c                                |  20 +-
 app/test/test_event_eth_rx_adapter.c               |   2 +-
 app/test/test_event_eth_tx_adapter.c               |   2 +-
 app/test/test_flow_classify.c                      |  68 ++---
 app/test/test_hash.c                               |  20 +-
 app/test/test_ipsec.c                              |  12 +-
 app/test/test_link_bonding.c                       | 284 +++++++++---------
 app/test/test_link_bonding_mode4.c                 | 116 ++++----
 app/test/test_link_bonding_rssconf.c               |   6 +-
 app/test/test_lpm.c                                |  76 ++---
 app/test/test_lpm_perf.c                           |  10 +-
 app/test/test_member.c                             |  20 +-
 app/test/test_pmd_perf.c                           |  20 +-
 app/test/test_sched.c                              |  20 +-
 app/test/test_table_acl.c                          |   8 +-
 app/test/test_thash.c                              |  12 +-
 app/test/virtual_pmd.c                             |   6 +-
 app/test/virtual_pmd.h                             |   2 +-
 doc/guides/nics/kni.rst                            |   2 +-
 doc/guides/prog_guide/bbdev.rst                    |   6 +-
 .../prog_guide/packet_classif_access_ctrl.rst      |  18 +-
 doc/guides/prog_guide/rte_flow.rst                 |   4 +-
 doc/guides/sample_app_ug/flow_classify.rst         |  28 +-
 doc/guides/sample_app_ug/flow_filtering.rst        |   6 +-
 doc/guides/sample_app_ug/ip_frag.rst               |  16 +-
 doc/guides/sample_app_ug/ip_reassembly.rst         |  16 +-
 doc/guides/sample_app_ug/ipv4_multicast.rst        |  16 +-
 doc/guides/sample_app_ug/l2_forward_job_stats.rst  |   6 +-
 .../sample_app_ug/l2_forward_real_virtual.rst      |   6 +-
 doc/guides/sample_app_ug/l3_forward.rst            |  12 +-
 doc/guides/sample_app_ug/link_status_intr.rst      |   6 +-
 doc/guides/sample_app_ug/ptpclient.rst             |   6 +-
 doc/guides/sample_app_ug/rxtx_callbacks.rst        |   2 +-
 doc/guides/sample_app_ug/server_node_efd.rst       |  12 +-
 doc/guides/sample_app_ug/skeleton.rst              |   4 +-
 doc/guides/sample_app_ug/vmdq_dcb_forwarding.rst   |   4 +-
 drivers/bus/dpaa/base/fman/fman.c                  |   2 +-
 drivers/bus/dpaa/base/fman/fman_hw.c               |   2 +-
 drivers/bus/dpaa/include/fman.h                    |   2 +-
 drivers/bus/dpaa/include/netcfg.h                  |   4 +-
 drivers/net/af_packet/rte_eth_af_packet.c          |   2 +-
 drivers/net/af_xdp/rte_eth_af_xdp.c                |   6 +-
 drivers/net/ark/ark_ethdev.c                       |  16 +-
 drivers/net/ark/ark_ext.h                          |   4 +-
 drivers/net/ark/ark_global.h                       |   4 +-
 drivers/net/atlantic/atl_ethdev.c                  |  20 +-
 drivers/net/atlantic/hw_atl/hw_atl_utils.c         |   8 +-
 drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c    |   4 +-
 drivers/net/avp/avp_ethdev.c                       |  20 +-
 drivers/net/avp/rte_avp_common.h                   |   2 +-
 drivers/net/axgbe/axgbe_dev.c                      |   4 +-
 drivers/net/axgbe/axgbe_ethdev.c                   |  10 +-
 drivers/net/axgbe/axgbe_ethdev.h                   |   4 +-
 drivers/net/axgbe/axgbe_rxtx.c                     |   2 +-
 drivers/net/bnx2x/bnx2x.c                          |  16 +-
 drivers/net/bnx2x/bnx2x_ethdev.c                   |   4 +-
 drivers/net/bnx2x/bnx2x_ethdev.h                   |   2 +-
 drivers/net/bnx2x/bnx2x_vfpf.c                     |   8 +-
 drivers/net/bnx2x/bnx2x_vfpf.h                     |   2 +-
 drivers/net/bnx2x/ecore_sp.h                       |   2 +-
 drivers/net/bnxt/bnxt.h                            |   4 +-
 drivers/net/bnxt/bnxt_ethdev.c                     |  70 ++---
 drivers/net/bnxt/bnxt_filter.c                     |   4 +-
 drivers/net/bnxt/bnxt_filter.h                     |   8 +-
 drivers/net/bnxt/bnxt_flow.c                       |  26 +-
 drivers/net/bnxt/bnxt_hwrm.c                       |  40 +--
 drivers/net/bnxt/bnxt_hwrm.h                       |   2 +-
 drivers/net/bnxt/bnxt_ring.c                       |   8 +-
 drivers/net/bnxt/bnxt_rxq.c                        |   2 +-
 drivers/net/bnxt/bnxt_rxr.c                        |   2 +-
 drivers/net/bnxt/bnxt_vnic.c                       |   2 +-
 drivers/net/bnxt/rte_pmd_bnxt.c                    |  14 +-
 drivers/net/bnxt/rte_pmd_bnxt.h                    |   4 +-
 drivers/net/bonding/rte_eth_bond.h                 |   2 +-
 drivers/net/bonding/rte_eth_bond_8023ad.c          |  28 +-
 drivers/net/bonding/rte_eth_bond_8023ad.h          |  10 +-
 drivers/net/bonding/rte_eth_bond_8023ad_private.h  |   2 +-
 drivers/net/bonding/rte_eth_bond_alb.c             |  78 ++---
 drivers/net/bonding/rte_eth_bond_alb.h             |  10 +-
 drivers/net/bonding/rte_eth_bond_api.c             |   2 +-
 drivers/net/bonding/rte_eth_bond_args.c            |   2 +-
 drivers/net/bonding/rte_eth_bond_pmd.c             | 194 ++++++-------
 drivers/net/bonding/rte_eth_bond_private.h         |   6 +-
 drivers/net/cxgbe/base/adapter.h                   |   6 +-
 drivers/net/cxgbe/base/t4_hw.c                     |   8 +-
 drivers/net/cxgbe/cxgbe.h                          |   4 +-
 drivers/net/cxgbe/cxgbe_ethdev.c                   |  14 +-
 drivers/net/cxgbe/cxgbe_filter.h                   |   2 +-
 drivers/net/cxgbe/cxgbe_flow.c                     |  10 +-
 drivers/net/cxgbe/cxgbe_main.c                     |   4 +-
 drivers/net/cxgbe/cxgbe_pfvf.h                     |   2 +-
 drivers/net/cxgbe/cxgbevf_main.c                   |   2 +-
 drivers/net/cxgbe/l2t.c                            |   8 +-
 drivers/net/cxgbe/l2t.h                            |   2 +-
 drivers/net/cxgbe/mps_tcam.c                       |  14 +-
 drivers/net/cxgbe/mps_tcam.h                       |   4 +-
 drivers/net/cxgbe/sge.c                            |   8 +-
 drivers/net/dpaa/dpaa_ethdev.c                     |  20 +-
 drivers/net/dpaa/dpaa_rxtx.c                       |  22 +-
 drivers/net/dpaa2/dpaa2_ethdev.c                   |  36 +--
 drivers/net/dpaa2/dpaa2_flow.c                     |  18 +-
 drivers/net/e1000/e1000_ethdev.h                   |   4 +-
 drivers/net/e1000/em_ethdev.c                      |  34 +--
 drivers/net/e1000/em_rxtx.c                        |  22 +-
 drivers/net/e1000/igb_ethdev.c                     |  70 ++---
 drivers/net/e1000/igb_flow.c                       |  12 +-
 drivers/net/e1000/igb_pf.c                         |  16 +-
 drivers/net/e1000/igb_rxtx.c                       |  18 +-
 drivers/net/ena/ena_ethdev.c                       |  16 +-
 drivers/net/ena/ena_ethdev.h                       |   2 +-
 drivers/net/enetc/base/enetc_hw.h                  |   4 +-
 drivers/net/enetc/enetc_ethdev.c                   |   6 +-
 drivers/net/enic/enic.h                            |   4 +-
 drivers/net/enic/enic_clsf.c                       |  40 +--
 drivers/net/enic/enic_ethdev.c                     |  28 +-
 drivers/net/enic/enic_flow.c                       | 106 +++----
 drivers/net/enic/enic_main.c                       |   4 +-
 drivers/net/enic/enic_res.c                        |   4 +-
 drivers/net/failsafe/failsafe.c                    |   6 +-
 drivers/net/failsafe/failsafe_args.c               |   4 +-
 drivers/net/failsafe/failsafe_ether.c              |   6 +-
 drivers/net/failsafe/failsafe_ops.c                |   6 +-
 drivers/net/failsafe/failsafe_private.h            |   4 +-
 drivers/net/fm10k/fm10k.h                          |   2 +-
 drivers/net/fm10k/fm10k_ethdev.c                   |  18 +-
 drivers/net/i40e/base/i40e_adminq_cmd.h            |   4 +-
 drivers/net/i40e/base/i40e_common.c                |  12 +-
 drivers/net/i40e/base/i40e_prototype.h             |   4 +-
 drivers/net/i40e/i40e_ethdev.c                     | 136 ++++-----
 drivers/net/i40e/i40e_ethdev.h                     |  22 +-
 drivers/net/i40e/i40e_ethdev_vf.c                  |  62 ++--
 drivers/net/i40e/i40e_fdir.c                       | 126 ++++----
 drivers/net/i40e/i40e_flow.c                       |  58 ++--
 drivers/net/i40e/i40e_pf.c                         |  18 +-
 drivers/net/i40e/i40e_rxtx.c                       |  28 +-
 drivers/net/i40e/i40e_vf_representor.c             |   2 +-
 drivers/net/i40e/rte_pmd_i40e.c                    |  30 +-
 drivers/net/i40e/rte_pmd_i40e.h                    |   8 +-
 drivers/net/iavf/base/iavf_adminq_cmd.h            |   4 +-
 drivers/net/iavf/base/iavf_common.c                |  12 +-
 drivers/net/iavf/base/iavf_prototype.h             |   4 +-
 drivers/net/iavf/iavf.h                            |   4 +-
 drivers/net/iavf/iavf_ethdev.c                     |  50 ++--
 drivers/net/iavf/iavf_rxtx.c                       |  14 +-
 drivers/net/iavf/iavf_vchnl.c                      |   8 +-
 drivers/net/ice/ice_ethdev.c                       |  62 ++--
 drivers/net/ice/ice_ethdev.h                       |   4 +-
 drivers/net/ice/ice_rxtx.c                         |  28 +-
 drivers/net/ixgbe/ixgbe_ethdev.c                   |  92 +++---
 drivers/net/ixgbe/ixgbe_ethdev.h                   |   4 +-
 drivers/net/ixgbe/ixgbe_flow.c                     |  22 +-
 drivers/net/ixgbe/ixgbe_pf.c                       |  14 +-
 drivers/net/ixgbe/ixgbe_rxtx.c                     |  14 +-
 drivers/net/ixgbe/ixgbe_vf_representor.c           |   4 +-
 drivers/net/ixgbe/rte_pmd_ixgbe.c                  |  10 +-
 drivers/net/ixgbe/rte_pmd_ixgbe.h                  |   2 +-
 drivers/net/kni/rte_eth_kni.c                      |   6 +-
 drivers/net/liquidio/lio_ethdev.c                  |  22 +-
 drivers/net/mlx4/mlx4.c                            |   4 +-
 drivers/net/mlx4/mlx4.h                            |   8 +-
 drivers/net/mlx4/mlx4_ethdev.c                     |   8 +-
 drivers/net/mlx4/mlx4_flow.c                       |  14 +-
 drivers/net/mlx4/mlx4_rxtx.c                       |   2 +-
 drivers/net/mlx5/mlx5.c                            |   4 +-
 drivers/net/mlx5/mlx5.h                            |  14 +-
 drivers/net/mlx5/mlx5_flow.c                       |  22 +-
 drivers/net/mlx5/mlx5_flow_dv.c                    |  44 +--
 drivers/net/mlx5/mlx5_flow_tcf.c                   |  66 ++---
 drivers/net/mlx5/mlx5_flow_verbs.c                 |  26 +-
 drivers/net/mlx5/mlx5_mac.c                        |  18 +-
 drivers/net/mlx5/mlx5_nl.c                         |  28 +-
 drivers/net/mlx5/mlx5_rxtx.c                       |   6 +-
 drivers/net/mlx5/mlx5_rxtx.h                       |   2 +-
 drivers/net/mlx5/mlx5_rxtx_vec_neon.h              |   8 +-
 drivers/net/mlx5/mlx5_rxtx_vec_sse.h               |  10 +-
 drivers/net/mlx5/mlx5_trigger.c                    |   6 +-
 drivers/net/mvneta/mvneta_ethdev.c                 |  22 +-
 drivers/net/mvneta/mvneta_ethdev.h                 |   2 +-
 drivers/net/mvpp2/mrvl_ethdev.c                    |  22 +-
 drivers/net/mvpp2/mrvl_ethdev.h                    |   2 +-
 drivers/net/mvpp2/mrvl_flow.c                      |   4 +-
 drivers/net/netvsc/hn_ethdev.c                     |   4 +-
 drivers/net/netvsc/hn_nvs.c                        |   2 +-
 drivers/net/netvsc/hn_rndis.c                      |   2 +-
 drivers/net/netvsc/hn_rxtx.c                       |  12 +-
 drivers/net/netvsc/hn_var.h                        |   4 +-
 drivers/net/netvsc/hn_vf.c                         |   8 +-
 drivers/net/nfp/nfp_net.c                          |  20 +-
 drivers/net/nfp/nfp_net_pmd.h                      |   2 +-
 drivers/net/null/rte_eth_null.c                    |   6 +-
 drivers/net/octeontx/octeontx_ethdev.c             |   8 +-
 drivers/net/octeontx/octeontx_ethdev.h             |   2 +-
 drivers/net/pcap/rte_eth_pcap.c                    |  22 +-
 drivers/net/qede/base/bcm_osal.h                   |   2 +-
 drivers/net/qede/base/ecore_dev.c                  |   4 +-
 drivers/net/qede/qede_ethdev.c                     |  58 ++--
 drivers/net/qede/qede_ethdev.h                     |   6 +-
 drivers/net/qede/qede_filter.c                     |  66 ++---
 drivers/net/qede/qede_if.h                         |   4 +-
 drivers/net/qede/qede_main.c                       |   6 +-
 drivers/net/qede/qede_rxtx.c                       |  32 +-
 drivers/net/qede/qede_rxtx.h                       |   2 +-
 drivers/net/ring/rte_eth_ring.c                    |   4 +-
 drivers/net/sfc/sfc.h                              |   2 +-
 drivers/net/sfc/sfc_ef10_tx.c                      |   4 +-
 drivers/net/sfc/sfc_ethdev.c                       |  20 +-
 drivers/net/sfc/sfc_flow.c                         |  12 +-
 drivers/net/sfc/sfc_port.c                         |   8 +-
 drivers/net/sfc/sfc_tso.c                          |   4 +-
 drivers/net/sfc/sfc_tso.h                          |   4 +-
 drivers/net/softnic/parser.c                       |  18 +-
 drivers/net/softnic/parser.h                       |   2 +-
 drivers/net/softnic/rte_eth_softnic.c              |   2 +-
 drivers/net/softnic/rte_eth_softnic_flow.c         |   4 +-
 drivers/net/softnic/rte_eth_softnic_pipeline.c     |  40 +--
 drivers/net/szedata2/rte_eth_szedata2.c            |   8 +-
 drivers/net/tap/rte_eth_tap.c                      |  60 ++--
 drivers/net/tap/rte_eth_tap.h                      |   2 +-
 drivers/net/tap/tap_bpf_program.c                  |  14 +-
 drivers/net/tap/tap_flow.c                         |  12 +-
 drivers/net/thunderx/base/nicvf_mbox.c             |   4 +-
 drivers/net/thunderx/base/nicvf_plat.h             |   2 +-
 drivers/net/thunderx/nicvf_ethdev.c                |  18 +-
 drivers/net/thunderx/nicvf_struct.h                |   2 +-
 drivers/net/vdev_netvsc/vdev_netvsc.c              |  16 +-
 drivers/net/vhost/rte_eth_vhost.c                  |  12 +-
 drivers/net/virtio/virtio_ethdev.c                 |  72 ++---
 drivers/net/virtio/virtio_pci.h                    |   4 +-
 drivers/net/virtio/virtio_rxtx.c                   |  32 +-
 drivers/net/virtio/virtio_user/vhost_kernel_tap.c  |   2 +-
 drivers/net/virtio/virtio_user/virtio_user_dev.c   |   6 +-
 drivers/net/virtio/virtio_user/virtio_user_dev.h   |   2 +-
 drivers/net/virtio/virtio_user_ethdev.c            |   8 +-
 drivers/net/virtio/virtqueue.h                     |   2 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c               |  12 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.h               |   2 +-
 drivers/net/vmxnet3/vmxnet3_rxtx.c                 |  44 +--
 examples/bbdev_app/main.c                          |  40 +--
 examples/bond/main.c                               |  78 ++---
 examples/distributor/main.c                        |   4 +-
 examples/ethtool/ethtool-app/ethapp.c              |   8 +-
 examples/ethtool/ethtool-app/main.c                |  10 +-
 examples/ethtool/lib/rte_ethtool.c                 |   8 +-
 examples/ethtool/lib/rte_ethtool.h                 |   6 +-
 examples/eventdev_pipeline/main.c                  |   4 +-
 examples/eventdev_pipeline/pipeline_common.h       |  10 +-
 examples/flow_classify/flow_classify.c             |  30 +-
 examples/flow_filtering/main.c                     |  10 +-
 examples/ip_fragmentation/main.c                   |  64 ++--
 examples/ip_pipeline/cli.c                         |   4 +-
 examples/ip_pipeline/kni.c                         |   2 +-
 examples/ip_pipeline/parser.c                      |  18 +-
 examples/ip_pipeline/parser.h                      |   2 +-
 examples/ip_pipeline/pipeline.c                    |  40 +--
 examples/ip_reassembly/main.c                      |  50 ++--
 examples/ipsec-secgw/esp.c                         |  42 +--
 examples/ipsec-secgw/ipsec-secgw.c                 |  42 +--
 examples/ipsec-secgw/ipsec.h                       |   2 +-
 examples/ipsec-secgw/parser.c                      |   4 +-
 examples/ipsec-secgw/sa.c                          |  16 +-
 examples/ipv4_multicast/main.c                     |  58 ++--
 examples/kni/main.c                                |  14 +-
 examples/l2fwd-cat/l2fwd-cat.c                     |   4 +-
 examples/l2fwd-crypto/main.c                       |  26 +-
 examples/l2fwd-jobstats/main.c                     |   8 +-
 examples/l2fwd-keepalive/main.c                    |   8 +-
 examples/l2fwd/main.c                              |   8 +-
 examples/l3fwd-acl/main.c                          | 102 +++----
 examples/l3fwd-power/main.c                        | 100 +++----
 examples/l3fwd-vf/main.c                           |  68 ++---
 examples/l3fwd/l3fwd.h                             |   8 +-
 examples/l3fwd/l3fwd_altivec.h                     |  14 +-
 examples/l3fwd/l3fwd_common.h                      |   4 +-
 examples/l3fwd/l3fwd_em.c                          |  44 +--
 examples/l3fwd/l3fwd_em.h                          |  20 +-
 examples/l3fwd/l3fwd_em_hlm.h                      |  16 +-
 examples/l3fwd/l3fwd_em_hlm_neon.h                 |  16 +-
 examples/l3fwd/l3fwd_em_hlm_sse.h                  |  16 +-
 examples/l3fwd/l3fwd_em_sequential.h               |  16 +-
 examples/l3fwd/l3fwd_lpm.c                         |  50 ++--
 examples/l3fwd/l3fwd_lpm.h                         |  20 +-
 examples/l3fwd/l3fwd_lpm_altivec.h                 |  20 +-
 examples/l3fwd/l3fwd_lpm_neon.h                    |  30 +-
 examples/l3fwd/l3fwd_lpm_sse.h                     |  20 +-
 examples/l3fwd/l3fwd_neon.h                        |  14 +-
 examples/l3fwd/l3fwd_sse.h                         |  14 +-
 examples/l3fwd/main.c                              |  20 +-
 examples/link_status_interrupt/main.c              |   8 +-
 examples/load_balancer/runtime.c                   |   6 +-
 .../client_server_mp/mp_server/main.c              |   2 +-
 examples/packet_ordering/main.c                    |   2 +-
 examples/performance-thread/l3fwd-thread/main.c    | 322 ++++++++++-----------
 examples/ptpclient/ptpclient.c                     |  32 +-
 examples/qos_meter/main.c                          |   4 +-
 examples/qos_sched/init.c                          |   2 +-
 examples/quota_watermark/qw/main.c                 |   8 +-
 examples/rxtx_callbacks/main.c                     |   4 +-
 examples/server_node_efd/node/node.c               |   6 +-
 examples/server_node_efd/server/main.c             |   8 +-
 examples/skeleton/basicfwd.c                       |   4 +-
 examples/tep_termination/main.c                    |   2 +-
 examples/tep_termination/main.h                    |   2 +-
 examples/tep_termination/vxlan.c                   | 108 +++----
 examples/tep_termination/vxlan.h                   |   8 +-
 examples/tep_termination/vxlan_setup.c             |  30 +-
 examples/tep_termination/vxlan_setup.h             |   2 +-
 examples/vhost/main.c                              |  40 +--
 examples/vhost/main.h                              |   2 +-
 examples/vm_power_manager/channel_monitor.c        |  12 +-
 .../guest_cli/vm_power_cli_guest.c                 |   2 +-
 examples/vm_power_manager/main.c                   |   6 +-
 examples/vmdq/main.c                               |  12 +-
 examples/vmdq_dcb/main.c                           |  12 +-
 lib/librte_ethdev/rte_class_eth.c                  |   4 +-
 lib/librte_ethdev/rte_eth_ctrl.h                   |  12 +-
 lib/librte_ethdev/rte_ethdev.c                     |  58 ++--
 lib/librte_ethdev/rte_ethdev.h                     |  14 +-
 lib/librte_ethdev/rte_ethdev_core.h                |  12 +-
 lib/librte_ethdev/rte_flow.h                       |  32 +-
 lib/librte_eventdev/rte_event_eth_rx_adapter.c     |  32 +-
 lib/librte_gro/gro_tcp4.c                          |  26 +-
 lib/librte_gro/gro_tcp4.h                          |  22 +-
 lib/librte_gro/gro_vxlan_tcp4.c                    |  64 ++--
 lib/librte_gro/gro_vxlan_tcp4.h                    |   6 +-
 lib/librte_gso/gso_common.h                        |  16 +-
 lib/librte_gso/gso_tcp4.c                          |  12 +-
 lib/librte_gso/gso_tunnel_tcp4.c                   |  14 +-
 lib/librte_gso/gso_udp4.c                          |   8 +-
 lib/librte_gso/rte_gso.h                           |   8 +-
 lib/librte_hash/rte_thash.h                        |   2 +-
 lib/librte_ip_frag/rte_ip_frag.h                   |  12 +-
 lib/librte_ip_frag/rte_ipv4_fragmentation.c        |  42 +--
 lib/librte_ip_frag/rte_ipv4_reassembly.c           |  14 +-
 lib/librte_ip_frag/rte_ipv6_fragmentation.c        |  26 +-
 lib/librte_ip_frag/rte_ipv6_reassembly.c           |   6 +-
 lib/librte_ipsec/crypto.h                          |   2 +-
 lib/librte_ipsec/esp_inb.c                         |  10 +-
 lib/librte_ipsec/esp_outb.c                        |   8 +-
 lib/librte_ipsec/iph.h                             |   8 +-
 lib/librte_ipsec/sa.c                              |   8 +-
 lib/librte_kni/rte_kni.c                           |   4 +-
 lib/librte_kni/rte_kni.h                           |   2 +-
 lib/librte_net/rte_arp.c                           |  32 +-
 lib/librte_net/rte_arp.h                           |  36 +--
 lib/librte_net/rte_esp.h                           |   2 +-
 lib/librte_net/rte_ether.h                         | 182 ++++++------
 lib/librte_net/rte_gre.h                           |   2 +-
 lib/librte_net/rte_icmp.h                          |   6 +-
 lib/librte_net/rte_ip.h                            |  72 ++---
 lib/librte_net/rte_net.c                           |  94 +++---
 lib/librte_net/rte_net.h                           |  22 +-
 lib/librte_net/rte_sctp.h                          |   2 +-
 lib/librte_net/rte_tcp.h                           |   2 +-
 lib/librte_net/rte_udp.h                           |   2 +-
 lib/librte_pipeline/rte_table_action.c             | 224 +++++++-------
 lib/librte_pipeline/rte_table_action.h             |   4 +-
 lib/librte_port/rte_port_ras.c                     |   8 +-
 lib/librte_port/rte_port_source_sink.c             |   6 +-
 lib/librte_vhost/vhost.h                           |   2 +-
 lib/librte_vhost/virtio_net.c                      |  42 +--
 388 files changed, 4145 insertions(+), 4145 deletions(-)
Signature · 1 line
2.11.0
#37 lore raw

RFC v2 1/14 net: add rte prefix to arp structures

Add 'rte_' prefix to structures:
- rename struct arp_hdr as struct rte_arp_hdr.
- rename struct arp_ipv4 as struct rte_arp_ipv4.

Also rename arp_hrd, arp_pro, arp_hln, arp_pln and arp_op fields to avoid conflict with the #defines in gnu libc.

---
 app/test-pmd/icmpecho.c                 | 36 ++++++++++++++++-----------------
 app/test/packet_burst_generator.c       | 12 +++++------
 app/test/packet_burst_generator.h       |  2 +-
 app/test/test_link_bonding.c            | 28 ++++++++++++-------------
 drivers/net/bonding/rte_eth_bond_alb.c  | 26 ++++++++++++------------
 drivers/net/bonding/rte_eth_bond_pmd.c  | 16 +++++++--------
 drivers/net/i40e/base/i40e_adminq_cmd.h |  4 ++--
 drivers/net/i40e/base/i40e_common.c     | 12 +++++------
 drivers/net/i40e/base/i40e_prototype.h  |  4 ++--
 drivers/net/i40e/i40e_fdir.c            |  4 ++--
 drivers/net/iavf/base/iavf_adminq_cmd.h |  4 ++--
 drivers/net/iavf/base/iavf_common.c     | 12 +++++------
 drivers/net/iavf/base/iavf_prototype.h  |  4 ++--
 examples/bond/main.c                    | 24 +++++++++++-----------
 lib/librte_net/rte_arp.c                | 14 ++++++-------
 lib/librte_net/rte_arp.h                | 16 +++++++--------
 16 files changed, 109 insertions(+), 109 deletions(-)
app/test-pmd/icmpecho.c +18 -18
index 55d266d77..34f68d73b 100644
@@ -36,9 +36,9 @@
 #include "testpmd.h"
 
 static const char *
-arp_op_name(uint16_t arp_op)
+arp_opcode_name(uint16_t arp_opcode)
 {
-	switch (arp_op ) {
+	switch (arp_opcode ) {
 	case ARP_OP_REQUEST:
 		return "ARP Request";
 	case ARP_OP_REPLY:
@@ -277,7 +277,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
 	struct rte_mbuf *pkt;
 	struct ether_hdr *eth_h;
 	struct vlan_hdr *vlan_h;
-	struct arp_hdr  *arp_h;
+	struct rte_arp_hdr  *arp_h;
 	struct ipv4_hdr *ip_h;
 	struct icmp_hdr *icmp_h;
 	struct ether_addr eth_addr;
@@ -288,8 +288,8 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
 	uint16_t nb_replies;
 	uint16_t eth_type;
 	uint16_t vlan_id;
-	uint16_t arp_op;
-	uint16_t arp_pro;
+	uint16_t arp_opcode;
+	uint16_t arp_protocol;
 	uint32_t cksum;
 	uint8_t  i;
 	int l2_len;
@@ -347,22 +347,22 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
 
 		/* Reply to ARP requests */
 		if (eth_type == ETHER_TYPE_ARP) {
-			arp_h = (struct arp_hdr *) ((char *)eth_h + l2_len);
-			arp_op = RTE_BE_TO_CPU_16(arp_h->arp_op);
-			arp_pro = RTE_BE_TO_CPU_16(arp_h->arp_pro);
+			arp_h = (struct rte_arp_hdr *) ((char *)eth_h + l2_len);
+			arp_opcode = RTE_BE_TO_CPU_16(arp_h->arp_opcode);
+			arp_protocol = RTE_BE_TO_CPU_16(arp_h->arp_protocol);
 			if (verbose_level > 0) {
 				printf("  ARP:  hrd=%d proto=0x%04x hln=%d "
 				       "pln=%d op=%u (%s)\n",
-				       RTE_BE_TO_CPU_16(arp_h->arp_hrd),
-				       arp_pro, arp_h->arp_hln,
-				       arp_h->arp_pln, arp_op,
-				       arp_op_name(arp_op));
+				       RTE_BE_TO_CPU_16(arp_h->arp_hardware),
+				       arp_protocol, arp_h->arp_hlen,
+				       arp_h->arp_plen, arp_opcode,
+				       arp_opcode_name(arp_opcode));
 			}
-			if ((RTE_BE_TO_CPU_16(arp_h->arp_hrd) !=
+			if ((RTE_BE_TO_CPU_16(arp_h->arp_hardware) !=
 			     ARP_HRD_ETHER) ||
-			    (arp_pro != ETHER_TYPE_IPv4) ||
-			    (arp_h->arp_hln != 6) ||
-			    (arp_h->arp_pln != 4)
+			    (arp_protocol != ETHER_TYPE_IPv4) ||
+			    (arp_h->arp_hlen != 6) ||
+			    (arp_h->arp_plen != 4)
 			    ) {
 				rte_pktmbuf_free(pkt);
 				if (verbose_level > 0)
@@ -381,7 +381,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
 				ipv4_addr_dump(" tip=", ip_addr);
 				printf("\n");
 			}
-			if (arp_op != ARP_OP_REQUEST) {
+			if (arp_opcode != ARP_OP_REQUEST) {
 				rte_pktmbuf_free(pkt);
 				continue;
 			}
@@ -396,7 +396,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
 			ether_addr_copy(&ports[fs->tx_port].eth_addr,
 					&eth_h->s_addr);
 
-			arp_h->arp_op = rte_cpu_to_be_16(ARP_OP_REPLY);
+			arp_h->arp_opcode = rte_cpu_to_be_16(ARP_OP_REPLY);
 			ether_addr_copy(&arp_h->arp_data.arp_tha, &eth_addr);
 			ether_addr_copy(&arp_h->arp_data.arp_sha, &arp_h->arp_data.arp_tha);
 			ether_addr_copy(&eth_h->s_addr, &arp_h->arp_data.arp_sha);
app/test/packet_burst_generator.c +6 -6
index e894dc76f..0b12058bb 100644
@@ -74,15 +74,15 @@ initialize_eth_header(struct ether_hdr *eth_hdr, struct ether_addr *src_mac,
 }
 
 void
-initialize_arp_header(struct arp_hdr *arp_hdr, struct ether_addr *src_mac,
+initialize_arp_header(struct rte_arp_hdr *arp_hdr, struct ether_addr *src_mac,
 		struct ether_addr *dst_mac, uint32_t src_ip, uint32_t dst_ip,
 		uint32_t opcode)
 {
-	arp_hdr->arp_hrd = rte_cpu_to_be_16(ARP_HRD_ETHER);
-	arp_hdr->arp_pro = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
-	arp_hdr->arp_hln = ETHER_ADDR_LEN;
-	arp_hdr->arp_pln = sizeof(uint32_t);
-	arp_hdr->arp_op = rte_cpu_to_be_16(opcode);
+	arp_hdr->arp_hardware = rte_cpu_to_be_16(ARP_HRD_ETHER);
+	arp_hdr->arp_protocol = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
+	arp_hdr->arp_hlen = ETHER_ADDR_LEN;
+	arp_hdr->arp_plen = sizeof(uint32_t);
+	arp_hdr->arp_opcode = rte_cpu_to_be_16(opcode);
 	ether_addr_copy(src_mac, &arp_hdr->arp_data.arp_sha);
 	arp_hdr->arp_data.arp_sip = src_ip;
 	ether_addr_copy(dst_mac, &arp_hdr->arp_data.arp_tha);
app/test/packet_burst_generator.h +1 -1
index c20cea6e9..b6e013a11 100644
@@ -29,7 +29,7 @@ initialize_eth_header(struct ether_hdr *eth_hdr, struct ether_addr *src_mac,
 		uint8_t vlan_enabled, uint16_t van_id);
 
 void
-initialize_arp_header(struct arp_hdr *arp_hdr, struct ether_addr *src_mac,
+initialize_arp_header(struct rte_arp_hdr *arp_hdr, struct ether_addr *src_mac,
 		struct ether_addr *dst_mac, uint32_t src_ip, uint32_t dst_ip,
 		uint32_t opcode);
 
app/test/test_link_bonding.c +14 -14
index 0fe1d78eb..db437a9c2 100644
@@ -4460,7 +4460,7 @@ test_alb_change_mac_in_reply_sent(void)
 	struct rte_mbuf *pkts_sent[MAX_PKT_BURST];
 
 	struct ether_hdr *eth_pkt;
-	struct arp_hdr *arp_pkt;
+	struct rte_arp_hdr *arp_pkt;
 
 	int slave_idx, nb_pkts, pkt_idx;
 	int retval = 0;
@@ -4495,7 +4495,7 @@ test_alb_change_mac_in_reply_sent(void)
 	eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
 	initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
 			0);
-	arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+	arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 	initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client1,
 			ARP_OP_REPLY);
 	rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
@@ -4505,7 +4505,7 @@ test_alb_change_mac_in_reply_sent(void)
 	eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
 	initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
 			0);
-	arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+	arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 	initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client2,
 			ARP_OP_REPLY);
 	rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
@@ -4515,7 +4515,7 @@ test_alb_change_mac_in_reply_sent(void)
 	eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
 	initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
 			0);
-	arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+	arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 	initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client3,
 			ARP_OP_REPLY);
 	rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
@@ -4525,7 +4525,7 @@ test_alb_change_mac_in_reply_sent(void)
 	eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
 	initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
 			0);
-	arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+	arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 	initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client4,
 			ARP_OP_REPLY);
 	rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
@@ -4546,7 +4546,7 @@ test_alb_change_mac_in_reply_sent(void)
 
 		for (pkt_idx = 0; pkt_idx < nb_pkts; pkt_idx++) {
 			eth_pkt = rte_pktmbuf_mtod(pkts_sent[pkt_idx], struct ether_hdr *);
-			arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+			arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 
 			if (slave_idx%2 == 0) {
 				if (!is_same_ether_addr(slave_mac1, &arp_pkt->arp_data.arp_sha)) {
@@ -4571,7 +4571,7 @@ static int
 test_alb_reply_from_client(void)
 {
 	struct ether_hdr *eth_pkt;
-	struct arp_hdr *arp_pkt;
+	struct rte_arp_hdr *arp_pkt;
 
 	struct rte_mbuf *pkt;
 	struct rte_mbuf *pkts_sent[MAX_PKT_BURST];
@@ -4608,7 +4608,7 @@ test_alb_reply_from_client(void)
 	eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
 	initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
 			0);
-	arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+	arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 	initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client1, ip_host,
 			ARP_OP_REPLY);
 	virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
@@ -4619,7 +4619,7 @@ test_alb_reply_from_client(void)
 	eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
 	initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
 			0);
-	arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+	arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 	initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client2, ip_host,
 			ARP_OP_REPLY);
 	virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
@@ -4630,7 +4630,7 @@ test_alb_reply_from_client(void)
 	eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
 	initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
 			0);
-	arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+	arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 	initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client3, ip_host,
 			ARP_OP_REPLY);
 	virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
@@ -4641,7 +4641,7 @@ test_alb_reply_from_client(void)
 	eth_pkt = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
 	initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
 			0);
-	arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+	arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 	initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client4, ip_host,
 			ARP_OP_REPLY);
 	virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
@@ -4667,7 +4667,7 @@ test_alb_reply_from_client(void)
 
 		for (pkt_idx = 0; pkt_idx < nb_pkts; pkt_idx++) {
 			eth_pkt = rte_pktmbuf_mtod(pkts_sent[pkt_idx], struct ether_hdr *);
-			arp_pkt = (struct arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
+			arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 
 			if (slave_idx%2 == 0) {
 				if (!is_same_ether_addr(slave_mac1, &arp_pkt->arp_data.arp_sha)) {
@@ -4699,7 +4699,7 @@ test_alb_receive_vlan_reply(void)
 {
 	struct ether_hdr *eth_pkt;
 	struct vlan_hdr *vlan_pkt;
-	struct arp_hdr *arp_pkt;
+	struct rte_arp_hdr *arp_pkt;
 
 	struct rte_mbuf *pkt;
 	struct rte_mbuf *pkts_sent[MAX_PKT_BURST];
@@ -4740,7 +4740,7 @@ test_alb_receive_vlan_reply(void)
 	vlan_pkt = vlan_pkt+1;
 	vlan_pkt->vlan_tci = rte_cpu_to_be_16(2);
 	vlan_pkt->eth_proto = rte_cpu_to_be_16(ETHER_TYPE_ARP);
-	arp_pkt = (struct arp_hdr *)((char *)(vlan_pkt + 1));
+	arp_pkt = (struct rte_arp_hdr *)((char *)(vlan_pkt + 1));
 	initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client1, ip_host,
 			ARP_OP_REPLY);
 	virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
drivers/net/bonding/rte_eth_bond_alb.c +13 -13
index d3e16d4bd..16a415a99 100644
@@ -74,17 +74,17 @@ bond_mode_alb_enable(struct rte_eth_dev *bond_dev)
 
 void bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset,
 		struct bond_dev_private *internals) {
-	struct arp_hdr *arp;
+	struct rte_arp_hdr *arp;
 
 	struct client_data *hash_table = internals->mode6.client_table;
 	struct client_data *client_info;
 
 	uint8_t hash_index;
 
-	arp = (struct arp_hdr *) ((char *) (eth_h + 1) + offset);
+	arp = (struct rte_arp_hdr *) ((char *) (eth_h + 1) + offset);
 
 	/* ARP Requests are forwarded to the application with no changes */
-	if (arp->arp_op != rte_cpu_to_be_16(ARP_OP_REPLY))
+	if (arp->arp_opcode != rte_cpu_to_be_16(ARP_OP_REPLY))
 		return;
 
 	/* From now on, we analyze only ARP Reply packets */
@@ -123,7 +123,7 @@ uint16_t
 bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset,
 		struct bond_dev_private *internals)
 {
-	struct arp_hdr *arp;
+	struct rte_arp_hdr *arp;
 
 	struct client_data *hash_table = internals->mode6.client_table;
 	struct client_data *client_info;
@@ -132,7 +132,7 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset,
 
 	struct ether_addr bonding_mac;
 
-	arp = (struct arp_hdr *)((char *)(eth_h + 1) + offset);
+	arp = (struct rte_arp_hdr *)((char *)(eth_h + 1) + offset);
 
 	/*
 	 * Traffic with src MAC other than bonding should be sent on
@@ -150,7 +150,7 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset,
 	client_info = &hash_table[hash_index];
 
 	rte_spinlock_lock(&internals->mode6.lock);
-	if (arp->arp_op == rte_cpu_to_be_16(ARP_OP_REPLY)) {
+	if (arp->arp_opcode == rte_cpu_to_be_16(ARP_OP_REPLY)) {
 		if (client_info->in_use) {
 			if (client_info->app_ip == arp->arp_data.arp_sip &&
 				client_info->cli_ip == arp->arp_data.arp_tip) {
@@ -196,7 +196,7 @@ bond_mode_alb_arp_upd(struct client_data *client_info,
 		struct rte_mbuf *pkt, struct bond_dev_private *internals)
 {
 	struct ether_hdr *eth_h;
-	struct arp_hdr *arp_h;
+	struct rte_arp_hdr *arp_h;
 	uint16_t slave_idx;
 
 	rte_spinlock_lock(&internals->mode6.lock);
@@ -209,7 +209,7 @@ bond_mode_alb_arp_upd(struct client_data *client_info,
 	else
 		eth_h->ether_type = rte_cpu_to_be_16(ETHER_TYPE_ARP);
 
-	arp_h = (struct arp_hdr *)((char *)eth_h + sizeof(struct ether_hdr)
+	arp_h = (struct rte_arp_hdr *)((char *)eth_h + sizeof(struct ether_hdr)
 			+ client_info->vlan_count * sizeof(struct vlan_hdr));
 
 	memcpy(eth_h + 1, client_info->vlan,
@@ -220,11 +220,11 @@ bond_mode_alb_arp_upd(struct client_data *client_info,
 	ether_addr_copy(&client_info->cli_mac, &arp_h->arp_data.arp_tha);
 	arp_h->arp_data.arp_tip = client_info->cli_ip;
 
-	arp_h->arp_hrd = rte_cpu_to_be_16(ARP_HRD_ETHER);
-	arp_h->arp_pro = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
-	arp_h->arp_hln = ETHER_ADDR_LEN;
-	arp_h->arp_pln = sizeof(uint32_t);
-	arp_h->arp_op = rte_cpu_to_be_16(ARP_OP_REPLY);
+	arp_h->arp_hardware = rte_cpu_to_be_16(ARP_HRD_ETHER);
+	arp_h->arp_protocol = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
+	arp_h->arp_hlen = ETHER_ADDR_LEN;
+	arp_h->arp_plen = sizeof(uint32_t);
+	arp_h->arp_opcode = rte_cpu_to_be_16(ARP_OP_REPLY);
 
 	slave_idx = client_info->slave_idx;
 	rte_spinlock_unlock(&internals->mode6.lock);
drivers/net/bonding/rte_eth_bond_pmd.c +8 -8
index f30422a6d..9c5425ef5 100644
@@ -489,9 +489,9 @@ uint32_t burstnumberTX;
 #ifdef RTE_LIBRTE_BOND_DEBUG_ALB
 
 static void
-arp_op_name(uint16_t arp_op, char *buf, size_t buf_len)
+arp_opcode_name(uint16_t arp_opcode, char *buf, size_t buf_len)
 {
-	switch (arp_op) {
+	switch (arp_opcode) {
 	case ARP_OP_REQUEST:
 		strlcpy(buf, "ARP Request", buf_len);
 		return;
@@ -566,7 +566,7 @@ update_client_stats(uint32_t addr, uint16_t port, uint32_t *TXorRXindicator)
 }
 
 #ifdef RTE_LIBRTE_BOND_DEBUG_ALB
-#define MODE6_DEBUG(info, src_ip, dst_ip, eth_h, arp_op, port, burstnumber) \
+#define MODE6_DEBUG(info, src_ip, dst_ip, eth_h, arp_opcode, port, burstnumber) \
 	rte_log(RTE_LOG_DEBUG, bond_logtype,				\
 		"%s port:%d SrcMAC:%02X:%02X:%02X:%02X:%02X:%02X SrcIP:%s " \
 		"DstMAC:%02X:%02X:%02X:%02X:%02X:%02X DstIP:%s %s %d\n", \
@@ -580,7 +580,7 @@ update_client_stats(uint32_t addr, uint16_t port, uint32_t *TXorRXindicator)
 		eth_h->d_addr.addr_bytes[2], eth_h->d_addr.addr_bytes[3], \
 		eth_h->d_addr.addr_bytes[4], eth_h->d_addr.addr_bytes[5], \
 		dst_ip,							\
-		arp_op, ++burstnumber)
+		arp_opcode, ++burstnumber)
 #endif
 
 static void
@@ -589,7 +589,7 @@ mode6_debug(const char __attribute__((unused)) *info, struct ether_hdr *eth_h,
 {
 	struct ipv4_hdr *ipv4_h;
 #ifdef RTE_LIBRTE_BOND_DEBUG_ALB
-	struct arp_hdr *arp_h;
+	struct rte_arp_hdr *arp_h;
 	char dst_ip[16];
 	char ArpOp[24];
 	char buf[16];
@@ -614,10 +614,10 @@ mode6_debug(const char __attribute__((unused)) *info, struct ether_hdr *eth_h,
 	}
 #ifdef RTE_LIBRTE_BOND_DEBUG_ALB
 	else if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_ARP)) {
-		arp_h = (struct arp_hdr *)((char *)(eth_h + 1) + offset);
+		arp_h = (struct rte_arp_hdr *)((char *)(eth_h + 1) + offset);
 		ipv4_addr_to_dot(arp_h->arp_data.arp_sip, src_ip, MaxIPv4String);
 		ipv4_addr_to_dot(arp_h->arp_data.arp_tip, dst_ip, MaxIPv4String);
-		arp_op_name(rte_be_to_cpu_16(arp_h->arp_op),
+		arp_opcode_name(rte_be_to_cpu_16(arp_h->arp_opcode),
 				ArpOp, sizeof(ArpOp));
 		MODE6_DEBUG(buf, src_ip, dst_ip, eth_h, ArpOp, port, *burstnumber);
 	}
@@ -1127,7 +1127,7 @@ bond_ethdev_tx_burst_alb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 						     "Failed to allocate ARP packet from pool");
 					continue;
 				}
-				pkt_size = sizeof(struct ether_hdr) + sizeof(struct arp_hdr)
+				pkt_size = sizeof(struct ether_hdr) + sizeof(struct rte_arp_hdr)
 						+ client_info->vlan_count * sizeof(struct vlan_hdr);
 				upd_pkt->data_len = pkt_size;
 				upd_pkt->pkt_len = pkt_size;
drivers/net/i40e/base/i40e_adminq_cmd.h +2 -2
index cf6ef63e3..f988e74c6 100644
@@ -458,7 +458,7 @@ struct i40e_aqc_cppm_configuration {
 I40E_CHECK_CMD_LENGTH(i40e_aqc_cppm_configuration);
 
 /* Set ARP Proxy command / response (indirect 0x0104) */
-struct i40e_aqc_arp_proxy_data {
+struct i40e_aqc_arp_protocolxy_data {
 	__le16	command_flags;
 #define I40E_AQ_ARP_INIT_IPV4	0x0800
 #define I40E_AQ_ARP_UNSUP_CTL	0x1000
@@ -474,7 +474,7 @@ struct i40e_aqc_arp_proxy_data {
 	u8	reserved[2];
 };
 
-I40E_CHECK_STRUCT_LEN(0x14, i40e_aqc_arp_proxy_data);
+I40E_CHECK_STRUCT_LEN(0x14, i40e_aqc_arp_protocolxy_data);
 
 /* Set NS Proxy Table Entry Command (indirect 0x0105) */
 struct i40e_aqc_ns_proxy_data {
drivers/net/i40e/base/i40e_common.c +6 -6
index 8a98afff1..875b8f8ad 100644
@@ -7301,16 +7301,16 @@ enum i40e_status_code i40e_vf_reset(struct i40e_hw *hw)
 #endif /* VF_DRIVER */
 
 /**
- * i40e_aq_set_arp_proxy_config
+ * i40e_aq_set_arp_protocolxy_config
  * @hw: pointer to the HW structure
  * @proxy_config: pointer to proxy config command table struct
  * @cmd_details: pointer to command details
  *
  * Set ARP offload parameters from pre-populated
- * i40e_aqc_arp_proxy_data struct
+ * i40e_aqc_arp_protocolxy_data struct
  **/
-enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw,
-				struct i40e_aqc_arp_proxy_data *proxy_config,
+enum i40e_status_code i40e_aq_set_arp_protocolxy_config(struct i40e_hw *hw,
+				struct i40e_aqc_arp_protocolxy_data *proxy_config,
 				struct i40e_asq_cmd_details *cmd_details)
 {
 	struct i40e_aq_desc desc;
@@ -7327,10 +7327,10 @@ enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw,
 				  CPU_TO_LE32(I40E_HI_DWORD((u64)proxy_config));
 	desc.params.external.addr_low =
 				  CPU_TO_LE32(I40E_LO_DWORD((u64)proxy_config));
-	desc.datalen = CPU_TO_LE16(sizeof(struct i40e_aqc_arp_proxy_data));
+	desc.datalen = CPU_TO_LE16(sizeof(struct i40e_aqc_arp_protocolxy_data));
 
 	status = i40e_asq_send_command(hw, &desc, proxy_config,
-				       sizeof(struct i40e_aqc_arp_proxy_data),
+				       sizeof(struct i40e_aqc_arp_protocolxy_data),
 				       cmd_details);
 
 	return status;
drivers/net/i40e/base/i40e_prototype.h +2 -2
index 0cf006dad..28f80178b 100644
@@ -556,8 +556,8 @@ enum i40e_status_code i40e_aq_get_phy_register(struct i40e_hw *hw,
 				u32 reg_addr, u32 *reg_val,
 				struct i40e_asq_cmd_details *cmd_details);
 
-enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw,
-			struct i40e_aqc_arp_proxy_data *proxy_config,
+enum i40e_status_code i40e_aq_set_arp_protocolxy_config(struct i40e_hw *hw,
+			struct i40e_aqc_arp_protocolxy_data *proxy_config,
 			struct i40e_asq_cmd_details *cmd_details);
 enum i40e_status_code i40e_aq_set_ns_proxy_table_entry(struct i40e_hw *hw,
 			struct i40e_aqc_ns_proxy_data *ns_proxy_table_entry,
drivers/net/i40e/i40e_fdir.c +2 -2
index d41601a17..4b32fee1e 100644
@@ -911,7 +911,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf,
 		 */
 		if (fdir_input->flow.l2_flow.ether_type ==
 				rte_cpu_to_be_16(ETHER_TYPE_ARP))
-			payload += sizeof(struct arp_hdr);
+			payload += sizeof(struct rte_arp_hdr);
 		set_idx = I40E_FLXPLD_L2_IDX;
 		break;
 	default:
@@ -1197,7 +1197,7 @@ i40e_flow_fdir_construct_pkt(struct i40e_pf *pf,
 		 */
 		if (fdir_input->flow.l2_flow.ether_type ==
 				rte_cpu_to_be_16(ETHER_TYPE_ARP))
-			payload += sizeof(struct arp_hdr);
+			payload += sizeof(struct rte_arp_hdr);
 		set_idx = I40E_FLXPLD_L2_IDX;
 	} else if (fdir_input->flow_ext.customized_pctype) {
 		/* If customized pctype is used */
drivers/net/iavf/base/iavf_adminq_cmd.h +2 -2
index 353feb3da..295771f94 100644
@@ -488,7 +488,7 @@ struct iavf_aqc_cppm_configuration {
 IAVF_CHECK_CMD_LENGTH(iavf_aqc_cppm_configuration);
 
 /* Set ARP Proxy command / response (indirect 0x0104) */
-struct iavf_aqc_arp_proxy_data {
+struct iavf_aqc_arp_protocolxy_data {
 	__le16	command_flags;
 #define IAVF_AQ_ARP_INIT_IPV4	0x0800
 #define IAVF_AQ_ARP_UNSUP_CTL	0x1000
@@ -504,7 +504,7 @@ struct iavf_aqc_arp_proxy_data {
 	u8	reserved[2];
 };
 
-IAVF_CHECK_STRUCT_LEN(0x14, iavf_aqc_arp_proxy_data);
+IAVF_CHECK_STRUCT_LEN(0x14, iavf_aqc_arp_protocolxy_data);
 
 /* Set NS Proxy Table Entry Command (indirect 0x0105) */
 struct iavf_aqc_ns_proxy_data {
drivers/net/iavf/base/iavf_common.c +6 -6
index be700dde2..e186bfdee 100644
@@ -1236,16 +1236,16 @@ enum iavf_status_code iavf_reset(struct iavf_hw *hw)
 }
 
 /**
- * iavf_aq_set_arp_proxy_config
+ * iavf_aq_set_arp_protocolxy_config
  * @hw: pointer to the HW structure
  * @proxy_config: pointer to proxy config command table struct
  * @cmd_details: pointer to command details
  *
  * Set ARP offload parameters from pre-populated
- * iavf_aqc_arp_proxy_data struct
+ * iavf_aqc_arp_protocolxy_data struct
  **/
-enum iavf_status_code iavf_aq_set_arp_proxy_config(struct iavf_hw *hw,
-				struct iavf_aqc_arp_proxy_data *proxy_config,
+enum iavf_status_code iavf_aq_set_arp_protocolxy_config(struct iavf_hw *hw,
+				struct iavf_aqc_arp_protocolxy_data *proxy_config,
 				struct iavf_asq_cmd_details *cmd_details)
 {
 	struct iavf_aq_desc desc;
@@ -1262,10 +1262,10 @@ enum iavf_status_code iavf_aq_set_arp_proxy_config(struct iavf_hw *hw,
 				  CPU_TO_LE32(IAVF_HI_DWORD((u64)proxy_config));
 	desc.params.external.addr_low =
 				  CPU_TO_LE32(IAVF_LO_DWORD((u64)proxy_config));
-	desc.datalen = CPU_TO_LE16(sizeof(struct iavf_aqc_arp_proxy_data));
+	desc.datalen = CPU_TO_LE16(sizeof(struct iavf_aqc_arp_protocolxy_data));
 
 	status = iavf_asq_send_command(hw, &desc, proxy_config,
-				       sizeof(struct iavf_aqc_arp_proxy_data),
+				       sizeof(struct iavf_aqc_arp_protocolxy_data),
 				       cmd_details);
 
 	return status;
drivers/net/iavf/base/iavf_prototype.h +2 -2
index 35122aedb..2cbb9072f 100644
@@ -146,8 +146,8 @@ enum iavf_status_code iavf_aq_get_phy_register(struct iavf_hw *hw,
 				u32 reg_addr, u32 *reg_val,
 				struct iavf_asq_cmd_details *cmd_details);
 
-enum iavf_status_code iavf_aq_set_arp_proxy_config(struct iavf_hw *hw,
-			struct iavf_aqc_arp_proxy_data *proxy_config,
+enum iavf_status_code iavf_aq_set_arp_protocolxy_config(struct iavf_hw *hw,
+			struct iavf_aqc_arp_protocolxy_data *proxy_config,
 			struct iavf_asq_cmd_details *cmd_details);
 enum iavf_status_code iavf_aq_set_ns_proxy_table_entry(struct iavf_hw *hw,
 			struct iavf_aqc_ns_proxy_data *ns_proxy_table_entry,
examples/bond/main.c +12 -12
index ef86194ff..4ad62c3cb 100644
@@ -339,7 +339,7 @@ static int lcore_main(__attribute__((unused)) void *arg1)
 	struct ether_addr d_addr;
 
 	struct ether_hdr *eth_hdr;
-	struct arp_hdr *arp_hdr;
+	struct rte_arp_hdr *arp_hdr;
 	struct ipv4_hdr *ipv4_hdr;
 	uint16_t ether_type, offset;
 
@@ -382,10 +382,10 @@ static int lcore_main(__attribute__((unused)) void *arg1)
 					global_flag_stru_p->port_packets[1]++;
 					rte_spinlock_unlock(&global_flag_stru_p->lock);
 				}
-				arp_hdr = (struct arp_hdr *)((char *)(eth_hdr + 1) + offset);
+				arp_hdr = (struct rte_arp_hdr *)((char *)(eth_hdr + 1) + offset);
 				if (arp_hdr->arp_data.arp_tip == bond_ip) {
-					if (arp_hdr->arp_op == rte_cpu_to_be_16(ARP_OP_REQUEST)) {
-						arp_hdr->arp_op = rte_cpu_to_be_16(ARP_OP_REPLY);
+					if (arp_hdr->arp_opcode == rte_cpu_to_be_16(ARP_OP_REQUEST)) {
+						arp_hdr->arp_opcode = rte_cpu_to_be_16(ARP_OP_REPLY);
 						/* Switch src and dst data and set bonding MAC */
 						ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
 						rte_eth_macaddr_get(BOND_PORT, &eth_hdr->s_addr);
@@ -450,7 +450,7 @@ static void cmd_obj_send_parsed(void *parsed_result,
 
 	struct rte_mbuf *created_pkt;
 	struct ether_hdr *eth_hdr;
-	struct arp_hdr *arp_hdr;
+	struct rte_arp_hdr *arp_hdr;
 
 	uint32_t bond_ip;
 	size_t pkt_size;
@@ -469,7 +469,7 @@ static void cmd_obj_send_parsed(void *parsed_result,
 		return;
 	}
 
-	pkt_size = sizeof(struct ether_hdr) + sizeof(struct arp_hdr);
+	pkt_size = sizeof(struct ether_hdr) + sizeof(struct rte_arp_hdr);
 	created_pkt->data_len = pkt_size;
 	created_pkt->pkt_len = pkt_size;
 
@@ -478,12 +478,12 @@ static void cmd_obj_send_parsed(void *parsed_result,
 	memset(&eth_hdr->d_addr, 0xFF, ETHER_ADDR_LEN);
 	eth_hdr->ether_type = rte_cpu_to_be_16(ETHER_TYPE_ARP);
 
-	arp_hdr = (struct arp_hdr *)((char *)eth_hdr + sizeof(struct ether_hdr));
-	arp_hdr->arp_hrd = rte_cpu_to_be_16(ARP_HRD_ETHER);
-	arp_hdr->arp_pro = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
-	arp_hdr->arp_hln = ETHER_ADDR_LEN;
-	arp_hdr->arp_pln = sizeof(uint32_t);
-	arp_hdr->arp_op = rte_cpu_to_be_16(ARP_OP_REQUEST);
+	arp_hdr = (struct rte_arp_hdr *)((char *)eth_hdr + sizeof(struct ether_hdr));
+	arp_hdr->arp_hardware = rte_cpu_to_be_16(ARP_HRD_ETHER);
+	arp_hdr->arp_protocol = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
+	arp_hdr->arp_hlen = ETHER_ADDR_LEN;
+	arp_hdr->arp_plen = sizeof(uint32_t);
+	arp_hdr->arp_opcode = rte_cpu_to_be_16(ARP_OP_REQUEST);
 
 	rte_eth_macaddr_get(BOND_PORT, &arp_hdr->arp_data.arp_sha);
 	arp_hdr->arp_data.arp_sip = bond_ip;
lib/librte_net/rte_arp.c +7 -7
index f0ed9bd68..c80ebc7e1 100644
@@ -12,7 +12,7 @@ rte_net_make_rarp_packet(struct rte_mempool *mpool,
 		const struct ether_addr *mac)
 {
 	struct ether_hdr *eth_hdr;
-	struct arp_hdr *rarp;
+	struct rte_arp_hdr *rarp;
 	struct rte_mbuf *mbuf;
 
 	if (mpool == NULL)
@@ -34,12 +34,12 @@ rte_net_make_rarp_packet(struct rte_mempool *mpool,
 	eth_hdr->ether_type = htons(ETHER_TYPE_RARP);
 
 	/* RARP header. */
-	rarp = (struct arp_hdr *)(eth_hdr + 1);
-	rarp->arp_hrd = htons(ARP_HRD_ETHER);
-	rarp->arp_pro = htons(ETHER_TYPE_IPv4);
-	rarp->arp_hln = ETHER_ADDR_LEN;
-	rarp->arp_pln = 4;
-	rarp->arp_op  = htons(ARP_OP_REVREQUEST);
+	rarp = (struct rte_arp_hdr *)(eth_hdr + 1);
+	rarp->arp_hardware = htons(ARP_HRD_ETHER);
+	rarp->arp_protocol = htons(ETHER_TYPE_IPv4);
+	rarp->arp_hlen = ETHER_ADDR_LEN;
+	rarp->arp_plen = 4;
+	rarp->arp_opcode  = htons(ARP_OP_REVREQUEST);
 
 	ether_addr_copy(mac, &rarp->arp_data.arp_sha);
 	ether_addr_copy(mac, &rarp->arp_data.arp_tha);
lib/librte_net/rte_arp.h +8 -8
index 139a84ca5..c9b5cd49d 100644
@@ -21,7 +21,7 @@ extern "C" {
 /**
  * ARP header IPv4 payload.
  */
-struct arp_ipv4 {
+struct rte_arp_ipv4 {
 	struct ether_addr arp_sha;  /**< sender hardware address */
 	uint32_t          arp_sip;  /**< sender IP address */
 	struct ether_addr arp_tha;  /**< target hardware address */
@@ -31,14 +31,14 @@ struct arp_ipv4 {
 /**
  * ARP header.
  */
-struct arp_hdr {
-	uint16_t arp_hrd;    /* format of hardware address */
+struct rte_arp_hdr {
+	uint16_t arp_hardware;    /* format of hardware address */
 #define ARP_HRD_ETHER     1  /* ARP Ethernet address format */
 
-	uint16_t arp_pro;    /* format of protocol address */
-	uint8_t  arp_hln;    /* length of hardware address */
-	uint8_t  arp_pln;    /* length of protocol address */
-	uint16_t arp_op;     /* ARP opcode (command) */
+	uint16_t arp_protocol;    /* format of protocol address */
+	uint8_t  arp_hlen;    /* length of hardware address */
+	uint8_t  arp_plen;    /* length of protocol address */
+	uint16_t arp_opcode;     /* ARP opcode (command) */
 #define	ARP_OP_REQUEST    1 /* request to resolve address */
 #define	ARP_OP_REPLY      2 /* response to previous request */
 #define	ARP_OP_REVREQUEST 3 /* request proto addr given hardware */
@@ -46,7 +46,7 @@ struct arp_hdr {
 #define	ARP_OP_INVREQUEST 8 /* request to identify peer */
 #define	ARP_OP_INVREPLY   9 /* response identifying peer */
 
-	struct arp_ipv4 arp_data;
+	struct rte_arp_ipv4 arp_data;
 } __attribute__((__packed__));
 
 /**
Signature · 1 line
2.11.0
#38 lore raw

Re: [dpdk-dev] [RFC v2 01/14] net: add rte prefix to arp structures

Quoted 8 lines · On Wed, 10 Apr 2019 10:32:05 +0200 Olivier Matz <[email protected]> wrote:

Add 'rte_' prefix to structures:
- rename struct arp_hdr as struct rte_arp_hdr.
- rename struct arp_ipv4 as struct rte_arp_ipv4.

Also rename arp_hrd, arp_pro, arp_hln, arp_pln and arp_op fields to avoid conflict with the #defines in gnu libc.

Agree that adding prefix is best way to handle rte_arp.h.

Could you fix up all the checkpatch whitespace warnings on this and resubmit it as a PATCH (not RFC)?

#39 lore raw

Re: [dpdk-dev] [RFC v2 01/14] net: add rte prefix to arp structures

Hi Stephen,

Quoted 10 lines · Stephen Hemminger
Quoted 7 lines · On Wed, 10 Apr 2019 10:32:05 +0200 Olivier Matz <[email protected]> wrote:

Add 'rte_' prefix to structures:
- rename struct arp_hdr as struct rte_arp_hdr.
- rename struct arp_ipv4 as struct rte_arp_ipv4.

Also rename arp_hrd, arp_pro, arp_hln, arp_pln and arp_op fields to avoid conflict with the #defines in gnu libc.

Quoted 6 lines
Quoted 1 line

Agree that adding prefix is best way to handle rte_arp.h.

Could you fix up all the checkpatch whitespace warnings on this and resubmit it as a PATCH (not RFC)?

I don't think fixing all whitespace warnings in the patchset is a good thing. It's not new code, and only fixing the parts I'm modifying may result in style inconsistency.

I'll have a look on a case by case basis.

Thanks
Olivier

#40 lore raw

Re: [dpdk-dev] [RFC v2 01/14] net: add rte prefix to arp structures

In reply to Olivier Matz

drivers/net/bonding/rte_eth_bond_pmd.c update_cli

Quoted 17 lines · On Wed, 10 Apr 2019 10:32:05 +0200 Olivier Matz <[email protected]> wrote:
drivers/net/bonding/rte_eth_bond_pmd.c +2 -2
index f30422a6d..9c5425ef5 100644
@@ -489,9 +489,9 @@ uint32_t burstnumberTX;
 #ifdef RTE_LIBRTE_BOND_DEBUG_ALB
 
 static void
-arp_op_name(uint16_t arp_op, char *buf, size_t buf_len)
+arp_opcode_name(uint16_t arp_opcode, char *buf, size_t buf_len)
 {
-	switch (arp_op) {
+	switch (arp_opcode) {
 	case ARP_OP_REQUEST:
 		strlcpy(buf, "ARP Request", buf_len);
 		return;
@@ -566,7 +566,7 @@ update_cli

This is an internal function, why did it have to be renamed?

drivers/net/i40e/base/i40e_adminq_cmd.h struct i40e_aqc_cppm_configuration { · line 462

Quoted 11 lines
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -1
index cf6ef63e3..f988e74c6 100644
@@ -458,7 +458,7 @@ struct i40e_aqc_cppm_configuration {
 I40E_CHECK_CMD_LENGTH(i40e_aqc_cppm_configuration);
 
 /* Set ARP Proxy command / response (indirect 0x0104) */
-struct i40e_aqc_arp_proxy_data {
+struct i40e_aqc_arp_protocolxy_data {
 	__le16	command_flags;

Don't change private data or function names in base code.

#41 lore raw

Re: [dpdk-dev] [RFC v2 01/14] net: add rte prefix to arp structures

Quoted 10 lines · Stephen Hemminger
Quoted 7 lines · On Wed, 10 Apr 2019 10:32:05 +0200 Olivier Matz <[email protected]> wrote:
drivers/net/bonding/rte_eth_bond_pmd.c +0 -0
index f30422a6d..9c5425ef5 100644
@@ -489,9 +489,9 @@ uint32_t burstnumberTX;
 #ifdef RTE_LIBRTE_BOND_DEBUG_ALB
 
Quoted 12 lines

drivers/net/bonding/rte_eth_bond_pmd.c update_cli

Quoted 10 lines
drivers/net/bonding/rte_eth_bond_pmd.c +2 -2
 static void
-arp_op_name(uint16_t arp_op, char *buf, size_t buf_len)
+arp_opcode_name(uint16_t arp_opcode, char *buf, size_t buf_len)
 {
-	switch (arp_op) {
+	switch (arp_opcode) {
 	case ARP_OP_REQUEST:
 		strlcpy(buf, "ARP Request", buf_len);
 		return;
@@ -566,7 +566,7 @@ update_cli

This is an internal function, why did it have to be renamed?

This is a mistake, thanks.

Quoted 8 lines
Quoted 8 lines
drivers/net/i40e/base/i40e_adminq_cmd.h +0 -0
index cf6ef63e3..f988e74c6 100644
@@ -458,7 +458,7 @@ struct i40e_aqc_cppm_configuration {
 I40E_CHECK_CMD_LENGTH(i40e_aqc_cppm_configuration);
 
Quoted 6 lines

drivers/net/i40e/base/i40e_adminq_cmd.h struct i40e_aqc_cppm_configuration { · line 462

Quoted 4 lines
drivers/net/i40e/base/i40e_adminq_cmd.h +1 -1
 /* Set ARP Proxy command / response (indirect 0x0104) */
-struct i40e_aqc_arp_proxy_data {
+struct i40e_aqc_arp_protocolxy_data {
 	__le16	command_flags;

Don't change private data or function names in base code.

Right, I'll fix that too.

Thanks

#42 lore raw

RFC v2 2/14 net: add rte prefix to arp defines

In reply to Olivier Matz

Add 'RTE_' prefix to defines:
- rename ARP_HRD_ETHER as RTE_ARP_HRD_ETHER.
- rename ARP_OP_REQUEST as RTE_ARP_OP_REQUEST.
- rename ARP_OP_REPLY as RTE_ARP_OP_REPLY.
- rename ARP_OP_REVREQUEST as RTE_ARP_OP_REVREQUEST.
- rename ARP_OP_REVREPLY as RTE_ARP_OP_REVREPLY.
- rename ARP_OP_INVREQUEST as RTE_ARP_OP_INVREQUEST.
- rename ARP_OP_INVREPLY as RTE_ARP_OP_INVREPLY.

---
 app/test-pmd/icmpecho.c                | 18 +++++++++---------
 app/test/packet_burst_generator.c      |  2 +-
 app/test/test_link_bonding.c           | 18 +++++++++---------
 drivers/net/bonding/rte_eth_bond_alb.c |  8 ++++----
 drivers/net/bonding/rte_eth_bond_pmd.c | 12 ++++++------
 examples/bond/main.c                   |  8 ++++----
 lib/librte_net/rte_arp.c               |  4 ++--
 lib/librte_net/rte_arp.h               | 14 +++++++-------
 8 files changed, 42 insertions(+), 42 deletions(-)
app/test-pmd/icmpecho.c +9 -9
index 34f68d73b..062e3ea43 100644
@@ -39,17 +39,17 @@ static const char *
 arp_opcode_name(uint16_t arp_opcode)
 {
 	switch (arp_opcode ) {
-	case ARP_OP_REQUEST:
+	case RTE_ARP_OP_REQUEST:
 		return "ARP Request";
-	case ARP_OP_REPLY:
+	case RTE_ARP_OP_REPLY:
 		return "ARP Reply";
-	case ARP_OP_REVREQUEST:
+	case RTE_ARP_OP_REVREQUEST:
 		return "Reverse ARP Request";
-	case ARP_OP_REVREPLY:
+	case RTE_ARP_OP_REVREPLY:
 		return "Reverse ARP Reply";
-	case ARP_OP_INVREQUEST:
+	case RTE_ARP_OP_INVREQUEST:
 		return "Peer Identify Request";
-	case ARP_OP_INVREPLY:
+	case RTE_ARP_OP_INVREPLY:
 		return "Peer Identify Reply";
 	default:
 		break;
@@ -359,7 +359,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
 				       arp_opcode_name(arp_opcode));
 			}
 			if ((RTE_BE_TO_CPU_16(arp_h->arp_hardware) !=
-			     ARP_HRD_ETHER) ||
+			     RTE_ARP_HRD_ETHER) ||
 			    (arp_protocol != ETHER_TYPE_IPv4) ||
 			    (arp_h->arp_hlen != 6) ||
 			    (arp_h->arp_plen != 4)
@@ -381,7 +381,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
 				ipv4_addr_dump(" tip=", ip_addr);
 				printf("\n");
 			}
-			if (arp_opcode != ARP_OP_REQUEST) {
+			if (arp_opcode != RTE_ARP_OP_REQUEST) {
 				rte_pktmbuf_free(pkt);
 				continue;
 			}
@@ -396,7 +396,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
 			ether_addr_copy(&ports[fs->tx_port].eth_addr,
 					&eth_h->s_addr);
 
-			arp_h->arp_opcode = rte_cpu_to_be_16(ARP_OP_REPLY);
+			arp_h->arp_opcode = rte_cpu_to_be_16(RTE_ARP_OP_REPLY);
 			ether_addr_copy(&arp_h->arp_data.arp_tha, &eth_addr);
 			ether_addr_copy(&arp_h->arp_data.arp_sha, &arp_h->arp_data.arp_tha);
 			ether_addr_copy(&eth_h->s_addr, &arp_h->arp_data.arp_sha);
app/test/packet_burst_generator.c +1 -1
index 0b12058bb..ccc0bd591 100644
@@ -78,7 +78,7 @@ initialize_arp_header(struct rte_arp_hdr *arp_hdr, struct ether_addr *src_mac,
 		struct ether_addr *dst_mac, uint32_t src_ip, uint32_t dst_ip,
 		uint32_t opcode)
 {
-	arp_hdr->arp_hardware = rte_cpu_to_be_16(ARP_HRD_ETHER);
+	arp_hdr->arp_hardware = rte_cpu_to_be_16(RTE_ARP_HRD_ETHER);
 	arp_hdr->arp_protocol = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
 	arp_hdr->arp_hlen = ETHER_ADDR_LEN;
 	arp_hdr->arp_plen = sizeof(uint32_t);
app/test/test_link_bonding.c +9 -9
index db437a9c2..2c20f44ea 100644
@@ -4497,7 +4497,7 @@ test_alb_change_mac_in_reply_sent(void)
 			0);
 	arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 	initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client1,
-			ARP_OP_REPLY);
+			RTE_ARP_OP_REPLY);
 	rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
 
 	pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
@@ -4507,7 +4507,7 @@ test_alb_change_mac_in_reply_sent(void)
 			0);
 	arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 	initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client2,
-			ARP_OP_REPLY);
+			RTE_ARP_OP_REPLY);
 	rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
 
 	pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
@@ -4517,7 +4517,7 @@ test_alb_change_mac_in_reply_sent(void)
 			0);
 	arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 	initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client3,
-			ARP_OP_REPLY);
+			RTE_ARP_OP_REPLY);
 	rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
 
 	pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
@@ -4527,7 +4527,7 @@ test_alb_change_mac_in_reply_sent(void)
 			0);
 	arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 	initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client4,
-			ARP_OP_REPLY);
+			RTE_ARP_OP_REPLY);
 	rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
 
 	slave_mac1 =
@@ -4610,7 +4610,7 @@ test_alb_reply_from_client(void)
 			0);
 	arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 	initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client1, ip_host,
-			ARP_OP_REPLY);
+			RTE_ARP_OP_REPLY);
 	virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
 			1);
 
@@ -4621,7 +4621,7 @@ test_alb_reply_from_client(void)
 			0);
 	arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 	initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client2, ip_host,
-			ARP_OP_REPLY);
+			RTE_ARP_OP_REPLY);
 	virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
 			1);
 
@@ -4632,7 +4632,7 @@ test_alb_reply_from_client(void)
 			0);
 	arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 	initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client3, ip_host,
-			ARP_OP_REPLY);
+			RTE_ARP_OP_REPLY);
 	virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
 			1);
 
@@ -4643,7 +4643,7 @@ test_alb_reply_from_client(void)
 			0);
 	arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt + sizeof(struct ether_hdr));
 	initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client4, ip_host,
-			ARP_OP_REPLY);
+			RTE_ARP_OP_REPLY);
 	virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
 			1);
 
@@ -4742,7 +4742,7 @@ test_alb_receive_vlan_reply(void)
 	vlan_pkt->eth_proto = rte_cpu_to_be_16(ETHER_TYPE_ARP);
 	arp_pkt = (struct rte_arp_hdr *)((char *)(vlan_pkt + 1));
 	initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client1, ip_host,
-			ARP_OP_REPLY);
+			RTE_ARP_OP_REPLY);
 	virtual_ethdev_add_mbufs_to_rx_queue(test_params->slave_port_ids[0], &pkt,
 			1);
 
drivers/net/bonding/rte_eth_bond_alb.c +4 -4
index 16a415a99..3df28965c 100644
@@ -84,7 +84,7 @@ void bond_mode_alb_arp_recv(struct ether_hdr *eth_h, uint16_t offset,
 	arp = (struct rte_arp_hdr *) ((char *) (eth_h + 1) + offset);
 
 	/* ARP Requests are forwarded to the application with no changes */
-	if (arp->arp_opcode != rte_cpu_to_be_16(ARP_OP_REPLY))
+	if (arp->arp_opcode != rte_cpu_to_be_16(RTE_ARP_OP_REPLY))
 		return;
 
 	/* From now on, we analyze only ARP Reply packets */
@@ -150,7 +150,7 @@ bond_mode_alb_arp_xmit(struct ether_hdr *eth_h, uint16_t offset,
 	client_info = &hash_table[hash_index];
 
 	rte_spinlock_lock(&internals->mode6.lock);
-	if (arp->arp_opcode == rte_cpu_to_be_16(ARP_OP_REPLY)) {
+	if (arp->arp_opcode == rte_cpu_to_be_16(RTE_ARP_OP_REPLY)) {
 		if (client_info->in_use) {
 			if (client_info->app_ip == arp->arp_data.arp_sip &&
 				client_info->cli_ip == arp->arp_data.arp_tip) {
@@ -220,11 +220,11 @@ bond_mode_alb_arp_upd(struct client_data *client_info,
 	ether_addr_copy(&client_info->cli_mac, &arp_h->arp_data.arp_tha);
 	arp_h->arp_data.arp_tip = client_info->cli_ip;
 
-	arp_h->arp_hardware = rte_cpu_to_be_16(ARP_HRD_ETHER);
+	arp_h->arp_hardware = rte_cpu_to_be_16(RTE_ARP_HRD_ETHER);
 	arp_h->arp_protocol = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
 	arp_h->arp_hlen = ETHER_ADDR_LEN;
 	arp_h->arp_plen = sizeof(uint32_t);
-	arp_h->arp_opcode = rte_cpu_to_be_16(ARP_OP_REPLY);
+	arp_h->arp_opcode = rte_cpu_to_be_16(RTE_ARP_OP_REPLY);
 
 	slave_idx = client_info->slave_idx;
 	rte_spinlock_unlock(&internals->mode6.lock);
drivers/net/bonding/rte_eth_bond_pmd.c +6 -6
index 9c5425ef5..63df3568d 100644
@@ -492,22 +492,22 @@ static void
 arp_opcode_name(uint16_t arp_opcode, char *buf, size_t buf_len)
 {
 	switch (arp_opcode) {
-	case ARP_OP_REQUEST:
+	case RTE_ARP_OP_REQUEST:
 		strlcpy(buf, "ARP Request", buf_len);
 		return;
-	case ARP_OP_REPLY:
+	case RTE_ARP_OP_REPLY:
 		strlcpy(buf, "ARP Reply", buf_len);
 		return;
-	case ARP_OP_REVREQUEST:
+	case RTE_ARP_OP_REVREQUEST:
 		strlcpy(buf, "Reverse ARP Request", buf_len);
 		return;
-	case ARP_OP_REVREPLY:
+	case RTE_ARP_OP_REVREPLY:
 		strlcpy(buf, "Reverse ARP Reply", buf_len);
 		return;
-	case ARP_OP_INVREQUEST:
+	case RTE_ARP_OP_INVREQUEST:
 		strlcpy(buf, "Peer Identify Request", buf_len);
 		return;
-	case ARP_OP_INVREPLY:
+	case RTE_ARP_OP_INVREPLY:
 		strlcpy(buf, "Peer Identify Reply", buf_len);
 		return;
 	default:
examples/bond/main.c +4 -4
index 4ad62c3cb..cf7335ddf 100644
@@ -384,8 +384,8 @@ static int lcore_main(__attribute__((unused)) void *arg1)
 				}
 				arp_hdr = (struct rte_arp_hdr *)((char *)(eth_hdr + 1) + offset);
 				if (arp_hdr->arp_data.arp_tip == bond_ip) {
-					if (arp_hdr->arp_opcode == rte_cpu_to_be_16(ARP_OP_REQUEST)) {
-						arp_hdr->arp_opcode = rte_cpu_to_be_16(ARP_OP_REPLY);
+					if (arp_hdr->arp_opcode == rte_cpu_to_be_16(RTE_ARP_OP_REQUEST)) {
+						arp_hdr->arp_opcode = rte_cpu_to_be_16(RTE_ARP_OP_REPLY);
 						/* Switch src and dst data and set bonding MAC */
 						ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
 						rte_eth_macaddr_get(BOND_PORT, &eth_hdr->s_addr);
@@ -479,11 +479,11 @@ static void cmd_obj_send_parsed(void *parsed_result,
 	eth_hdr->ether_type = rte_cpu_to_be_16(ETHER_TYPE_ARP);
 
 	arp_hdr = (struct rte_arp_hdr *)((char *)eth_hdr + sizeof(struct ether_hdr));
-	arp_hdr->arp_hardware = rte_cpu_to_be_16(ARP_HRD_ETHER);
+	arp_hdr->arp_hardware = rte_cpu_to_be_16(RTE_ARP_HRD_ETHER);
 	arp_hdr->arp_protocol = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
 	arp_hdr->arp_hlen = ETHER_ADDR_LEN;
 	arp_hdr->arp_plen = sizeof(uint32_t);
-	arp_hdr->arp_opcode = rte_cpu_to_be_16(ARP_OP_REQUEST);
+	arp_hdr->arp_opcode = rte_cpu_to_be_16(RTE_ARP_OP_REQUEST);
 
 	rte_eth_macaddr_get(BOND_PORT, &arp_hdr->arp_data.arp_sha);
 	arp_hdr->arp_data.arp_sip = bond_ip;
lib/librte_net/rte_arp.c +2 -2
index c80ebc7e1..877874a5e 100644
@@ -35,11 +35,11 @@ rte_net_make_rarp_packet(struct rte_mempool *mpool,
 
 	/* RARP header. */
 	rarp = (struct rte_arp_hdr *)(eth_hdr + 1);
-	rarp->arp_hardware = htons(ARP_HRD_ETHER);
+	rarp->arp_hardware = htons(RTE_ARP_HRD_ETHER);
 	rarp->arp_protocol = htons(ETHER_TYPE_IPv4);
 	rarp->arp_hlen = ETHER_ADDR_LEN;
 	rarp->arp_plen = 4;
-	rarp->arp_opcode  = htons(ARP_OP_REVREQUEST);
+	rarp->arp_opcode  = htons(RTE_ARP_OP_REVREQUEST);
 
 	ether_addr_copy(mac, &rarp->arp_data.arp_sha);
 	ether_addr_copy(mac, &rarp->arp_data.arp_tha);
lib/librte_net/rte_arp.h +7 -7
index c9b5cd49d..a94fa6a00 100644
@@ -33,18 +33,18 @@ struct rte_arp_ipv4 {
  */
 struct rte_arp_hdr {
 	uint16_t arp_hardware;    /* format of hardware address */
-#define ARP_HRD_ETHER     1  /* ARP Ethernet address format */
+#define RTE_ARP_HRD_ETHER     1  /* ARP Ethernet address format */
 
 	uint16_t arp_protocol;    /* format of protocol address */
 	uint8_t  arp_hlen;    /* length of hardware address */
 	uint8_t  arp_plen;    /* length of protocol address */
 	uint16_t arp_opcode;     /* ARP opcode (command) */
-#define	ARP_OP_REQUEST    1 /* request to resolve address */
-#define	ARP_OP_REPLY      2 /* response to previous request */
-#define	ARP_OP_REVREQUEST 3 /* request proto addr given hardware */
-#define	ARP_OP_REVREPLY   4 /* response giving protocol address */
-#define	ARP_OP_INVREQUEST 8 /* request to identify peer */
-#define	ARP_OP_INVREPLY   9 /* response identifying peer */
+#define	RTE_ARP_OP_REQUEST    1 /* request to resolve address */
+#define	RTE_ARP_OP_REPLY      2 /* response to previous request */
+#define	RTE_ARP_OP_REVREQUEST 3 /* request proto addr given hardware */
+#define	RTE_ARP_OP_REVREPLY   4 /* response giving protocol address */
+#define	RTE_ARP_OP_INVREQUEST 8 /* request to identify peer */
+#define	RTE_ARP_OP_INVREPLY   9 /* response identifying peer */
 
 	struct rte_arp_ipv4 arp_data;
 } __attribute__((__packed__));
Signature · 1 line
2.11.0