summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/bbdev_app/main.c39
-rw-r--r--examples/bond/main.c30
-rw-r--r--examples/distributor/main.c2
-rw-r--r--examples/ethtool/ethtool-app/ethapp.c4
-rw-r--r--examples/ethtool/ethtool-app/main.c6
-rw-r--r--examples/ethtool/lib/rte_ethtool.c6
-rw-r--r--examples/ethtool/lib/rte_ethtool.h7
-rw-r--r--examples/eventdev_pipeline/main.c2
-rw-r--r--examples/eventdev_pipeline/pipeline_common.h6
-rw-r--r--examples/flow_classify/flow_classify.c12
-rw-r--r--examples/flow_filtering/main.c6
-rw-r--r--examples/ip_fragmentation/main.c19
-rw-r--r--examples/ip_pipeline/cli.c4
-rw-r--r--examples/ip_pipeline/parser.c12
-rw-r--r--examples/ip_pipeline/parser.h2
-rw-r--r--examples/ip_reassembly/main.c13
-rw-r--r--examples/ipsec-secgw/ipsec-secgw.c19
-rw-r--r--examples/ipsec-secgw/ipsec.h2
-rw-r--r--examples/ipsec-secgw/parser.c4
-rw-r--r--examples/ipv4_multicast/main.c16
-rw-r--r--examples/kni/main.c8
-rw-r--r--examples/l2fwd-cat/l2fwd-cat.c2
-rw-r--r--examples/l2fwd-crypto/main.c12
-rw-r--r--examples/l2fwd-jobstats/main.c6
-rw-r--r--examples/l2fwd-keepalive/main.c6
-rw-r--r--examples/l2fwd/main.c6
-rw-r--r--examples/l3fwd-acl/main.c20
-rw-r--r--examples/l3fwd-power/main.c16
-rw-r--r--examples/l3fwd-vf/main.c10
-rw-r--r--examples/l3fwd/l3fwd.h2
-rw-r--r--examples/l3fwd/l3fwd_altivec.h12
-rw-r--r--examples/l3fwd/l3fwd_em.c6
-rw-r--r--examples/l3fwd/l3fwd_em.h8
-rw-r--r--examples/l3fwd/l3fwd_em_hlm.h11
-rw-r--r--examples/l3fwd/l3fwd_em_hlm_neon.h8
-rw-r--r--examples/l3fwd/l3fwd_em_hlm_sse.h8
-rw-r--r--examples/l3fwd/l3fwd_em_sequential.h11
-rw-r--r--examples/l3fwd/l3fwd_lpm.c14
-rw-r--r--examples/l3fwd/l3fwd_lpm.h8
-rw-r--r--examples/l3fwd/l3fwd_lpm_altivec.h10
-rw-r--r--examples/l3fwd/l3fwd_lpm_neon.h20
-rw-r--r--examples/l3fwd/l3fwd_lpm_sse.h10
-rw-r--r--examples/l3fwd/l3fwd_neon.h12
-rw-r--r--examples/l3fwd/l3fwd_sse.h12
-rw-r--r--examples/l3fwd/main.c8
-rw-r--r--examples/link_status_interrupt/main.c6
-rw-r--r--examples/load_balancer/runtime.c6
-rw-r--r--examples/multi_process/client_server_mp/mp_server/main.c2
-rw-r--r--examples/packet_ordering/main.c2
-rw-r--r--examples/performance-thread/l3fwd-thread/main.c136
-rw-r--r--examples/ptpclient/ptpclient.c28
-rw-r--r--examples/qos_meter/main.c3
-rw-r--r--examples/quota_watermark/qw/main.c6
-rw-r--r--examples/rxtx_callbacks/main.c2
-rw-r--r--examples/server_node_efd/node/node.c2
-rw-r--r--examples/server_node_efd/server/main.c4
-rw-r--r--examples/skeleton/basicfwd.c2
-rw-r--r--examples/tep_termination/main.c2
-rw-r--r--examples/tep_termination/main.h2
-rw-r--r--examples/tep_termination/vxlan.c44
-rw-r--r--examples/tep_termination/vxlan.h6
-rw-r--r--examples/tep_termination/vxlan_setup.c6
-rw-r--r--examples/tep_termination/vxlan_setup.h2
-rw-r--r--examples/vhost/main.c26
-rw-r--r--examples/vhost/main.h2
-rw-r--r--examples/vm_power_manager/channel_monitor.c6
-rw-r--r--examples/vm_power_manager/guest_cli/vm_power_cli_guest.c2
-rw-r--r--examples/vm_power_manager/main.c4
-rw-r--r--examples/vmdq/main.c10
-rw-r--r--examples/vmdq_dcb/main.c10
70 files changed, 399 insertions, 379 deletions
diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index d68c06a..2675a16 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -273,7 +273,7 @@ signal_handler(int signum)
}
static void
-print_mac(unsigned int portid, struct ether_addr *bbdev_ports_eth_address)
+print_mac(unsigned int portid, struct rte_ether_addr *bbdev_ports_eth_address)
{
printf("Port %u, MAC address: %02X:%02X:%02X:%02X:%02X:%02X\n\n",
(unsigned int) portid,
@@ -341,14 +341,14 @@ check_port_link_status(uint16_t port_id)
static inline void
add_ether_hdr(struct rte_mbuf *pkt_src, struct rte_mbuf *pkt_dst)
{
- struct ether_hdr *eth_from;
- struct ether_hdr *eth_to;
+ struct rte_ether_hdr *eth_from;
+ struct rte_ether_hdr *eth_to;
- eth_from = rte_pktmbuf_mtod(pkt_src, struct ether_hdr *);
- eth_to = rte_pktmbuf_mtod(pkt_dst, struct ether_hdr *);
+ eth_from = rte_pktmbuf_mtod(pkt_src, struct rte_ether_hdr *);
+ eth_to = rte_pktmbuf_mtod(pkt_dst, struct rte_ether_hdr *);
/* copy header */
- rte_memcpy(eth_to, eth_from, sizeof(struct ether_hdr));
+ rte_memcpy(eth_to, eth_from, sizeof(struct rte_ether_hdr));
}
static inline void
@@ -377,7 +377,7 @@ transform_enc_out_dec_in(struct rte_mbuf **mbufs, uint8_t *temp_buf,
for (i = 0; i < num_pkts; ++i) {
uint16_t pkt_data_len = rte_pktmbuf_data_len(mbufs[i]) -
- sizeof(struct ether_hdr);
+ sizeof(struct rte_ether_hdr);
/* Resize the packet if needed */
if (pkt_data_len < ncb) {
@@ -395,7 +395,8 @@ transform_enc_out_dec_in(struct rte_mbuf **mbufs, uint8_t *temp_buf,
for (l = start_bit_idx; l < start_bit_idx + d; ++l) {
uint8_t *data = rte_pktmbuf_mtod_offset(
mbufs[i], uint8_t *,
- sizeof(struct ether_hdr) + (l >> 3));
+ sizeof(struct rte_ether_hdr) +
+ (l >> 3));
if (*data & (0x80 >> (l & 7)))
temp_buf[out_idx] = LLR_1_BIT;
else
@@ -410,7 +411,7 @@ transform_enc_out_dec_in(struct rte_mbuf **mbufs, uint8_t *temp_buf,
}
rte_memcpy(rte_pktmbuf_mtod_offset(mbufs[i], uint8_t *,
- sizeof(struct ether_hdr)), temp_buf, ncb);
+ sizeof(struct rte_ether_hdr)), temp_buf, ncb);
}
}
@@ -423,9 +424,9 @@ verify_data(struct rte_mbuf **mbufs, uint16_t num_pkts)
struct rte_mbuf *in = out->userdata;
if (memcmp(rte_pktmbuf_mtod_offset(in, uint8_t *,
- sizeof(struct ether_hdr)),
+ sizeof(struct rte_ether_hdr)),
rte_pktmbuf_mtod_offset(out, uint8_t *,
- sizeof(struct ether_hdr)),
+ sizeof(struct rte_ether_hdr)),
K / 8 - CRC_24B_LEN))
printf("Input and output buffers are not equal!\n");
}
@@ -439,7 +440,7 @@ initialize_ports(struct app_config_params *app_params,
uint16_t port_id = app_params->port_id;
uint16_t q;
/* ethernet addresses of ports */
- struct ether_addr bbdev_port_eth_addr;
+ struct rte_ether_addr bbdev_port_eth_addr;
/* initialize ports */
printf("\nInitializing port %u...\n", app_params->port_id);
@@ -707,14 +708,14 @@ run_encoding(struct lcore_conf *lcore_conf)
char *data;
const uint16_t pkt_data_len =
rte_pktmbuf_data_len(rx_pkts_burst[i]) -
- sizeof(struct ether_hdr);
+ sizeof(struct rte_ether_hdr);
/* save input mbuf pointer for later comparison */
enc_out_pkts[i]->userdata = rx_pkts_burst[i];
/* copy ethernet header */
rte_pktmbuf_reset(enc_out_pkts[i]);
data = rte_pktmbuf_append(enc_out_pkts[i],
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
if (data == NULL) {
printf(
"Not enough space for ethernet header in encoder output mbuf\n");
@@ -728,7 +729,7 @@ run_encoding(struct lcore_conf *lcore_conf)
bbdev_ops_burst[i]->turbo_enc.input.data =
rx_pkts_burst[i];
bbdev_ops_burst[i]->turbo_enc.input.offset =
- sizeof(struct ether_hdr);
+ sizeof(struct rte_ether_hdr);
/* Encoder will attach the CRC24B, adjust the length */
bbdev_ops_burst[i]->turbo_enc.input.length = in_data_len;
@@ -746,7 +747,7 @@ run_encoding(struct lcore_conf *lcore_conf)
bbdev_ops_burst[i]->turbo_enc.output.data =
enc_out_pkts[i];
bbdev_ops_burst[i]->turbo_enc.output.offset =
- sizeof(struct ether_hdr);
+ sizeof(struct rte_ether_hdr);
}
/* Enqueue packets on BBDevice */
@@ -834,15 +835,15 @@ run_decoding(struct lcore_conf *lcore_conf)
bbdev_ops_burst[i]->turbo_dec.input.data = recv_pkts_burst[i];
bbdev_ops_burst[i]->turbo_dec.input.offset =
- sizeof(struct ether_hdr);
+ sizeof(struct rte_ether_hdr);
bbdev_ops_burst[i]->turbo_dec.input.length =
rte_pktmbuf_data_len(recv_pkts_burst[i])
- - sizeof(struct ether_hdr);
+ - sizeof(struct rte_ether_hdr);
bbdev_ops_burst[i]->turbo_dec.hard_output.data =
recv_pkts_burst[i];
bbdev_ops_burst[i]->turbo_dec.hard_output.offset =
- sizeof(struct ether_hdr);
+ sizeof(struct rte_ether_hdr);
}
/* Enqueue packets on BBDevice */
diff --git a/examples/bond/main.c b/examples/bond/main.c
index 21a67e5..38d1b40 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -201,7 +201,7 @@ slave_port_init(uint16_t portid, struct rte_mempool *mbuf_pool)
"Start port %d failed (res=%d)",
portid, retval);
- struct ether_addr addr;
+ struct rte_ether_addr addr;
rte_eth_macaddr_get(portid, &addr);
printf("Port %u MAC: ", portid);
@@ -291,7 +291,7 @@ bond_port_init(struct rte_mempool *mbuf_pool)
rte_eth_promiscuous_enable(BOND_PORT);
- struct ether_addr addr;
+ struct rte_ether_addr addr;
rte_eth_macaddr_get(BOND_PORT, &addr);
printf("Port %u MAC: ", (unsigned)BOND_PORT);
@@ -300,21 +300,22 @@ bond_port_init(struct rte_mempool *mbuf_pool)
}
static inline size_t
-get_vlan_offset(struct ether_hdr *eth_hdr, uint16_t *proto)
+get_vlan_offset(struct rte_ether_hdr *eth_hdr, uint16_t *proto)
{
size_t vlan_offset = 0;
if (rte_cpu_to_be_16(ETHER_TYPE_VLAN) == *proto) {
- struct vlan_hdr *vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1);
+ struct rte_vlan_hdr *vlan_hdr =
+ (struct rte_vlan_hdr *)(eth_hdr + 1);
- vlan_offset = sizeof(struct vlan_hdr);
+ vlan_offset = sizeof(struct rte_vlan_hdr);
*proto = vlan_hdr->eth_proto;
if (rte_cpu_to_be_16(ETHER_TYPE_VLAN) == *proto) {
vlan_hdr = vlan_hdr + 1;
*proto = vlan_hdr->eth_proto;
- vlan_offset += sizeof(struct vlan_hdr);
+ vlan_offset += sizeof(struct rte_vlan_hdr);
}
}
return vlan_offset;
@@ -336,9 +337,9 @@ struct global_flag_stru_t *global_flag_stru_p = &global_flag_stru;
static int lcore_main(__attribute__((unused)) void *arg1)
{
struct rte_mbuf *pkts[MAX_PKT_BURST] __rte_cache_aligned;
- struct ether_addr d_addr;
+ struct rte_ether_addr d_addr;
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
struct rte_arp_hdr *arp_hdr;
struct ipv4_hdr *ipv4_hdr;
uint16_t ether_type, offset;
@@ -370,7 +371,8 @@ static int lcore_main(__attribute__((unused)) void *arg1)
global_flag_stru_p->port_packets[0]++;
rte_spinlock_unlock(&global_flag_stru_p->lock);
}
- eth_hdr = rte_pktmbuf_mtod(pkts[i], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkts[i],
+ struct rte_ether_hdr *);
ether_type = eth_hdr->ether_type;
if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_VLAN))
printf("VLAN taged frame, offset:");
@@ -450,7 +452,7 @@ static void cmd_obj_send_parsed(void *parsed_result,
char ip_str[INET6_ADDRSTRLEN];
struct rte_mbuf *created_pkt;
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
struct rte_arp_hdr *arp_hdr;
uint32_t bond_ip;
@@ -470,17 +472,17 @@ static void cmd_obj_send_parsed(void *parsed_result,
return;
}
- pkt_size = sizeof(struct ether_hdr) + sizeof(struct rte_arp_hdr);
+ pkt_size = sizeof(struct rte_ether_hdr) + sizeof(struct rte_arp_hdr);
created_pkt->data_len = pkt_size;
created_pkt->pkt_len = pkt_size;
- eth_hdr = rte_pktmbuf_mtod(created_pkt, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(created_pkt, struct rte_ether_hdr *);
rte_eth_macaddr_get(BOND_PORT, &eth_hdr->s_addr);
memset(&eth_hdr->d_addr, 0xFF, ETHER_ADDR_LEN);
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));
+ (char *)eth_hdr + sizeof(struct rte_ether_hdr));
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;
@@ -700,7 +702,7 @@ static void cmd_show_parsed(__attribute__((unused)) void *parsed_result,
{
uint16_t slaves[16] = {0};
uint8_t len = 16;
- struct ether_addr addr;
+ struct rte_ether_addr addr;
uint16_t i = 0;
while (i < slaves_count) {
diff --git a/examples/distributor/main.c b/examples/distributor/main.c
index b5499bb..e4c8c3c 100644
--- a/examples/distributor/main.c
+++ b/examples/distributor/main.c
@@ -179,7 +179,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
return 0;
}
- struct ether_addr addr;
+ struct rte_ether_addr addr;
rte_eth_macaddr_get(port, &addr);
printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8
" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n",
diff --git a/examples/ethtool/ethtool-app/ethapp.c b/examples/ethtool/ethtool-app/ethapp.c
index a4e64b3..ce7f715 100644
--- a/examples/ethtool/ethtool-app/ethapp.c
+++ b/examples/ethtool/ethtool-app/ethapp.c
@@ -30,7 +30,7 @@ struct pcmd_intstr_params {
struct pcmd_intmac_params {
cmdline_fixed_string_t cmd;
uint16_t port;
- struct ether_addr mac;
+ struct rte_ether_addr mac;
};
struct pcmd_str_params {
cmdline_fixed_string_t cmd;
@@ -475,7 +475,7 @@ pcmd_macaddr_callback(void *ptr_params,
void *ptr_data)
{
struct pcmd_intmac_params *params = ptr_params;
- struct ether_addr mac_addr;
+ struct rte_ether_addr mac_addr;
int stat;
stat = 0;
diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/ethtool-app/main.c
index e23d3af..27c22cf 100644
--- a/examples/ethtool/ethtool-app/main.c
+++ b/examples/ethtool/ethtool-app/main.c
@@ -32,7 +32,7 @@ struct txq_port {
};
struct app_port {
- struct ether_addr mac_addr;
+ struct rte_ether_addr mac_addr;
struct txq_port txq;
rte_spinlock_t lock;
int port_active;
@@ -158,9 +158,9 @@ static void setup_ports(struct app_config *app_cfg, int cnt_ports)
static void process_frame(struct app_port *ptr_port,
struct rte_mbuf *ptr_frame)
{
- struct ether_hdr *ptr_mac_hdr;
+ struct rte_ether_hdr *ptr_mac_hdr;
- ptr_mac_hdr = rte_pktmbuf_mtod(ptr_frame, struct ether_hdr *);
+ ptr_mac_hdr = rte_pktmbuf_mtod(ptr_frame, struct rte_ether_hdr *);
ether_addr_copy(&ptr_mac_hdr->s_addr, &ptr_mac_hdr->d_addr);
ether_addr_copy(&ptr_port->mac_addr, &ptr_mac_hdr->s_addr);
}
diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c
index bf10139..299488c 100644
--- a/examples/ethtool/lib/rte_ethtool.c
+++ b/examples/ethtool/lib/rte_ethtool.c
@@ -303,7 +303,7 @@ rte_ethtool_net_stop(uint16_t port_id)
}
int
-rte_ethtool_net_get_mac_addr(uint16_t port_id, struct ether_addr *addr)
+rte_ethtool_net_get_mac_addr(uint16_t port_id, struct rte_ether_addr *addr)
{
RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
if (addr == NULL)
@@ -314,7 +314,7 @@ rte_ethtool_net_get_mac_addr(uint16_t port_id, struct ether_addr *addr)
}
int
-rte_ethtool_net_set_mac_addr(uint16_t port_id, struct ether_addr *addr)
+rte_ethtool_net_set_mac_addr(uint16_t port_id, struct rte_ether_addr *addr)
{
if (addr == NULL)
return -EINVAL;
@@ -323,7 +323,7 @@ rte_ethtool_net_set_mac_addr(uint16_t port_id, struct ether_addr *addr)
int
rte_ethtool_net_validate_addr(uint16_t port_id __rte_unused,
- struct ether_addr *addr)
+ struct rte_ether_addr *addr)
{
if (addr == NULL)
return -EINVAL;
diff --git a/examples/ethtool/lib/rte_ethtool.h b/examples/ethtool/lib/rte_ethtool.h
index 31cd5ae..f177096 100644
--- a/examples/ethtool/lib/rte_ethtool.h
+++ b/examples/ethtool/lib/rte_ethtool.h
@@ -260,7 +260,7 @@ int rte_ethtool_net_stop(uint16_t port_id);
* - (0) if successful.
* - (-ENODEV) if *port_id* invalid.
*/
-int rte_ethtool_net_get_mac_addr(uint16_t port_id, struct ether_addr *addr);
+int rte_ethtool_net_get_mac_addr(uint16_t port_id, struct rte_ether_addr *addr);
/**
* Setting the Ethernet device MAC address.
@@ -276,7 +276,7 @@ int rte_ethtool_net_get_mac_addr(uint16_t port_id, struct ether_addr *addr);
* - (-EINVAL) if parameters invalid.
* - others depends on the specific operations implementation.
*/
-int rte_ethtool_net_set_mac_addr(uint16_t port_id, struct ether_addr *addr);
+int rte_ethtool_net_set_mac_addr(uint16_t port_id, struct rte_ether_addr *addr);
/**
* Validate if the provided MAC address is valid unicast address
@@ -292,7 +292,8 @@ int rte_ethtool_net_set_mac_addr(uint16_t port_id, struct ether_addr *addr);
* - (-EINVAL) if parameters invalid.
* - others depends on the specific operations implementation.
*/
-int rte_ethtool_net_validate_addr(uint16_t port_id, struct ether_addr *addr);
+int rte_ethtool_net_validate_addr(uint16_t port_id,
+ struct rte_ether_addr *addr);
/**
* Setting the Ethernet device maximum Tx unit.
diff --git a/examples/eventdev_pipeline/main.c b/examples/eventdev_pipeline/main.c
index 58f8904..63227f0 100644
--- a/examples/eventdev_pipeline/main.c
+++ b/examples/eventdev_pipeline/main.c
@@ -317,7 +317,7 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool)
}
/* Display the port MAC address. */
- struct ether_addr addr;
+ struct rte_ether_addr addr;
rte_eth_macaddr_get(port, &addr);
printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
diff --git a/examples/eventdev_pipeline/pipeline_common.h b/examples/eventdev_pipeline/pipeline_common.h
index a6cc912..ef23d96 100644
--- a/examples/eventdev_pipeline/pipeline_common.h
+++ b/examples/eventdev_pipeline/pipeline_common.h
@@ -99,11 +99,11 @@ struct config_data cdata;
static __rte_always_inline void
exchange_mac(struct rte_mbuf *m)
{
- struct ether_hdr *eth;
- struct ether_addr addr;
+ struct rte_ether_hdr *eth;
+ struct rte_ether_addr addr;
/* change mac addresses on packet (to use mbuf data) */
- eth = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
ether_addr_copy(&eth->d_addr, &addr);
ether_addr_copy(&addr, &eth->d_addr);
}
diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c
index 1996129..5ae81fa 100644
--- a/examples/flow_classify/flow_classify.c
+++ b/examples/flow_classify/flow_classify.c
@@ -98,7 +98,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {
.size = sizeof(uint8_t),
.field_index = PROTO_FIELD_IPV4,
.input_index = PROTO_INPUT_IPV4,
- .offset = sizeof(struct ether_hdr) +
+ .offset = sizeof(struct rte_ether_hdr) +
offsetof(struct ipv4_hdr, next_proto_id),
},
/* next input field (IPv4 source address) - 4 consecutive bytes. */
@@ -108,7 +108,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {
.size = sizeof(uint32_t),
.field_index = SRC_FIELD_IPV4,
.input_index = SRC_INPUT_IPV4,
- .offset = sizeof(struct ether_hdr) +
+ .offset = sizeof(struct rte_ether_hdr) +
offsetof(struct ipv4_hdr, src_addr),
},
/* next input field (IPv4 destination address) - 4 consecutive bytes. */
@@ -118,7 +118,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {
.size = sizeof(uint32_t),
.field_index = DST_FIELD_IPV4,
.input_index = DST_INPUT_IPV4,
- .offset = sizeof(struct ether_hdr) +
+ .offset = sizeof(struct rte_ether_hdr) +
offsetof(struct ipv4_hdr, dst_addr),
},
/*
@@ -131,7 +131,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {
.size = sizeof(uint16_t),
.field_index = SRCP_FIELD_IPV4,
.input_index = SRCP_DESTP_INPUT_IPV4,
- .offset = sizeof(struct ether_hdr) +
+ .offset = sizeof(struct rte_ether_hdr) +
sizeof(struct ipv4_hdr) +
offsetof(struct tcp_hdr, src_port),
},
@@ -141,7 +141,7 @@ static struct rte_acl_field_def ipv4_defs[NUM_FIELDS_IPV4] = {
.size = sizeof(uint16_t),
.field_index = DSTP_FIELD_IPV4,
.input_index = SRCP_DESTP_INPUT_IPV4,
- .offset = sizeof(struct ether_hdr) +
+ .offset = sizeof(struct rte_ether_hdr) +
sizeof(struct ipv4_hdr) +
offsetof(struct tcp_hdr, dst_port),
},
@@ -192,7 +192,7 @@ static inline int
port_init(uint8_t port, struct rte_mempool *mbuf_pool)
{
struct rte_eth_conf port_conf = port_conf_default;
- struct ether_addr addr;
+ struct rte_ether_addr addr;
const uint16_t rx_rings = 1, tx_rings = 1;
int retval;
uint16_t q;
diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index a582ac0..7b8e7c4 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -45,7 +45,7 @@ struct rte_flow *flow;
#include "flow_blocks.c"
static inline void
-print_ether_addr(const char *what, struct ether_addr *eth_addr)
+print_ether_addr(const char *what, struct rte_ether_addr *eth_addr)
{
char buf[ETHER_ADDR_FMT_SIZE];
ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);
@@ -56,7 +56,7 @@ static void
main_loop(void)
{
struct rte_mbuf *mbufs[32];
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
struct rte_flow_error error;
uint16_t nb_rx;
uint16_t i;
@@ -71,7 +71,7 @@ main_loop(void)
struct rte_mbuf *m = mbufs[j];
eth_hdr = rte_pktmbuf_mtod(m,
- struct ether_hdr *);
+ struct rte_ether_hdr *);
print_ether_addr("src=",
&eth_hdr->s_addr);
print_ether_addr(" - dst=",
diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index e90a61e..a9efb4b 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -60,7 +60,7 @@
* We have to consider the max possible overhead.
*/
#define MTU_OVERHEAD \
- (ETHER_HDR_LEN + ETHER_CRC_LEN + 2 * sizeof(struct vlan_hdr))
+ (ETHER_HDR_LEN + ETHER_CRC_LEN + 2 * sizeof(struct rte_vlan_hdr))
/*
* Default payload in bytes for the IPv6 packet.
@@ -90,7 +90,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
/* ethernet addresses of ports */
-static struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
+static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
#ifndef IPv4_BYTES
#define IPv4_BYTES_FMT "%" PRIu8 ".%" PRIu8 ".%" PRIu8 ".%" PRIu8
@@ -252,7 +252,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
port_out = port_in;
/* Remove the Ethernet header and trailer from the input packet */
- rte_pktmbuf_adj(m, (uint16_t)sizeof(struct ether_hdr));
+ rte_pktmbuf_adj(m, (uint16_t)sizeof(struct rte_ether_hdr));
/* Build transmission burst */
len = qconf->tx_mbufs[port_out].len;
@@ -340,13 +340,14 @@ l3fwd_simple_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf,
void *d_addr_bytes;
m = qconf->tx_mbufs[port_out].m_table[i];
- struct ether_hdr *eth_hdr = (struct ether_hdr *)
- rte_pktmbuf_prepend(m, (uint16_t)sizeof(struct ether_hdr));
+ struct rte_ether_hdr *eth_hdr = (struct rte_ether_hdr *)
+ rte_pktmbuf_prepend(m,
+ (uint16_t)sizeof(struct rte_ether_hdr));
if (eth_hdr == NULL) {
rte_panic("No headroom in mbuf.\n");
}
- m->l2_len = sizeof(struct ether_hdr);
+ m->l2_len = sizeof(struct rte_ether_hdr);
/* 02:00:00:00:00:xx */
d_addr_bytes = &eth_hdr->d_addr.addr_bytes[0];
@@ -568,7 +569,7 @@ parse_args(int argc, char **argv)
}
static void
-print_ethaddr(const char *name, struct ether_addr *eth_addr)
+print_ethaddr(const char *name, struct rte_ether_addr *eth_addr)
{
char buf[ETHER_ADDR_FMT_SIZE];
ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);
@@ -669,11 +670,11 @@ check_ptype(int portid)
static inline void
parse_ptype(struct rte_mbuf *m)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
uint32_t packet_type = RTE_PTYPE_UNKNOWN;
uint16_t ether_type;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
ether_type = eth_hdr->ether_type;
if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4))
packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c
index bcf62fb..309b293 100644
--- a/examples/ip_pipeline/cli.c
+++ b/examples/ip_pipeline/cli.c
@@ -245,7 +245,7 @@ static void
print_link_info(struct link *link, char *out, size_t out_size)
{
struct rte_eth_stats stats;
- struct ether_addr mac_addr;
+ struct rte_ether_addr mac_addr;
struct rte_eth_link eth_link;
uint16_t mtu;
@@ -4777,7 +4777,7 @@ cmd_pipeline_table_rule_delete_default(char **tokens,
}
static void
-ether_addr_show(FILE *f, struct ether_addr *addr)
+ether_addr_show(FILE *f, struct rte_ether_addr *addr)
{
fprintf(f, "%02x:%02x:%02x:%02x:%02x:%02x",
(uint32_t)addr->addr_bytes[0], (uint32_t)addr->addr_bytes[1],
diff --git a/examples/ip_pipeline/parser.c b/examples/ip_pipeline/parser.c
index ffcdeb3..4777f9f 100644
--- a/examples/ip_pipeline/parser.c
+++ b/examples/ip_pipeline/parser.c
@@ -513,13 +513,13 @@ inet_pton6(const char *src, unsigned char *dst)
return 1;
}
-static struct ether_addr *
+static struct rte_ether_addr *
my_ether_aton(const char *a)
{
int i;
char *end;
unsigned long o[ETHER_ADDR_LEN];
- static struct ether_addr ether_addr;
+ static struct rte_ether_addr ether_addr;
i = 0;
do {
@@ -553,7 +553,7 @@ my_ether_aton(const char *a)
} else
return NULL;
- return (struct ether_addr *)&ether_addr;
+ return (struct rte_ether_addr *)&ether_addr;
}
int
@@ -581,15 +581,15 @@ parse_ipv6_addr(const char *token, struct in6_addr *ipv6)
}
int
-parse_mac_addr(const char *token, struct ether_addr *addr)
+parse_mac_addr(const char *token, struct rte_ether_addr *addr)
{
- struct ether_addr *tmp;
+ struct rte_ether_addr *tmp;
tmp = my_ether_aton(token);
if (tmp == NULL)
return -1;
- memcpy(addr, tmp, sizeof(struct ether_addr));
+ memcpy(addr, tmp, sizeof(struct rte_ether_addr));
return 0;
}
diff --git a/examples/ip_pipeline/parser.h b/examples/ip_pipeline/parser.h
index 261a8c8..4538f67 100644
--- a/examples/ip_pipeline/parser.h
+++ b/examples/ip_pipeline/parser.h
@@ -47,7 +47,7 @@ int parse_hex_string(char *src, uint8_t *dst, uint32_t *size);
int parse_ipv4_addr(const char *token, struct in_addr *ipv4);
int parse_ipv6_addr(const char *token, struct in6_addr *ipv6);
-int parse_mac_addr(const char *token, struct ether_addr *addr);
+int parse_mac_addr(const char *token, struct rte_ether_addr *addr);
int parse_mpls_labels(char *string, uint32_t *labels, uint32_t *n_labels);
struct cpu_core_params {
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 17b55d4..d9ecac0 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -95,7 +95,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
/* ethernet addresses of ports */
-static struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
+static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
#ifndef IPv4_BYTES
#define IPv4_BYTES_FMT "%" PRIu8 ".%" PRIu8 ".%" PRIu8 ".%" PRIu8
@@ -308,7 +308,7 @@ static inline void
reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
struct lcore_queue_conf *qconf, uint64_t tms)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
struct rte_ip_frag_tbl *tbl;
struct rte_ip_frag_death_row *dr;
struct rx_queue *rxq;
@@ -318,7 +318,7 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
rxq = &qconf->rx_queue_list[queue];
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
dst_port = portid;
@@ -350,7 +350,7 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
if (mo != m) {
m = mo;
eth_hdr = rte_pktmbuf_mtod(m,
- struct ether_hdr *);
+ struct rte_ether_hdr *);
ip_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
}
}
@@ -388,7 +388,8 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue,
if (mo != m) {
m = mo;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m,
+ struct rte_ether_hdr *);
ip_hdr = (struct ipv6_hdr *)(eth_hdr + 1);
}
}
@@ -691,7 +692,7 @@ parse_args(int argc, char **argv)
}
static void
-print_ethaddr(const char *name, const struct ether_addr *eth_addr)
+print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr)
{
char buf[ETHER_ADDR_FMT_SIZE];
ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index 478dd80..66e9216 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -233,9 +233,9 @@ static inline void
prepare_one_packet(struct rte_mbuf *pkt, struct ipsec_traffic *t)
{
uint8_t *nlp;
- struct ether_hdr *eth;
+ struct rte_ether_hdr *eth;
- eth = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+ eth = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
if (eth->ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) {
nlp = (uint8_t *)rte_pktmbuf_adj(pkt, ETHER_HDR_LEN);
nlp = RTE_PTR_ADD(nlp, offsetof(struct ip, ip_p));
@@ -325,11 +325,12 @@ prepare_tx_pkt(struct rte_mbuf *pkt, uint16_t port,
const struct lcore_conf *qconf)
{
struct ip *ip;
- struct ether_hdr *ethhdr;
+ struct rte_ether_hdr *ethhdr;
ip = rte_pktmbuf_mtod(pkt, struct ip *);
- ethhdr = (struct ether_hdr *)rte_pktmbuf_prepend(pkt, ETHER_HDR_LEN);
+ ethhdr = (struct rte_ether_hdr *)
+ rte_pktmbuf_prepend(pkt, ETHER_HDR_LEN);
if (ip->ip_v == IPVERSION) {
pkt->ol_flags |= qconf->outbound.ipv4_offloads;
@@ -352,9 +353,9 @@ prepare_tx_pkt(struct rte_mbuf *pkt, uint16_t port,
}
memcpy(&ethhdr->s_addr, &ethaddr_tbl[port].src,
- sizeof(struct ether_addr));
+ sizeof(struct rte_ether_addr));
memcpy(&ethhdr->d_addr, &ethaddr_tbl[port].dst,
- sizeof(struct ether_addr));
+ sizeof(struct rte_ether_addr));
}
static inline void
@@ -1424,7 +1425,7 @@ parse_args(int32_t argc, char **argv)
}
static void
-print_ethaddr(const char *name, const struct ether_addr *eth_addr)
+print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr)
{
char buf[ETHER_ADDR_FMT_SIZE];
ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);
@@ -1435,7 +1436,7 @@ print_ethaddr(const char *name, const struct ether_addr *eth_addr)
* Update destination ethaddr for the port.
*/
int
-add_dst_ethaddr(uint16_t port, const struct ether_addr *addr)
+add_dst_ethaddr(uint16_t port, const struct rte_ether_addr *addr)
{
if (port >= RTE_DIM(ethaddr_tbl))
return -EINVAL;
@@ -1832,7 +1833,7 @@ port_init(uint16_t portid, uint64_t req_rx_offloads, uint64_t req_tx_offloads)
uint16_t tx_queueid, rx_queueid, queue, lcore_id;
int32_t ret, socket_id;
struct lcore_conf *qconf;
- struct ether_addr ethaddr;
+ struct rte_ether_addr ethaddr;
struct rte_eth_conf local_port_conf = port_conf;
rte_eth_dev_info_get(portid, &dev_info);
diff --git a/examples/ipsec-secgw/ipsec.h b/examples/ipsec-secgw/ipsec.h
index 589398f..e9272d7 100644
--- a/examples/ipsec-secgw/ipsec.h
+++ b/examples/ipsec-secgw/ipsec.h
@@ -306,7 +306,7 @@ sa_check_offloads(uint16_t port_id, uint64_t *rx_offloads,
uint64_t *tx_offloads);
int
-add_dst_ethaddr(uint16_t port, const struct ether_addr *addr);
+add_dst_ethaddr(uint16_t port, const struct rte_ether_addr *addr);
void
enqueue_cop_burst(struct cdev_qp *cqp);
diff --git a/examples/ipsec-secgw/parser.c b/examples/ipsec-secgw/parser.c
index b0a8ee2..fc8c238 100644
--- a/examples/ipsec-secgw/parser.c
+++ b/examples/ipsec-secgw/parser.c
@@ -324,7 +324,7 @@ parse_uint8x16(const char *s, uint8_t *v, uint8_t ls)
}
static int
-parse_mac(const char *str, struct ether_addr *addr)
+parse_mac(const char *str, struct rte_ether_addr *addr)
{
uint32_t i;
@@ -499,7 +499,7 @@ cfg_parse_neigh(void *parsed_result, __rte_unused struct cmdline *cl,
int32_t rc;
struct cfg_neigh_add_item *res;
struct parse_status *st;
- struct ether_addr mac;
+ struct rte_ether_addr mac;
st = data;
res = parsed_result;
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 1eef291..a047197 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -80,7 +80,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
/* ethernet addresses of ports */
-static struct ether_addr ports_eth_addr[MAX_PORTS];
+static struct rte_ether_addr ports_eth_addr[MAX_PORTS];
/* mask of enabled ports */
static uint32_t enabled_port_mask = 0;
@@ -267,14 +267,15 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone)
* and put it into the outgoing queue for the given port.
*/
static inline void
-mcast_send_pkt(struct rte_mbuf *pkt, struct ether_addr *dest_addr,
+mcast_send_pkt(struct rte_mbuf *pkt, struct rte_ether_addr *dest_addr,
struct lcore_queue_conf *qconf, uint16_t port)
{
- struct ether_hdr *ethdr;
+ struct rte_ether_hdr *ethdr;
uint16_t len;
/* Construct Ethernet header. */
- ethdr = (struct ether_hdr *)rte_pktmbuf_prepend(pkt, (uint16_t)sizeof(*ethdr));
+ ethdr = (struct rte_ether_hdr *)
+ rte_pktmbuf_prepend(pkt, (uint16_t)sizeof(*ethdr));
RTE_ASSERT(ethdr != NULL);
ether_addr_copy(dest_addr, &ethdr->d_addr);
@@ -302,11 +303,12 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf)
uint16_t port;
union {
uint64_t as_int;
- struct ether_addr as_addr;
+ struct rte_ether_addr as_addr;
} dst_eth_addr;
/* Remove the Ethernet header from the input packet */
- iphdr = (struct ipv4_hdr *)rte_pktmbuf_adj(m, (uint16_t)sizeof(struct ether_hdr));
+ iphdr = (struct 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);
@@ -535,7 +537,7 @@ parse_args(int argc, char **argv)
}
static void
-print_ethaddr(const char *name, struct ether_addr *eth_addr)
+print_ethaddr(const char *name, struct rte_ether_addr *eth_addr)
{
char buf[ETHER_ADDR_FMT_SIZE];
ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);
diff --git a/examples/kni/main.c b/examples/kni/main.c
index a58774a..8bea071 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -832,7 +832,7 @@ kni_config_network_interface(uint16_t port_id, uint8_t if_up)
}
static void
-print_ethaddr(const char *name, struct ether_addr *mac_addr)
+print_ethaddr(const char *name, struct rte_ether_addr *mac_addr)
{
char buf[ETHER_ADDR_FMT_SIZE];
ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, mac_addr);
@@ -851,10 +851,10 @@ kni_config_mac_address(uint16_t port_id, uint8_t mac_addr[])
}
RTE_LOG(INFO, APP, "Configure mac address of %d\n", port_id);
- print_ethaddr("Address:", (struct ether_addr *)mac_addr);
+ print_ethaddr("Address:", (struct rte_ether_addr *)mac_addr);
ret = rte_eth_dev_default_mac_addr_set(port_id,
- (struct ether_addr *)mac_addr);
+ (struct rte_ether_addr *)mac_addr);
if (ret < 0)
RTE_LOG(ERR, APP, "Failed to config mac_addr for port %d\n",
port_id);
@@ -912,7 +912,7 @@ kni_alloc(uint16_t port_id)
}
/* Get the interface default mac address */
rte_eth_macaddr_get(port_id,
- (struct ether_addr *)&conf.mac_addr);
+ (struct rte_ether_addr *)&conf.mac_addr);
rte_eth_dev_get_mtu(port_id, &conf.mtu);
diff --git a/examples/l2fwd-cat/l2fwd-cat.c b/examples/l2fwd-cat/l2fwd-cat.c
index 0e6078a..1a8af28 100644
--- a/examples/l2fwd-cat/l2fwd-cat.c
+++ b/examples/l2fwd-cat/l2fwd-cat.c
@@ -73,7 +73,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
return retval;
/* Display the port MAC address. */
- struct ether_addr addr;
+ struct rte_ether_addr addr;
rte_eth_macaddr_get(port, &addr);
printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 06517b4..dd09855 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -79,7 +79,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
/* ethernet addresses of ports */
-static struct ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS];
+static struct rte_ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS];
/* mask of enabled ports */
static uint64_t l2fwd_enabled_port_mask;
@@ -387,19 +387,19 @@ l2fwd_simple_crypto_enqueue(struct rte_mbuf *m,
struct rte_crypto_op *op,
struct l2fwd_crypto_params *cparams)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
struct ipv4_hdr *ip_hdr;
uint32_t ipdata_offset, data_len;
uint32_t pad_len = 0;
char *padding;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
if (eth_hdr->ether_type != rte_cpu_to_be_16(ETHER_TYPE_IPv4))
return -1;
- ipdata_offset = sizeof(struct ether_hdr);
+ ipdata_offset = sizeof(struct rte_ether_hdr);
ip_hdr = (struct ipv4_hdr *)(rte_pktmbuf_mtod(m, char *) +
ipdata_offset);
@@ -593,10 +593,10 @@ l2fwd_send_packet(struct rte_mbuf *m, uint16_t port)
static void
l2fwd_mac_updating(struct rte_mbuf *m, uint16_t dest_portid)
{
- struct ether_hdr *eth;
+ struct rte_ether_hdr *eth;
void *tmp;
- eth = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
/* 02:00:00:00:00:xx */
tmp = &eth->d_addr.addr_bytes[0];
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index a4d28e1..033104d 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -52,7 +52,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
/* ethernet addresses of ports */
-static struct ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS];
+static struct rte_ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS];
/* mask of enabled ports */
static uint32_t l2fwd_enabled_port_mask;
@@ -335,14 +335,14 @@ show_stats_cb(__rte_unused void *param)
static void
l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid)
{
- struct ether_hdr *eth;
+ struct rte_ether_hdr *eth;
void *tmp;
int sent;
unsigned dst_port;
struct rte_eth_dev_tx_buffer *buffer;
dst_port = l2fwd_dst_ports[portid];
- eth = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
/* 02:00:00:00:00:xx */
tmp = &eth->d_addr.addr_bytes[0];
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 0bf2b53..21d1993 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -58,7 +58,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
/* ethernet addresses of ports */
-static struct ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS];
+static struct rte_ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS];
/* mask of enabled ports */
static uint32_t l2fwd_enabled_port_mask;
@@ -165,14 +165,14 @@ print_stats(__attribute__((unused)) struct rte_timer *ptr_timer,
static void
l2fwd_simple_forward(struct rte_mbuf *m, unsigned portid)
{
- struct ether_hdr *eth;
+ struct rte_ether_hdr *eth;
void *tmp;
int sent;
unsigned dst_port;
struct rte_eth_dev_tx_buffer *buffer;
dst_port = l2fwd_dst_ports[portid];
- eth = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
/* 02:00:00:00:00:xx */
tmp = &eth->d_addr.addr_bytes[0];
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 6c23215..c1d6797 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -59,7 +59,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
/* ethernet addresses of ports */
-static struct ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS];
+static struct rte_ether_addr l2fwd_ports_eth_addr[RTE_MAX_ETHPORTS];
/* mask of enabled ports */
static uint32_t l2fwd_enabled_port_mask = 0;
@@ -151,10 +151,10 @@ print_stats(void)
static void
l2fwd_mac_updating(struct rte_mbuf *m, unsigned dest_portid)
{
- struct ether_hdr *eth;
+ struct rte_ether_hdr *eth;
void *tmp;
- eth = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
/* 02:00:00:00:00:xx */
tmp = &eth->d_addr.addr_bytes[0];
diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c
index a322ce4..3a0f582 100644
--- a/examples/l3fwd-acl/main.c
+++ b/examples/l3fwd-acl/main.c
@@ -82,7 +82,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
/* ethernet addresses of ports */
-static struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
+static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
/* mask of enabled ports */
static uint32_t enabled_port_mask;
@@ -173,7 +173,7 @@ send_single_packet(struct rte_mbuf *m, uint16_t port);
*c = (unsigned char)(ip >> 8 & 0xff);\
*d = (unsigned char)(ip & 0xff);\
} while (0)
-#define OFF_ETHHEAD (sizeof(struct ether_hdr))
+#define OFF_ETHHEAD (sizeof(struct rte_ether_hdr))
#define OFF_IPV42PROTO (offsetof(struct ipv4_hdr, next_proto_id))
#define OFF_IPV62PROTO (offsetof(struct ipv6_hdr, proto))
#define MBUF_IPV4_2PROTO(m) \
@@ -542,9 +542,9 @@ dump_acl4_rule(struct rte_mbuf *m, uint32_t sig)
{
uint32_t offset = sig & ~ACL_DENY_SIGNATURE;
unsigned char a, b, c, d;
- struct ipv4_hdr *ipv4_hdr = rte_pktmbuf_mtod_offset(m,
- struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ struct ipv4_hdr *ipv4_hdr =
+ rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
+ sizeof(struct rte_ether_hdr));
uint32_t_to_char(rte_bswap32(ipv4_hdr->src_addr), &a, &b, &c, &d);
printf("Packet Src:%hhu.%hhu.%hhu.%hhu ", a, b, c, d);
@@ -566,9 +566,9 @@ dump_acl6_rule(struct rte_mbuf *m, uint32_t sig)
{
unsigned i;
uint32_t offset = sig & ~ACL_DENY_SIGNATURE;
- struct ipv6_hdr *ipv6_hdr = rte_pktmbuf_mtod_offset(m,
- struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ struct ipv6_hdr *ipv6_hdr =
+ rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *,
+ sizeof(struct rte_ether_hdr));
printf("Packet Src");
for (i = 0; i < RTE_DIM(ipv6_hdr->src_addr); i += sizeof(uint16_t))
@@ -625,7 +625,7 @@ prepare_one_packet(struct rte_mbuf **pkts_in, struct acl_search_t *acl,
if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type)) {
ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
/* Check to make sure the packet is valid (RFC1812) */
if (is_valid_ipv4_pkt(ipv4_hdr, pkt->pkt_len) >= 0) {
@@ -1754,7 +1754,7 @@ parse_args(int argc, char **argv)
}
static void
-print_ethaddr(const char *name, const struct ether_addr *eth_addr)
+print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr)
{
char buf[ETHER_ADDR_FMT_SIZE];
ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 3b448ac..bcd584d 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -135,7 +135,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
/* ethernet addresses of ports */
-static struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
+static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
/* ethernet addresses of ports */
static rte_spinlock_t locks[RTE_MAX_ETHPORTS];
@@ -618,11 +618,11 @@ get_ipv4_dst_port(struct ipv4_hdr *ipv4_hdr, uint16_t portid,
static inline void
parse_ptype_one(struct rte_mbuf *m)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
uint32_t packet_type = RTE_PTYPE_UNKNOWN;
uint16_t ether_type;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
ether_type = eth_hdr->ether_type;
if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4))
packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
@@ -661,18 +661,18 @@ static inline void
l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,
struct lcore_conf *qconf)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
struct ipv4_hdr *ipv4_hdr;
void *d_addr_bytes;
uint16_t dst_port;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
/* Handle IPv4 headers.*/
ipv4_hdr =
rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
#ifdef DO_RFC_1812_CHECKS
/* Check to make sure the packet is valid (RFC1812) */
@@ -710,7 +710,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,
ipv6_hdr =
rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
dst_port = get_ipv6_dst_port(ipv6_hdr, portid,
qconf->ipv6_lookup_struct);
@@ -1577,7 +1577,7 @@ parse_args(int argc, char **argv)
}
static void
-print_ethaddr(const char *name, const struct ether_addr *eth_addr)
+print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr)
{
char buf[ETHER_ADDR_FMT_SIZE];
ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);
diff --git a/examples/l3fwd-vf/main.c b/examples/l3fwd-vf/main.c
index 41137f9..2c0c89e 100644
--- a/examples/l3fwd-vf/main.c
+++ b/examples/l3fwd-vf/main.c
@@ -112,7 +112,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
/* ethernet addresses of ports */
-static struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
+static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
/* mask of enabled ports */
static uint32_t enabled_port_mask = 0;
@@ -417,15 +417,15 @@ static inline void
l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,
lookup_struct_t *l3fwd_lookup_struct)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
struct ipv4_hdr *ipv4_hdr;
void *tmp;
uint16_t dst_port;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
#ifdef DO_RFC_1812_CHECKS
/* Check to make sure the packet is valid (RFC1812) */
@@ -788,7 +788,7 @@ parse_args(int argc, char **argv)
}
static void
-print_ethaddr(const char *name, const struct ether_addr *eth_addr)
+print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr)
{
char buf[ETHER_ADDR_FMT_SIZE];
ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);
diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h
index c962dea..1893f8c 100644
--- a/examples/l3fwd/l3fwd.h
+++ b/examples/l3fwd/l3fwd.h
@@ -73,7 +73,7 @@ extern volatile bool force_quit;
/* ethernet addresses of ports */
extern uint64_t dest_eth_addr[RTE_MAX_ETHPORTS];
-extern struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
+extern struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
/* mask of enabled ports */
extern uint32_t enabled_port_mask;
diff --git a/examples/l3fwd/l3fwd_altivec.h b/examples/l3fwd/l3fwd_altivec.h
index 5ec99f9..0c68aa0 100644
--- a/examples/l3fwd/l3fwd_altivec.h
+++ b/examples/l3fwd/l3fwd_altivec.h
@@ -68,13 +68,13 @@ processx4_step3(struct rte_mbuf *pkt[FWDSTEP], uint16_t dst_port[FWDSTEP])
*p[2] = te[2];
*p[3] = te[3];
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[0] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[0] + 1),
&dst_port[0], pkt[0]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[1] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[1] + 1),
&dst_port[1], pkt[1]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[2] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[2] + 1),
&dst_port[2], pkt[2]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[3] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1),
&dst_port[3], pkt[3]->packet_type);
}
@@ -121,10 +121,10 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, vector unsigned short dp1,
static inline void
process_packet(struct rte_mbuf *pkt, uint16_t *dst_port)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
vector unsigned int te, ve;
- eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
te = *(vector unsigned int *)eth_hdr;
ve = (vector unsigned int)val_eth[dst_port[0]];
diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c
index fa8f82b..64e79b9 100644
--- a/examples/l3fwd/l3fwd_em.c
+++ b/examples/l3fwd/l3fwd_em.c
@@ -561,7 +561,7 @@ em_check_ptype(int portid)
static inline void
em_parse_ptype(struct rte_mbuf *m)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
uint32_t packet_type = RTE_PTYPE_UNKNOWN;
uint16_t ether_type;
void *l3;
@@ -569,9 +569,9 @@ em_parse_ptype(struct rte_mbuf *m)
struct ipv4_hdr *ipv4_hdr;
struct ipv6_hdr *ipv6_hdr;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
ether_type = eth_hdr->ether_type;
- l3 = (uint8_t *)eth_hdr + sizeof(struct ether_hdr);
+ l3 = (uint8_t *)eth_hdr + sizeof(struct rte_ether_hdr);
if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4)) {
ipv4_hdr = (struct ipv4_hdr *)l3;
hdr_len = (ipv4_hdr->version_ihl & IPV4_HDR_IHL_MASK) *
diff --git a/examples/l3fwd/l3fwd_em.h b/examples/l3fwd/l3fwd_em.h
index 228164e..de1278b 100644
--- a/examples/l3fwd/l3fwd_em.h
+++ b/examples/l3fwd/l3fwd_em.h
@@ -9,20 +9,20 @@ static __rte_always_inline void
l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid,
struct lcore_conf *qconf)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
struct ipv4_hdr *ipv4_hdr;
uint16_t dst_port;
uint32_t tcp_or_udp;
uint32_t l3_ptypes;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
tcp_or_udp = m->packet_type & (RTE_PTYPE_L4_TCP | RTE_PTYPE_L4_UDP);
l3_ptypes = m->packet_type & RTE_PTYPE_L3_MASK;
if (tcp_or_udp && (l3_ptypes == RTE_PTYPE_L3_IPV4)) {
/* Handle IPv4 headers.*/
ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
#ifdef DO_RFC_1812_CHECKS
/* Check to make sure the packet is valid (RFC1812) */
@@ -55,7 +55,7 @@ l3fwd_em_simple_forward(struct rte_mbuf *m, uint16_t portid,
struct ipv6_hdr *ipv6_hdr;
ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
dst_port = em_get_ipv6_dst_port(ipv6_hdr, portid,
qconf->ipv6_lookup_struct);
diff --git a/examples/l3fwd/l3fwd_em_hlm.h b/examples/l3fwd/l3fwd_em_hlm.h
index 22c26dc..ec52a01 100644
--- a/examples/l3fwd/l3fwd_em_hlm.h
+++ b/examples/l3fwd/l3fwd_em_hlm.h
@@ -92,7 +92,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
/* Handle IPv4 headers.*/
ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
next_hop = em_get_ipv4_dst_port(ipv4_hdr, portid,
qconf->ipv4_lookup_struct);
@@ -107,7 +107,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
/* Handle IPv6 headers.*/
ipv6_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
next_hop = em_get_ipv6_dst_port(ipv6_hdr, portid,
qconf->ipv6_lookup_struct);
@@ -142,7 +142,7 @@ l3fwd_em_send_packets(int nb_rx, struct rte_mbuf **pkts_burst,
for (j = 0; j < EM_HASH_LOOKUP_COUNT && j < nb_rx; j++) {
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j],
- struct ether_hdr *) + 1);
+ struct rte_ether_hdr *) + 1);
}
for (j = 0; j < n; j += EM_HASH_LOOKUP_COUNT) {
@@ -159,8 +159,9 @@ l3fwd_em_send_packets(int nb_rx, struct rte_mbuf **pkts_burst,
for (i = 0, pos = j + EM_HASH_LOOKUP_COUNT;
i < EM_HASH_LOOKUP_COUNT && pos < nb_rx; i++, pos++) {
- rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[pos],
- struct ether_hdr *) + 1);
+ rte_prefetch0(rte_pktmbuf_mtod(
+ pkts_burst[pos],
+ struct rte_ether_hdr *) + 1);
}
if (tcp_or_udp && (l3_type == RTE_PTYPE_L3_IPV4)) {
diff --git a/examples/l3fwd/l3fwd_em_hlm_neon.h b/examples/l3fwd/l3fwd_em_hlm_neon.h
index 16c8b04..3ee2304 100644
--- a/examples/l3fwd/l3fwd_em_hlm_neon.h
+++ b/examples/l3fwd/l3fwd_em_hlm_neon.h
@@ -13,7 +13,7 @@ get_ipv4_5tuple(struct rte_mbuf *m0, int32x4_t mask0,
union ipv4_5tuple_host *key)
{
int32x4_t tmpdata0 = vld1q_s32(rte_pktmbuf_mtod_offset(m0, int32_t *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv4_hdr, time_to_live)));
key->xmm = vandq_s32(tmpdata0, mask0);
@@ -25,17 +25,17 @@ get_ipv6_5tuple(struct rte_mbuf *m0, int32x4_t mask0,
{
int32x4_t tmpdata0 = vld1q_s32(
rte_pktmbuf_mtod_offset(m0, int *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv6_hdr, payload_len)));
int32x4_t tmpdata1 = vld1q_s32(
rte_pktmbuf_mtod_offset(m0, int *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv6_hdr, payload_len) + 8));
int32x4_t tmpdata2 = vld1q_s32(
rte_pktmbuf_mtod_offset(m0, int *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv6_hdr, payload_len) + 16));
key->xmm[0] = vandq_s32(tmpdata0, mask0);
diff --git a/examples/l3fwd/l3fwd_em_hlm_sse.h b/examples/l3fwd/l3fwd_em_hlm_sse.h
index 41e2be9..8156bbb 100644
--- a/examples/l3fwd/l3fwd_em_hlm_sse.h
+++ b/examples/l3fwd/l3fwd_em_hlm_sse.h
@@ -13,7 +13,7 @@ get_ipv4_5tuple(struct rte_mbuf *m0, __m128i mask0,
{
__m128i tmpdata0 = _mm_loadu_si128(
rte_pktmbuf_mtod_offset(m0, __m128i *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv4_hdr, time_to_live)));
key->xmm = _mm_and_si128(tmpdata0, mask0);
@@ -25,18 +25,18 @@ get_ipv6_5tuple(struct rte_mbuf *m0, __m128i mask0,
{
__m128i tmpdata0 = _mm_loadu_si128(
rte_pktmbuf_mtod_offset(m0, __m128i *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv6_hdr, payload_len)));
__m128i tmpdata1 = _mm_loadu_si128(
rte_pktmbuf_mtod_offset(m0, __m128i *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv6_hdr, payload_len) +
sizeof(__m128i)));
__m128i tmpdata2 = _mm_loadu_si128(
rte_pktmbuf_mtod_offset(m0, __m128i *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv6_hdr, payload_len) +
sizeof(__m128i) + sizeof(__m128i)));
diff --git a/examples/l3fwd/l3fwd_em_sequential.h b/examples/l3fwd/l3fwd_em_sequential.h
index 35cf5ea..770660e 100644
--- a/examples/l3fwd/l3fwd_em_sequential.h
+++ b/examples/l3fwd/l3fwd_em_sequential.h
@@ -37,7 +37,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
/* Handle IPv4 headers.*/
ipv4_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
next_hop = em_get_ipv4_dst_port(ipv4_hdr, portid,
qconf->ipv4_lookup_struct);
@@ -52,7 +52,7 @@ em_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
/* Handle IPv6 headers.*/
ipv6_hdr = rte_pktmbuf_mtod_offset(pkt, struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
next_hop = em_get_ipv6_dst_port(ipv6_hdr, portid,
qconf->ipv6_lookup_struct);
@@ -81,13 +81,14 @@ l3fwd_em_send_packets(int nb_rx, struct rte_mbuf **pkts_burst,
if (nb_rx > 0) {
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[0],
- struct ether_hdr *) + 1);
+ struct rte_ether_hdr *) + 1);
}
for (i = 1, j = 0; j < nb_rx; i++, j++) {
if (i < nb_rx) {
- rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i],
- struct ether_hdr *) + 1);
+ rte_prefetch0(rte_pktmbuf_mtod(
+ pkts_burst[i],
+ struct rte_ether_hdr *) + 1);
}
dst_port[j] = em_get_dst_port(qconf, pkts_burst[j], portid);
}
diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c
index 60a0063..b373047 100644
--- a/examples/l3fwd/l3fwd_lpm.c
+++ b/examples/l3fwd/l3fwd_lpm.c
@@ -108,18 +108,18 @@ lpm_get_dst_port(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
{
struct ipv6_hdr *ipv6_hdr;
struct ipv4_hdr *ipv4_hdr;
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type)) {
- eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
return lpm_get_ipv4_dst_port(ipv4_hdr, portid,
qconf->ipv4_lookup_struct);
} else if (RTE_ETH_IS_IPV6_HDR(pkt->packet_type)) {
- eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
ipv6_hdr = (struct ipv6_hdr *)(eth_hdr + 1);
return lpm_get_ipv6_dst_port(ipv6_hdr, portid,
@@ -140,7 +140,7 @@ lpm_get_dst_port_with_ipv4(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
{
uint32_t next_hop;
struct ipv6_hdr *ipv6_hdr;
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type)) {
return (uint16_t) ((rte_lpm_lookup(qconf->ipv4_lookup_struct,
@@ -149,7 +149,7 @@ lpm_get_dst_port_with_ipv4(const struct lcore_conf *qconf, struct rte_mbuf *pkt,
} else if (RTE_ETH_IS_IPV6_HDR(pkt->packet_type)) {
- eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
ipv6_hdr = (struct ipv6_hdr *)(eth_hdr + 1);
return (uint16_t) ((rte_lpm6_lookup(qconf->ipv6_lookup_struct,
@@ -380,11 +380,11 @@ lpm_check_ptype(int portid)
static inline void
lpm_parse_ptype(struct rte_mbuf *m)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
uint32_t packet_type = RTE_PTYPE_UNKNOWN;
uint16_t ether_type;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
ether_type = eth_hdr->ether_type;
if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4))
packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
diff --git a/examples/l3fwd/l3fwd_lpm.h b/examples/l3fwd/l3fwd_lpm.h
index b68868f..0c98d3f 100644
--- a/examples/l3fwd/l3fwd_lpm.h
+++ b/examples/l3fwd/l3fwd_lpm.h
@@ -9,16 +9,16 @@ static __rte_always_inline void
l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid,
struct lcore_conf *qconf)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
struct ipv4_hdr *ipv4_hdr;
uint16_t dst_port;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
/* Handle IPv4 headers.*/
ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
#ifdef DO_RFC_1812_CHECKS
/* Check to make sure the packet is valid (RFC1812) */
@@ -51,7 +51,7 @@ l3fwd_lpm_simple_forward(struct rte_mbuf *m, uint16_t portid,
struct ipv6_hdr *ipv6_hdr;
ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
dst_port = lpm_get_ipv6_dst_port(ipv6_hdr, portid,
qconf->ipv6_lookup_struct);
diff --git a/examples/l3fwd/l3fwd_lpm_altivec.h b/examples/l3fwd/l3fwd_lpm_altivec.h
index 4c9e243..b36e991 100644
--- a/examples/l3fwd/l3fwd_lpm_altivec.h
+++ b/examples/l3fwd/l3fwd_lpm_altivec.h
@@ -18,28 +18,28 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP],
uint32_t *ipv4_flag)
{
struct ipv4_hdr *ipv4_hdr;
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
uint32_t x0, x1, x2, x3;
- eth_hdr = rte_pktmbuf_mtod(pkt[0], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x0 = ipv4_hdr->dst_addr;
ipv4_flag[0] = pkt[0]->packet_type & RTE_PTYPE_L3_IPV4;
rte_compiler_barrier();
- eth_hdr = rte_pktmbuf_mtod(pkt[1], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[1], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x1 = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[1]->packet_type;
rte_compiler_barrier();
- eth_hdr = rte_pktmbuf_mtod(pkt[2], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[2], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x2 = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[2]->packet_type;
rte_compiler_barrier();
- eth_hdr = rte_pktmbuf_mtod(pkt[3], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[3], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x3 = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[3]->packet_type;
diff --git a/examples/l3fwd/l3fwd_lpm_neon.h b/examples/l3fwd/l3fwd_lpm_neon.h
index 02ec0d8..a3e42cf 100644
--- a/examples/l3fwd/l3fwd_lpm_neon.h
+++ b/examples/l3fwd/l3fwd_lpm_neon.h
@@ -19,25 +19,25 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP],
uint32_t *ipv4_flag)
{
struct ipv4_hdr *ipv4_hdr;
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
int32_t dst[FWDSTEP];
- eth_hdr = rte_pktmbuf_mtod(pkt[0], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
dst[0] = ipv4_hdr->dst_addr;
ipv4_flag[0] = pkt[0]->packet_type & RTE_PTYPE_L3_IPV4;
- eth_hdr = rte_pktmbuf_mtod(pkt[1], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[1], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
dst[1] = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[1]->packet_type;
- eth_hdr = rte_pktmbuf_mtod(pkt[2], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[2], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
dst[2] = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[2]->packet_type;
- eth_hdr = rte_pktmbuf_mtod(pkt[3], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[3], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
dst[3] = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[3]->packet_type;
@@ -98,14 +98,14 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst,
if (k) {
for (i = 0; i < FWDSTEP; i++) {
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[i],
- struct ether_hdr *) + 1);
+ struct rte_ether_hdr *) + 1);
}
for (j = 0; j != k - FWDSTEP; j += FWDSTEP) {
for (i = 0; i < FWDSTEP; i++) {
rte_prefetch0(rte_pktmbuf_mtod(
pkts_burst[j + i + FWDSTEP],
- struct ether_hdr *) + 1);
+ struct rte_ether_hdr *) + 1);
}
processx4_step1(&pkts_burst[j], &dip, &ipv4_flag);
@@ -125,17 +125,17 @@ l3fwd_lpm_send_packets(int nb_rx, struct rte_mbuf **pkts_burst,
switch (m) {
case 3:
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j],
- struct ether_hdr *) + 1);
+ struct rte_ether_hdr *) + 1);
j++;
/* fallthrough */
case 2:
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j],
- struct ether_hdr *) + 1);
+ struct rte_ether_hdr *) + 1);
j++;
/* fallthrough */
case 1:
rte_prefetch0(rte_pktmbuf_mtod(pkts_burst[j],
- struct ether_hdr *) + 1);
+ struct rte_ether_hdr *) + 1);
j++;
}
diff --git a/examples/l3fwd/l3fwd_lpm_sse.h b/examples/l3fwd/l3fwd_lpm_sse.h
index 1d16159..4603e07 100644
--- a/examples/l3fwd/l3fwd_lpm_sse.h
+++ b/examples/l3fwd/l3fwd_lpm_sse.h
@@ -16,25 +16,25 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP],
uint32_t *ipv4_flag)
{
struct ipv4_hdr *ipv4_hdr;
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
uint32_t x0, x1, x2, x3;
- eth_hdr = rte_pktmbuf_mtod(pkt[0], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x0 = ipv4_hdr->dst_addr;
ipv4_flag[0] = pkt[0]->packet_type & RTE_PTYPE_L3_IPV4;
- eth_hdr = rte_pktmbuf_mtod(pkt[1], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[1], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x1 = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[1]->packet_type;
- eth_hdr = rte_pktmbuf_mtod(pkt[2], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[2], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x2 = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[2]->packet_type;
- eth_hdr = rte_pktmbuf_mtod(pkt[3], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[3], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x3 = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[3]->packet_type;
diff --git a/examples/l3fwd/l3fwd_neon.h b/examples/l3fwd/l3fwd_neon.h
index 76ccdfa..af2dc47 100644
--- a/examples/l3fwd/l3fwd_neon.h
+++ b/examples/l3fwd/l3fwd_neon.h
@@ -48,13 +48,13 @@ processx4_step3(struct rte_mbuf *pkt[FWDSTEP], uint16_t dst_port[FWDSTEP])
vst1q_u32(p[2], ve[2]);
vst1q_u32(p[3], ve[3]);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[0] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[0] + 1),
&dst_port[0], pkt[0]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[1] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[1] + 1),
&dst_port[1], pkt[1]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[2] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[2] + 1),
&dst_port[2], pkt[2]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[3] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1),
&dst_port[3], pkt[3]->packet_type);
}
@@ -104,10 +104,10 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, uint16x8_t dp1,
static inline void
process_packet(struct rte_mbuf *pkt, uint16_t *dst_port)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
uint32x4_t te, ve;
- eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
te = vld1q_u32((uint32_t *)eth_hdr);
ve = vreinterpretq_u32_s32(val_eth[dst_port[0]]);
diff --git a/examples/l3fwd/l3fwd_sse.h b/examples/l3fwd/l3fwd_sse.h
index ed5267c..3349f27 100644
--- a/examples/l3fwd/l3fwd_sse.h
+++ b/examples/l3fwd/l3fwd_sse.h
@@ -48,13 +48,13 @@ processx4_step3(struct rte_mbuf *pkt[FWDSTEP], uint16_t dst_port[FWDSTEP])
_mm_storeu_si128(p[2], te[2]);
_mm_storeu_si128(p[3], te[3]);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[0] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[0] + 1),
&dst_port[0], pkt[0]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[1] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[1] + 1),
&dst_port[1], pkt[1]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[2] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[2] + 1),
&dst_port[2], pkt[2]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[3] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1),
&dst_port[3], pkt[3]->packet_type);
}
@@ -101,10 +101,10 @@ port_groupx4(uint16_t pn[FWDSTEP + 1], uint16_t *lp, __m128i dp1, __m128i dp2)
static inline void
process_packet(struct rte_mbuf *pkt, uint16_t *dst_port)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
__m128i te, ve;
- eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
te = _mm_loadu_si128((__m128i *)eth_hdr);
ve = val_eth[dst_port[0]];
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 7b96831..b0a700a 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -81,7 +81,7 @@ volatile bool force_quit;
/* ethernet addresses of ports */
uint64_t dest_eth_addr[RTE_MAX_ETHPORTS];
-struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
+struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
xmm_t val_eth[RTE_MAX_ETHPORTS];
@@ -647,7 +647,7 @@ parse_args(int argc, char **argv)
}
static void
-print_ethaddr(const char *name, const struct ether_addr *eth_addr)
+print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr)
{
char buf[ETHER_ADDR_FMT_SIZE];
ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);
@@ -908,14 +908,14 @@ main(int argc, char **argv)
print_ethaddr(" Address:", &ports_eth_addr[portid]);
printf(", ");
print_ethaddr("Destination:",
- (const struct ether_addr *)&dest_eth_addr[portid]);
+ (const struct rte_ether_addr *)&dest_eth_addr[portid]);
printf(", ");
/*
* prepare src MACs for each port.
*/
ether_addr_copy(&ports_eth_addr[portid],
- (struct ether_addr *)(val_eth + portid) + 1);
+ (struct rte_ether_addr *)(val_eth + portid) + 1);
/* init memory */
if (!per_port_pool) {
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index f3346d2..9997c58 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -53,7 +53,7 @@ static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;
static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
/* ethernet addresses of ports */
-static struct ether_addr lsi_ports_eth_addr[RTE_MAX_ETHPORTS];
+static struct rte_ether_addr lsi_ports_eth_addr[RTE_MAX_ETHPORTS];
/* mask of enabled ports */
static uint32_t lsi_enabled_port_mask = 0;
@@ -163,13 +163,13 @@ print_stats(void)
static void
lsi_simple_forward(struct rte_mbuf *m, unsigned portid)
{
- struct ether_hdr *eth;
+ struct rte_ether_hdr *eth;
void *tmp;
unsigned dst_port = lsi_dst_ports[portid];
int sent;
struct rte_eth_dev_tx_buffer *buffer;
- eth = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
/* 02:00:00:00:00:xx */
tmp = &eth->d_addr.addr_bytes[0];
diff --git a/examples/load_balancer/runtime.c b/examples/load_balancer/runtime.c
index 39a846a..f39681d 100644
--- a/examples/load_balancer/runtime.c
+++ b/examples/load_balancer/runtime.c
@@ -507,9 +507,9 @@ app_lcore_worker(
}
pkt = lp->mbuf_in.array[j];
- ipv4_hdr = rte_pktmbuf_mtod_offset(pkt,
- struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ ipv4_hdr = rte_pktmbuf_mtod_offset(
+ pkt, struct ipv4_hdr *,
+ sizeof(struct rte_ether_hdr));
ipv4_dst = rte_be_to_cpu_32(ipv4_hdr->dst_addr);
if (unlikely(rte_lpm_lookup(lp->lpm_table, ipv4_dst, &port) != 0)) {
diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c
index 0ddc63e..9a8e422 100644
--- a/examples/multi_process/client_server_mp/mp_server/main.c
+++ b/examples/multi_process/client_server_mp/mp_server/main.c
@@ -66,7 +66,7 @@ get_printable_mac_addr(uint16_t port)
if (unlikely(port >= RTE_MAX_ETHPORTS))
return err_address;
if (unlikely(addresses[port][0]=='\0')){
- struct ether_addr mac;
+ struct rte_ether_addr mac;
rte_eth_macaddr_get(port, &mac);
snprintf(addresses[port], sizeof(addresses[port]),
"%02x:%02x:%02x:%02x:%02x:%02x\n",
diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 149bfdd..ca31202 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -255,7 +255,7 @@ configure_tx_buffers(struct rte_eth_dev_tx_buffer *tx_buffer[])
static inline int
configure_eth_port(uint16_t port_id)
{
- struct ether_addr addr;
+ struct rte_ether_addr addr;
const uint16_t rxRings = 1, txRings = 1;
int ret;
uint16_t q;
diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index 4f8747b..b29ed9e 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -92,11 +92,11 @@ check_ptype(int portid)
static inline void
parse_ptype(struct rte_mbuf *m)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
uint32_t packet_type = RTE_PTYPE_UNKNOWN;
uint16_t ether_type;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
ether_type = eth_hdr->ether_type;
if (ether_type == rte_cpu_to_be_16(ETHER_TYPE_IPv4))
packet_type |= RTE_PTYPE_L3_IPV4_EXT_UNKNOWN;
@@ -186,7 +186,7 @@ static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;
/* ethernet addresses of ports */
static uint64_t dest_eth_addr[RTE_MAX_ETHPORTS];
-static struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
+static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
static xmm_t val_eth[RTE_MAX_ETHPORTS];
@@ -884,39 +884,39 @@ static inline void l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid)
static inline void
simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid)
{
- struct ether_hdr *eth_hdr[8];
+ struct rte_ether_hdr *eth_hdr[8];
struct ipv4_hdr *ipv4_hdr[8];
uint16_t dst_port[8];
int32_t ret[8];
union ipv4_5tuple_host key[8];
__m128i data[8];
- eth_hdr[0] = rte_pktmbuf_mtod(m[0], struct ether_hdr *);
- eth_hdr[1] = rte_pktmbuf_mtod(m[1], struct ether_hdr *);
- eth_hdr[2] = rte_pktmbuf_mtod(m[2], struct ether_hdr *);
- eth_hdr[3] = rte_pktmbuf_mtod(m[3], struct ether_hdr *);
- eth_hdr[4] = rte_pktmbuf_mtod(m[4], struct ether_hdr *);
- eth_hdr[5] = rte_pktmbuf_mtod(m[5], struct ether_hdr *);
- eth_hdr[6] = rte_pktmbuf_mtod(m[6], struct ether_hdr *);
- eth_hdr[7] = rte_pktmbuf_mtod(m[7], struct ether_hdr *);
+ eth_hdr[0] = rte_pktmbuf_mtod(m[0], struct rte_ether_hdr *);
+ eth_hdr[1] = rte_pktmbuf_mtod(m[1], struct rte_ether_hdr *);
+ eth_hdr[2] = rte_pktmbuf_mtod(m[2], struct rte_ether_hdr *);
+ eth_hdr[3] = rte_pktmbuf_mtod(m[3], struct rte_ether_hdr *);
+ eth_hdr[4] = rte_pktmbuf_mtod(m[4], struct rte_ether_hdr *);
+ eth_hdr[5] = rte_pktmbuf_mtod(m[5], struct rte_ether_hdr *);
+ eth_hdr[6] = rte_pktmbuf_mtod(m[6], struct rte_ether_hdr *);
+ eth_hdr[7] = rte_pktmbuf_mtod(m[7], struct rte_ether_hdr *);
/* Handle IPv4 headers.*/
ipv4_hdr[0] = rte_pktmbuf_mtod_offset(m[0], struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ipv4_hdr[1] = rte_pktmbuf_mtod_offset(m[1], struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ipv4_hdr[2] = rte_pktmbuf_mtod_offset(m[2], struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ipv4_hdr[3] = rte_pktmbuf_mtod_offset(m[3], struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ipv4_hdr[4] = rte_pktmbuf_mtod_offset(m[4], struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ipv4_hdr[5] = rte_pktmbuf_mtod_offset(m[5], struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ipv4_hdr[6] = rte_pktmbuf_mtod_offset(m[6], struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ipv4_hdr[7] = rte_pktmbuf_mtod_offset(m[7], struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
#ifdef DO_RFC_1812_CHECKS
/* Check to make sure the packet is valid (RFC1812) */
@@ -967,28 +967,28 @@ simple_ipv4_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid)
#endif /* End of #ifdef DO_RFC_1812_CHECKS */
data[0] = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m[0], __m128i *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv4_hdr, time_to_live)));
data[1] = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m[1], __m128i *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv4_hdr, time_to_live)));
data[2] = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m[2], __m128i *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv4_hdr, time_to_live)));
data[3] = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m[3], __m128i *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv4_hdr, time_to_live)));
data[4] = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m[4], __m128i *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv4_hdr, time_to_live)));
data[5] = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m[5], __m128i *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv4_hdr, time_to_live)));
data[6] = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m[6], __m128i *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv4_hdr, time_to_live)));
data[7] = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m[7], __m128i *,
- sizeof(struct ether_hdr) +
+ sizeof(struct rte_ether_hdr) +
offsetof(struct ipv4_hdr, time_to_live)));
key[0].xmm = _mm_and_si128(data[0], mask0);
@@ -1094,13 +1094,13 @@ static inline void get_ipv6_5tuple(struct rte_mbuf *m0, __m128i mask0,
__m128i mask1, union ipv6_5tuple_host *key)
{
__m128i tmpdata0 = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m0,
- __m128i *, sizeof(struct ether_hdr) +
+ __m128i *, sizeof(struct rte_ether_hdr) +
offsetof(struct ipv6_hdr, payload_len)));
__m128i tmpdata1 = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m0,
- __m128i *, sizeof(struct ether_hdr) +
+ __m128i *, sizeof(struct rte_ether_hdr) +
offsetof(struct ipv6_hdr, payload_len) + sizeof(__m128i)));
__m128i tmpdata2 = _mm_loadu_si128(rte_pktmbuf_mtod_offset(m0,
- __m128i *, sizeof(struct ether_hdr) +
+ __m128i *, sizeof(struct rte_ether_hdr) +
offsetof(struct ipv6_hdr, payload_len) + sizeof(__m128i) +
sizeof(__m128i)));
key->xmm[0] = _mm_and_si128(tmpdata0, mask0);
@@ -1113,37 +1113,37 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid)
{
int32_t ret[8];
uint16_t dst_port[8];
- struct ether_hdr *eth_hdr[8];
+ struct rte_ether_hdr *eth_hdr[8];
union ipv6_5tuple_host key[8];
__attribute__((unused)) struct ipv6_hdr *ipv6_hdr[8];
- eth_hdr[0] = rte_pktmbuf_mtod(m[0], struct ether_hdr *);
- eth_hdr[1] = rte_pktmbuf_mtod(m[1], struct ether_hdr *);
- eth_hdr[2] = rte_pktmbuf_mtod(m[2], struct ether_hdr *);
- eth_hdr[3] = rte_pktmbuf_mtod(m[3], struct ether_hdr *);
- eth_hdr[4] = rte_pktmbuf_mtod(m[4], struct ether_hdr *);
- eth_hdr[5] = rte_pktmbuf_mtod(m[5], struct ether_hdr *);
- eth_hdr[6] = rte_pktmbuf_mtod(m[6], struct ether_hdr *);
- eth_hdr[7] = rte_pktmbuf_mtod(m[7], struct ether_hdr *);
+ eth_hdr[0] = rte_pktmbuf_mtod(m[0], struct rte_ether_hdr *);
+ eth_hdr[1] = rte_pktmbuf_mtod(m[1], struct rte_ether_hdr *);
+ eth_hdr[2] = rte_pktmbuf_mtod(m[2], struct rte_ether_hdr *);
+ eth_hdr[3] = rte_pktmbuf_mtod(m[3], struct rte_ether_hdr *);
+ eth_hdr[4] = rte_pktmbuf_mtod(m[4], struct rte_ether_hdr *);
+ eth_hdr[5] = rte_pktmbuf_mtod(m[5], struct rte_ether_hdr *);
+ eth_hdr[6] = rte_pktmbuf_mtod(m[6], struct rte_ether_hdr *);
+ eth_hdr[7] = rte_pktmbuf_mtod(m[7], struct rte_ether_hdr *);
/* Handle IPv6 headers.*/
ipv6_hdr[0] = rte_pktmbuf_mtod_offset(m[0], struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ipv6_hdr[1] = rte_pktmbuf_mtod_offset(m[1], struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ipv6_hdr[2] = rte_pktmbuf_mtod_offset(m[2], struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ipv6_hdr[3] = rte_pktmbuf_mtod_offset(m[3], struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ipv6_hdr[4] = rte_pktmbuf_mtod_offset(m[4], struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ipv6_hdr[5] = rte_pktmbuf_mtod_offset(m[5], struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ipv6_hdr[6] = rte_pktmbuf_mtod_offset(m[6], struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ipv6_hdr[7] = rte_pktmbuf_mtod_offset(m[7], struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
get_ipv6_5tuple(m[0], mask1, mask2, &key[0]);
get_ipv6_5tuple(m[1], mask1, mask2, &key[1]);
@@ -1228,16 +1228,16 @@ simple_ipv6_fwd_8pkts(struct rte_mbuf *m[8], uint16_t portid)
static __rte_always_inline void
l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
struct ipv4_hdr *ipv4_hdr;
uint16_t dst_port;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
if (RTE_ETH_IS_IPV4_HDR(m->packet_type)) {
/* Handle IPv4 headers.*/
ipv4_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
#ifdef DO_RFC_1812_CHECKS
/* Check to make sure the packet is valid (RFC1812) */
@@ -1270,7 +1270,7 @@ l3fwd_simple_forward(struct rte_mbuf *m, uint16_t portid)
struct ipv6_hdr *ipv6_hdr;
ipv6_hdr = rte_pktmbuf_mtod_offset(m, struct ipv6_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
dst_port = get_ipv6_dst_port(ipv6_hdr, portid,
RTE_PER_LCORE(lcore_conf)->ipv6_lookup_struct);
@@ -1346,7 +1346,7 @@ get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint16_t portid)
{
uint32_t next_hop;
struct ipv6_hdr *ipv6_hdr;
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
if (RTE_ETH_IS_IPV4_HDR(pkt->packet_type)) {
return (uint16_t) ((rte_lpm_lookup(
@@ -1355,7 +1355,7 @@ get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint16_t portid)
} else if (RTE_ETH_IS_IPV6_HDR(pkt->packet_type)) {
- eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
ipv6_hdr = (struct ipv6_hdr *)(eth_hdr + 1);
return (uint16_t) ((rte_lpm6_lookup(
@@ -1371,13 +1371,13 @@ get_dst_port(struct rte_mbuf *pkt, uint32_t dst_ipv4, uint16_t portid)
static inline void
process_packet(struct rte_mbuf *pkt, uint16_t *dst_port, uint16_t portid)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
struct ipv4_hdr *ipv4_hdr;
uint32_t dst_ipv4;
uint16_t dp;
__m128i te, ve;
- eth_hdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
dst_ipv4 = ipv4_hdr->dst_addr;
@@ -1403,25 +1403,25 @@ processx4_step1(struct rte_mbuf *pkt[FWDSTEP],
uint32_t *ipv4_flag)
{
struct ipv4_hdr *ipv4_hdr;
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
uint32_t x0, x1, x2, x3;
- eth_hdr = rte_pktmbuf_mtod(pkt[0], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[0], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x0 = ipv4_hdr->dst_addr;
ipv4_flag[0] = pkt[0]->packet_type & RTE_PTYPE_L3_IPV4;
- eth_hdr = rte_pktmbuf_mtod(pkt[1], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[1], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x1 = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[1]->packet_type;
- eth_hdr = rte_pktmbuf_mtod(pkt[2], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[2], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x2 = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[2]->packet_type;
- eth_hdr = rte_pktmbuf_mtod(pkt[3], struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(pkt[3], struct rte_ether_hdr *);
ipv4_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
x3 = ipv4_hdr->dst_addr;
ipv4_flag[0] &= pkt[3]->packet_type;
@@ -1503,13 +1503,13 @@ processx4_step3(struct rte_mbuf *pkt[FWDSTEP], uint16_t dst_port[FWDSTEP])
_mm_store_si128(p[2], te[2]);
_mm_store_si128(p[3], te[3]);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[0] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[0] + 1),
&dst_port[0], pkt[0]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[1] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[1] + 1),
&dst_port[1], pkt[1]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[2] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[2] + 1),
&dst_port[2], pkt[2]->packet_type);
- rfc1812_process((struct ipv4_hdr *)((struct ether_hdr *)p[3] + 1),
+ rfc1812_process((struct ipv4_hdr *)((struct rte_ether_hdr *)p[3] + 1),
&dst_port[3], pkt[3]->packet_type);
}
@@ -3020,7 +3020,7 @@ parse_args(int argc, char **argv)
}
static void
-print_ethaddr(const char *name, const struct ether_addr *eth_addr)
+print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr)
{
char buf[ETHER_ADDR_FMT_SIZE];
@@ -3576,14 +3576,14 @@ main(int argc, char **argv)
print_ethaddr(" Address:", &ports_eth_addr[portid]);
printf(", ");
print_ethaddr("Destination:",
- (const struct ether_addr *)&dest_eth_addr[portid]);
+ (const struct rte_ether_addr *)&dest_eth_addr[portid]);
printf(", ");
/*
* prepare src MACs for each port.
*/
ether_addr_copy(&ports_eth_addr[portid],
- (struct ether_addr *)(val_eth + portid) + 1);
+ (struct rte_ether_addr *)(val_eth + portid) + 1);
/* init memory */
ret = init_mem(NB_MBUF);
diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c
index 82ae71c..7d28f59 100644
--- a/examples/ptpclient/ptpclient.c
+++ b/examples/ptpclient/ptpclient.c
@@ -53,7 +53,7 @@ static const struct rte_eth_conf port_conf_default = {
},
};
-static const struct ether_addr ether_multicast = {
+static const struct rte_ether_addr ether_multicast = {
.addr_bytes = {0x01, 0x1b, 0x19, 0x0, 0x0, 0x0}
};
@@ -334,7 +334,7 @@ parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx)
struct ptp_header *ptp_hdr;
ptp_hdr = (struct ptp_header *)(rte_pktmbuf_mtod(ptp_data->m, char *)
- + sizeof(struct ether_hdr));
+ + sizeof(struct rte_ether_hdr));
ptp_data->seqID_SYNC = rte_be_to_cpu_16(ptp_hdr->seq_id);
if (ptp_data->ptpset == 0) {
@@ -361,20 +361,20 @@ parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx)
static void
parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
{
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
struct ptp_header *ptp_hdr;
struct clock_id *client_clkid;
struct ptp_message *ptp_msg;
struct rte_mbuf *created_pkt;
struct tstamp *origin_tstamp;
- struct ether_addr eth_multicast = ether_multicast;
+ struct rte_ether_addr eth_multicast = ether_multicast;
size_t pkt_size;
int wait_us;
struct rte_mbuf *m = ptp_data->m;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
ptp_hdr = (struct ptp_header *)(rte_pktmbuf_mtod(m, char *)
- + sizeof(struct ether_hdr));
+ + sizeof(struct rte_ether_hdr));
if (memcmp(&ptp_data->master_clock_id,
&ptp_hdr->source_port_id.clock_id,
sizeof(struct clock_id)) != 0)
@@ -382,7 +382,7 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
ptp_data->seqID_FOLLOWUP = rte_be_to_cpu_16(ptp_hdr->seq_id);
ptp_msg = (struct ptp_message *) (rte_pktmbuf_mtod(m, char *) +
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
origin_tstamp = &ptp_msg->follow_up.precise_origin_tstamp;
ptp_data->tstamp1.tv_nsec = ntohl(origin_tstamp->ns);
@@ -393,11 +393,11 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
if (ptp_data->seqID_FOLLOWUP == ptp_data->seqID_SYNC) {
created_pkt = rte_pktmbuf_alloc(mbuf_pool);
- pkt_size = sizeof(struct ether_hdr) +
+ pkt_size = sizeof(struct rte_ether_hdr) +
sizeof(struct ptp_message);
created_pkt->data_len = pkt_size;
created_pkt->pkt_len = pkt_size;
- eth_hdr = rte_pktmbuf_mtod(created_pkt, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(created_pkt, struct rte_ether_hdr *);
rte_eth_macaddr_get(ptp_data->portid, &eth_hdr->s_addr);
/* Set multicast address 01-1B-19-00-00-00. */
@@ -406,7 +406,7 @@ parse_fup(struct ptpv2_data_slave_ordinary *ptp_data)
eth_hdr->ether_type = htons(PTP_PROTOCOL);
ptp_msg = (struct ptp_message *)
(rte_pktmbuf_mtod(created_pkt, char *) +
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ptp_msg->delay_req.hdr.seq_id = htons(ptp_data->seqID_SYNC);
ptp_msg->delay_req.hdr.msg_type = DELAY_REQ;
@@ -499,7 +499,7 @@ parse_drsp(struct ptpv2_data_slave_ordinary *ptp_data)
uint16_t seq_id;
ptp_msg = (struct ptp_message *) (rte_pktmbuf_mtod(m, char *) +
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
seq_id = rte_be_to_cpu_16(ptp_msg->delay_resp.hdr.seq_id);
if (memcmp(&ptp_data->client_clock_id,
&ptp_msg->delay_resp.req_port_id.clock_id,
@@ -535,17 +535,17 @@ parse_drsp(struct ptpv2_data_slave_ordinary *ptp_data)
static void
parse_ptp_frames(uint16_t portid, struct rte_mbuf *m) {
struct ptp_header *ptp_hdr;
- struct ether_hdr *eth_hdr;
+ struct rte_ether_hdr *eth_hdr;
uint16_t eth_type;
- eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
eth_type = rte_be_to_cpu_16(eth_hdr->ether_type);
if (eth_type == PTP_PROTOCOL) {
ptp_data.m = m;
ptp_data.portid = portid;
ptp_hdr = (struct ptp_header *)(rte_pktmbuf_mtod(m, char *)
- + sizeof(struct ether_hdr));
+ + sizeof(struct rte_ether_hdr));
switch (ptp_hdr->msg_type) {
case SYNC:
diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index 9b01124..431e84f 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -145,7 +145,8 @@ app_pkt_handle(struct rte_mbuf *pkt, uint64_t time)
{
uint8_t input_color, output_color;
uint8_t *pkt_data = rte_pktmbuf_mtod(pkt, uint8_t *);
- uint32_t pkt_len = rte_pktmbuf_pkt_len(pkt) - sizeof(struct ether_hdr);
+ uint32_t pkt_len = rte_pktmbuf_pkt_len(pkt) -
+ sizeof(struct rte_ether_hdr);
uint8_t flow_id = (uint8_t)(pkt_data[APP_PKT_FLOW_POS] & (APP_FLOWS_MAX - 1));
input_color = pkt_data[APP_PKT_COLOR_POS];
enum policer_action action;
diff --git a/examples/quota_watermark/qw/main.c b/examples/quota_watermark/qw/main.c
index c55d387..61e92a8 100644
--- a/examples/quota_watermark/qw/main.c
+++ b/examples/quota_watermark/qw/main.c
@@ -50,8 +50,8 @@ static void send_pause_frame(uint16_t port_id, uint16_t duration)
{
struct rte_mbuf *mbuf;
struct ether_fc_frame *pause_frame;
- struct ether_hdr *hdr;
- struct ether_addr mac_addr;
+ struct rte_ether_hdr *hdr;
+ struct rte_ether_addr mac_addr;
RTE_LOG_DP(DEBUG, USER1,
"Sending PAUSE frame (duration=%d) on port %d\n",
@@ -63,7 +63,7 @@ static void send_pause_frame(uint16_t port_id, uint16_t duration)
return;
/* Prepare a PAUSE frame */
- hdr = rte_pktmbuf_mtod(mbuf, struct ether_hdr *);
+ hdr = rte_pktmbuf_mtod(mbuf, struct rte_ether_hdr *);
pause_frame = (struct ether_fc_frame *) &hdr[1];
rte_eth_macaddr_get(port_id, &mac_addr);
diff --git a/examples/rxtx_callbacks/main.c b/examples/rxtx_callbacks/main.c
index 2058be6..a277519 100644
--- a/examples/rxtx_callbacks/main.c
+++ b/examples/rxtx_callbacks/main.c
@@ -115,7 +115,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
if (retval < 0)
return retval;
- struct ether_addr addr;
+ struct rte_ether_addr addr;
rte_eth_macaddr_get(port, &addr);
printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8
diff --git a/examples/server_node_efd/node/node.c b/examples/server_node_efd/node/node.c
index 3b97fbd..8bec351 100644
--- a/examples/server_node_efd/node/node.c
+++ b/examples/server_node_efd/node/node.c
@@ -275,7 +275,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 *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ipv4_dst_ip[i] = ipv4_hdr->dst_addr;
key_ptrs[i] = &ipv4_dst_ip[i];
}
diff --git a/examples/server_node_efd/server/main.c b/examples/server_node_efd/server/main.c
index 404f1f1..a086c5a 100644
--- a/examples/server_node_efd/server/main.c
+++ b/examples/server_node_efd/server/main.c
@@ -68,7 +68,7 @@ get_printable_mac_addr(uint16_t port)
{
static const char err_address[] = "00:00:00:00:00:00";
static char addresses[RTE_MAX_ETHPORTS][sizeof(err_address)];
- struct ether_addr mac;
+ struct rte_ether_addr mac;
if (unlikely(port >= RTE_MAX_ETHPORTS))
return err_address;
@@ -253,7 +253,7 @@ process_packets(uint32_t port_num __rte_unused, struct rte_mbuf *pkts[],
for (i = 0; i < rx_count; i++) {
/* Handle IPv4 header.*/
ipv4_hdr = rte_pktmbuf_mtod_offset(pkts[i], struct ipv4_hdr *,
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
ipv4_dst_ip[i] = ipv4_hdr->dst_addr;
key_ptrs[i] = (void *)&ipv4_dst_ip[i];
}
diff --git a/examples/skeleton/basicfwd.c b/examples/skeleton/basicfwd.c
index 4aba1dc..7e3cd87 100644
--- a/examples/skeleton/basicfwd.c
+++ b/examples/skeleton/basicfwd.c
@@ -82,7 +82,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
return retval;
/* Display the port MAC address. */
- struct ether_addr addr;
+ struct rte_ether_addr addr;
rte_eth_macaddr_get(port, &addr);
printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
diff --git a/examples/tep_termination/main.c b/examples/tep_termination/main.c
index e0fe7bd..9d8ab17 100644
--- a/examples/tep_termination/main.c
+++ b/examples/tep_termination/main.c
@@ -157,7 +157,7 @@ uint16_t ports[RTE_MAX_ETHPORTS];
static unsigned nb_ports; /**< The number of ports specified in command line */
/* ethernet addresses of ports */
-struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
+struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
/* heads for the main used and free linked lists for the data path. */
static struct virtio_net_data_ll *ll_root_used;
diff --git a/examples/tep_termination/main.h b/examples/tep_termination/main.h
index 966c63a..7a70f73 100644
--- a/examples/tep_termination/main.h
+++ b/examples/tep_termination/main.h
@@ -50,7 +50,7 @@ struct vhost_dev {
/**< Memory region information for gpa to hpa translation. */
struct virtio_memory_regions_hpa *regions_hpa;
/**< Device MAC address (Obtained on first TX packet). */
- struct ether_addr mac_address;
+ struct rte_ether_addr mac_address;
/**< RX queue number. */
uint16_t rx_q;
/**< Data core that the device is added to. */
diff --git a/examples/tep_termination/vxlan.c b/examples/tep_termination/vxlan.c
index 7732821..6545b8a 100644
--- a/examples/tep_termination/vxlan.c
+++ b/examples/tep_termination/vxlan.c
@@ -28,19 +28,20 @@ get_psd_sum(void *l3_hdr, uint16_t ethertype, uint64_t ol_flags)
* header.
*/
static void
-parse_ethernet(struct ether_hdr *eth_hdr, union tunnel_offload_info *info,
+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;
uint16_t ethertype;
- info->outer_l2_len = sizeof(struct ether_hdr);
+ info->outer_l2_len = sizeof(struct rte_ether_hdr);
ethertype = rte_be_to_cpu_16(eth_hdr->ether_type);
if (ethertype == ETHER_TYPE_VLAN) {
- struct vlan_hdr *vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1);
- info->outer_l2_len += sizeof(struct vlan_hdr);
+ struct rte_vlan_hdr *vlan_hdr =
+ (struct rte_vlan_hdr *)(eth_hdr + 1);
+ info->outer_l2_len += sizeof(struct rte_vlan_hdr);
ethertype = rte_be_to_cpu_16(vlan_hdr->eth_proto);
}
@@ -68,7 +69,8 @@ parse_ethernet(struct ether_hdr *eth_hdr, union tunnel_offload_info *info,
* Calculate the checksum of a packet in hardware
*/
static uint64_t
-process_inner_cksums(struct ether_hdr *eth_hdr, union tunnel_offload_info *info)
+process_inner_cksums(struct rte_ether_hdr *eth_hdr,
+ union tunnel_offload_info *info)
{
void *l3_hdr = NULL;
uint8_t l4_proto;
@@ -80,12 +82,13 @@ process_inner_cksums(struct ether_hdr *eth_hdr, union tunnel_offload_info *info)
struct sctp_hdr *sctp_hdr;
uint64_t ol_flags = 0;
- info->l2_len = sizeof(struct ether_hdr);
+ info->l2_len = sizeof(struct rte_ether_hdr);
ethertype = rte_be_to_cpu_16(eth_hdr->ether_type);
if (ethertype == ETHER_TYPE_VLAN) {
- struct vlan_hdr *vlan_hdr = (struct vlan_hdr *)(eth_hdr + 1);
- info->l2_len += sizeof(struct vlan_hdr);
+ struct rte_vlan_hdr *vlan_hdr =
+ (struct rte_vlan_hdr *)(eth_hdr + 1);
+ info->l2_len += sizeof(struct rte_vlan_hdr);
ethertype = rte_be_to_cpu_16(vlan_hdr->eth_proto);
}
@@ -141,7 +144,8 @@ decapsulation(struct rte_mbuf *pkt)
uint16_t outer_header_len;
struct udp_hdr *udp_hdr;
union tunnel_offload_info info = { .data = 0 };
- struct ether_hdr *phdr = rte_pktmbuf_mtod(pkt, struct ether_hdr *);
+ struct rte_ether_hdr *phdr =
+ rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
parse_ethernet(phdr, &info, &l4_proto);
@@ -158,7 +162,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 vxlan_hdr);
+ + sizeof(struct udp_hdr) + sizeof(struct rte_vxlan_hdr);
rte_pktmbuf_adj(pkt, outer_header_len);
@@ -172,29 +176,31 @@ encapsulation(struct rte_mbuf *m, uint8_t queue_id)
uint64_t ol_flags = 0;
uint32_t old_len = m->pkt_len, hash;
union tunnel_offload_info tx_offload = { .data = 0 };
- struct ether_hdr *phdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ struct rte_ether_hdr *phdr =
+ rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
/*Allocate space for new ethernet, IPv4, UDP and VXLAN headers*/
- struct ether_hdr *pneth = (struct ether_hdr *) rte_pktmbuf_prepend(m,
- sizeof(struct ether_hdr) + sizeof(struct ipv4_hdr)
- + sizeof(struct udp_hdr) + sizeof(struct vxlan_hdr));
+ struct rte_ether_hdr *pneth =
+ (struct rte_ether_hdr *) rte_pktmbuf_prepend(m,
+ sizeof(struct rte_ether_hdr) + sizeof(struct ipv4_hdr)
+ + sizeof(struct udp_hdr) + sizeof(struct rte_vxlan_hdr));
struct ipv4_hdr *ip = (struct ipv4_hdr *) &pneth[1];
struct udp_hdr *udp = (struct udp_hdr *) &ip[1];
- struct vxlan_hdr *vxlan = (struct vxlan_hdr *) &udp[1];
+ struct rte_vxlan_hdr *vxlan = (struct rte_vxlan_hdr *) &udp[1];
/* convert TX queue ID to vport ID */
vport_id = queue_id - 1;
/* replace original Ethernet header with ours */
pneth = rte_memcpy(pneth, &app_l2_hdr[vport_id],
- sizeof(struct ether_hdr));
+ sizeof(struct rte_ether_hdr));
/* copy in IP header */
ip = rte_memcpy(ip, &app_ip_hdr[vport_id],
sizeof(struct ipv4_hdr));
ip->total_length = rte_cpu_to_be_16(m->pkt_len
- - sizeof(struct ether_hdr));
+ - sizeof(struct rte_ether_hdr));
/* outer IP checksum */
ol_flags |= PKT_TX_OUTER_IP_CKSUM;
@@ -209,7 +215,7 @@ encapsulation(struct rte_mbuf *m, uint8_t queue_id)
m->l2_len += ETHER_VXLAN_HLEN;
}
- m->outer_l2_len = sizeof(struct ether_hdr);
+ m->outer_l2_len = sizeof(struct rte_ether_hdr);
m->outer_l3_len = sizeof(struct ipv4_hdr);
ol_flags |= PKT_TX_TUNNEL_VXLAN;
@@ -225,7 +231,7 @@ encapsulation(struct rte_mbuf *m, uint8_t queue_id)
udp->dgram_cksum = 0;
udp->dgram_len = rte_cpu_to_be_16(old_len
+ sizeof(struct udp_hdr)
- + sizeof(struct vxlan_hdr));
+ + sizeof(struct rte_vxlan_hdr));
udp->dst_port = rte_cpu_to_be_16(vxdev.dst_port);
hash = rte_hash_crc(phdr, 2 * ETHER_ADDR_LEN, phdr->ether_type);
diff --git a/examples/tep_termination/vxlan.h b/examples/tep_termination/vxlan.h
index bff786a..780ae73 100644
--- a/examples/tep_termination/vxlan.h
+++ b/examples/tep_termination/vxlan.h
@@ -17,15 +17,15 @@
#define DEFAULT_VXLAN_PORT 4789
extern struct ipv4_hdr app_ip_hdr[VXLAN_N_PORTS];
-extern struct ether_hdr app_l2_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;
struct vxlan_port {
uint32_t vport_id; /**< VirtIO port id */
uint32_t peer_ip; /**< remote VTEP IP address */
- struct ether_addr peer_mac; /**< remote VTEP MAC address */
- struct ether_addr vport_mac; /**< VirtIO port MAC address */
+ struct rte_ether_addr peer_mac; /**< remote VTEP MAC address */
+ struct rte_ether_addr vport_mac; /**< VirtIO port MAC address */
} __rte_cache_aligned;
struct vxlan_conf {
diff --git a/examples/tep_termination/vxlan_setup.c b/examples/tep_termination/vxlan_setup.c
index ad7fbe9..e4af7bc 100644
--- a/examples/tep_termination/vxlan_setup.c
+++ b/examples/tep_termination/vxlan_setup.c
@@ -49,7 +49,7 @@
struct vxlan_conf vxdev;
struct ipv4_hdr app_ip_hdr[VXLAN_N_PORTS];
-struct ether_hdr app_l2_hdr[VXLAN_N_PORTS];
+struct rte_ether_hdr app_l2_hdr[VXLAN_N_PORTS];
/* local VTEP IP address */
uint8_t vxlan_multicast_ips[2][4] = { {239, 1, 1, 1 }, {239, 1, 2, 1 } };
@@ -227,7 +227,7 @@ int
vxlan_link(struct vhost_dev *vdev, struct rte_mbuf *m)
{
int i, ret;
- struct ether_hdr *pkt_hdr;
+ struct rte_ether_hdr *pkt_hdr;
uint64_t portid = vdev->vid;
struct ipv4_hdr *ip;
@@ -242,7 +242,7 @@ vxlan_link(struct vhost_dev *vdev, struct rte_mbuf *m)
}
/* Learn MAC address of guest device from packet */
- pkt_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ pkt_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
if (is_same_ether_addr(&(pkt_hdr->s_addr), &vdev->mac_address)) {
RTE_LOG(INFO, VHOST_DATA,
"(%d) WARNING: This device is using an existing"
diff --git a/examples/tep_termination/vxlan_setup.h b/examples/tep_termination/vxlan_setup.h
index 2c20e2e..4dc37d6 100644
--- a/examples/tep_termination/vxlan_setup.h
+++ b/examples/tep_termination/vxlan_setup.h
@@ -9,7 +9,7 @@ extern uint16_t nb_devices;
extern uint16_t udp_port;
extern uint8_t filter_idx;
extern uint16_t ports[RTE_MAX_ETHPORTS];
-extern struct ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
+extern struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
extern uint32_t enable_stats;
extern struct device_statistics dev_statistics[MAX_DEVICES];
extern uint8_t rx_decap;
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index 8f7b758..cd1a51b 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -161,7 +161,7 @@ const uint16_t vlan_tags[] = {
};
/* ethernet addresses of ports */
-static struct ether_addr vmdq_ports_eth_addr[RTE_MAX_ETHPORTS];
+static struct rte_ether_addr vmdq_ports_eth_addr[RTE_MAX_ETHPORTS];
static struct vhost_dev_tailq_list vhost_dev_list =
TAILQ_HEAD_INITIALIZER(vhost_dev_list);
@@ -660,7 +660,7 @@ static unsigned check_ports_num(unsigned nb_ports)
}
static __rte_always_inline struct vhost_dev *
-find_vhost_dev(struct ether_addr *mac)
+find_vhost_dev(struct rte_ether_addr *mac)
{
struct vhost_dev *vdev;
@@ -680,11 +680,11 @@ find_vhost_dev(struct ether_addr *mac)
static int
link_vmdq(struct vhost_dev *vdev, struct rte_mbuf *m)
{
- struct ether_hdr *pkt_hdr;
+ struct rte_ether_hdr *pkt_hdr;
int i, ret;
/* Learn MAC address of guest device from packet */
- pkt_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ pkt_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
if (find_vhost_dev(&pkt_hdr->s_addr)) {
RTE_LOG(ERR, VHOST_DATA,
@@ -786,10 +786,10 @@ virtio_xmit(struct vhost_dev *dst_vdev, struct vhost_dev *src_vdev,
static __rte_always_inline int
virtio_tx_local(struct vhost_dev *vdev, struct rte_mbuf *m)
{
- struct ether_hdr *pkt_hdr;
+ struct rte_ether_hdr *pkt_hdr;
struct vhost_dev *dst_vdev;
- pkt_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ pkt_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
dst_vdev = find_vhost_dev(&pkt_hdr->d_addr);
if (!dst_vdev)
@@ -824,7 +824,8 @@ find_local_dest(struct vhost_dev *vdev, struct rte_mbuf *m,
uint32_t *offset, uint16_t *vlan_tag)
{
struct vhost_dev *dst_vdev;
- struct ether_hdr *pkt_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ struct rte_ether_hdr *pkt_hdr =
+ rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
dst_vdev = find_vhost_dev(&pkt_hdr->d_addr);
if (!dst_vdev)
@@ -866,7 +867,8 @@ static void virtio_tx_offload(struct rte_mbuf *m)
void *l3_hdr;
struct ipv4_hdr *ipv4_hdr = NULL;
struct tcp_hdr *tcp_hdr = NULL;
- struct ether_hdr *eth_hdr = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ struct rte_ether_hdr *eth_hdr =
+ rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
l3_hdr = (char *)eth_hdr + m->l2_len;
@@ -910,10 +912,10 @@ virtio_tx_route(struct vhost_dev *vdev, struct rte_mbuf *m, uint16_t vlan_tag)
struct mbuf_table *tx_q;
unsigned offset = 0;
const uint16_t lcore_id = rte_lcore_id();
- struct ether_hdr *nh;
+ struct rte_ether_hdr *nh;
- nh = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ nh = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
if (unlikely(is_broadcast_ether_addr(&nh->d_addr))) {
struct vhost_dev *vdev2;
@@ -946,10 +948,10 @@ queue2nic:
/*Add packet to the port tx queue*/
tx_q = &lcore_tx_queue[lcore_id];
- nh = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ nh = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
if (unlikely(nh->ether_type == rte_cpu_to_be_16(ETHER_TYPE_VLAN))) {
/* Guest has inserted the vlan tag. */
- struct vlan_hdr *vh = (struct vlan_hdr *) (nh + 1);
+ struct rte_vlan_hdr *vh = (struct rte_vlan_hdr *) (nh + 1);
uint16_t vlan_tag_be = rte_cpu_to_be_16(vlan_tag);
if ((vm2vm_mode == VM2VM_HARDWARE) &&
(vh->vlan_tci != vlan_tag_be))
diff --git a/examples/vhost/main.h b/examples/vhost/main.h
index 764c33a..7cba0ed 100644
--- a/examples/vhost/main.h
+++ b/examples/vhost/main.h
@@ -35,7 +35,7 @@ struct vhost_dev {
/**< Number of memory regions for gpa to hpa translation. */
uint32_t nregions_hpa;
/**< Device MAC address (Obtained on first TX packet). */
- struct ether_addr mac_address;
+ struct rte_ether_addr mac_address;
/**< RX VMDQ queue number. */
uint16_t vmdq_rx_q;
/**< Vlan tag assigned to the pool */
diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c
index 4a28710..1194f62 100644
--- a/examples/vm_power_manager/channel_monitor.c
+++ b/examples/vm_power_manager/channel_monitor.c
@@ -56,12 +56,12 @@ static struct policy policies[MAX_CLIENTS];
#ifdef USE_JANSSON
union PFID {
- struct ether_addr addr;
+ struct rte_ether_addr addr;
uint64_t pfid;
};
static int
-str_to_ether_addr(const char *a, struct ether_addr *ether_addr)
+str_to_ether_addr(const char *a, struct rte_ether_addr *ether_addr)
{
int i;
char *end;
@@ -404,7 +404,7 @@ get_pfid(struct policy *pol)
RTE_ETH_FOREACH_DEV(x) {
ret = rte_pmd_i40e_query_vfid_by_mac(x,
- (struct ether_addr *)&(pol->pkt.vfid[i]));
+ (struct rte_ether_addr *)&(pol->pkt.vfid[i]));
if (ret != -EINVAL) {
pol->port[i] = x;
break;
diff --git a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
index 2d9e768..78c3aa0 100644
--- a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
+++ b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
@@ -34,7 +34,7 @@ struct cmd_quit_result {
};
union PFID {
- struct ether_addr addr;
+ struct rte_ether_addr addr;
uint64_t pfid;
};
diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index 5fa13fe..f8cab11 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -105,7 +105,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
return retval;
/* Display the port MAC address. */
- struct ether_addr addr;
+ struct rte_ether_addr addr;
rte_eth_macaddr_get(port, &addr);
printf("Port %u MAC: %02" PRIx8 " %02" PRIx8 " %02" PRIx8
" %02" PRIx8 " %02" PRIx8 " %02" PRIx8 "\n",
@@ -355,7 +355,7 @@ main(int argc, char **argv)
/* Initialize ports. */
RTE_ETH_FOREACH_DEV(portid) {
- struct ether_addr eth;
+ struct rte_ether_addr eth;
int w, j;
int ret;
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 627a5da..5195a51 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -106,12 +106,12 @@ const uint16_t num_vlans = RTE_DIM(vlan_tags);
static uint16_t num_pf_queues, num_vmdq_queues;
static uint16_t vmdq_pool_base, vmdq_queue_base;
/* pool mac addr template, pool mac addr is like: 52 54 00 12 port# pool# */
-static struct ether_addr pool_addr_template = {
+static struct rte_ether_addr pool_addr_template = {
.addr_bytes = {0x52, 0x54, 0x00, 0x12, 0x00, 0x00}
};
/* ethernet addresses of ports */
-static struct ether_addr vmdq_ports_eth_addr[RTE_MAX_ETHPORTS];
+static struct rte_ether_addr vmdq_ports_eth_addr[RTE_MAX_ETHPORTS];
#define MAX_QUEUE_NUM_10G 128
#define MAX_QUEUE_NUM_1G 8
@@ -281,7 +281,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
* Removes this after i40e fixes this issue.
*/
for (q = 0; q < num_pools; q++) {
- struct ether_addr mac;
+ struct rte_ether_addr mac;
mac = pool_addr_template;
mac.addr_bytes[4] = port;
mac.addr_bytes[5] = q;
@@ -407,10 +407,10 @@ vmdq_parse_args(int argc, char **argv)
static void
update_mac_address(struct rte_mbuf *m, unsigned dst_port)
{
- struct ether_hdr *eth;
+ struct rte_ether_hdr *eth;
void *tmp;
- eth = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
/* 02:00:00:00:00:xx */
tmp = &eth->d_addr.addr_bytes[0];
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 6463683..75cf31a 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -121,12 +121,12 @@ const uint16_t vlan_tags[] = {
const uint16_t num_vlans = RTE_DIM(vlan_tags);
/* pool mac addr template, pool mac addr is like: 52 54 00 12 port# pool# */
-static struct ether_addr pool_addr_template = {
+static struct rte_ether_addr pool_addr_template = {
.addr_bytes = {0x52, 0x54, 0x00, 0x12, 0x00, 0x00}
};
/* ethernet addresses of ports */
-static struct ether_addr vmdq_ports_eth_addr[RTE_MAX_ETHPORTS];
+static struct rte_ether_addr vmdq_ports_eth_addr[RTE_MAX_ETHPORTS];
/* Builds up the correct configuration for vmdq+dcb based on the vlan tags array
* given above, and the number of traffic classes available for use. */
@@ -332,7 +332,7 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool)
/* Set mac for each pool.*/
for (q = 0; q < num_pools; q++) {
- struct ether_addr mac;
+ struct rte_ether_addr mac;
mac = pool_addr_template;
mac.addr_bytes[4] = port;
@@ -494,10 +494,10 @@ vmdq_parse_args(int argc, char **argv)
static void
update_mac_address(struct rte_mbuf *m, unsigned dst_port)
{
- struct ether_hdr *eth;
+ struct rte_ether_hdr *eth;
void *tmp;
- eth = rte_pktmbuf_mtod(m, struct ether_hdr *);
+ eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
/* 02:00:00:00:00:xx */
tmp = &eth->d_addr.addr_bytes[0];