summaryrefslogtreecommitdiff
path: root/app/test-pmd
diff options
context:
space:
mode:
authorOlivier Matz <olivier.matz@6wind.com>2019-05-21 18:13:04 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2019-05-24 13:34:45 +0200
commit538da7a1cad25fbdffe298c8ca76fc4dbd262d1b (patch)
treec658a60595b1dec44557da57a2b6259a3d286854 /app/test-pmd
parent6d13ea8e8e49ab957deae2bba5ecf4a4bfe747d1 (diff)
downloaddpdk-538da7a1cad25fbdffe298c8ca76fc4dbd262d1b.zip
dpdk-538da7a1cad25fbdffe298c8ca76fc4dbd262d1b.tar.gz
dpdk-538da7a1cad25fbdffe298c8ca76fc4dbd262d1b.tar.xz
net: add rte prefix to ether functions
Add 'rte_' prefix to functions: - rename is_same_ether_addr() as rte_is_same_ether_addr(). - rename is_zero_ether_addr() as rte_is_zero_ether_addr(). - rename is_unicast_ether_addr() as rte_is_unicast_ether_addr(). - rename is_multicast_ether_addr() as rte_is_multicast_ether_addr(). - rename is_broadcast_ether_addr() as rte_is_broadcast_ether_addr(). - rename is_universal_ether_addr() as rte_is_universal_ether_addr(). - rename is_local_admin_ether_addr() as rte_is_local_admin_ether_addr(). - rename is_valid_assigned_ether_addr() as rte_is_valid_assigned_ether_addr(). - rename eth_random_addr() as rte_eth_random_addr(). - rename ether_addr_copy() as rte_ether_addr_copy(). - rename ether_format_addr() as rte_ether_format_addr(). Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'app/test-pmd')
-rw-r--r--app/test-pmd/cmdline.c6
-rw-r--r--app/test-pmd/config.c8
-rw-r--r--app/test-pmd/csumonly.c4
-rw-r--r--app/test-pmd/flowgen.c4
-rw-r--r--app/test-pmd/icmpecho.c27
-rw-r--r--app/test-pmd/ieee1588fwd.c6
-rw-r--r--app/test-pmd/macfwd.c4
-rw-r--r--app/test-pmd/macswap.h6
-rw-r--r--app/test-pmd/txonly.c4
-rw-r--r--app/test-pmd/util.c2
10 files changed, 38 insertions, 33 deletions
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 90e3502..1fb6099 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -8813,8 +8813,8 @@ cmd_tunnel_filter_parsed(void *parsed_result,
memset(&tunnel_filter_conf, 0, sizeof(tunnel_filter_conf));
- ether_addr_copy(&res->outer_mac, &tunnel_filter_conf.outer_mac);
- ether_addr_copy(&res->inner_mac, &tunnel_filter_conf.inner_mac);
+ rte_ether_addr_copy(&res->outer_mac, &tunnel_filter_conf.outer_mac);
+ rte_ether_addr_copy(&res->inner_mac, &tunnel_filter_conf.inner_mac);
tunnel_filter_conf.inner_vlan = res->inner_vlan;
if (res->ip_value.family == AF_INET) {
@@ -12472,7 +12472,7 @@ static void cmd_mcast_addr_parsed(void *parsed_result,
{
struct cmd_mcast_addr_result *res = parsed_result;
- if (!is_multicast_ether_addr(&res->mc_addr)) {
+ if (!rte_is_multicast_ether_addr(&res->mc_addr)) {
printf("Invalid multicast addr %02X:%02X:%02X:%02X:%02X:%02X\n",
res->mc_addr.addr_bytes[0], res->mc_addr.addr_bytes[1],
res->mc_addr.addr_bytes[2], res->mc_addr.addr_bytes[3],
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 03ce502..7a67690 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -111,7 +111,7 @@ static void
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);
+ rte_ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);
printf("%s%s", name, buf);
}
@@ -3536,7 +3536,7 @@ mcast_addr_add(portid_t port_id, struct rte_ether_addr *mc_addr)
* in the pool of multicast addresses.
*/
for (i = 0; i < port->mc_addr_nb; i++) {
- if (is_same_ether_addr(mc_addr, &port->mc_addr_pool[i])) {
+ if (rte_is_same_ether_addr(mc_addr, &port->mc_addr_pool[i])) {
printf("multicast address already filtered by port\n");
return;
}
@@ -3544,7 +3544,7 @@ mcast_addr_add(portid_t port_id, struct rte_ether_addr *mc_addr)
if (mcast_addr_pool_extend(port) != 0)
return;
- ether_addr_copy(mc_addr, &port->mc_addr_pool[i]);
+ rte_ether_addr_copy(mc_addr, &port->mc_addr_pool[i]);
eth_port_multicast_addr_list_set(port_id);
}
@@ -3563,7 +3563,7 @@ mcast_addr_remove(portid_t port_id, struct rte_ether_addr *mc_addr)
* Search the pool of multicast MAC addresses for the removed address.
*/
for (i = 0; i < port->mc_addr_nb; i++) {
- if (is_same_ether_addr(mc_addr, &port->mc_addr_pool[i]))
+ if (rte_is_same_ether_addr(mc_addr, &port->mc_addr_pool[i]))
break;
}
if (i == port->mc_addr_nb) {
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 481b91a..8de37c8 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -767,9 +767,9 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
* and inner headers */
eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
- ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
+ rte_ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
&eth_hdr->d_addr);
- ether_addr_copy(&ports[fs->tx_port].eth_addr,
+ rte_ether_addr_copy(&ports[fs->tx_port].eth_addr,
&eth_hdr->s_addr);
parse_ethernet(eth_hdr, &info);
l3_hdr = (char *)eth_hdr + info.l2_len;
diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c
index ac56ca1..3f29e94 100644
--- a/app/test-pmd/flowgen.c
+++ b/app/test-pmd/flowgen.c
@@ -171,8 +171,8 @@ pkt_burst_flow_gen(struct fwd_stream *fs)
/* Initialize Ethernet header. */
eth_hdr = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *);
- ether_addr_copy(&cfg_ether_dst, &eth_hdr->d_addr);
- ether_addr_copy(&cfg_ether_src, &eth_hdr->s_addr);
+ 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);
/* Initialize IP header. */
diff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c
index 3cc4d25..f411792 100644
--- a/app/test-pmd/icmpecho.c
+++ b/app/test-pmd/icmpecho.c
@@ -225,7 +225,7 @@ ether_addr_dump(const char *what, const struct rte_ether_addr *ea)
{
char buf[ETHER_ADDR_FMT_SIZE];
- ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, ea);
+ rte_ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, ea);
if (what)
printf("%s", what);
printf("%s", buf);
@@ -370,12 +370,14 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
continue;
}
if (verbose_level > 0) {
- ether_addr_copy(&arp_h->arp_data.arp_sha, &eth_addr);
+ rte_ether_addr_copy(&arp_h->arp_data.arp_sha,
+ &eth_addr);
ether_addr_dump(" sha=", &eth_addr);
ip_addr = arp_h->arp_data.arp_sip;
ipv4_addr_dump(" sip=", ip_addr);
printf("\n");
- ether_addr_copy(&arp_h->arp_data.arp_tha, &eth_addr);
+ rte_ether_addr_copy(&arp_h->arp_data.arp_tha,
+ &eth_addr);
ether_addr_dump(" tha=", &eth_addr);
ip_addr = arp_h->arp_data.arp_tip;
ipv4_addr_dump(" tip=", ip_addr);
@@ -391,15 +393,18 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
*/
/* Use source MAC address as destination MAC address. */
- ether_addr_copy(&eth_h->s_addr, &eth_h->d_addr);
+ rte_ether_addr_copy(&eth_h->s_addr, &eth_h->d_addr);
/* Set source MAC address with MAC address of TX port */
- ether_addr_copy(&ports[fs->tx_port].eth_addr,
+ rte_ether_addr_copy(&ports[fs->tx_port].eth_addr,
&eth_h->s_addr);
arp_h->arp_opcode = rte_cpu_to_be_16(RTE_ARP_OP_REPLY);
- ether_addr_copy(&arp_h->arp_data.arp_tha, &eth_addr);
- ether_addr_copy(&arp_h->arp_data.arp_sha, &arp_h->arp_data.arp_tha);
- ether_addr_copy(&eth_h->s_addr, &arp_h->arp_data.arp_sha);
+ rte_ether_addr_copy(&arp_h->arp_data.arp_tha,
+ &eth_addr);
+ rte_ether_addr_copy(&arp_h->arp_data.arp_sha,
+ &arp_h->arp_data.arp_tha);
+ rte_ether_addr_copy(&eth_h->s_addr,
+ &arp_h->arp_data.arp_sha);
/* Swap IP addresses in ARP payload */
ip_addr = arp_h->arp_data.arp_sip;
@@ -456,9 +461,9 @@ reply_to_icmp_echo_rqsts(struct fwd_stream *fs)
* ICMP checksum is computed by assuming it is valid in the
* echo request and not verified.
*/
- ether_addr_copy(&eth_h->s_addr, &eth_addr);
- ether_addr_copy(&eth_h->d_addr, &eth_h->s_addr);
- ether_addr_copy(&eth_addr, &eth_h->d_addr);
+ rte_ether_addr_copy(&eth_h->s_addr, &eth_addr);
+ rte_ether_addr_copy(&eth_h->d_addr, &eth_h->s_addr);
+ rte_ether_addr_copy(&eth_addr, &eth_h->d_addr);
ip_addr = ip_h->src_addr;
if (is_multicast_ipv4_addr(ip_h->dst_addr)) {
uint32_t ip_src;
diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c
index c6aa3c6..2b7003b 100644
--- a/app/test-pmd/ieee1588fwd.c
+++ b/app/test-pmd/ieee1588fwd.c
@@ -178,9 +178,9 @@ ieee1588_packet_fwd(struct fwd_stream *fs)
port_ieee1588_rx_timestamp_check(fs->rx_port, timesync_index);
/* Swap dest and src mac addresses. */
- ether_addr_copy(&eth_hdr->d_addr, &addr);
- ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
- ether_addr_copy(&addr, &eth_hdr->s_addr);
+ rte_ether_addr_copy(&eth_hdr->d_addr, &addr);
+ rte_ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
+ rte_ether_addr_copy(&addr, &eth_hdr->s_addr);
/* Forward PTP packet with hardware TX timestamp */
mb->ol_flags |= PKT_TX_IEEE1588_TMST;
diff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c
index 631f86f..f151492 100644
--- a/app/test-pmd/macfwd.c
+++ b/app/test-pmd/macfwd.c
@@ -92,9 +92,9 @@ pkt_burst_mac_forward(struct fwd_stream *fs)
void *));
mb = pkts_burst[i];
eth_hdr = rte_pktmbuf_mtod(mb, struct rte_ether_hdr *);
- ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
+ rte_ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
&eth_hdr->d_addr);
- ether_addr_copy(&ports[fs->tx_port].eth_addr,
+ rte_ether_addr_copy(&ports[fs->tx_port].eth_addr,
&eth_hdr->s_addr);
mb->ol_flags &= IND_ATTACHED_MBUF | EXT_ATTACHED_MBUF;
mb->ol_flags |= ol_flags;
diff --git a/app/test-pmd/macswap.h b/app/test-pmd/macswap.h
index d53e5d4..0138441 100644
--- a/app/test-pmd/macswap.h
+++ b/app/test-pmd/macswap.h
@@ -29,9 +29,9 @@ do_macswap(struct rte_mbuf *pkts[], uint16_t nb,
eth_hdr = rte_pktmbuf_mtod(mb, struct rte_ether_hdr *);
/* Swap dest and src mac addresses. */
- ether_addr_copy(&eth_hdr->d_addr, &addr);
- ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
- ether_addr_copy(&addr, &eth_hdr->s_addr);
+ rte_ether_addr_copy(&eth_hdr->d_addr, &addr);
+ rte_ether_addr_copy(&eth_hdr->s_addr, &eth_hdr->d_addr);
+ rte_ether_addr_copy(&addr, &eth_hdr->s_addr);
mbuf_field_set(mb, ol_flags);
}
diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c
index e558b40..eb3a245 100644
--- a/app/test-pmd/txonly.c
+++ b/app/test-pmd/txonly.c
@@ -266,8 +266,8 @@ pkt_burst_transmit(struct fwd_stream *fs)
/*
* Initialize Ethernet header.
*/
- ether_addr_copy(&peer_eth_addrs[fs->peer_addr], &eth_hdr.d_addr);
- ether_addr_copy(&ports[fs->tx_port].eth_addr, &eth_hdr.s_addr);
+ 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);
if (rte_mempool_get_bulk(mbp, (void **)pkts_burst,
diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
index 0544b8e..55f3844 100644
--- a/app/test-pmd/util.c
+++ b/app/test-pmd/util.c
@@ -17,7 +17,7 @@ static inline void
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);
+ rte_ether_format_addr(buf, ETHER_ADDR_FMT_SIZE, eth_addr);
printf("%s%s", what, buf);
}