summaryrefslogtreecommitdiff
path: root/app/test-pmd
diff options
context:
space:
mode:
Diffstat (limited to 'app/test-pmd')
-rw-r--r--app/test-pmd/cmdline.c34
-rw-r--r--app/test-pmd/cmdline_flow.c80
-rw-r--r--app/test-pmd/config.c4
-rw-r--r--app/test-pmd/csumonly.c46
-rw-r--r--app/test-pmd/flowgen.c2
-rw-r--r--app/test-pmd/icmpecho.c12
-rw-r--r--app/test-pmd/ieee1588fwd.c4
-rw-r--r--app/test-pmd/parameters.c6
-rw-r--r--app/test-pmd/testpmd.c11
-rw-r--r--app/test-pmd/testpmd.h20
-rw-r--r--app/test-pmd/txonly.c2
-rw-r--r--app/test-pmd/util.c4
12 files changed, 113 insertions, 112 deletions
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 1fb6099..d1e0d44 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -1925,16 +1925,16 @@ cmd_config_max_pkt_len_parsed(void *parsed_result,
uint64_t rx_offloads = port->dev_conf.rxmode.offloads;
if (!strcmp(res->name, "max-pkt-len")) {
- if (res->value < ETHER_MIN_LEN) {
+ if (res->value < RTE_ETHER_MIN_LEN) {
printf("max-pkt-len can not be less than %d\n",
- ETHER_MIN_LEN);
+ RTE_ETHER_MIN_LEN);
return;
}
if (res->value == port->dev_conf.rxmode.max_rx_pkt_len)
return;
port->dev_conf.rxmode.max_rx_pkt_len = res->value;
- if (res->value > ETHER_MAX_LEN)
+ if (res->value > RTE_ETHER_MAX_LEN)
rx_offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME;
else
rx_offloads &= ~DEV_RX_OFFLOAD_JUMBO_FRAME;
@@ -1996,8 +1996,8 @@ cmd_config_mtu_parsed(void *parsed_result,
{
struct cmd_config_mtu_result *res = parsed_result;
- if (res->value < ETHER_MIN_LEN) {
- printf("mtu cannot be less than %d\n", ETHER_MIN_LEN);
+ if (res->value < RTE_ETHER_MIN_LEN) {
+ printf("mtu cannot be less than %d\n", RTE_ETHER_MIN_LEN);
return;
}
port_mtu_set(res->port_id, res->value);
@@ -8236,7 +8236,7 @@ cmd_set_vf_macvlan_parsed(void *parsed_result,
memset(&filter, 0, sizeof(struct rte_eth_mac_filter));
- rte_memcpy(&filter.mac_addr, &res->address, ETHER_ADDR_LEN);
+ rte_memcpy(&filter.mac_addr, &res->address, RTE_ETHER_ADDR_LEN);
/* set VF MAC filter */
filter.is_vf = 1;
@@ -9210,7 +9210,7 @@ cmd_set_mirror_mask_parsed(void *parsed_result,
return;
for (i = 0; i < nb_item; i++) {
- if (vlan_list[i] > ETHER_MAX_VLAN_ID) {
+ if (vlan_list[i] > RTE_ETHER_MAX_VLAN_ID) {
printf("Invalid vlan_id: must be < 4096\n");
return;
}
@@ -15301,9 +15301,9 @@ static void cmd_set_vxlan_parsed(void *parsed_result,
if (vxlan_encap_conf.select_vlan)
vxlan_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
rte_memcpy(vxlan_encap_conf.eth_src, res->eth_src.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
rte_memcpy(vxlan_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
}
cmdline_parse_inst_t cmd_set_vxlan = {
@@ -15492,9 +15492,9 @@ static void cmd_set_nvgre_parsed(void *parsed_result,
if (nvgre_encap_conf.select_vlan)
nvgre_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
rte_memcpy(nvgre_encap_conf.eth_src, res->eth_src.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
rte_memcpy(nvgre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
}
cmdline_parse_inst_t cmd_set_nvgre = {
@@ -15609,9 +15609,9 @@ static void cmd_set_l2_encap_parsed(void *parsed_result,
if (l2_encap_conf.select_vlan)
l2_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
rte_memcpy(l2_encap_conf.eth_src, res->eth_src.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
rte_memcpy(l2_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
}
cmdline_parse_inst_t cmd_set_l2_encap = {
@@ -15801,9 +15801,9 @@ static void cmd_set_mplsogre_encap_parsed(void *parsed_result,
if (mplsogre_encap_conf.select_vlan)
mplsogre_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
rte_memcpy(mplsogre_encap_conf.eth_src, res->eth_src.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
rte_memcpy(mplsogre_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
}
cmdline_parse_inst_t cmd_set_mplsogre_encap = {
@@ -16039,9 +16039,9 @@ static void cmd_set_mplsoudp_encap_parsed(void *parsed_result,
if (mplsoudp_encap_conf.select_vlan)
mplsoudp_encap_conf.vlan_tci = rte_cpu_to_be_16(res->tci);
rte_memcpy(mplsoudp_encap_conf.eth_src, res->eth_src.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
rte_memcpy(mplsoudp_encap_conf.eth_dst, res->eth_dst.addr_bytes,
- ETHER_ADDR_LEN);
+ RTE_ETHER_ADDR_LEN);
}
cmdline_parse_inst_t cmd_set_mplsoudp_encap = {
diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c
index 2e274f9..7a1c5ab 100644
--- a/app/test-pmd/cmdline_flow.c
+++ b/app/test-pmd/cmdline_flow.c
@@ -3493,9 +3493,9 @@ parse_vc_action_vxlan_encap(struct context *ctx, const struct token *token,
.item_vxlan.flags = 0,
};
memcpy(action_vxlan_encap_data->item_eth.dst.addr_bytes,
- vxlan_encap_conf.eth_dst, ETHER_ADDR_LEN);
+ vxlan_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN);
memcpy(action_vxlan_encap_data->item_eth.src.addr_bytes,
- vxlan_encap_conf.eth_src, ETHER_ADDR_LEN);
+ vxlan_encap_conf.eth_src, RTE_ETHER_ADDR_LEN);
if (!vxlan_encap_conf.select_ipv4) {
memcpy(&action_vxlan_encap_data->item_ipv6.hdr.src_addr,
&vxlan_encap_conf.ipv6_src,
@@ -3616,9 +3616,9 @@ parse_vc_action_nvgre_encap(struct context *ctx, const struct token *token,
.item_nvgre.flow_id = 0,
};
memcpy(action_nvgre_encap_data->item_eth.dst.addr_bytes,
- nvgre_encap_conf.eth_dst, ETHER_ADDR_LEN);
+ nvgre_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN);
memcpy(action_nvgre_encap_data->item_eth.src.addr_bytes,
- nvgre_encap_conf.eth_src, ETHER_ADDR_LEN);
+ nvgre_encap_conf.eth_src, RTE_ETHER_ADDR_LEN);
if (!nvgre_encap_conf.select_ipv4) {
memcpy(&action_nvgre_encap_data->item_ipv6.hdr.src_addr,
&nvgre_encap_conf.ipv6_src,
@@ -3680,22 +3680,22 @@ parse_vc_action_l2_encap(struct context *ctx, const struct token *token,
};
header = action_encap_data->data;
if (l2_encap_conf.select_vlan)
- eth.type = rte_cpu_to_be_16(ETHER_TYPE_VLAN);
+ eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN);
else if (l2_encap_conf.select_ipv4)
- eth.type = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
+ eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
else
- eth.type = rte_cpu_to_be_16(ETHER_TYPE_IPv6);
+ eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6);
memcpy(eth.dst.addr_bytes,
- l2_encap_conf.eth_dst, ETHER_ADDR_LEN);
+ l2_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN);
memcpy(eth.src.addr_bytes,
- l2_encap_conf.eth_src, ETHER_ADDR_LEN);
+ l2_encap_conf.eth_src, RTE_ETHER_ADDR_LEN);
memcpy(header, &eth, sizeof(eth));
header += sizeof(eth);
if (l2_encap_conf.select_vlan) {
if (l2_encap_conf.select_ipv4)
- vlan.inner_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
+ vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
else
- vlan.inner_type = rte_cpu_to_be_16(ETHER_TYPE_IPv6);
+ vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6);
memcpy(header, &vlan, sizeof(vlan));
header += sizeof(vlan);
}
@@ -3744,7 +3744,7 @@ parse_vc_action_l2_decap(struct context *ctx, const struct token *token,
};
header = action_decap_data->data;
if (l2_decap_conf.select_vlan)
- eth.type = rte_cpu_to_be_16(ETHER_TYPE_VLAN);
+ eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN);
memcpy(header, &eth, sizeof(eth));
header += sizeof(eth);
if (l2_decap_conf.select_vlan) {
@@ -3815,22 +3815,22 @@ parse_vc_action_mplsogre_encap(struct context *ctx, const struct token *token,
};
header = action_encap_data->data;
if (mplsogre_encap_conf.select_vlan)
- eth.type = rte_cpu_to_be_16(ETHER_TYPE_VLAN);
+ eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN);
else if (mplsogre_encap_conf.select_ipv4)
- eth.type = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
+ eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
else
- eth.type = rte_cpu_to_be_16(ETHER_TYPE_IPv6);
+ eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6);
memcpy(eth.dst.addr_bytes,
- mplsogre_encap_conf.eth_dst, ETHER_ADDR_LEN);
+ mplsogre_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN);
memcpy(eth.src.addr_bytes,
- mplsogre_encap_conf.eth_src, ETHER_ADDR_LEN);
+ mplsogre_encap_conf.eth_src, RTE_ETHER_ADDR_LEN);
memcpy(header, &eth, sizeof(eth));
header += sizeof(eth);
if (mplsogre_encap_conf.select_vlan) {
if (mplsogre_encap_conf.select_ipv4)
- vlan.inner_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
+ vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
else
- vlan.inner_type = rte_cpu_to_be_16(ETHER_TYPE_IPv6);
+ vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6);
memcpy(header, &vlan, sizeof(vlan));
header += sizeof(vlan);
}
@@ -3910,22 +3910,22 @@ parse_vc_action_mplsogre_decap(struct context *ctx, const struct token *token,
};
header = action_decap_data->data;
if (mplsogre_decap_conf.select_vlan)
- eth.type = rte_cpu_to_be_16(ETHER_TYPE_VLAN);
+ eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN);
else if (mplsogre_encap_conf.select_ipv4)
- eth.type = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
+ eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
else
- eth.type = rte_cpu_to_be_16(ETHER_TYPE_IPv6);
+ eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6);
memcpy(eth.dst.addr_bytes,
- mplsogre_encap_conf.eth_dst, ETHER_ADDR_LEN);
+ mplsogre_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN);
memcpy(eth.src.addr_bytes,
- mplsogre_encap_conf.eth_src, ETHER_ADDR_LEN);
+ mplsogre_encap_conf.eth_src, RTE_ETHER_ADDR_LEN);
memcpy(header, &eth, sizeof(eth));
header += sizeof(eth);
if (mplsogre_encap_conf.select_vlan) {
if (mplsogre_encap_conf.select_ipv4)
- vlan.inner_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
+ vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
else
- vlan.inner_type = rte_cpu_to_be_16(ETHER_TYPE_IPv6);
+ vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6);
memcpy(header, &vlan, sizeof(vlan));
header += sizeof(vlan);
}
@@ -4006,22 +4006,22 @@ parse_vc_action_mplsoudp_encap(struct context *ctx, const struct token *token,
};
header = action_encap_data->data;
if (mplsoudp_encap_conf.select_vlan)
- eth.type = rte_cpu_to_be_16(ETHER_TYPE_VLAN);
+ eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN);
else if (mplsoudp_encap_conf.select_ipv4)
- eth.type = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
+ eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
else
- eth.type = rte_cpu_to_be_16(ETHER_TYPE_IPv6);
+ eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6);
memcpy(eth.dst.addr_bytes,
- mplsoudp_encap_conf.eth_dst, ETHER_ADDR_LEN);
+ mplsoudp_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN);
memcpy(eth.src.addr_bytes,
- mplsoudp_encap_conf.eth_src, ETHER_ADDR_LEN);
+ mplsoudp_encap_conf.eth_src, RTE_ETHER_ADDR_LEN);
memcpy(header, &eth, sizeof(eth));
header += sizeof(eth);
if (mplsoudp_encap_conf.select_vlan) {
if (mplsoudp_encap_conf.select_ipv4)
- vlan.inner_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
+ vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
else
- vlan.inner_type = rte_cpu_to_be_16(ETHER_TYPE_IPv6);
+ vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6);
memcpy(header, &vlan, sizeof(vlan));
header += sizeof(vlan);
}
@@ -4103,22 +4103,22 @@ parse_vc_action_mplsoudp_decap(struct context *ctx, const struct token *token,
};
header = action_decap_data->data;
if (mplsoudp_decap_conf.select_vlan)
- eth.type = rte_cpu_to_be_16(ETHER_TYPE_VLAN);
+ eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN);
else if (mplsoudp_encap_conf.select_ipv4)
- eth.type = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
+ eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
else
- eth.type = rte_cpu_to_be_16(ETHER_TYPE_IPv6);
+ eth.type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6);
memcpy(eth.dst.addr_bytes,
- mplsoudp_encap_conf.eth_dst, ETHER_ADDR_LEN);
+ mplsoudp_encap_conf.eth_dst, RTE_ETHER_ADDR_LEN);
memcpy(eth.src.addr_bytes,
- mplsoudp_encap_conf.eth_src, ETHER_ADDR_LEN);
+ mplsoudp_encap_conf.eth_src, RTE_ETHER_ADDR_LEN);
memcpy(header, &eth, sizeof(eth));
header += sizeof(eth);
if (mplsoudp_encap_conf.select_vlan) {
if (mplsoudp_encap_conf.select_ipv4)
- vlan.inner_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
+ vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv4);
else
- vlan.inner_type = rte_cpu_to_be_16(ETHER_TYPE_IPv6);
+ vlan.inner_type = rte_cpu_to_be_16(RTE_ETHER_TYPE_IPv6);
memcpy(header, &vlan, sizeof(vlan));
header += sizeof(vlan);
}
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 7a67690..ab458c8 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -110,8 +110,8 @@ const struct rss_type_info rss_type_table[] = {
static void
print_ethaddr(const char *name, 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);
}
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 8de37c8..d1344b9 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -92,9 +92,9 @@ struct simple_gre_hdr {
static uint16_t
get_udptcp_checksum(void *l3_hdr, void *l4_hdr, uint16_t ethertype)
{
- if (ethertype == _htons(ETHER_TYPE_IPv4))
+ if (ethertype == _htons(RTE_ETHER_TYPE_IPv4))
return rte_ipv4_udptcp_cksum(l3_hdr, l4_hdr);
- else /* assume ethertype == ETHER_TYPE_IPv6 */
+ else /* assume ethertype == RTE_ETHER_TYPE_IPv6 */
return rte_ipv6_udptcp_cksum(l3_hdr, l4_hdr);
}
@@ -150,7 +150,7 @@ parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info *info)
info->l2_len = sizeof(struct rte_ether_hdr);
info->ethertype = eth_hdr->ether_type;
- if (info->ethertype == _htons(ETHER_TYPE_VLAN)) {
+ if (info->ethertype == _htons(RTE_ETHER_TYPE_VLAN)) {
struct rte_vlan_hdr *vlan_hdr = (
struct rte_vlan_hdr *)(eth_hdr + 1);
@@ -159,11 +159,11 @@ parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info *info)
}
switch (info->ethertype) {
- case _htons(ETHER_TYPE_IPv4):
+ case _htons(RTE_ETHER_TYPE_IPv4):
ipv4_hdr = (struct ipv4_hdr *) ((char *)eth_hdr + info->l2_len);
parse_ipv4(ipv4_hdr, info);
break;
- case _htons(ETHER_TYPE_IPv6):
+ case _htons(RTE_ETHER_TYPE_IPv6):
ipv6_hdr = (struct ipv6_hdr *) ((char *)eth_hdr + info->l2_len);
parse_ipv6(ipv6_hdr, info);
break;
@@ -201,7 +201,7 @@ parse_vxlan(struct udp_hdr *udp_hdr,
sizeof(struct rte_vxlan_hdr));
parse_ethernet(eth_hdr, info);
- info->l2_len += ETHER_VXLAN_HLEN; /* add udp + vxlan */
+ info->l2_len += RTE_ETHER_VXLAN_HLEN; /* add udp + vxlan */
}
/* Parse a vxlan-gpe header */
@@ -223,7 +223,7 @@ parse_vxlan_gpe(struct udp_hdr *udp_hdr,
sizeof(struct udp_hdr));
if (!vxlan_gpe_hdr->proto || vxlan_gpe_hdr->proto ==
- VXLAN_GPE_TYPE_IPV4) {
+ RTE_VXLAN_GPE_TYPE_IPV4) {
info->is_tunnel = 1;
info->outer_ethertype = info->ethertype;
info->outer_l2_len = info->l2_len;
@@ -234,10 +234,10 @@ parse_vxlan_gpe(struct udp_hdr *udp_hdr,
vxlan_gpe_len);
parse_ipv4(ipv4_hdr, info);
- info->ethertype = _htons(ETHER_TYPE_IPv4);
+ info->ethertype = _htons(RTE_ETHER_TYPE_IPv4);
info->l2_len = 0;
- } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_IPV6) {
+ } else if (vxlan_gpe_hdr->proto == RTE_VXLAN_GPE_TYPE_IPV6) {
info->is_tunnel = 1;
info->outer_ethertype = info->ethertype;
info->outer_l2_len = info->l2_len;
@@ -247,11 +247,11 @@ parse_vxlan_gpe(struct udp_hdr *udp_hdr,
ipv6_hdr = (struct ipv6_hdr *)((char *)vxlan_gpe_hdr +
vxlan_gpe_len);
- info->ethertype = _htons(ETHER_TYPE_IPv6);
+ info->ethertype = _htons(RTE_ETHER_TYPE_IPv6);
parse_ipv6(ipv6_hdr, info);
info->l2_len = 0;
- } else if (vxlan_gpe_hdr->proto == VXLAN_GPE_TYPE_ETH) {
+ } else if (vxlan_gpe_hdr->proto == RTE_VXLAN_GPE_TYPE_ETH) {
info->is_tunnel = 1;
info->outer_ethertype = info->ethertype;
info->outer_l2_len = info->l2_len;
@@ -265,7 +265,7 @@ parse_vxlan_gpe(struct udp_hdr *udp_hdr,
} else
return;
- info->l2_len += ETHER_VXLAN_GPE_HLEN;
+ info->l2_len += RTE_ETHER_VXLAN_GPE_HLEN;
}
/* Parse a gre header */
@@ -286,7 +286,7 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
if (gre_hdr->flags & _htons(GRE_CHECKSUM_PRESENT))
gre_len += GRE_EXT_LEN;
- if (gre_hdr->proto == _htons(ETHER_TYPE_IPv4)) {
+ if (gre_hdr->proto == _htons(RTE_ETHER_TYPE_IPv4)) {
info->is_tunnel = 1;
info->outer_ethertype = info->ethertype;
info->outer_l2_len = info->l2_len;
@@ -296,10 +296,10 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
ipv4_hdr = (struct ipv4_hdr *)((char *)gre_hdr + gre_len);
parse_ipv4(ipv4_hdr, info);
- info->ethertype = _htons(ETHER_TYPE_IPv4);
+ info->ethertype = _htons(RTE_ETHER_TYPE_IPv4);
info->l2_len = 0;
- } else if (gre_hdr->proto == _htons(ETHER_TYPE_IPv6)) {
+ } else if (gre_hdr->proto == _htons(RTE_ETHER_TYPE_IPv6)) {
info->is_tunnel = 1;
info->outer_ethertype = info->ethertype;
info->outer_l2_len = info->l2_len;
@@ -308,11 +308,11 @@ parse_gre(struct simple_gre_hdr *gre_hdr, struct testpmd_offload_info *info)
ipv6_hdr = (struct ipv6_hdr *)((char *)gre_hdr + gre_len);
- info->ethertype = _htons(ETHER_TYPE_IPv6);
+ info->ethertype = _htons(RTE_ETHER_TYPE_IPv6);
parse_ipv6(ipv6_hdr, info);
info->l2_len = 0;
- } else if (gre_hdr->proto == _htons(ETHER_TYPE_TEB)) {
+ } else if (gre_hdr->proto == _htons(RTE_ETHER_TYPE_TEB)) {
info->is_tunnel = 1;
info->outer_ethertype = info->ethertype;
info->outer_l2_len = info->l2_len;
@@ -349,10 +349,10 @@ parse_encap_ip(void *encap_ip, struct testpmd_offload_info *info)
if (ip_version == 4) {
parse_ipv4(ipv4_hdr, info);
- info->ethertype = _htons(ETHER_TYPE_IPv4);
+ info->ethertype = _htons(RTE_ETHER_TYPE_IPv4);
} else {
parse_ipv6(ipv6_hdr, info);
- info->ethertype = _htons(ETHER_TYPE_IPv6);
+ info->ethertype = _htons(RTE_ETHER_TYPE_IPv6);
}
info->l2_len = 0;
}
@@ -384,7 +384,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
tso_segsz = info->tunnel_tso_segsz;
}
- if (info->ethertype == _htons(ETHER_TYPE_IPv4)) {
+ if (info->ethertype == _htons(RTE_ETHER_TYPE_IPv4)) {
ipv4_hdr = l3_hdr;
ipv4_hdr->hdr_checksum = 0;
@@ -398,7 +398,7 @@ process_inner_cksums(void *l3_hdr, const struct testpmd_offload_info *info,
ipv4_hdr->hdr_checksum =
rte_ipv4_cksum(ipv4_hdr);
}
- } else if (info->ethertype == _htons(ETHER_TYPE_IPv6))
+ } else if (info->ethertype == _htons(RTE_ETHER_TYPE_IPv6))
ol_flags |= PKT_TX_IPV6;
else
return 0; /* packet type not supported, nothing to do */
@@ -459,7 +459,7 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
struct udp_hdr *udp_hdr;
uint64_t ol_flags = 0;
- if (info->outer_ethertype == _htons(ETHER_TYPE_IPv4)) {
+ if (info->outer_ethertype == _htons(RTE_ETHER_TYPE_IPv4)) {
ipv4_hdr->hdr_checksum = 0;
ol_flags |= PKT_TX_OUTER_IPV4;
@@ -495,7 +495,7 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,
/* do not recalculate udp cksum if it was 0 */
if (udp_hdr->dgram_cksum != 0) {
udp_hdr->dgram_cksum = 0;
- if (info->outer_ethertype == _htons(ETHER_TYPE_IPv4))
+ if (info->outer_ethertype == _htons(RTE_ETHER_TYPE_IPv4))
udp_hdr->dgram_cksum =
rte_ipv4_udptcp_cksum(ipv4_hdr, udp_hdr);
else
diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c
index 3f29e94..ccc5dd8 100644
--- a/app/test-pmd/flowgen.c
+++ b/app/test-pmd/flowgen.c
@@ -173,7 +173,7 @@ pkt_burst_flow_gen(struct fwd_stream *fs)
eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
rte_ether_addr_copy(&cfg_ether_dst, &eth_hdr->d_addr);
rte_ether_addr_copy(&cfg_ether_src, &eth_hdr->s_addr);
- 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);
/* Initialize IP header. */
ip_hdr = (struct ipv4_hdr *)(eth_hdr + 1);
diff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c
index f411792..c6c7cb6 100644
--- a/app/test-pmd/icmpecho.c
+++ b/app/test-pmd/icmpecho.c
@@ -223,9 +223,9 @@ ipv4_addr_to_dot(uint32_t be_ipv4_addr, char *buf)
static void
ether_addr_dump(const char *what, const struct rte_ether_addr *ea)
{
- char buf[ETHER_ADDR_FMT_SIZE];
+ char buf[RTE_ETHER_ADDR_FMT_SIZE];
- rte_ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, ea);
+ rte_ether_format_addr(buf, RTE_ETHER_ADDR_FMT_SIZE, ea);
if (what)
printf("%s", what);
printf("%s", buf);
@@ -330,7 +330,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
ether_addr_dump(" ETH: src=", &eth_h->s_addr);
ether_addr_dump(" dst=", &eth_h->d_addr);
}
- if (eth_type == ETHER_TYPE_VLAN) {
+ if (eth_type == RTE_ETHER_TYPE_VLAN) {
vlan_h = (struct rte_vlan_hdr *)
((char *)eth_h + sizeof(struct rte_ether_hdr));
l2_len += sizeof(struct rte_vlan_hdr);
@@ -346,7 +346,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
}
/* Reply to ARP requests */
- if (eth_type == ETHER_TYPE_ARP) {
+ if (eth_type == RTE_ETHER_TYPE_ARP) {
arp_h = (struct rte_arp_hdr *) ((char *)eth_h + l2_len);
arp_op = RTE_BE_TO_CPU_16(arp_h->arp_opcode);
arp_pro = RTE_BE_TO_CPU_16(arp_h->arp_protocol);
@@ -360,7 +360,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
}
if ((RTE_BE_TO_CPU_16(arp_h->arp_hardware) !=
RTE_ARP_HRD_ETHER) ||
- (arp_pro != ETHER_TYPE_IPv4) ||
+ (arp_pro != RTE_ETHER_TYPE_IPv4) ||
(arp_h->arp_hlen != 6) ||
(arp_h->arp_plen != 4)
) {
@@ -414,7 +414,7 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
continue;
}
- if (eth_type != ETHER_TYPE_IPv4) {
+ if (eth_type != RTE_ETHER_TYPE_IPv4) {
rte_pktmbuf_free(pkt);
continue;
}
diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c
index 2b7003b..e3b98e3 100644
--- a/app/test-pmd/ieee1588fwd.c
+++ b/app/test-pmd/ieee1588fwd.c
@@ -115,7 +115,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs)
eth_type = rte_be_to_cpu_16(eth_hdr->ether_type);
if (! (mb->ol_flags & PKT_RX_IEEE1588_PTP)) {
- if (eth_type == ETHER_TYPE_1588) {
+ if (eth_type == RTE_ETHER_TYPE_1588) {
printf("Port %u Received PTP packet not filtered"
" by hardware\n",
fs->rx_port);
@@ -128,7 +128,7 @@ ieee1588_packet_fwd(struct fwd_stream *fs)
rte_pktmbuf_free(mb);
return;
}
- if (eth_type != ETHER_TYPE_1588) {
+ if (eth_type != RTE_ETHER_TYPE_1588) {
printf("Port %u Received NON PTP packet incorrectly"
" detected by hardware\n",
fs->rx_port);
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 41eb3ff..245b610 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -879,15 +879,15 @@ launch_args_parse(int argc, char** argv)
}
if (!strcmp(lgopts[opt_idx].name, "max-pkt-len")) {
n = atoi(optarg);
- if (n >= ETHER_MIN_LEN) {
+ if (n >= RTE_ETHER_MIN_LEN) {
rx_mode.max_rx_pkt_len = (uint32_t) n;
- if (n > ETHER_MAX_LEN)
+ if (n > RTE_ETHER_MAX_LEN)
rx_offloads |=
DEV_RX_OFFLOAD_JUMBO_FRAME;
} else
rte_exit(EXIT_FAILURE,
"Invalid max-pkt-len=%d - should be > %d\n",
- n, ETHER_MIN_LEN);
+ n, RTE_ETHER_MIN_LEN);
}
if (!strcmp(lgopts[opt_idx].name, "pkt-filter-mode")) {
if (!strcmp(optarg, "signature"))
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 2c736ec..55e1b9d 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -413,7 +413,8 @@ lcoreid_t latencystats_lcore_id = -1;
* Ethernet device configuration.
*/
struct rte_eth_rxmode rx_mode = {
- .max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame length. */
+ .max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+ /**< Default maximum frame length. */
};
struct rte_eth_txmode tx_mode = {
@@ -526,7 +527,7 @@ static void dev_event_callback(const char *device_name,
static int all_ports_started(void);
struct gso_status gso_ports[RTE_MAX_ETHPORTS];
-uint16_t gso_max_segment_size = ETHER_MAX_LEN - ETHER_CRC_LEN;
+uint16_t gso_max_segment_size = RTE_ETHER_MAX_LEN - RTE_ETHER_CRC_LEN;
/*
* Helper function to check if socket is already discovered.
@@ -582,7 +583,7 @@ set_def_peer_eth_addrs(void)
portid_t i;
for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
- peer_eth_addrs[i].addr_bytes[0] = ETHER_LOCAL_ADMIN_ADDR;
+ peer_eth_addrs[i].addr_bytes[0] = RTE_ETHER_LOCAL_ADMIN_ADDR;
peer_eth_addrs[i].addr_bytes[5] = i;
}
}
@@ -1223,8 +1224,8 @@ init_config(void)
fwd_lcores[lc_id]->gso_ctx.direct_pool = mbp;
fwd_lcores[lc_id]->gso_ctx.indirect_pool = mbp;
fwd_lcores[lc_id]->gso_ctx.gso_types = gso_types;
- fwd_lcores[lc_id]->gso_ctx.gso_size = ETHER_MAX_LEN -
- ETHER_CRC_LEN;
+ fwd_lcores[lc_id]->gso_ctx.gso_size = RTE_ETHER_MAX_LEN -
+ RTE_ETHER_CRC_LEN;
fwd_lcores[lc_id]->gso_ctx.flag = 0;
}
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index abee0a9..e3a6f7c 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -501,8 +501,8 @@ struct vxlan_encap_conf {
rte_be16_t vlan_tci;
uint8_t ip_tos;
uint8_t ip_ttl;
- uint8_t eth_src[ETHER_ADDR_LEN];
- uint8_t eth_dst[ETHER_ADDR_LEN];
+ uint8_t eth_src[RTE_ETHER_ADDR_LEN];
+ uint8_t eth_dst[RTE_ETHER_ADDR_LEN];
};
struct vxlan_encap_conf vxlan_encap_conf;
@@ -516,8 +516,8 @@ struct nvgre_encap_conf {
uint8_t ipv6_src[16];
uint8_t ipv6_dst[16];
rte_be16_t vlan_tci;
- uint8_t eth_src[ETHER_ADDR_LEN];
- uint8_t eth_dst[ETHER_ADDR_LEN];
+ uint8_t eth_src[RTE_ETHER_ADDR_LEN];
+ uint8_t eth_dst[RTE_ETHER_ADDR_LEN];
};
struct nvgre_encap_conf nvgre_encap_conf;
@@ -526,8 +526,8 @@ struct l2_encap_conf {
uint32_t select_ipv4:1;
uint32_t select_vlan:1;
rte_be16_t vlan_tci;
- uint8_t eth_src[ETHER_ADDR_LEN];
- uint8_t eth_dst[ETHER_ADDR_LEN];
+ uint8_t eth_src[RTE_ETHER_ADDR_LEN];
+ uint8_t eth_dst[RTE_ETHER_ADDR_LEN];
};
struct l2_encap_conf l2_encap_conf;
@@ -547,8 +547,8 @@ struct mplsogre_encap_conf {
uint8_t ipv6_src[16];
uint8_t ipv6_dst[16];
rte_be16_t vlan_tci;
- uint8_t eth_src[ETHER_ADDR_LEN];
- uint8_t eth_dst[ETHER_ADDR_LEN];
+ uint8_t eth_src[RTE_ETHER_ADDR_LEN];
+ uint8_t eth_dst[RTE_ETHER_ADDR_LEN];
};
struct mplsogre_encap_conf mplsogre_encap_conf;
@@ -571,8 +571,8 @@ struct mplsoudp_encap_conf {
uint8_t ipv6_src[16];
uint8_t ipv6_dst[16];
rte_be16_t vlan_tci;
- uint8_t eth_src[ETHER_ADDR_LEN];
- uint8_t eth_dst[ETHER_ADDR_LEN];
+ uint8_t eth_src[RTE_ETHER_ADDR_LEN];
+ uint8_t eth_dst[RTE_ETHER_ADDR_LEN];
};
struct mplsoudp_encap_conf mplsoudp_encap_conf;
diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c
index eb3a245..91fb1f6 100644
--- a/app/test-pmd/txonly.c
+++ b/app/test-pmd/txonly.c
@@ -268,7 +268,7 @@ pkt_burst_transmit(struct fwd_stream *fs)
*/
rte_ether_addr_copy(&peer_eth_addrs[fs->peer_addr], &eth_hdr.d_addr);
rte_ether_addr_copy(&ports[fs->tx_port].eth_addr, &eth_hdr.s_addr);
- 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);
if (rte_mempool_get_bulk(mbp, (void **)pkts_burst,
nb_pkt_per_burst) == 0) {
diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
index 55f3844..105c560 100644
--- a/app/test-pmd/util.c
+++ b/app/test-pmd/util.c
@@ -16,8 +16,8 @@
static inline void
print_ether_addr(const char *what, 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", what, buf);
}