summaryrefslogtreecommitdiff
path: root/app/test
diff options
context:
space:
mode:
Diffstat (limited to 'app/test')
-rw-r--r--app/test/packet_burst_generator.c14
-rw-r--r--app/test/test_cmdline_etheraddr.c2
-rw-r--r--app/test/test_flow_classify.c6
-rw-r--r--app/test/test_link_bonding.c111
-rw-r--r--app/test/test_link_bonding_mode4.c30
-rw-r--r--app/test/test_link_bonding_rssconf.c4
-rw-r--r--app/test/test_pmd_perf.c8
-rw-r--r--app/test/test_sched.c2
-rw-r--r--app/test/virtual_pmd.c2
9 files changed, 92 insertions, 87 deletions
diff --git a/app/test/packet_burst_generator.c b/app/test/packet_burst_generator.c
index ba94e61..0999b87 100644
--- a/app/test/packet_burst_generator.c
+++ b/app/test/packet_burst_generator.c
@@ -65,7 +65,7 @@ initialize_eth_header(struct rte_ether_hdr *eth_hdr,
struct rte_vlan_hdr *vhdr = (struct rte_vlan_hdr *)(
(uint8_t *)eth_hdr + sizeof(struct rte_ether_hdr));
- eth_hdr->ether_type = rte_cpu_to_be_16(ETHER_TYPE_VLAN);
+ eth_hdr->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN);
vhdr->eth_proto = rte_cpu_to_be_16(ether_type);
vhdr->vlan_tci = van_id;
@@ -82,8 +82,8 @@ initialize_arp_header(struct rte_arp_hdr *arp_hdr,
uint32_t opcode)
{
arp_hdr->arp_hardware = rte_cpu_to_be_16(RTE_ARP_HRD_ETHER);
- arp_hdr->arp_protocol = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
- arp_hdr->arp_hlen = ETHER_ADDR_LEN;
+ arp_hdr->arp_protocol = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
+ arp_hdr->arp_hlen = RTE_ETHER_ADDR_LEN;
arp_hdr->arp_plen = sizeof(uint32_t);
arp_hdr->arp_opcode = rte_cpu_to_be_16(opcode);
rte_ether_addr_copy(src_mac, &arp_hdr->arp_data.arp_sha);
@@ -322,10 +322,10 @@ nomore_mbuf:
pkt->l2_len = eth_hdr_size;
if (ipv4) {
- pkt->vlan_tci = ETHER_TYPE_IPv4;
+ pkt->vlan_tci = RTE_ETHER_TYPE_IPv4;
pkt->l3_len = sizeof(struct ipv4_hdr);
} else {
- pkt->vlan_tci = ETHER_TYPE_IPv6;
+ pkt->vlan_tci = RTE_ETHER_TYPE_IPv6;
pkt->l3_len = sizeof(struct ipv6_hdr);
}
@@ -437,10 +437,10 @@ nomore_mbuf:
pkt->l2_len = eth_hdr_size;
if (ipv4) {
- pkt->vlan_tci = ETHER_TYPE_IPv4;
+ pkt->vlan_tci = RTE_ETHER_TYPE_IPv4;
pkt->l3_len = sizeof(struct ipv4_hdr);
} else {
- pkt->vlan_tci = ETHER_TYPE_IPv6;
+ pkt->vlan_tci = RTE_ETHER_TYPE_IPv6;
pkt->l3_len = sizeof(struct ipv6_hdr);
}
diff --git a/app/test/test_cmdline_etheraddr.c b/app/test/test_cmdline_etheraddr.c
index 90943c2..9a32fd7 100644
--- a/app/test/test_cmdline_etheraddr.c
+++ b/app/test/test_cmdline_etheraddr.c
@@ -85,7 +85,7 @@ static int
is_addr_different(const struct rte_ether_addr addr, uint64_t num)
{
int i;
- for (i = 0; i < ETHER_ADDR_LEN; i++, num >>= 8)
+ for (i = 0; i < RTE_ETHER_ADDR_LEN; i++, num >>= 8)
if (addr.addr_bytes[i] != (num & 0xFF)) {
return 1;
}
diff --git a/app/test/test_flow_classify.c b/app/test/test_flow_classify.c
index f81bbba..3f06f30 100644
--- a/app/test/test_flow_classify.c
+++ b/app/test/test_flow_classify.c
@@ -504,7 +504,7 @@ init_ipv4_udp_traffic(struct rte_mempool *mp,
printf("Set up IPv4 UDP traffic\n");
initialize_eth_header(&pkt_eth_hdr,
(struct rte_ether_addr *)src_mac,
- (struct rte_ether_addr *)dst_mac, ETHER_TYPE_IPv4, 0, 0);
+ (struct rte_ether_addr *)dst_mac, RTE_ETHER_TYPE_IPv4, 0, 0);
pktlen = (uint16_t)(sizeof(struct rte_ether_hdr));
printf("ETH pktlen %u\n", pktlen);
@@ -541,7 +541,7 @@ init_ipv4_tcp_traffic(struct rte_mempool *mp,
printf("Set up IPv4 TCP traffic\n");
initialize_eth_header(&pkt_eth_hdr,
(struct rte_ether_addr *)src_mac,
- (struct rte_ether_addr *)dst_mac, ETHER_TYPE_IPv4, 0, 0);
+ (struct rte_ether_addr *)dst_mac, RTE_ETHER_TYPE_IPv4, 0, 0);
pktlen = (uint16_t)(sizeof(struct rte_ether_hdr));
printf("ETH pktlen %u\n", pktlen);
@@ -578,7 +578,7 @@ init_ipv4_sctp_traffic(struct rte_mempool *mp,
printf("Set up IPv4 SCTP traffic\n");
initialize_eth_header(&pkt_eth_hdr,
(struct rte_ether_addr *)src_mac,
- (struct rte_ether_addr *)dst_mac, ETHER_TYPE_IPv4, 0, 0);
+ (struct rte_ether_addr *)dst_mac, RTE_ETHER_TYPE_IPv4, 0, 0);
pktlen = (uint16_t)(sizeof(struct rte_ether_hdr));
printf("ETH pktlen %u\n", pktlen);
diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
index 5a7f45f..eb6f1a9 100644
--- a/app/test/test_link_bonding.c
+++ b/app/test/test_link_bonding.c
@@ -136,7 +136,7 @@ static struct rte_eth_conf default_pmd_conf = {
.rxmode = {
.mq_mode = ETH_MQ_RX_NONE,
.split_hdr_size = 0,
- .max_rx_pkt_len = ETHER_MAX_LEN,
+ .max_rx_pkt_len = RTE_ETHER_MAX_LEN,
},
.txmode = {
.mq_mode = ETH_MQ_TX_NONE,
@@ -237,7 +237,7 @@ test_setup(void)
for (i = 0; i < TEST_MAX_NUMBER_OF_PORTS; i++) {
char pmd_name[RTE_ETH_NAME_MAX_LEN];
- mac_addr->addr_bytes[ETHER_ADDR_LEN-1] = i;
+ mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] = i;
snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN, "eth_virt_%d", i);
@@ -396,7 +396,7 @@ test_remove_slave_from_bonded_device(void)
mac_addr = (struct rte_ether_addr *)slave_mac;
- mac_addr->addr_bytes[ETHER_ADDR_LEN-1] =
+ mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] =
test_params->bonded_slave_count-1;
rte_eth_macaddr_get(
@@ -752,7 +752,7 @@ test_set_primary_slave(void)
test_params->bonded_port_id);
expected_mac_addr = (struct rte_ether_addr *)&slave_mac;
- expected_mac_addr->addr_bytes[ETHER_ADDR_LEN-1] = i;
+ expected_mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] = i;
/* Check primary slave MAC */
rte_eth_macaddr_get(test_params->slave_port_ids[i], &read_mac_addr);
@@ -902,7 +902,8 @@ test_set_bonded_port_initialization_mac_assignment(void)
for (i = 0; i < BONDED_INIT_MAC_ASSIGNMENT_SLAVE_COUNT; i++) {
char pmd_name[RTE_ETH_NAME_MAX_LEN];
- slave_mac_addr.addr_bytes[ETHER_ADDR_LEN-1] = i + 100;
+ slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =
+ i + 100;
snprintf(pmd_name, RTE_ETH_NAME_MAX_LEN,
"eth_slave_%d", i);
@@ -942,8 +943,8 @@ test_set_bonded_port_initialization_mac_assignment(void)
/*
* 3. Set explicit MAC address on bonded ethdev
*/
- bonded_mac_addr.addr_bytes[ETHER_ADDR_LEN-2] = 0xFF;
- bonded_mac_addr.addr_bytes[ETHER_ADDR_LEN-1] = 0xAA;
+ bonded_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-2] = 0xFF;
+ bonded_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0xAA;
TEST_ASSERT_SUCCESS(rte_eth_bond_mac_address_set(
bonded_port_id, &bonded_mac_addr),
@@ -974,13 +975,13 @@ test_set_bonded_port_initialization_mac_assignment(void)
sizeof(read_mac_addr)),
"slave port 0 mac address not as expected");
- slave_mac_addr.addr_bytes[ETHER_ADDR_LEN-1] = 1 + 100;
+ slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100;
rte_eth_macaddr_get(slave_port_ids[1], &read_mac_addr);
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 1 mac address not as expected");
- slave_mac_addr.addr_bytes[ETHER_ADDR_LEN-1] = 2 + 100;
+ slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 2 + 100;
rte_eth_macaddr_get(slave_port_ids[2], &read_mac_addr);
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
@@ -1005,13 +1006,13 @@ test_set_bonded_port_initialization_mac_assignment(void)
sizeof(read_mac_addr)),
"bonded port mac address not as expected");
- slave_mac_addr.addr_bytes[ETHER_ADDR_LEN-1] = 0 + 100;
+ slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0 + 100;
rte_eth_macaddr_get(slave_port_ids[0], &read_mac_addr);
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 0 mac address not as expected");
- slave_mac_addr.addr_bytes[ETHER_ADDR_LEN-1] = 1 + 100;
+ slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100;
rte_eth_macaddr_get(slave_port_ids[1], &read_mac_addr);
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
@@ -1042,19 +1043,19 @@ test_set_bonded_port_initialization_mac_assignment(void)
"Number of slaves (%d) is great than expected (%d).",
slave_count, 0);
- slave_mac_addr.addr_bytes[ETHER_ADDR_LEN-1] = 0 + 100;
+ slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 0 + 100;
rte_eth_macaddr_get(slave_port_ids[0], &read_mac_addr);
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 0 mac address not as expected");
- slave_mac_addr.addr_bytes[ETHER_ADDR_LEN-1] = 1 + 100;
+ slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 1 + 100;
rte_eth_macaddr_get(slave_port_ids[1], &read_mac_addr);
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
"slave port 1 mac address not as expected");
- slave_mac_addr.addr_bytes[ETHER_ADDR_LEN-1] = 2 + 100;
+ slave_mac_addr.addr_bytes[RTE_ETHER_ADDR_LEN-1] = 2 + 100;
rte_eth_macaddr_get(slave_port_ids[2], &read_mac_addr);
TEST_ASSERT_SUCCESS(memcmp(&slave_mac_addr, &read_mac_addr,
sizeof(read_mac_addr)),
@@ -1271,9 +1272,9 @@ generate_test_burst(struct rte_mbuf **pkts_burst, uint16_t burst_size,
void *ip_hdr;
if (ipv4)
- ether_type = ETHER_TYPE_IPv4;
+ ether_type = RTE_ETHER_TYPE_IPv4;
else
- ether_type = ETHER_TYPE_IPv6;
+ ether_type = RTE_ETHER_TYPE_IPv6;
if (toggle_dst_mac)
initialize_eth_header(test_params->pkt_eth_hdr,
@@ -1953,7 +1954,7 @@ test_roundrobin_verfiy_polling_slave_link_status_change(void)
for (i = 0; i < TEST_RR_POLLING_LINK_STATUS_SLAVE_COUNT; i++) {
/* Generate slave name / MAC address */
snprintf(slave_name, RTE_ETH_NAME_MAX_LEN, "eth_virt_poll_%d", i);
- mac_addr->addr_bytes[ETHER_ADDR_LEN-1] = i;
+ mac_addr->addr_bytes[RTE_ETHER_ADDR_LEN-1] = i;
/* Create slave devices with no ISR Support */
if (polling_test_slaves[i] == -1) {
@@ -2046,7 +2047,7 @@ test_activebackup_tx_burst(void)
initialize_eth_header(test_params->pkt_eth_hdr,
(struct rte_ether_addr *)src_mac,
(struct rte_ether_addr *)dst_mac_0,
- ETHER_TYPE_IPv4, 0, 0);
+ RTE_ETHER_TYPE_IPv4, 0, 0);
pktlen = initialize_udp_header(test_params->pkt_udp_hdr, src_port,
dst_port_0, 16);
pktlen = initialize_ipv4_header(test_params->pkt_ipv4_hdr, src_addr,
@@ -2583,7 +2584,7 @@ test_balance_l2_tx_burst(void)
initialize_eth_header(test_params->pkt_eth_hdr,
(struct rte_ether_addr *)src_mac,
(struct rte_ether_addr *)dst_mac_0,
- ETHER_TYPE_IPv4, 0, 0);
+ RTE_ETHER_TYPE_IPv4, 0, 0);
pktlen = initialize_udp_header(test_params->pkt_udp_hdr, src_port,
dst_port_0, 16);
pktlen = initialize_ipv4_header(test_params->pkt_ipv4_hdr, src_addr,
@@ -2599,7 +2600,7 @@ test_balance_l2_tx_burst(void)
initialize_eth_header(test_params->pkt_eth_hdr,
(struct rte_ether_addr *)src_mac,
(struct rte_ether_addr *)dst_mac_1,
- ETHER_TYPE_IPv4, 0, 0);
+ RTE_ETHER_TYPE_IPv4, 0, 0);
/* Generate a burst 2 of packets to transmit */
TEST_ASSERT_EQUAL(generate_packet_burst(test_params->mbuf_pool, &pkts_burst[1][0],
@@ -3425,7 +3426,7 @@ test_broadcast_tx_burst(void)
initialize_eth_header(test_params->pkt_eth_hdr,
(struct rte_ether_addr *)src_mac,
(struct rte_ether_addr *)dst_mac_0,
- ETHER_TYPE_IPv4, 0, 0);
+ RTE_ETHER_TYPE_IPv4, 0, 0);
pktlen = initialize_udp_header(test_params->pkt_udp_hdr, src_port,
dst_port_0, 16);
@@ -4011,12 +4012,12 @@ test_tlb_tx_burst(void)
initialize_eth_header(test_params->pkt_eth_hdr,
(struct rte_ether_addr *)src_mac,
(struct rte_ether_addr *)dst_mac_0,
- ETHER_TYPE_IPv4, 0, 0);
+ RTE_ETHER_TYPE_IPv4, 0, 0);
} else {
initialize_eth_header(test_params->pkt_eth_hdr,
(struct rte_ether_addr *)test_params->default_slave_mac,
(struct rte_ether_addr *)dst_mac_0,
- ETHER_TYPE_IPv4, 0, 0);
+ RTE_ETHER_TYPE_IPv4, 0, 0);
}
pktlen = initialize_udp_header(test_params->pkt_udp_hdr, src_port,
dst_port_0, 16);
@@ -4519,10 +4520,10 @@ test_alb_change_mac_in_reply_sent(void)
* them through the bonding port.
*/
pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
- memcpy(client_mac.addr_bytes, mac_client1, ETHER_ADDR_LEN);
+ memcpy(client_mac.addr_bytes, mac_client1, RTE_ETHER_ADDR_LEN);
eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
- initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
- 0);
+ initialize_eth_header(eth_pkt, &bond_mac, &client_mac,
+ RTE_ETHER_TYPE_ARP, 0, 0);
arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt +
sizeof(struct rte_ether_hdr));
initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client1,
@@ -4530,10 +4531,10 @@ test_alb_change_mac_in_reply_sent(void)
rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
- memcpy(client_mac.addr_bytes, mac_client2, ETHER_ADDR_LEN);
+ memcpy(client_mac.addr_bytes, mac_client2, RTE_ETHER_ADDR_LEN);
eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
- initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
- 0);
+ initialize_eth_header(eth_pkt, &bond_mac, &client_mac,
+ RTE_ETHER_TYPE_ARP, 0, 0);
arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt +
sizeof(struct rte_ether_hdr));
initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client2,
@@ -4541,10 +4542,10 @@ test_alb_change_mac_in_reply_sent(void)
rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
- memcpy(client_mac.addr_bytes, mac_client3, ETHER_ADDR_LEN);
+ memcpy(client_mac.addr_bytes, mac_client3, RTE_ETHER_ADDR_LEN);
eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
- initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
- 0);
+ initialize_eth_header(eth_pkt, &bond_mac, &client_mac,
+ RTE_ETHER_TYPE_ARP, 0, 0);
arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt +
sizeof(struct rte_ether_hdr));
initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client3,
@@ -4552,10 +4553,10 @@ test_alb_change_mac_in_reply_sent(void)
rte_eth_tx_burst(test_params->bonded_port_id, 0, &pkt, 1);
pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
- memcpy(client_mac.addr_bytes, mac_client4, ETHER_ADDR_LEN);
+ memcpy(client_mac.addr_bytes, mac_client4, RTE_ETHER_ADDR_LEN);
eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
- initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
- 0);
+ initialize_eth_header(eth_pkt, &bond_mac, &client_mac,
+ RTE_ETHER_TYPE_ARP, 0, 0);
arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt +
sizeof(struct rte_ether_hdr));
initialize_arp_header(arp_pkt, &bond_mac, &client_mac, ip_host, ip_client4,
@@ -4640,10 +4641,10 @@ test_alb_reply_from_client(void)
* them in the rx queue to be received by the bonding driver on rx_burst.
*/
pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
- memcpy(client_mac.addr_bytes, mac_client1, ETHER_ADDR_LEN);
+ memcpy(client_mac.addr_bytes, mac_client1, RTE_ETHER_ADDR_LEN);
eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
- initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
- 0);
+ initialize_eth_header(eth_pkt, &bond_mac, &client_mac,
+ RTE_ETHER_TYPE_ARP, 0, 0);
arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt +
sizeof(struct rte_ether_hdr));
initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client1, ip_host,
@@ -4652,10 +4653,10 @@ test_alb_reply_from_client(void)
1);
pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
- memcpy(client_mac.addr_bytes, mac_client2, ETHER_ADDR_LEN);
+ memcpy(client_mac.addr_bytes, mac_client2, RTE_ETHER_ADDR_LEN);
eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
- initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
- 0);
+ initialize_eth_header(eth_pkt, &bond_mac, &client_mac,
+ RTE_ETHER_TYPE_ARP, 0, 0);
arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt +
sizeof(struct rte_ether_hdr));
initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client2, ip_host,
@@ -4664,10 +4665,10 @@ test_alb_reply_from_client(void)
1);
pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
- memcpy(client_mac.addr_bytes, mac_client3, ETHER_ADDR_LEN);
+ memcpy(client_mac.addr_bytes, mac_client3, RTE_ETHER_ADDR_LEN);
eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
- initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
- 0);
+ initialize_eth_header(eth_pkt, &bond_mac, &client_mac,
+ RTE_ETHER_TYPE_ARP, 0, 0);
arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt +
sizeof(struct rte_ether_hdr));
initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client3, ip_host,
@@ -4676,10 +4677,10 @@ test_alb_reply_from_client(void)
1);
pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
- memcpy(client_mac.addr_bytes, mac_client4, ETHER_ADDR_LEN);
+ memcpy(client_mac.addr_bytes, mac_client4, RTE_ETHER_ADDR_LEN);
eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
- initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_ARP, 0,
- 0);
+ initialize_eth_header(eth_pkt, &bond_mac, &client_mac,
+ RTE_ETHER_TYPE_ARP, 0, 0);
arp_pkt = (struct rte_arp_hdr *)((char *)eth_pkt +
sizeof(struct rte_ether_hdr));
initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client4, ip_host,
@@ -4774,16 +4775,16 @@ test_alb_receive_vlan_reply(void)
* Generating packet with double VLAN header and placing it in the rx queue.
*/
pkt = rte_pktmbuf_alloc(test_params->mbuf_pool);
- memcpy(client_mac.addr_bytes, mac_client1, ETHER_ADDR_LEN);
+ memcpy(client_mac.addr_bytes, mac_client1, RTE_ETHER_ADDR_LEN);
eth_pkt = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
- initialize_eth_header(eth_pkt, &bond_mac, &client_mac, ETHER_TYPE_VLAN, 0,
- 0);
+ initialize_eth_header(eth_pkt, &bond_mac, &client_mac,
+ RTE_ETHER_TYPE_VLAN, 0, 0);
vlan_pkt = (struct rte_vlan_hdr *)((char *)(eth_pkt + 1));
vlan_pkt->vlan_tci = rte_cpu_to_be_16(1);
- vlan_pkt->eth_proto = rte_cpu_to_be_16(ETHER_TYPE_VLAN);
+ vlan_pkt->eth_proto = rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN);
vlan_pkt = vlan_pkt+1;
vlan_pkt->vlan_tci = rte_cpu_to_be_16(2);
- vlan_pkt->eth_proto = rte_cpu_to_be_16(ETHER_TYPE_ARP);
+ vlan_pkt->eth_proto = rte_cpu_to_be_16(RTE_ETHER_TYPE_ARP);
arp_pkt = (struct rte_arp_hdr *)((char *)(vlan_pkt + 1));
initialize_arp_header(arp_pkt, &client_mac, &bond_mac, ip_client1, ip_host,
RTE_ARP_OP_REPLY);
@@ -4810,7 +4811,8 @@ test_alb_receive_vlan_reply(void)
retval = -1;
goto test_end;
}
- if (vlan_pkt->eth_proto != rte_cpu_to_be_16(ETHER_TYPE_VLAN)) {
+ if (vlan_pkt->eth_proto != rte_cpu_to_be_16(
+ RTE_ETHER_TYPE_VLAN)) {
retval = -1;
goto test_end;
}
@@ -4819,7 +4821,8 @@ test_alb_receive_vlan_reply(void)
retval = -1;
goto test_end;
}
- if (vlan_pkt->eth_proto != rte_cpu_to_be_16(ETHER_TYPE_ARP)) {
+ if (vlan_pkt->eth_proto != rte_cpu_to_be_16(
+ RTE_ETHER_TYPE_ARP)) {
retval = -1;
goto test_end;
}
diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c
index 0bb81fd..96466a1 100644
--- a/app/test/test_link_bonding_mode4.c
+++ b/app/test/test_link_bonding_mode4.c
@@ -108,7 +108,7 @@ static struct link_bonding_unittest_params test_params = {
static struct rte_eth_conf default_pmd_conf = {
.rxmode = {
.mq_mode = ETH_MQ_RX_NONE,
- .max_rx_pkt_len = ETHER_MAX_LEN,
+ .max_rx_pkt_len = RTE_ETHER_MAX_LEN,
.split_hdr_size = 0,
},
.txmode = {
@@ -233,7 +233,7 @@ add_slave(struct slave_conf *slave, uint8_t start)
RTE_VERIFY(slave->port_id != INVALID_PORT_ID);
rte_ether_addr_copy(&slave_mac_default, &addr);
- addr.addr_bytes[ETHER_ADDR_LEN - 1] = slave->port_id;
+ addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = slave->port_id;
rte_eth_dev_mac_addr_remove(slave->port_id, &addr);
@@ -299,7 +299,7 @@ lacp_recv_cb(uint16_t slave_id, struct rte_mbuf *lacp_pkt)
RTE_VERIFY(lacp_pkt != NULL);
hdr = rte_pktmbuf_mtod(lacp_pkt, struct rte_ether_hdr *);
- RTE_VERIFY(hdr->ether_type == rte_cpu_to_be_16(ETHER_TYPE_SLOW));
+ RTE_VERIFY(hdr->ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_SLOW));
slow_hdr = rte_pktmbuf_mtod(lacp_pkt, struct slow_protocol_frame *);
RTE_VERIFY(slow_hdr->slow_protocol.subtype == SLOW_SUBTYPE_LACP);
@@ -480,7 +480,7 @@ make_lacp_reply(struct slave_conf *slave, struct rte_mbuf *pkt)
/* look for LACP */
hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
- if (hdr->ether_type != rte_cpu_to_be_16(ETHER_TYPE_SLOW))
+ if (hdr->ether_type != rte_cpu_to_be_16(RTE_ETHER_TYPE_SLOW))
return 1;
slow_hdr = rte_pktmbuf_mtod(pkt, struct slow_protocol_frame *);
@@ -492,7 +492,8 @@ make_lacp_reply(struct slave_conf *slave, struct rte_mbuf *pkt)
/* Change source address to partner address */
rte_ether_addr_copy(&parnter_mac_default, &slow_hdr->eth_hdr.s_addr);
- slow_hdr->eth_hdr.s_addr.addr_bytes[ETHER_ADDR_LEN - 1] = slave->port_id;
+ slow_hdr->eth_hdr.s_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =
+ slave->port_id;
lacp = (struct lacpdu *) &slow_hdr->slow_protocol;
/* Save last received state */
@@ -930,11 +931,11 @@ test_mode4_rx(void)
FOR_EACH_SLAVE(i, slave) {
void *pkt = NULL;
- dst_mac.addr_bytes[ETHER_ADDR_LEN - 1] = slave->port_id;
+ dst_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = slave->port_id;
retval = generate_and_put_packets(slave, &src_mac, &dst_mac, 1);
TEST_ASSERT_SUCCESS(retval, "Failed to generate test packet burst.");
- src_mac.addr_bytes[ETHER_ADDR_LEN - 1] = slave->port_id;
+ src_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = slave->port_id;
retval = generate_and_put_packets(slave, &src_mac, &bonded_mac, 1);
TEST_ASSERT_SUCCESS(retval, "Failed to generate test packet burst.");
@@ -995,7 +996,7 @@ test_mode4_tx_burst(void)
/* Prepare burst */
for (pkts_cnt = 0; pkts_cnt < RTE_DIM(pkts); pkts_cnt++) {
- dst_mac.addr_bytes[ETHER_ADDR_LEN - 1] = pkts_cnt;
+ dst_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = pkts_cnt;
retval = generate_packets(&bonded_mac, &dst_mac, 1, &pkts[pkts_cnt]);
if (retval != 1)
@@ -1068,7 +1069,7 @@ test_mode4_tx_burst(void)
/* Prepare burst. */
for (pkts_cnt = 0; pkts_cnt < RTE_DIM(pkts); pkts_cnt++) {
- dst_mac.addr_bytes[ETHER_ADDR_LEN - 1] = pkts_cnt;
+ dst_mac.addr_bytes[RTE_ETHER_ADDR_LEN - 1] = pkts_cnt;
retval = generate_packets(&bonded_mac, &dst_mac, 1, &pkts[pkts_cnt]);
if (retval != 1)
@@ -1140,9 +1141,10 @@ init_marker(struct rte_mbuf *pkt, struct slave_conf *slave)
/* Init source address */
rte_ether_addr_copy(&parnter_mac_default, &marker_hdr->eth_hdr.s_addr);
- marker_hdr->eth_hdr.s_addr.addr_bytes[ETHER_ADDR_LEN-1] = slave->port_id;
+ marker_hdr->eth_hdr.s_addr.addr_bytes[RTE_ETHER_ADDR_LEN - 1] =
+ slave->port_id;
- marker_hdr->eth_hdr.ether_type = rte_cpu_to_be_16(ETHER_TYPE_SLOW);
+ marker_hdr->eth_hdr.ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_SLOW);
marker_hdr->marker.subtype = SLOW_SUBTYPE_MARKER;
marker_hdr->marker.version_number = 1;
@@ -1168,7 +1170,7 @@ test_mode4_marker(void)
int retval;
uint16_t nb_pkts;
uint8_t i, j;
- const uint16_t ethtype_slow_be = rte_be_to_cpu_16(ETHER_TYPE_SLOW);
+ const uint16_t ethtype_slow_be = rte_be_to_cpu_16(RTE_ETHER_TYPE_SLOW);
retval = initialize_bonded_device_with_slaves(TEST_MARKER_SLAVE_COUT,
0);
@@ -1368,7 +1370,7 @@ test_mode4_ext_ctrl(void)
rte_ether_addr_copy(&slow_protocol_mac_addr, &dst_mac);
initialize_eth_header(&lacpdu.eth_hdr, &src_mac, &dst_mac,
- ETHER_TYPE_SLOW, 0, 0);
+ RTE_ETHER_TYPE_SLOW, 0, 0);
for (i = 0; i < SLAVE_COUNT; i++) {
lacp_tx_buf[i] = rte_pktmbuf_alloc(test_params.mbuf_pool);
@@ -1422,7 +1424,7 @@ test_mode4_ext_lacp(void)
rte_ether_addr_copy(&slow_protocol_mac_addr, &dst_mac);
initialize_eth_header(&lacpdu.eth_hdr, &src_mac, &dst_mac,
- ETHER_TYPE_SLOW, 0, 0);
+ RTE_ETHER_TYPE_SLOW, 0, 0);
for (i = 0; i < SLAVE_COUNT; i++) {
lacp_tx_buf[i] = rte_pktmbuf_alloc(test_params.mbuf_pool);
diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bonding_rssconf.c
index 4392522..65de3b9 100644
--- a/app/test/test_link_bonding_rssconf.c
+++ b/app/test/test_link_bonding_rssconf.c
@@ -81,7 +81,7 @@ static struct link_bonding_rssconf_unittest_params test_params = {
static struct rte_eth_conf default_pmd_conf = {
.rxmode = {
.mq_mode = ETH_MQ_RX_NONE,
- .max_rx_pkt_len = ETHER_MAX_LEN,
+ .max_rx_pkt_len = RTE_ETHER_MAX_LEN,
.split_hdr_size = 0,
},
.txmode = {
@@ -93,7 +93,7 @@ static struct rte_eth_conf default_pmd_conf = {
static struct rte_eth_conf rss_pmd_conf = {
.rxmode = {
.mq_mode = ETH_MQ_RX_RSS,
- .max_rx_pkt_len = ETHER_MAX_LEN,
+ .max_rx_pkt_len = RTE_ETHER_MAX_LEN,
.split_hdr_size = 0,
},
.txmode = {
diff --git a/app/test/test_pmd_perf.c b/app/test/test_pmd_perf.c
index a0c3eb9..4b973ff 100644
--- a/app/test/test_pmd_perf.c
+++ b/app/test/test_pmd_perf.c
@@ -63,7 +63,7 @@ static struct rte_ether_addr ports_eth_addr[RTE_MAX_ETHPORTS];
static struct rte_eth_conf port_conf = {
.rxmode = {
.mq_mode = ETH_MQ_RX_NONE,
- .max_rx_pkt_len = ETHER_MAX_LEN,
+ .max_rx_pkt_len = RTE_ETHER_MAX_LEN,
.split_hdr_size = 0,
},
.txmode = {
@@ -173,8 +173,8 @@ check_all_ports_link_status(uint16_t port_num, uint32_t port_mask)
static void
print_ethaddr(const char *name, const struct rte_ether_addr *eth_addr)
{
- char buf[ETHER_ADDR_FMT_SIZE];
- rte_ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);
+ char buf[RTE_ETHER_ADDR_FMT_SIZE];
+ rte_ether_format_addr(buf, RTE_ETHER_ADDR_FMT_SIZE, eth_addr);
printf("%s%s", name, buf);
}
@@ -192,7 +192,7 @@ init_traffic(struct rte_mempool *mp,
initialize_eth_header(&pkt_eth_hdr,
(struct rte_ether_addr *)src_mac,
- (struct rte_ether_addr *)dst_mac, ETHER_TYPE_IPv4, 0, 0);
+ (struct rte_ether_addr *)dst_mac, RTE_ETHER_TYPE_IPv4, 0, 0);
pktlen = initialize_ipv4_header(&pkt_ipv4_hdr,
IPV4_ADDR(10, 0, 0, 1),
diff --git a/app/test/test_sched.c b/app/test/test_sched.c
index a782bf3..a08e129 100644
--- a/app/test/test_sched.c
+++ b/app/test/test_sched.c
@@ -95,7 +95,7 @@ prepare_pkt(struct rte_sched_port *port, struct rte_mbuf *mbuf)
vlan1->vlan_tci = rte_cpu_to_be_16(SUBPORT);
vlan2->vlan_tci = rte_cpu_to_be_16(PIPE);
- eth_hdr->ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
+ eth_hdr->ether_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
ip_hdr->dst_addr = IPv4(0,0,TC,QUEUE);
diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c
index 15ce644..55c2bdb 100644
--- a/app/test/virtual_pmd.c
+++ b/app/test/virtual_pmd.c
@@ -566,7 +566,7 @@ virtual_ethdev_create(const char *name, struct rte_ether_addr *mac_addr,
eth_dev->data->dev_link.link_speed = ETH_SPEED_NUM_10G;
eth_dev->data->dev_link.link_duplex = ETH_LINK_FULL_DUPLEX;
- eth_dev->data->mac_addrs = rte_zmalloc(name, ETHER_ADDR_LEN, 0);
+ eth_dev->data->mac_addrs = rte_zmalloc(name, RTE_ETHER_ADDR_LEN, 0);
if (eth_dev->data->mac_addrs == NULL)
goto err;