diff options
Diffstat (limited to 'drivers/net')
68 files changed, 279 insertions, 250 deletions
diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 9460318..6b39580 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -1578,7 +1578,7 @@ static int atl_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, uint32_t index __rte_unused, uint32_t pool __rte_unused) { - if (is_zero_ether_addr(mac_addr)) { + if (rte_is_zero_ether_addr(mac_addr)) { PMD_DRV_LOG(ERR, "Invalid Ethernet Address"); return -EINVAL; } diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils.c b/drivers/net/atlantic/hw_atl/hw_atl_utils.c index 26a53a2..84d11ab 100644 --- a/drivers/net/atlantic/hw_atl/hw_atl_utils.c +++ b/drivers/net/atlantic/hw_atl/hw_atl_utils.c @@ -657,7 +657,7 @@ static int hw_atl_utils_get_mac_permanent(struct aq_hw_s *self, mac_addr[1] = rte_constant_bswap32(mac_addr[1]); } - ether_addr_copy((struct rte_ether_addr *)mac_addr, + rte_ether_addr_copy((struct rte_ether_addr *)mac_addr, (struct rte_ether_addr *)mac); if ((mac[0] & 0x01U) || ((mac[0] | mac[1] | mac[2]) == 0x00U)) { @@ -868,7 +868,7 @@ static int aq_fw1x_set_wol(struct aq_hw_s *self, bool wol_enabled, u8 *mac) prpc->msg_wol.pattern_id = 1U; prpc->msg_wol.wol_packet_type = 2U; /* Magic Packet */ - ether_addr_copy((struct rte_ether_addr *)mac, + rte_ether_addr_copy((struct rte_ether_addr *)mac, (struct rte_ether_addr *)&prpc->msg_wol.wol_pattern); } else { rpc_size = sizeof(prpc->msg_id) + sizeof(prpc->msg_del_id); diff --git a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c index 55b5ce3..70d6e14 100644 --- a/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c +++ b/drivers/net/atlantic/hw_atl/hw_atl_utils_fw2x.c @@ -228,7 +228,7 @@ int aq_fw2x_get_mac_permanent(struct aq_hw_s *self, u8 *mac) mac_addr[1] = rte_constant_bswap32(mac_addr[1]); } - ether_addr_copy((struct rte_ether_addr *)mac_addr, + rte_ether_addr_copy((struct rte_ether_addr *)mac_addr, (struct rte_ether_addr *)mac); if ((mac[0] & 0x01U) || ((mac[0] | mac[1] | mac[2]) == 0x00U)) { diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c index 69a70d2..38e5eae 100644 --- a/drivers/net/avp/avp_ethdev.c +++ b/drivers/net/avp/avp_ethdev.c @@ -1014,7 +1014,7 @@ eth_avp_dev_init(struct rte_eth_dev *eth_dev) } /* Get a mac from device config */ - ether_addr_copy(&avp->ethaddr, ð_dev->data->mac_addrs[0]); + rte_ether_addr_copy(&avp->ethaddr, ð_dev->data->mac_addrs[0]); return 0; } @@ -1216,12 +1216,12 @@ _avp_mac_filter(struct avp_dev *avp, struct rte_mbuf *m) return 0; } - if (likely(is_broadcast_ether_addr(ð->d_addr))) { + if (likely(rte_is_broadcast_ether_addr(ð->d_addr))) { /* allow all broadcast packets */ return 0; } - if (likely(is_multicast_ether_addr(ð->d_addr))) { + if (likely(rte_is_multicast_ether_addr(ð->d_addr))) { /* allow all multicast packets */ return 0; } diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c index e89c0ec..237b75c 100644 --- a/drivers/net/axgbe/axgbe_ethdev.c +++ b/drivers/net/axgbe/axgbe_ethdev.c @@ -634,11 +634,11 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev) return -ENOMEM; } - if (!is_valid_assigned_ether_addr(&pdata->mac_addr)) - eth_random_addr(pdata->mac_addr.addr_bytes); + if (!rte_is_valid_assigned_ether_addr(&pdata->mac_addr)) + rte_eth_random_addr(pdata->mac_addr.addr_bytes); /* Copy the permanent MAC address */ - ether_addr_copy(&pdata->mac_addr, ð_dev->data->mac_addrs[0]); + rte_ether_addr_copy(&pdata->mac_addr, ð_dev->data->mac_addrs[0]); /* Clock settings */ pdata->sysclk_rate = AXGBE_V2_DMA_CLOCK_FREQ; diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 17b6817..39d3091 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -2214,8 +2214,8 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0) tx_parse_bd = &txq->tx_ring[TX_BD(bd_prod, txq)].parse_bd_e2; - if (is_multicast_ether_addr(&eh->d_addr)) { - if (is_broadcast_ether_addr(&eh->d_addr)) + if (rte_is_multicast_ether_addr(&eh->d_addr)) { + if (rte_is_broadcast_ether_addr(&eh->d_addr)) mac_type = BROADCAST_ADDRESS; else mac_type = MULTICAST_ADDRESS; diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c index cd5522d..7cf738a 100644 --- a/drivers/net/bnx2x/bnx2x_vfpf.c +++ b/drivers/net/bnx2x/bnx2x_vfpf.c @@ -300,11 +300,11 @@ int bnx2x_vf_get_resources(struct bnx2x_softc *sc, uint8_t tx_count, uint8_t rx_ sc->igu_sb_cnt, sc->igu_base_sb); strncpy(sc->fw_ver, sc_resp.fw_ver, sizeof(sc->fw_ver)); - if (is_valid_assigned_ether_addr(&sc_resp.resc.current_mac_addr)) - ether_addr_copy(&sc_resp.resc.current_mac_addr, + if (rte_is_valid_assigned_ether_addr(&sc_resp.resc.current_mac_addr)) + rte_ether_addr_copy(&sc_resp.resc.current_mac_addr, (struct rte_ether_addr *)sc->link_params.mac_addr); else - eth_random_addr(sc->link_params.mac_addr); + rte_eth_random_addr(sc->link_params.mac_addr); out: bnx2x_vf_finalize(sc, &acq->first_tlv); diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c index 1afe674..a1f527d 100644 --- a/drivers/net/bnxt/bnxt_flow.c +++ b/drivers/net/bnxt/bnxt_flow.c @@ -187,10 +187,10 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, * Destination MAC address mask must not be partially * set. Should be all 1's or all 0's. */ - if ((!is_zero_ether_addr(ð_mask->src) && - !is_broadcast_ether_addr(ð_mask->src)) || - (!is_zero_ether_addr(ð_mask->dst) && - !is_broadcast_ether_addr(ð_mask->dst))) { + if ((!rte_is_zero_ether_addr(ð_mask->src) && + !rte_is_broadcast_ether_addr(ð_mask->src)) || + (!rte_is_zero_ether_addr(ð_mask->dst) && + !rte_is_broadcast_ether_addr(ð_mask->dst))) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, @@ -209,7 +209,7 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, return -rte_errno; } - if (is_broadcast_ether_addr(ð_mask->dst)) { + if (rte_is_broadcast_ether_addr(ð_mask->dst)) { rte_memcpy(filter->dst_macaddr, ð_spec->dst, 6); en |= use_ntuple ? @@ -217,7 +217,7 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, EM_FLOW_ALLOC_INPUT_EN_DST_MACADDR; } - if (is_broadcast_ether_addr(ð_mask->src)) { + if (rte_is_broadcast_ether_addr(ð_mask->src)) { rte_memcpy(filter->src_macaddr, ð_spec->src, 6); en |= use_ntuple ? diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index 59e75b0..e2fe4f7 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -2586,7 +2586,7 @@ static void add_random_mac_if_needed(struct bnxt *bp, if (memcmp(mac.addr_bytes, "\x00\x00\x00\x00\x00", 6) == 0) { cfg_req->enables |= rte_cpu_to_le_32(HWRM_FUNC_CFG_INPUT_ENABLES_DFLT_MAC_ADDR); - eth_random_addr(cfg_req->dflt_mac_addr); + rte_eth_random_addr(cfg_req->dflt_mac_addr); bp->pf.vf_info[vf].random_mac = true; } else { memcpy(cfg_req->dflt_mac_addr, mac.addr_bytes, ETHER_ADDR_LEN); diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c index 51bf3f5..6077c3d 100644 --- a/drivers/net/bonding/rte_eth_bond_8023ad.c +++ b/drivers/net/bonding/rte_eth_bond_8023ad.c @@ -322,7 +322,7 @@ rx_machine(struct bond_dev_private *internals, uint16_t slave_id, agg = &bond_mode_8023ad_ports[port->aggregator_port_id]; bool match = port->actor.system_priority == lacp->partner.port_params.system_priority && - is_same_ether_addr(&agg->actor.system, + rte_is_same_ether_addr(&agg->actor.system, &lacp->partner.port_params.system) && port->actor.port_priority == lacp->partner.port_params.port_priority && @@ -575,7 +575,7 @@ tx_machine(struct bond_dev_private *internals, uint16_t slave_id) hdr = rte_pktmbuf_mtod(lacp_pkt, struct lacpdu_header *); /* Source and destination MAC */ - ether_addr_copy(&lacp_mac_addr, &hdr->eth_hdr.d_addr); + rte_ether_addr_copy(&lacp_mac_addr, &hdr->eth_hdr.d_addr); rte_eth_macaddr_get(slave_id, &hdr->eth_hdr.s_addr); hdr->eth_hdr.ether_type = rte_cpu_to_be_16(ETHER_TYPE_SLOW); @@ -592,7 +592,8 @@ tx_machine(struct bond_dev_private *internals, uint16_t slave_id) memcpy(&hdr->lacpdu.actor.port_params, &port->actor, sizeof(port->actor)); agg = &bond_mode_8023ad_ports[port->aggregator_port_id]; - ether_addr_copy(&agg->actor.system, &hdr->lacpdu.actor.port_params.system); + rte_ether_addr_copy(&agg->actor.system, + &hdr->lacpdu.actor.port_params.system); lacpdu->actor.state = port->actor_state; /* PARTNER */ @@ -694,9 +695,10 @@ selection_logic(struct bond_dev_private *internals, uint16_t slave_id) * ID (MAC address). */ if ((agg->actor.key == port->actor.key && agg->partner.system_priority == port->partner.system_priority && - is_same_ether_addr(&agg->partner.system, &port->partner.system) == 1 + rte_is_same_ether_addr(&agg->partner.system, + &port->partner.system) == 1 && (agg->partner.key == port->partner.key)) && - is_zero_ether_addr(&port->partner.system) != 1 && + rte_is_zero_ether_addr(&port->partner.system) != 1 && (agg->actor.key & rte_cpu_to_be_16(BOND_LINK_FULL_DUPLEX_KEY)) != 0) { @@ -791,7 +793,7 @@ rx_machine_update(struct bond_dev_private *internals, uint16_t slave_id, RTE_ASSERT(lacp->lacpdu.subtype == SLOW_SUBTYPE_LACP); partner = &lacp->lacpdu.partner; - if (is_same_ether_addr(&partner->port_params.system, + if (rte_is_same_ether_addr(&partner->port_params.system, &internals->mode4.mac_addr)) { /* This LACP frame is sending to the bonding port * so pass it to rx_machine. @@ -842,8 +844,8 @@ bond_mode_8023ad_periodic_cb(void *arg) SM_FLAG_SET(port, NTT); } - if (!is_same_ether_addr(&port->actor.system, &slave_addr)) { - ether_addr_copy(&slave_addr, &port->actor.system); + if (!rte_is_same_ether_addr(&port->actor.system, &slave_addr)) { + rte_ether_addr_copy(&slave_addr, &port->actor.system); if (port->aggregator_port_id == slave_id) SM_FLAG_SET(port, NTT); } @@ -1055,10 +1057,10 @@ bond_mode_8023ad_mac_address_update(struct rte_eth_dev *bond_dev) slave = &bond_mode_8023ad_ports[slave_id]; rte_eth_macaddr_get(slave_id, &slave_addr); - if (is_same_ether_addr(&slave_addr, &slave->actor.system)) + if (rte_is_same_ether_addr(&slave_addr, &slave->actor.system)) continue; - ether_addr_copy(&slave_addr, &slave->actor.system); + rte_ether_addr_copy(&slave_addr, &slave->actor.system); /* Do nothing if this port is not an aggregator. In other case * Set NTT flag on every port that use this aggregator. */ if (slave->aggregator_port_id != slave_id) diff --git a/drivers/net/bonding/rte_eth_bond_alb.c b/drivers/net/bonding/rte_eth_bond_alb.c index da0b062..00d6b50 100644 --- a/drivers/net/bonding/rte_eth_bond_alb.c +++ b/drivers/net/bonding/rte_eth_bond_alb.c @@ -102,17 +102,21 @@ void bond_mode_alb_arp_recv(struct rte_ether_hdr *eth_h, uint16_t offset, if (client_info->in_use == 0 || client_info->app_ip != arp->arp_data.arp_tip || client_info->cli_ip != arp->arp_data.arp_sip || - !is_same_ether_addr(&client_info->cli_mac, &arp->arp_data.arp_sha) || + !rte_is_same_ether_addr(&client_info->cli_mac, + &arp->arp_data.arp_sha) || client_info->vlan_count != offset / sizeof(struct rte_vlan_hdr) || memcmp(client_info->vlan, eth_h + 1, offset) != 0 ) { client_info->in_use = 1; client_info->app_ip = arp->arp_data.arp_tip; client_info->cli_ip = arp->arp_data.arp_sip; - ether_addr_copy(&arp->arp_data.arp_sha, &client_info->cli_mac); + rte_ether_addr_copy(&arp->arp_data.arp_sha, + &client_info->cli_mac); client_info->slave_idx = calculate_slave(internals); - rte_eth_macaddr_get(client_info->slave_idx, &client_info->app_mac); - ether_addr_copy(&client_info->app_mac, &arp->arp_data.arp_tha); + rte_eth_macaddr_get(client_info->slave_idx, + &client_info->app_mac); + rte_ether_addr_copy(&client_info->app_mac, + &arp->arp_data.arp_tha); memcpy(client_info->vlan, eth_h + 1, offset); client_info->vlan_count = offset / sizeof(struct rte_vlan_hdr); } @@ -140,7 +144,7 @@ bond_mode_alb_arp_xmit(struct rte_ether_hdr *eth_h, uint16_t offset, * current primary port. */ rte_eth_macaddr_get(internals->port_id, &bonding_mac); - if (!is_same_ether_addr(&bonding_mac, &arp->arp_data.arp_sha)) { + if (!rte_is_same_ether_addr(&bonding_mac, &arp->arp_data.arp_sha)) { rte_eth_macaddr_get(internals->current_primary_port, &arp->arp_data.arp_sha); return internals->current_primary_port; @@ -156,13 +160,16 @@ bond_mode_alb_arp_xmit(struct rte_ether_hdr *eth_h, uint16_t offset, if (client_info->app_ip == arp->arp_data.arp_sip && client_info->cli_ip == arp->arp_data.arp_tip) { /* Entry is already assigned to this client */ - if (!is_broadcast_ether_addr(&arp->arp_data.arp_tha)) { - ether_addr_copy(&arp->arp_data.arp_tha, - &client_info->cli_mac); + if (!rte_is_broadcast_ether_addr( + &arp->arp_data.arp_tha)) { + rte_ether_addr_copy( + &arp->arp_data.arp_tha, + &client_info->cli_mac); } rte_eth_macaddr_get(client_info->slave_idx, &client_info->app_mac); - ether_addr_copy(&client_info->app_mac, &arp->arp_data.arp_sha); + rte_ether_addr_copy(&client_info->app_mac, + &arp->arp_data.arp_sha); memcpy(client_info->vlan, eth_h + 1, offset); client_info->vlan_count = offset / sizeof(struct rte_vlan_hdr); rte_spinlock_unlock(&internals->mode6.lock); @@ -174,11 +181,14 @@ bond_mode_alb_arp_xmit(struct rte_ether_hdr *eth_h, uint16_t offset, client_info->in_use = 1; client_info->ntt = 0; client_info->app_ip = arp->arp_data.arp_sip; - ether_addr_copy(&arp->arp_data.arp_tha, &client_info->cli_mac); + rte_ether_addr_copy(&arp->arp_data.arp_tha, + &client_info->cli_mac); client_info->cli_ip = arp->arp_data.arp_tip; client_info->slave_idx = calculate_slave(internals); - rte_eth_macaddr_get(client_info->slave_idx, &client_info->app_mac); - ether_addr_copy(&client_info->app_mac, &arp->arp_data.arp_sha); + rte_eth_macaddr_get(client_info->slave_idx, + &client_info->app_mac); + rte_ether_addr_copy(&client_info->app_mac, + &arp->arp_data.arp_sha); memcpy(client_info->vlan, eth_h + 1, offset); client_info->vlan_count = offset / sizeof(struct rte_vlan_hdr); rte_spinlock_unlock(&internals->mode6.lock); @@ -203,8 +213,8 @@ bond_mode_alb_arp_upd(struct client_data *client_info, rte_spinlock_lock(&internals->mode6.lock); eth_h = rte_pktmbuf_mtod(pkt, struct rte_ether_hdr *); - ether_addr_copy(&client_info->app_mac, ð_h->s_addr); - ether_addr_copy(&client_info->cli_mac, ð_h->d_addr); + rte_ether_addr_copy(&client_info->app_mac, ð_h->s_addr); + rte_ether_addr_copy(&client_info->cli_mac, ð_h->d_addr); if (client_info->vlan_count > 0) eth_h->ether_type = rte_cpu_to_be_16(ETHER_TYPE_VLAN); else @@ -217,9 +227,9 @@ bond_mode_alb_arp_upd(struct client_data *client_info, memcpy(eth_h + 1, client_info->vlan, client_info->vlan_count * sizeof(struct rte_vlan_hdr)); - ether_addr_copy(&client_info->app_mac, &arp_h->arp_data.arp_sha); + rte_ether_addr_copy(&client_info->app_mac, &arp_h->arp_data.arp_sha); arp_h->arp_data.arp_sip = client_info->app_ip; - ether_addr_copy(&client_info->cli_mac, &arp_h->arp_data.arp_tha); + rte_ether_addr_copy(&client_info->cli_mac, &arp_h->arp_data.arp_tha); arp_h->arp_data.arp_tip = client_info->cli_ip; arp_h->arp_hardware = rte_cpu_to_be_16(RTE_ARP_HRD_ETHER); diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 9950635..6e137a6 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -454,8 +454,8 @@ bond_ethdev_rx_burst_8023ad(void *queue, struct rte_mbuf **bufs, if (unlikely(is_lacp_packets(hdr->ether_type, subtype, bufs[j]) || !collecting || (!promisc && - !is_multicast_ether_addr(&hdr->d_addr) && - !is_same_ether_addr(bond_mac, + !rte_is_multicast_ether_addr(&hdr->d_addr) && + !rte_is_same_ether_addr(bond_mac, &hdr->d_addr)))) { if (hdr->ether_type == ether_type_slow_be) { @@ -1021,7 +1021,7 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) sizeof(internals->tlb_slaves_order[0]) * num_of_slaves); - ether_addr_copy(primary_port->data->mac_addrs, &primary_slave_addr); + rte_ether_addr_copy(primary_port->data->mac_addrs, &primary_slave_addr); if (nb_pkts > 3) { for (i = 0; i < 3; i++) @@ -1036,8 +1036,10 @@ bond_ethdev_tx_burst_tlb(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts) ether_hdr = rte_pktmbuf_mtod(bufs[j], struct rte_ether_hdr *); - if (is_same_ether_addr(ðer_hdr->s_addr, &primary_slave_addr)) - ether_addr_copy(&active_slave_addr, ðer_hdr->s_addr); + if (rte_is_same_ether_addr(ðer_hdr->s_addr, + &primary_slave_addr)) + rte_ether_addr_copy(&active_slave_addr, + ðer_hdr->s_addr); #if defined(RTE_LIBRTE_BOND_DEBUG_ALB) || defined(RTE_LIBRTE_BOND_DEBUG_ALB_L1) mode6_debug("TX IPv4:", ether_hdr, slaves[i], &burstnumberTX); #endif @@ -1523,7 +1525,7 @@ mac_address_get(struct rte_eth_dev *eth_dev, mac_addr = eth_dev->data->mac_addrs; - ether_addr_copy(mac_addr, dst_mac_addr); + rte_ether_addr_copy(mac_addr, dst_mac_addr); return 0; } @@ -1566,7 +1568,7 @@ slave_add_mac_addresses(struct rte_eth_dev *bonded_eth_dev, for (i = 1; i < BOND_MAX_MAC_ADDRS; i++) { mac_addr = &bonded_eth_dev->data->mac_addrs[i]; - if (is_same_ether_addr(mac_addr, &null_mac_addr)) + if (rte_is_same_ether_addr(mac_addr, &null_mac_addr)) break; ret = rte_eth_dev_mac_addr_add(slave_port_id, mac_addr, 0); @@ -1595,7 +1597,7 @@ slave_remove_mac_addresses(struct rte_eth_dev *bonded_eth_dev, rc = 0; for (i = 1; i < BOND_MAX_MAC_ADDRS; i++) { mac_addr = &bonded_eth_dev->data->mac_addrs[i]; - if (is_same_ether_addr(mac_addr, &null_mac_addr)) + if (rte_is_same_ether_addr(mac_addr, &null_mac_addr)) break; ret = rte_eth_dev_mac_addr_remove(slave_port_id, mac_addr); diff --git a/drivers/net/cxgbe/base/adapter.h b/drivers/net/cxgbe/base/adapter.h index b54f75e..1221664 100644 --- a/drivers/net/cxgbe/base/adapter.h +++ b/drivers/net/cxgbe/base/adapter.h @@ -671,7 +671,7 @@ static inline void t4_os_set_hw_addr(struct adapter *adapter, int port_idx, { struct port_info *pi = adap2pinfo(adapter, port_idx); - ether_addr_copy((struct rte_ether_addr *)hw_addr, + rte_ether_addr_copy((struct rte_ether_addr *)hw_addr, &pi->eth_dev->data->mac_addrs[0]); } diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.c index ee9920a..a7b053b 100644 --- a/drivers/net/cxgbe/cxgbe_flow.c +++ b/drivers/net/cxgbe/cxgbe_flow.c @@ -115,12 +115,12 @@ ch_rte_parsetype_eth(const void *dmask, const struct rte_flow_item *item, mask = umask ? umask : (const struct rte_flow_item_eth *)dmask; /* we don't support SRC_MAC filtering*/ - if (!is_zero_ether_addr(&mask->src)) + if (!rte_is_zero_ether_addr(&mask->src)) return rte_flow_error_set(e, ENOTSUP, RTE_FLOW_ERROR_TYPE_ITEM, item, "src mac filtering not supported"); - if (!is_zero_ether_addr(&mask->dst)) { + if (!rte_is_zero_ether_addr(&mask->dst)) { const u8 *addr = (const u8 *)&spec->dst.addr_bytes[0]; const u8 *m = (const u8 *)&mask->dst.addr_bytes[0]; struct rte_flow *flow = (struct rte_flow *)fs->private; diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 0e1dc1a..6716dd0 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -1374,7 +1374,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) } /* copy the primary mac address */ - ether_addr_copy(&fman_intf->mac_addr, ð_dev->data->mac_addrs[0]); + rte_ether_addr_copy(&fman_intf->mac_addr, ð_dev->data->mac_addrs[0]); RTE_LOG(INFO, PMD, "net: dpaa: %s: %02x:%02x:%02x:%02x:%02x:%02x\n", dpaa_device->name, diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index ae4d7e1..1afeaa9 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -2021,9 +2021,9 @@ populate_mac_addr(struct fsl_mc_io *dpni_dev, struct dpaa2_dev_priv *priv, * If empty_mac(phy), return prime. * if both are empty, create random MAC, set as prime and return */ - if (!is_zero_ether_addr(&phy_mac)) { + if (!rte_is_zero_ether_addr(&phy_mac)) { /* If the addresses are not same, overwrite prime */ - if (!is_same_ether_addr(&phy_mac, &prime_mac)) { + if (!rte_is_same_ether_addr(&phy_mac, &prime_mac)) { ret = dpni_set_primary_mac_addr(dpni_dev, CMD_PRI_LOW, priv->token, phy_mac.addr_bytes); @@ -2035,9 +2035,9 @@ populate_mac_addr(struct fsl_mc_io *dpni_dev, struct dpaa2_dev_priv *priv, memcpy(&prime_mac, &phy_mac, sizeof(struct rte_ether_addr)); } - } else if (is_zero_ether_addr(&prime_mac)) { + } else if (rte_is_zero_ether_addr(&prime_mac)) { /* In case phys and prime, both are zero, create random MAC */ - eth_random_addr(prime_mac.addr_bytes); + rte_eth_random_addr(prime_mac.addr_bytes); ret = dpni_set_primary_mac_addr(dpni_dev, CMD_PRI_LOW, priv->token, prime_mac.addr_bytes); diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index b2fdb5e..cd70f28 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -294,7 +294,7 @@ eth_em_dev_init(struct rte_eth_dev *eth_dev) } /* Copy the permanent MAC address */ - ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, + rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, eth_dev->data->mac_addrs); /* initialize the vfta */ diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index e21a772..03047af 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -840,7 +840,7 @@ eth_igb_dev_init(struct rte_eth_dev *eth_dev) } /* Copy the permanent MAC address */ - ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, + rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, ð_dev->data->mac_addrs[0]); /* initialize the vfta */ @@ -1039,8 +1039,8 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev) } /* Generate a random MAC address, if none was assigned by PF. */ - if (is_zero_ether_addr(perm_addr)) { - eth_random_addr(perm_addr->addr_bytes); + if (rte_is_zero_ether_addr(perm_addr)) { + rte_eth_random_addr(perm_addr->addr_bytes); PMD_INIT_LOG(INFO, "\tVF MAC address not assigned by Host PF"); PMD_INIT_LOG(INFO, "\tAssign randomly generated MAC address " "%02x:%02x:%02x:%02x:%02x:%02x", @@ -1059,7 +1059,7 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev) return diag; } /* Copy the permanent MAC address */ - ether_addr_copy((struct rte_ether_addr *)hw->mac.perm_addr, + rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.perm_addr, ð_dev->data->mac_addrs[0]); PMD_INIT_LOG(DEBUG, "port %d vendorID=0x%x deviceID=0x%x " diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c index 3368349..8dcfc71 100644 --- a/drivers/net/e1000/igb_flow.c +++ b/drivers/net/e1000/igb_flow.c @@ -548,9 +548,9 @@ cons_parse_ethertype_filter(const struct rte_flow_attr *attr, * Mask bits of destination MAC address must be full * of 1 or full of 0. */ - if (!is_zero_ether_addr(ð_mask->src) || - (!is_zero_ether_addr(ð_mask->dst) && - !is_broadcast_ether_addr(ð_mask->dst))) { + if (!rte_is_zero_ether_addr(ð_mask->src) || + (!rte_is_zero_ether_addr(ð_mask->dst) && + !rte_is_broadcast_ether_addr(ð_mask->dst))) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, "Invalid ether address mask"); @@ -567,7 +567,7 @@ cons_parse_ethertype_filter(const struct rte_flow_attr *attr, /* If mask bits of destination MAC address * are full of 1, set RTE_ETHTYPE_FLAGS_MAC. */ - if (is_broadcast_ether_addr(ð_mask->dst)) { + if (rte_is_broadcast_ether_addr(ð_mask->dst)) { filter->mac_addr = eth_spec->dst; filter->flags |= RTE_ETHTYPE_FLAGS_MAC; } else { diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c index 9f15213..ab48a26 100644 --- a/drivers/net/e1000/igb_pf.c +++ b/drivers/net/e1000/igb_pf.c @@ -43,7 +43,7 @@ int igb_vf_perm_addr_gen(struct rte_eth_dev *dev, uint16_t vf_num) uint16_t vfn; for (vfn = 0; vfn < vf_num; vfn++) { - eth_random_addr(vf_mac_addr); + rte_eth_random_addr(vf_mac_addr); /* keep the random address as default */ memcpy(vfinfo[vfn].vf_mac_addresses, vf_mac_addr, ETHER_ADDR_LEN); @@ -306,8 +306,8 @@ igb_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) uint8_t *new_mac = (uint8_t *)(&msgbuf[1]); int rah; - if (is_unicast_ether_addr((struct rte_ether_addr *)new_mac)) { - if (!is_zero_ether_addr((struct rte_ether_addr *)new_mac)) + if (rte_is_unicast_ether_addr((struct rte_ether_addr *)new_mac)) { + if (!rte_is_zero_ether_addr((struct rte_ether_addr *)new_mac)) rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, sizeof(vfinfo[vf].vf_mac_addresses)); hw->mac.ops.rar_set(hw, new_mac, rar_entry); diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c index 1d832f9..5ed86f0 100644 --- a/drivers/net/ena/ena_ethdev.c +++ b/drivers/net/ena/ena_ethdev.c @@ -1814,7 +1814,8 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev) /* Copy MAC address and point DPDK to it */ eth_dev->data->mac_addrs = (struct rte_ether_addr *)adapter->mac_addr; - ether_addr_copy((struct rte_ether_addr *)get_feat_ctx.dev_attr.mac_addr, + rte_ether_addr_copy((struct rte_ether_addr *) + get_feat_ctx.dev_attr.mac_addr, (struct rte_ether_addr *)adapter->mac_addr); /* diff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c index 2f47335..e637c86 100644 --- a/drivers/net/enetc/enetc_ethdev.c +++ b/drivers/net/enetc/enetc_ethdev.c @@ -840,7 +840,7 @@ enetc_dev_init(struct rte_eth_dev *eth_dev) } /* Copy the permanent MAC address */ - ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, + rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, ð_dev->data->mac_addrs[0]); /* Set MTU */ diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 71e1b9c..3b55eba 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -648,7 +648,7 @@ static void debug_log_add_del_addr(struct rte_ether_addr *addr, bool add) { char mac_str[ETHER_ADDR_FMT_SIZE]; - ether_format_addr(mac_str, ETHER_ADDR_FMT_SIZE, addr); + rte_ether_format_addr(mac_str, ETHER_ADDR_FMT_SIZE, addr); PMD_INIT_LOG(DEBUG, " %s address %s\n", add ? "add" : "remove", mac_str); } @@ -668,9 +668,10 @@ static int enicpmd_set_mc_addr_list(struct rte_eth_dev *eth_dev, /* Validate the given addresses first */ for (i = 0; i < nb_mc_addr && mc_addr_set != NULL; i++) { addr = &mc_addr_set[i]; - if (!is_multicast_ether_addr(addr) || - is_broadcast_ether_addr(addr)) { - ether_format_addr(mac_str, ETHER_ADDR_FMT_SIZE, addr); + if (!rte_is_multicast_ether_addr(addr) || + rte_is_broadcast_ether_addr(addr)) { + rte_ether_format_addr(mac_str, + ETHER_ADDR_FMT_SIZE, addr); PMD_INIT_LOG(ERR, " invalid multicast address %s\n", mac_str); return -EINVAL; @@ -704,7 +705,7 @@ static int enicpmd_set_mc_addr_list(struct rte_eth_dev *eth_dev, for (i = 0; i < enic->mc_count; i++) { addr = &enic->mc_addrs[i]; for (j = 0; j < nb_mc_addr; j++) { - if (is_same_ether_addr(addr, &mc_addr_set[j])) + if (rte_is_same_ether_addr(addr, &mc_addr_set[j])) break; } if (j < nb_mc_addr) @@ -718,7 +719,7 @@ static int enicpmd_set_mc_addr_list(struct rte_eth_dev *eth_dev, for (i = 0; i < nb_mc_addr; i++) { addr = &mc_addr_set[i]; for (j = 0; j < enic->mc_count; j++) { - if (is_same_ether_addr(addr, &enic->mc_addrs[j])) + if (rte_is_same_ether_addr(addr, &enic->mc_addrs[j])) break; } if (j < enic->mc_count) diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 6b76839..cbd2839 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -1673,7 +1673,7 @@ static int enic_dev_init(struct enic *enic) dev_err(enic, "mac addr storage alloc failed, aborting.\n"); return -1; } - ether_addr_copy((struct rte_ether_addr *)enic->mac_addr, + rte_ether_addr_copy((struct rte_ether_addr *)enic->mac_addr, eth_dev->data->mac_addrs); vnic_dev_set_reset_flag(enic->vdev, 0); diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c index 8f7d911..e91c274 100644 --- a/drivers/net/failsafe/failsafe.c +++ b/drivers/net/failsafe/failsafe.c @@ -253,8 +253,8 @@ fs_eth_dev_create(struct rte_vdev_device *vdev) */ FOREACH_SUBDEV(sdev, i, dev) if (sdev->state >= DEV_PROBED) { - ether_addr_copy(Ð(sdev)->data->mac_addrs[0], - mac); + rte_ether_addr_copy( + Ð(sdev)->data->mac_addrs[0], mac); break; } /* @@ -265,7 +265,7 @@ fs_eth_dev_create(struct rte_vdev_device *vdev) * probed slaves. */ if (i == priv->subs_tail) - eth_random_addr(&mac->addr_bytes[0]); + rte_eth_random_addr(&mac->addr_bytes[0]); } INFO("MAC address is %02x:%02x:%02x:%02x:%02x:%02x", mac->addr_bytes[0], mac->addr_bytes[1], diff --git a/drivers/net/failsafe/failsafe_ether.c b/drivers/net/failsafe/failsafe_ether.c index 549ee6b..325c67c 100644 --- a/drivers/net/failsafe/failsafe_ether.c +++ b/drivers/net/failsafe/failsafe_ether.c @@ -174,7 +174,7 @@ fs_eth_dev_conf_apply(struct rte_eth_dev *dev, if (ret) { char ea_fmt[ETHER_ADDR_FMT_SIZE]; - ether_format_addr(ea_fmt, ETHER_ADDR_FMT_SIZE, ea); + rte_ether_format_addr(ea_fmt, ETHER_ADDR_FMT_SIZE, ea); ERROR("Adding MAC address %s failed", ea_fmt); return ret; } diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index e4f9f93..d8e060d 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -614,7 +614,7 @@ fm10k_dev_mq_rx_configure(struct rte_eth_dev *dev) /* reset MAC/VLAN as it's based on VMDQ or PF main VSI */ memset(dev->data->mac_addrs, 0, ETHER_ADDR_LEN * FM10K_MAX_MACADDR_NUM); - ether_addr_copy((const struct rte_ether_addr *)hw->mac.addr, + rte_ether_addr_copy((const struct rte_ether_addr *)hw->mac.addr, &dev->data->mac_addrs[0]); memset(macvlan, 0, sizeof(*macvlan)); macvlan->nb_queue_pools = nb_queue_pools; @@ -1534,7 +1534,7 @@ fm10k_vlan_filter_set(struct rte_eth_dev *dev, uint16_t vlan_id, int on) for (mac_index = 0; (mac_index < FM10K_MAX_MACADDR_NUM) && (result == FM10K_SUCCESS); mac_index++) { - if (is_zero_ether_addr(&data->mac_addrs[mac_index])) + if (rte_is_zero_ether_addr(&data->mac_addrs[mac_index])) continue; if (mac_num > macvlan->mac_num - 1) { PMD_INIT_LOG(ERR, "MAC address number " @@ -3090,16 +3090,16 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev) diag = fm10k_read_mac_addr(hw); - ether_addr_copy((const struct rte_ether_addr *)hw->mac.addr, + rte_ether_addr_copy((const struct rte_ether_addr *)hw->mac.addr, &dev->data->mac_addrs[0]); if (diag != FM10K_SUCCESS || - !is_valid_assigned_ether_addr(dev->data->mac_addrs)) { + !rte_is_valid_assigned_ether_addr(dev->data->mac_addrs)) { /* Generate a random addr */ - eth_random_addr(hw->mac.addr); + rte_eth_random_addr(hw->mac.addr); memcpy(hw->mac.perm_addr, hw->mac.addr, ETH_ALEN); - ether_addr_copy((const struct rte_ether_addr *)hw->mac.addr, + rte_ether_addr_copy((const struct rte_ether_addr *)hw->mac.addr, &dev->data->mac_addrs[0]); } diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 85fdf35..3aba03d 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1469,7 +1469,7 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused) goto err_get_mac_addr; } /* Copy the permanent MAC address */ - ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, + rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, (struct rte_ether_addr *)hw->mac.perm_addr); /* Disable flow control */ @@ -1521,7 +1521,7 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused) "Failed to allocated memory for storing mac address"); goto err_mac_alloc; } - ether_addr_copy((struct rte_ether_addr *)hw->mac.perm_addr, + rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.perm_addr, &dev->data->mac_addrs[0]); /* Init dcb to sw mode by default */ @@ -4123,7 +4123,7 @@ i40e_vf_mac_filter_set(struct i40e_pf *pf, new_mac = &filter->mac_addr; - if (is_zero_ether_addr(new_mac)) { + if (rte_is_zero_ether_addr(new_mac)) { PMD_DRV_LOG(ERR, "Invalid ethernet address."); return -EINVAL; } @@ -4136,7 +4136,7 @@ i40e_vf_mac_filter_set(struct i40e_pf *pf, } vf = &pf->vfs[vf_id]; - if (add && is_same_ether_addr(new_mac, &(pf->dev_addr))) { + if (add && rte_is_same_ether_addr(new_mac, &pf->dev_addr)) { PMD_DRV_LOG(INFO, "Ignore adding permanent MAC address."); return -EINVAL; } @@ -4154,7 +4154,7 @@ i40e_vf_mac_filter_set(struct i40e_pf *pf, PMD_DRV_LOG(ERR, "Failed to add MAC filter."); return -1; } - ether_addr_copy(new_mac, &pf->dev_addr); + rte_ether_addr_copy(new_mac, &pf->dev_addr); } else { rte_memcpy(hw->mac.addr, hw->mac.perm_addr, ETHER_ADDR_LEN); @@ -4165,7 +4165,7 @@ i40e_vf_mac_filter_set(struct i40e_pf *pf, } /* Clear device address as it has been removed */ - if (is_same_ether_addr(&(pf->dev_addr), new_mac)) + if (rte_is_same_ether_addr(&pf->dev_addr, new_mac)) memset(&pf->dev_addr, 0, sizeof(struct rte_ether_addr)); } @@ -6913,7 +6913,7 @@ i40e_find_mac_filter(struct i40e_vsi *vsi, struct i40e_mac_filter *f; TAILQ_FOREACH(f, &vsi->mac_list, next) { - if (is_same_ether_addr(macaddr, &f->mac_info.mac_addr)) + if (rte_is_same_ether_addr(macaddr, &f->mac_info.mac_addr)) return f; } @@ -7586,9 +7586,11 @@ i40e_tunnel_filter_convert( struct i40e_aqc_cloud_filters_element_bb *cld_filter, struct i40e_tunnel_filter *tunnel_filter) { - ether_addr_copy((struct rte_ether_addr *)&cld_filter->element.outer_mac, + rte_ether_addr_copy((struct rte_ether_addr *) + &cld_filter->element.outer_mac, (struct rte_ether_addr *)&tunnel_filter->input.outer_mac); - ether_addr_copy((struct rte_ether_addr *)&cld_filter->element.inner_mac, + rte_ether_addr_copy((struct rte_ether_addr *) + &cld_filter->element.inner_mac, (struct rte_ether_addr *)&tunnel_filter->input.inner_mac); tunnel_filter->input.inner_vlan = cld_filter->element.inner_vlan; if ((rte_le_to_cpu_16(cld_filter->element.flags) & @@ -7697,9 +7699,9 @@ i40e_dev_tunnel_filter_set(struct i40e_pf *pf, } pfilter = cld_filter; - ether_addr_copy(&tunnel_filter->outer_mac, + rte_ether_addr_copy(&tunnel_filter->outer_mac, (struct rte_ether_addr *)&pfilter->element.outer_mac); - ether_addr_copy(&tunnel_filter->inner_mac, + rte_ether_addr_copy(&tunnel_filter->inner_mac, (struct rte_ether_addr *)&pfilter->element.inner_mac); pfilter->element.inner_vlan = @@ -8144,9 +8146,9 @@ i40e_dev_consistent_tunnel_filter_set(struct i40e_pf *pf, } pfilter = cld_filter; - ether_addr_copy(&tunnel_filter->outer_mac, + rte_ether_addr_copy(&tunnel_filter->outer_mac, (struct rte_ether_addr *)&pfilter->element.outer_mac); - ether_addr_copy(&tunnel_filter->inner_mac, + rte_ether_addr_copy(&tunnel_filter->inner_mac, (struct rte_ether_addr *)&pfilter->element.inner_mac); pfilter->element.inner_vlan = @@ -8627,13 +8629,13 @@ i40e_tunnel_filter_param_check(struct i40e_pf *pf, } if ((filter->filter_type & ETH_TUNNEL_FILTER_OMAC) && - (is_zero_ether_addr(&filter->outer_mac))) { + (rte_is_zero_ether_addr(&filter->outer_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL outer MAC address"); return -EINVAL; } if ((filter->filter_type & ETH_TUNNEL_FILTER_IMAC) && - (is_zero_ether_addr(&filter->inner_mac))) { + (rte_is_zero_ether_addr(&filter->inner_mac))) { PMD_DRV_LOG(ERR, "Cannot add NULL inner MAC address"); return -EINVAL; } @@ -11960,13 +11962,14 @@ static int i40e_set_default_mac_addr(struct rte_eth_dev *dev, struct i40e_mac_filter *f; int ret; - if (!is_valid_assigned_ether_addr(mac_addr)) { + if (!rte_is_valid_assigned_ether_addr(mac_addr)) { PMD_DRV_LOG(ERR, "Tried to set invalid MAC address."); return -EINVAL; } TAILQ_FOREACH(f, &vsi->mac_list, next) { - if (is_same_ether_addr(&pf->dev_addr, &f->mac_info.mac_addr)) + if (rte_is_same_ether_addr(&pf->dev_addr, + &f->mac_info.mac_addr)) break; } @@ -12084,9 +12087,11 @@ i40e_tunnel_filter_restore(struct i40e_pf *pf) vsi = vf->vsi; } memset(&cld_filter, 0, sizeof(cld_filter)); - ether_addr_copy((struct rte_ether_addr *)&f->input.outer_mac, + rte_ether_addr_copy((struct rte_ether_addr *) + &f->input.outer_mac, (struct rte_ether_addr *)&cld_filter.element.outer_mac); - ether_addr_copy((struct rte_ether_addr *)&f->input.inner_mac, + rte_ether_addr_copy((struct rte_ether_addr *) + &f->input.inner_mac, (struct rte_ether_addr *)&cld_filter.element.inner_mac); cld_filter.element.inner_vlan = f->input.inner_vlan; cld_filter.element.flags = f->input.flags; diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 0b05ddb..f7f193c 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -788,7 +788,7 @@ i40evf_add_mac_addr(struct rte_eth_dev *dev, int err; struct vf_cmd_info args; - if (is_zero_ether_addr(addr)) { + if (rte_is_zero_ether_addr(addr)) { PMD_DRV_LOG(ERR, "Invalid mac:%x:%x:%x:%x:%x:%x", addr->addr_bytes[0], addr->addr_bytes[1], addr->addr_bytes[2], addr->addr_bytes[3], @@ -1274,10 +1274,11 @@ i40evf_init_vf(struct rte_eth_dev *dev) vf->vsi.adapter = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); /* Store the MAC address configured by host, or generate random one */ - if (is_valid_assigned_ether_addr((struct rte_ether_addr *)hw->mac.addr)) + if (rte_is_valid_assigned_ether_addr( + (struct rte_ether_addr *)hw->mac.addr)) vf->flags |= I40E_FLAG_VF_MAC_BY_PF; else - eth_random_addr(hw->mac.addr); /* Generate a random one */ + rte_eth_random_addr(hw->mac.addr); /* Generate a random one */ I40E_WRITE_REG(hw, I40E_VFINT_DYN_CTL01, (I40E_ITR_INDEX_DEFAULT << @@ -1512,7 +1513,7 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev) ETHER_ADDR_LEN * I40E_NUM_MACADDR_MAX); return -ENOMEM; } - ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, + rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, ð_dev->data->mac_addrs[0]); return 0; @@ -1937,7 +1938,7 @@ i40evf_add_del_all_mac_addr(struct rte_eth_dev *dev, bool add) j = 0; len = sizeof(struct virtchnl_ether_addr_list); for (i = begin; i < I40E_NUM_MACADDR_MAX; i++, next_begin++) { - if (is_zero_ether_addr(&dev->data->mac_addrs[i])) + if (rte_is_zero_ether_addr(&dev->data->mac_addrs[i])) continue; len += sizeof(struct virtchnl_ether_addr); if (len >= I40E_AQ_BUF_SZ) { @@ -1954,7 +1955,7 @@ i40evf_add_del_all_mac_addr(struct rte_eth_dev *dev, bool add) for (i = begin; i < next_begin; i++) { addr = &dev->data->mac_addrs[i]; - if (is_zero_ether_addr(addr)) + if (rte_is_zero_ether_addr(addr)) continue; rte_memcpy(list->list[j].addr, addr->addr_bytes, sizeof(addr->addr_bytes)); @@ -2707,7 +2708,7 @@ i40evf_set_default_mac_addr(struct rte_eth_dev *dev, struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private); struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private); - if (!is_valid_assigned_ether_addr(mac_addr)) { + if (!rte_is_valid_assigned_ether_addr(mac_addr)) { PMD_DRV_LOG(ERR, "Tried to set invalid MAC address."); return -EINVAL; } @@ -2720,7 +2721,7 @@ i40evf_set_default_mac_addr(struct rte_eth_dev *dev, if (i40evf_add_mac_addr(dev, mac_addr, 0, 0) != 0) return -EIO; - ether_addr_copy(mac_addr, (struct rte_ether_addr *)hw->mac.addr); + rte_ether_addr_copy(mac_addr, (struct rte_ether_addr *)hw->mac.addr); return 0; } diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c index 559ca92..73778a9 100644 --- a/drivers/net/i40e/i40e_flow.c +++ b/drivers/net/i40e/i40e_flow.c @@ -2006,9 +2006,9 @@ i40e_flow_parse_ethertype_pattern(struct rte_eth_dev *dev, * Mask bits of destination MAC address must be full * of 1 or full of 0. */ - if (!is_zero_ether_addr(ð_mask->src) || - (!is_zero_ether_addr(ð_mask->dst) && - !is_broadcast_ether_addr(ð_mask->dst))) { + if (!rte_is_zero_ether_addr(ð_mask->src) || + (!rte_is_zero_ether_addr(ð_mask->dst) && + !rte_is_broadcast_ether_addr(ð_mask->dst))) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, @@ -2027,7 +2027,7 @@ i40e_flow_parse_ethertype_pattern(struct rte_eth_dev *dev, /* If mask bits of destination MAC address * are full of 1, set RTE_ETHTYPE_FLAGS_MAC. */ - if (is_broadcast_ether_addr(ð_mask->dst)) { + if (rte_is_broadcast_ether_addr(ð_mask->dst)) { filter->mac_addr = eth_spec->dst; filter->flags |= RTE_ETHTYPE_FLAGS_MAC; } else { @@ -2484,8 +2484,8 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev, eth_mask = item->mask; if (eth_spec && eth_mask) { - if (!is_zero_ether_addr(ð_mask->src) || - !is_zero_ether_addr(ð_mask->dst)) { + if (!rte_is_zero_ether_addr(ð_mask->src) || + !rte_is_zero_ether_addr(ð_mask->dst)) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, @@ -3325,8 +3325,8 @@ i40e_flow_parse_vxlan_pattern(__rte_unused struct rte_eth_dev *dev, /* DST address of inner MAC shouldn't be masked. * SRC address of Inner MAC should be masked. */ - if (!is_broadcast_ether_addr(ð_mask->dst) || - !is_zero_ether_addr(ð_mask->src) || + if (!rte_is_broadcast_ether_addr(ð_mask->dst) || + !rte_is_zero_ether_addr(ð_mask->src) || eth_mask->type) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, @@ -3555,8 +3555,8 @@ i40e_flow_parse_nvgre_pattern(__rte_unused struct rte_eth_dev *dev, /* DST address of inner MAC shouldn't be masked. * SRC address of Inner MAC should be masked. */ - if (!is_broadcast_ether_addr(ð_mask->dst) || - !is_zero_ether_addr(ð_mask->src) || + if (!rte_is_broadcast_ether_addr(ð_mask->dst) || + !rte_is_zero_ether_addr(ð_mask->src) || eth_mask->type) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, @@ -4810,9 +4810,9 @@ i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf, int ret = 0; memset(&cld_filter, 0, sizeof(cld_filter)); - ether_addr_copy((struct rte_ether_addr *)&filter->input.outer_mac, + rte_ether_addr_copy((struct rte_ether_addr *)&filter->input.outer_mac, (struct rte_ether_addr *)&cld_filter.element.outer_mac); - ether_addr_copy((struct rte_ether_addr *)&filter->input.inner_mac, + rte_ether_addr_copy((struct rte_ether_addr *)&filter->input.inner_mac, (struct rte_ether_addr *)&cld_filter.element.inner_mac); cld_filter.element.inner_vlan = filter->input.inner_vlan; cld_filter.element.flags = filter->input.flags; diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c index 4d7001d..b7636c7 100644 --- a/drivers/net/i40e/i40e_pf.c +++ b/drivers/net/i40e/i40e_pf.c @@ -348,7 +348,7 @@ i40e_pf_host_process_cmd_get_vf_resource(struct i40e_pf_vf *vf, uint8_t *msg, vf_res->vsi_res[0].vsi_type = VIRTCHNL_VSI_SRIOV; vf_res->vsi_res[0].vsi_id = vf->vsi->vsi_id; vf_res->vsi_res[0].num_queue_pairs = vf->vsi->nb_qps; - ether_addr_copy(&vf->mac_addr, + rte_ether_addr_copy(&vf->mac_addr, (struct rte_ether_addr *)vf_res->vsi_res[0].default_mac_addr); send_msg: @@ -845,7 +845,7 @@ i40e_pf_host_process_cmd_add_ether_address(struct i40e_pf_vf *vf, mac = (struct rte_ether_addr *)(addr_list->list[i].addr); rte_memcpy(&filter.mac_addr, mac, ETHER_ADDR_LEN); filter.filter_type = RTE_MACVLAN_PERFECT_MATCH; - if (is_zero_ether_addr(mac) || + if (rte_is_zero_ether_addr(mac) || i40e_vsi_add_mac(vf->vsi, &filter)) { ret = I40E_ERR_INVALID_MAC_ADDR; goto send_msg; @@ -887,7 +887,7 @@ i40e_pf_host_process_cmd_del_ether_address(struct i40e_pf_vf *vf, for (i = 0; i < addr_list->num_elements; i++) { mac = (struct rte_ether_addr *)(addr_list->list[i].addr); - if(is_zero_ether_addr(mac) || + if (rte_is_zero_ether_addr(mac) || i40e_vsi_delete_mac(vf->vsi, mac)) { ret = I40E_ERR_INVALID_MAC_ADDR; goto send_msg; diff --git a/drivers/net/i40e/rte_pmd_i40e.c b/drivers/net/i40e/rte_pmd_i40e.c index 8e56255..3d66b63 100644 --- a/drivers/net/i40e/rte_pmd_i40e.c +++ b/drivers/net/i40e/rte_pmd_i40e.c @@ -560,7 +560,7 @@ rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id, return -EINVAL; } - ether_addr_copy(mac_addr, &vf->mac_addr); + rte_ether_addr_copy(mac_addr, &vf->mac_addr); /* Remove all existing mac */ TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp) @@ -604,9 +604,9 @@ rte_pmd_i40e_remove_vf_mac_addr(uint16_t port, uint16_t vf_id, return -EINVAL; } - if (is_same_ether_addr(mac_addr, &vf->mac_addr)) + if (rte_is_same_ether_addr(mac_addr, &vf->mac_addr)) /* Reset the mac with NULL address */ - ether_addr_copy(&null_mac_addr, &vf->mac_addr); + rte_ether_addr_copy(&null_mac_addr, &vf->mac_addr); /* Remove the mac */ i40e_vsi_delete_mac(vsi, mac_addr); @@ -2387,7 +2387,7 @@ rte_pmd_i40e_add_vf_mac_addr(uint16_t port, uint16_t vf_id, } mac_filter.filter_type = RTE_MACVLAN_PERFECT_MATCH; - ether_addr_copy(mac_addr, &mac_filter.mac_addr); + rte_ether_addr_copy(mac_addr, &mac_filter.mac_addr); ret = i40e_vsi_add_mac(vsi, &mac_filter); if (ret != I40E_SUCCESS) { PMD_DRV_LOG(ERR, "Failed to add MAC filter."); @@ -2515,7 +2515,7 @@ rte_pmd_i40e_query_vfid_by_mac(uint16_t port, vf = &pf->vfs[vf_id]; mac = &vf->mac_addr; - if (is_same_ether_addr(mac, vf_mac)) + if (rte_is_same_ether_addr(mac, vf_mac)) return vf_id; } diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index c983550..f545bd9 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -706,7 +706,7 @@ iavf_dev_add_mac_addr(struct rte_eth_dev *dev, struct rte_ether_addr *addr, struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter); int err; - if (is_zero_ether_addr(addr)) { + if (rte_is_zero_ether_addr(addr)) { PMD_DRV_LOG(ERR, "Invalid Ethernet Address"); return -EINVAL; } @@ -951,11 +951,11 @@ iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev, old_addr = (struct rte_ether_addr *)hw->mac.addr; perm_addr = (struct rte_ether_addr *)hw->mac.perm_addr; - if (is_same_ether_addr(mac_addr, old_addr)) + if (rte_is_same_ether_addr(mac_addr, old_addr)) return 0; /* If the MAC address is configured by host, skip the setting */ - if (is_valid_assigned_ether_addr(perm_addr)) + if (rte_is_valid_assigned_ether_addr(perm_addr)) return -EPERM; ret = iavf_add_del_eth_addr(adapter, old_addr, FALSE); @@ -983,7 +983,7 @@ iavf_dev_set_default_mac_addr(struct rte_eth_dev *dev, if (ret) return -EIO; - ether_addr_copy(mac_addr, (struct rte_ether_addr *)hw->mac.addr); + rte_ether_addr_copy(mac_addr, (struct rte_ether_addr *)hw->mac.addr); return 0; } @@ -1317,10 +1317,10 @@ iavf_dev_init(struct rte_eth_dev *eth_dev) /* If the MAC address is not configured by host, * generate a random one. */ - if (!is_valid_assigned_ether_addr( + if (!rte_is_valid_assigned_ether_addr( (struct rte_ether_addr *)hw->mac.addr)) - eth_random_addr(hw->mac.addr); - ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, + rte_eth_random_addr(hw->mac.addr); + rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.addr, ð_dev->data->mac_addrs[0]); /* register callback func to eal lib */ diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index a705dbd..14395fe 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -647,7 +647,7 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add) len = sizeof(struct virtchnl_ether_addr_list); for (i = begin; i < IAVF_NUM_MACADDR_MAX; i++, next_begin++) { addr = &adapter->eth_dev->data->mac_addrs[i]; - if (is_zero_ether_addr(addr)) + if (rte_is_zero_ether_addr(addr)) continue; len += sizeof(struct virtchnl_ether_addr); if (len >= IAVF_AQ_BUF_SZ) { @@ -664,7 +664,7 @@ iavf_add_del_all_mac_addr(struct iavf_adapter *adapter, bool add) for (i = begin; i < next_begin; i++) { addr = &adapter->eth_dev->data->mac_addrs[i]; - if (is_zero_ether_addr(addr)) + if (rte_is_zero_ether_addr(addr)) continue; rte_memcpy(list->list[j].addr, addr->addr_bytes, sizeof(addr->addr_bytes)); diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index d09d172..40b2753 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -485,13 +485,14 @@ ice_init_mac_address(struct rte_eth_dev *dev) { struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private); - if (!is_unicast_ether_addr + if (!rte_is_unicast_ether_addr ((struct rte_ether_addr *)hw->port_info[0].mac.lan_addr)) { PMD_INIT_LOG(ERR, "Invalid MAC address"); return -EINVAL; } - ether_addr_copy((struct rte_ether_addr *)hw->port_info[0].mac.lan_addr, + rte_ether_addr_copy( + (struct rte_ether_addr *)hw->port_info[0].mac.lan_addr, (struct rte_ether_addr *)hw->port_info[0].mac.perm_addr); dev->data->mac_addrs = @@ -502,8 +503,9 @@ ice_init_mac_address(struct rte_eth_dev *dev) return -ENOMEM; } /* store it to dev data */ - ether_addr_copy((struct rte_ether_addr *)hw->port_info[0].mac.perm_addr, - &dev->data->mac_addrs[0]); + rte_ether_addr_copy( + (struct rte_ether_addr *)hw->port_info[0].mac.perm_addr, + &dev->data->mac_addrs[0]); return 0; } @@ -514,7 +516,7 @@ ice_find_mac_filter(struct ice_vsi *vsi, struct rte_ether_addr *macaddr) struct ice_mac_filter *f; TAILQ_FOREACH(f, &vsi->mac_list, next) { - if (is_same_ether_addr(macaddr, &f->mac_info.mac_addr)) + if (rte_is_same_ether_addr(macaddr, &f->mac_info.mac_addr)) return f; } @@ -2357,13 +2359,13 @@ static int ice_macaddr_set(struct rte_eth_dev *dev, uint8_t flags = 0; int ret; - if (!is_valid_assigned_ether_addr(mac_addr)) { + if (!rte_is_valid_assigned_ether_addr(mac_addr)) { PMD_DRV_LOG(ERR, "Tried to set invalid MAC address."); return -EINVAL; } TAILQ_FOREACH(f, &vsi->mac_list, next) { - if (is_same_ether_addr(&pf->dev_addr, &f->mac_info.mac_addr)) + if (rte_is_same_ether_addr(&pf->dev_addr, &f->mac_info.mac_addr)) break; } diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c index aee2aac..b18d183 100644 --- a/drivers/net/ipn3ke/ipn3ke_representor.c +++ b/drivers/net/ipn3ke/ipn3ke_representor.c @@ -124,9 +124,10 @@ ipn3ke_rpst_dev_start(struct rte_eth_dev *dev) snprintf(attr_name, IPN3KE_RAWDEV_ATTR_LEN_MAX, "%s", "LineSideBaseMAC"); rawdev->dev_ops->attr_get(rawdev, attr_name, &base_mac); - ether_addr_copy((struct rte_ether_addr *)&base_mac, &rpst->mac_addr); + rte_ether_addr_copy((struct rte_ether_addr *)&base_mac, + &rpst->mac_addr); - ether_addr_copy(&rpst->mac_addr, &dev->data->mac_addrs[0]); + rte_ether_addr_copy(&rpst->mac_addr, &dev->data->mac_addrs[0]); dev->data->mac_addrs->addr_bytes[ETHER_ADDR_LEN - 1] = (uint8_t)rpst->port_id + 1; @@ -656,13 +657,13 @@ ipn3ke_rpst_mac_addr_set(struct rte_eth_dev *ethdev, struct ipn3ke_rpst *rpst = IPN3KE_DEV_PRIVATE_TO_RPST(ethdev); uint32_t val; - if (!is_valid_assigned_ether_addr(mac_addr)) { + if (!rte_is_valid_assigned_ether_addr(mac_addr)) { IPN3KE_AFU_PMD_ERR("Tried to set invalid MAC address."); return -EINVAL; } if (hw->retimer.mac_type == IFPGA_RAWDEV_RETIMER_MAC_TYPE_10GE_XFI) { - ether_addr_copy(&mac_addr[0], &rpst->mac_addr); + rte_ether_addr_copy(&mac_addr[0], &rpst->mac_addr); /* Set mac address */ rte_memcpy(((char *)(&val)), &mac_addr[0], sizeof(uint32_t)); diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 3ae521a..f1bae7b 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -1223,7 +1223,7 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) return -ENOMEM; } /* Copy the permanent MAC address */ - ether_addr_copy((struct rte_ether_addr *)hw->mac.perm_addr, + rte_ether_addr_copy((struct rte_ether_addr *)hw->mac.perm_addr, ð_dev->data->mac_addrs[0]); /* Allocate memory for storing hash filter MAC addresses */ @@ -1661,7 +1661,7 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev) } /* Generate a random MAC address, if none was assigned by PF. */ - if (is_zero_ether_addr(perm_addr)) { + if (rte_is_zero_ether_addr(perm_addr)) { generate_random_mac_addr(perm_addr); diag = ixgbe_set_rar_vf(hw, 1, perm_addr->addr_bytes, 0, 1); if (diag) { @@ -1681,7 +1681,7 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev) } /* Copy the permanent MAC address */ - ether_addr_copy(perm_addr, ð_dev->data->mac_addrs[0]); + rte_ether_addr_copy(perm_addr, ð_dev->data->mac_addrs[0]); /* reset the hardware with the new settings */ diag = hw->mac.ops.start_hw(hw); @@ -6092,7 +6092,7 @@ ixgbevf_remove_mac_addr(struct rte_eth_dev *dev, uint32_t index) if (i == index) continue; /* Skip NULL MAC addresses */ - if (is_zero_ether_addr(mac_addr)) + if (rte_is_zero_ether_addr(mac_addr)) continue; /* Skip the permanent MAC address */ if (memcmp(perm_addr, mac_addr, diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c index f0fafeb..7024354 100644 --- a/drivers/net/ixgbe/ixgbe_flow.c +++ b/drivers/net/ixgbe/ixgbe_flow.c @@ -744,9 +744,9 @@ cons_parse_ethertype_filter(const struct rte_flow_attr *attr, * Mask bits of destination MAC address must be full * of 1 or full of 0. */ - if (!is_zero_ether_addr(ð_mask->src) || - (!is_zero_ether_addr(ð_mask->dst) && - !is_broadcast_ether_addr(ð_mask->dst))) { + if (!rte_is_zero_ether_addr(ð_mask->src) || + (!rte_is_zero_ether_addr(ð_mask->dst) && + !rte_is_broadcast_ether_addr(ð_mask->dst))) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, "Invalid ether address mask"); @@ -763,7 +763,7 @@ cons_parse_ethertype_filter(const struct rte_flow_attr *attr, /* If mask bits of destination MAC address * are full of 1, set RTE_ETHTYPE_FLAGS_MAC. */ - if (is_broadcast_ether_addr(ð_mask->dst)) { + if (rte_is_broadcast_ether_addr(ð_mask->dst)) { filter->mac_addr = eth_spec->dst; filter->flags |= RTE_ETHTYPE_FLAGS_MAC; } else { diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c index 6180c94..a2ae703 100644 --- a/drivers/net/ixgbe/ixgbe_pf.c +++ b/drivers/net/ixgbe/ixgbe_pf.c @@ -46,7 +46,7 @@ int ixgbe_vf_perm_addr_gen(struct rte_eth_dev *dev, uint16_t vf_num) uint16_t vfn; for (vfn = 0; vfn < vf_num; vfn++) { - eth_random_addr(vf_mac_addr); + rte_eth_random_addr(vf_mac_addr); /* keep the random address as default */ memcpy(vfinfo[vfn].vf_mac_addresses, vf_mac_addr, ETHER_ADDR_LEN); @@ -463,7 +463,8 @@ ixgbe_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf) int rar_entry = hw->mac.num_rar_entries - (vf + 1); uint8_t *new_mac = (uint8_t *)(&msgbuf[1]); - if (is_valid_assigned_ether_addr((struct rte_ether_addr *)new_mac)) { + if (rte_is_valid_assigned_ether_addr( + (struct rte_ether_addr *)new_mac)) { rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6); return hw->mac.ops.set_rar(hw, rar_entry, new_mac, vf, IXGBE_RAH_AV); } diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c index 3defba1..db21918 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c @@ -35,7 +35,8 @@ rte_pmd_ixgbe_set_vf_mac_addr(uint16_t port, uint16_t vf, vfinfo = *(IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private)); rar_entry = hw->mac.num_rar_entries - (vf + 1); - if (is_valid_assigned_ether_addr((struct rte_ether_addr *)new_mac)) { + if (rte_is_valid_assigned_ether_addr( + (struct rte_ether_addr *)new_mac)) { rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, ETHER_ADDR_LEN); return hw->mac.ops.set_rar(hw, rar_entry, new_mac, vf, diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c index 180cfd6..1cb1f06 100644 --- a/drivers/net/kni/rte_eth_kni.c +++ b/drivers/net/kni/rte_eth_kni.c @@ -363,7 +363,7 @@ eth_kni_create(struct rte_vdev_device *vdev, data->dev_link = pmd_link; data->mac_addrs = &internals->eth_addr; - eth_random_addr(internals->eth_addr.addr_bytes); + rte_eth_random_addr(internals->eth_addr.addr_bytes); eth_dev->dev_ops = ð_kni_ops; diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index de234e9..21ded9e 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -1835,7 +1835,7 @@ lio_dev_configure(struct rte_eth_dev *eth_dev) 2 + i)); /* Copy the permanent MAC address */ - ether_addr_copy((struct rte_ether_addr *)mac, + rte_ether_addr_copy((struct rte_ether_addr *)mac, ð_dev->data->mac_addrs[0]); /* enable firmware checksum support for tunnel packets */ diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c index 6995c14..6639037 100644 --- a/drivers/net/mlx4/mlx4_ethdev.c +++ b/drivers/net/mlx4/mlx4_ethdev.c @@ -522,7 +522,7 @@ mlx4_set_mc_addr_list(struct rte_eth_dev *dev, struct rte_ether_addr *list, for (i = RTE_DIM(priv->mac) - num; i != RTE_DIM(priv->mac) - priv->mac_mc; ++i) - if (!is_zero_ether_addr(&priv->mac[i])) { + if (!rte_is_zero_ether_addr(&priv->mac[i])) { rte_errno = EBUSY; return -rte_errno; } diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index 78bd452..244f193 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -1398,7 +1398,7 @@ next_vlan: mac = &priv->mac[i]; else mac = ð_mask.dst; - if (is_zero_ether_addr(mac)) + if (rte_is_zero_ether_addr(mac)) continue; /* Check if MAC flow rule is already present. */ for (flow = LIST_FIRST(&priv->flows); diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_tcf.c index 789748d..48d54e8 100644 --- a/drivers/net/mlx5/mlx5_flow_tcf.c +++ b/drivers/net/mlx5/mlx5_flow_tcf.c @@ -3334,7 +3334,7 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow, " parameter is ignored"); break; } - if (!is_zero_ether_addr(&mask.eth->dst)) { + if (!rte_is_zero_ether_addr(&mask.eth->dst)) { mnl_attr_put(nlh, TCA_FLOWER_KEY_ETH_DST, ETHER_ADDR_LEN, spec.eth->dst.addr_bytes); @@ -3342,7 +3342,7 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct mlx5_flow *dev_flow, ETHER_ADDR_LEN, mask.eth->dst.addr_bytes); } - if (!is_zero_ether_addr(&mask.eth->src)) { + if (!rte_is_zero_ether_addr(&mask.eth->src)) { mnl_attr_put(nlh, TCA_FLOWER_KEY_ETH_SRC, ETHER_ADDR_LEN, spec.eth->src.addr_bytes); diff --git a/drivers/net/mlx5/mlx5_mac.c b/drivers/net/mlx5/mlx5_mac.c index 9f6b89a..9204c5f 100644 --- a/drivers/net/mlx5/mlx5_mac.c +++ b/drivers/net/mlx5/mlx5_mac.c @@ -71,7 +71,7 @@ mlx5_internal_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) const int vf = priv->config.vf; assert(index < MLX5_MAX_MAC_ADDRESSES); - if (is_zero_ether_addr(&dev->data->mac_addrs[index])) + if (rte_is_zero_ether_addr(&dev->data->mac_addrs[index])) return; if (vf) mlx5_nl_mac_addr_remove(dev, &dev->data->mac_addrs[index], @@ -101,7 +101,7 @@ mlx5_internal_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac, unsigned int i; assert(index < MLX5_MAX_MAC_ADDRESSES); - if (is_zero_ether_addr(mac)) { + if (rte_is_zero_ether_addr(mac)) { rte_errno = EINVAL; return -rte_errno; } diff --git a/drivers/net/mlx5/mlx5_nl.c b/drivers/net/mlx5/mlx5_nl.c index ce4c937..50cd32a 100644 --- a/drivers/net/mlx5/mlx5_nl.c +++ b/drivers/net/mlx5/mlx5_nl.c @@ -340,7 +340,7 @@ mlx5_nl_mac_addr_cb(struct nlmsghdr *nh, void *arg) #ifndef NDEBUG char m[18]; - ether_format_addr(m, 18, RTA_DATA(attribute)); + rte_ether_format_addr(m, 18, RTA_DATA(attribute)); DRV_LOG(DEBUG, "bridge MAC address %s", m); #endif memcpy(&(*data->mac)[data->mac_n++], @@ -555,14 +555,14 @@ mlx5_nl_mac_addr_sync(struct rte_eth_dev *dev) /* Verify the address is not in the array yet. */ for (j = 0; j != MLX5_MAX_MAC_ADDRESSES; ++j) - if (is_same_ether_addr(&macs[i], + if (rte_is_same_ether_addr(&macs[i], &dev->data->mac_addrs[j])) break; if (j != MLX5_MAX_MAC_ADDRESSES) continue; /* Find the first entry available. */ for (j = 0; j != MLX5_MAX_MAC_ADDRESSES; ++j) { - if (is_zero_ether_addr(&dev->data->mac_addrs[j])) { + if (rte_is_zero_ether_addr(&dev->data->mac_addrs[j])) { dev->data->mac_addrs[j] = macs[i]; break; } diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c index d539ba6..9ec71c3 100644 --- a/drivers/net/mvneta/mvneta_ethdev.c +++ b/drivers/net/mvneta/mvneta_ethdev.c @@ -595,7 +595,7 @@ mvneta_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) ret = neta_ppio_remove_mac_addr(priv->ppio, dev->data->mac_addrs[index].addr_bytes); if (ret) { - ether_format_addr(buf, sizeof(buf), + rte_ether_format_addr(buf, sizeof(buf), &dev->data->mac_addrs[index]); MVNETA_LOG(ERR, "Failed to remove mac %s", buf); } @@ -633,7 +633,7 @@ mvneta_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, ret = neta_ppio_add_mac_addr(priv->ppio, mac_addr->addr_bytes); if (ret) { - ether_format_addr(buf, sizeof(buf), mac_addr); + rte_ether_format_addr(buf, sizeof(buf), mac_addr); MVNETA_LOG(ERR, "Failed to add mac %s", buf); return -1; } @@ -661,7 +661,7 @@ mvneta_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) ret = neta_ppio_set_mac_addr(priv->ppio, mac_addr->addr_bytes); if (ret) { char buf[ETHER_ADDR_FMT_SIZE]; - ether_format_addr(buf, sizeof(buf), mac_addr); + rte_ether_format_addr(buf, sizeof(buf), mac_addr); MVNETA_LOG(ERR, "Failed to set mac to %s", buf); } return 0; diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index 8647c9b..4c6edb4 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -1080,7 +1080,7 @@ mrvl_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) ret = pp2_ppio_remove_mac_addr(priv->ppio, dev->data->mac_addrs[index].addr_bytes); if (ret) { - ether_format_addr(buf, sizeof(buf), + rte_ether_format_addr(buf, sizeof(buf), &dev->data->mac_addrs[index]); MRVL_LOG(ERR, "Failed to remove mac %s", buf); } @@ -1134,7 +1134,7 @@ mrvl_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, */ ret = pp2_ppio_add_mac_addr(priv->ppio, mac_addr->addr_bytes); if (ret) { - ether_format_addr(buf, sizeof(buf), mac_addr); + rte_ether_format_addr(buf, sizeof(buf), mac_addr); MRVL_LOG(ERR, "Failed to add mac %s", buf); return -1; } @@ -1168,7 +1168,7 @@ mrvl_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) ret = pp2_ppio_set_mac_addr(priv->ppio, mac_addr->addr_bytes); if (ret) { char buf[ETHER_ADDR_FMT_SIZE]; - ether_format_addr(buf, sizeof(buf), mac_addr); + rte_ether_format_addr(buf, sizeof(buf), mac_addr); MRVL_LOG(ERR, "Failed to set mac to %s", buf); } diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index a5850c2..6192420 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -128,8 +128,8 @@ hn_update_packet_stats(struct hn_stats *stats, const struct rte_mbuf *m) } ea = rte_pktmbuf_mtod(m, const struct rte_ether_addr *); - if (is_multicast_ether_addr(ea)) { - if (is_broadcast_ether_addr(ea)) + if (rte_is_multicast_ether_addr(ea)) { + if (rte_is_broadcast_ether_addr(ea)) stats->broadcast++; else stats->multicast++; diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c index f1be7e2..27ac87e 100644 --- a/drivers/net/netvsc/hn_vf.c +++ b/drivers/net/netvsc/hn_vf.c @@ -42,7 +42,7 @@ static int hn_vf_match(const struct rte_eth_dev *dev) if (vf_dev == dev) continue; - if (is_same_ether_addr(mac, vf_mac)) + if (rte_is_same_ether_addr(mac, vf_mac)) return i; } return -ENOENT; diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c index 679af6e..ffdc2bf 100644 --- a/drivers/net/nfb/nfb_ethdev.c +++ b/drivers/net/nfb/nfb_ethdev.c @@ -360,7 +360,7 @@ nfb_eth_mac_addr_set(struct rte_eth_dev *dev, struct pmd_internals *internals = (struct pmd_internals *) data->dev_private; - if (!is_valid_assigned_ether_addr(mac_addr)) + if (!rte_is_valid_assigned_ether_addr(mac_addr)) return -EINVAL; for (i = 0; i < ETHER_ADDR_LEN; i++) { @@ -371,7 +371,7 @@ nfb_eth_mac_addr_set(struct rte_eth_dev *dev, for (i = 0; i < internals->max_rxmac; ++i) nc_rxmac_set_mac(internals->rxmac[i], 0, mac, 1); - ether_addr_copy(mac_addr, data->mac_addrs); + rte_ether_addr_copy(mac_addr, data->mac_addrs); return 0; } @@ -472,7 +472,7 @@ nfb_eth_dev_init(struct rte_eth_dev *dev) return -EINVAL; } - eth_random_addr(eth_addr_init.addr_bytes); + rte_eth_random_addr(eth_addr_init.addr_bytes); eth_addr_init.addr_bytes[0] = eth_addr.addr_bytes[0]; eth_addr_init.addr_bytes[1] = eth_addr.addr_bytes[1]; eth_addr_init.addr_bytes[2] = eth_addr.addr_bytes[2]; diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 95c2be1..853b780 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -2962,17 +2962,17 @@ nfp_net_init(struct rte_eth_dev *eth_dev) nfp_net_vf_read_mac(hw); } - if (!is_valid_assigned_ether_addr( + if (!rte_is_valid_assigned_ether_addr( (struct rte_ether_addr *)&hw->mac_addr)) { PMD_INIT_LOG(INFO, "Using random mac address for port %d", port); /* Using random mac addresses for VFs */ - eth_random_addr(&hw->mac_addr[0]); + rte_eth_random_addr(&hw->mac_addr[0]); nfp_net_write_mac(hw, (uint8_t *)&hw->mac_addr); } /* Copying mac address to DPDK eth_dev struct */ - ether_addr_copy((struct rte_ether_addr *)hw->mac_addr, + rte_ether_addr_copy((struct rte_ether_addr *)hw->mac_addr, ð_dev->data->mac_addrs[0]); if (!(hw->cap & NFP_NET_CFG_CTRL_LIVE_ADDR)) diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index 7683511..d1d49b5 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -535,7 +535,7 @@ eth_dev_null_create(struct rte_vdev_device *dev, internals->packet_size = packet_size; internals->packet_copy = packet_copy; internals->port_id = eth_dev->data->port_id; - eth_random_addr(internals->eth_addr.addr_bytes); + rte_eth_random_addr(internals->eth_addr.addr_bytes); internals->flow_type_rss_offloads = ETH_RSS_PROTO_MASK; internals->reta_size = RTE_DIM(internals->reta_conf) * RTE_RETA_GROUP_SIZE; diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c index a72d466..c7fadf2 100644 --- a/drivers/net/qede/qede_ethdev.c +++ b/drivers/net/qede/qede_ethdev.c @@ -580,7 +580,7 @@ qede_ucast_filter(struct rte_eth_dev *eth_dev, struct ecore_filter_ucast *ucast, DP_ERR(edev, "Did not allocate memory for ucast\n"); return -ENOMEM; } - ether_addr_copy(mac_addr, &u->mac); + rte_ether_addr_copy(mac_addr, &u->mac); u->vlan = ucast->vlan; u->vni = ucast->vni; SLIST_INSERT_HEAD(&qdev->uc_list_head, u, list); @@ -623,14 +623,14 @@ qede_add_mcast_filters(struct rte_eth_dev *eth_dev, DP_ERR(edev, "Did not allocate memory for mcast\n"); return -ENOMEM; } - ether_addr_copy(&mc_addrs[i], &m->mac); + rte_ether_addr_copy(&mc_addrs[i], &m->mac); SLIST_INSERT_HEAD(&qdev->mc_list_head, m, list); } memset(&mcast, 0, sizeof(mcast)); mcast.num_mc_addrs = mc_addrs_num; mcast.opcode = ECORE_FILTER_ADD; for (i = 0; i < mc_addrs_num; i++) - ether_addr_copy(&mc_addrs[i], (struct rte_ether_addr *) + rte_ether_addr_copy(&mc_addrs[i], (struct rte_ether_addr *) &mcast.mac[i]); rc = ecore_filter_mcast_cmd(edev, &mcast, ECORE_SPQ_MODE_CB, NULL); if (rc != ECORE_SUCCESS) { @@ -655,7 +655,7 @@ static int qede_del_mcast_filters(struct rte_eth_dev *eth_dev) mcast.opcode = ECORE_FILTER_REMOVE; j = 0; SLIST_FOREACH(tmp, &qdev->mc_list_head, list) { - ether_addr_copy(&tmp->mac, + rte_ether_addr_copy(&tmp->mac, (struct rte_ether_addr *)&mcast.mac[j]); j++; } @@ -709,13 +709,13 @@ qede_mac_addr_add(struct rte_eth_dev *eth_dev, struct rte_ether_addr *mac_addr, struct ecore_filter_ucast ucast; int re; - if (!is_valid_assigned_ether_addr(mac_addr)) + if (!rte_is_valid_assigned_ether_addr(mac_addr)) return -EINVAL; qede_set_ucast_cmn_params(&ucast); ucast.opcode = ECORE_FILTER_ADD; ucast.type = ECORE_FILTER_MAC; - ether_addr_copy(mac_addr, (struct rte_ether_addr *)&ucast.mac); + rte_ether_addr_copy(mac_addr, (struct rte_ether_addr *)&ucast.mac); re = (int)qede_mac_int_ops(eth_dev, &ucast, 1); return re; } @@ -735,7 +735,7 @@ qede_mac_addr_remove(struct rte_eth_dev *eth_dev, uint32_t index) return; } - if (!is_valid_assigned_ether_addr(ð_dev->data->mac_addrs[index])) + if (!rte_is_valid_assigned_ether_addr(ð_dev->data->mac_addrs[index])) return; qede_set_ucast_cmn_params(&ucast); @@ -743,7 +743,7 @@ qede_mac_addr_remove(struct rte_eth_dev *eth_dev, uint32_t index) ucast.type = ECORE_FILTER_MAC; /* Use the index maintained by rte */ - ether_addr_copy(ð_dev->data->mac_addrs[index], + rte_ether_addr_copy(ð_dev->data->mac_addrs[index], (struct rte_ether_addr *)&ucast.mac); qede_mac_int_ops(eth_dev, &ucast, false); @@ -1774,7 +1774,7 @@ qede_set_mc_addr_list(struct rte_eth_dev *eth_dev, } for (i = 0; i < mc_addrs_num; i++) { - if (!is_multicast_ether_addr(&mc_addrs[i])) { + if (!rte_is_multicast_ether_addr(&mc_addrs[i])) { DP_ERR(edev, "Not a valid multicast MAC\n"); return -EINVAL; } @@ -2552,10 +2552,10 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf) } if (!is_vf) { - ether_addr_copy((struct rte_ether_addr *)edev->hwfns[0]. + rte_ether_addr_copy((struct rte_ether_addr *)edev->hwfns[0]. hw_info.hw_mac_addr, ð_dev->data->mac_addrs[0]); - ether_addr_copy(ð_dev->data->mac_addrs[0], + rte_ether_addr_copy(ð_dev->data->mac_addrs[0], &adapter->primary_mac); } else { ecore_vf_read_bulletin(ECORE_LEADING_HWFN(edev), @@ -2568,11 +2568,12 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf) &is_mac_forced); if (is_mac_exist) { DP_INFO(edev, "VF macaddr received from PF\n"); - ether_addr_copy( + rte_ether_addr_copy( (struct rte_ether_addr *)&vf_mac, ð_dev->data->mac_addrs[0]); - ether_addr_copy(ð_dev->data->mac_addrs[0], - &adapter->primary_mac); + rte_ether_addr_copy( + ð_dev->data->mac_addrs[0], + &adapter->primary_mac); } else { DP_ERR(edev, "No VF macaddr assigned\n"); } diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index fadcdb5..dd9897d 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -983,7 +983,7 @@ sfc_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) * Copy the address to the device private data so that * it could be recalled in the case of adapter restart. */ - ether_addr_copy(mac_addr, &port->default_mac_addr); + rte_ether_addr_copy(mac_addr, &port->default_mac_addr); /* * Neither of the two following checks can return @@ -1043,7 +1043,7 @@ sfc_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) unlock: if (rc != 0) - ether_addr_copy(old_addr, &port->default_mac_addr); + rte_ether_addr_copy(old_addr, &port->default_mac_addr); sfc_adapter_unlock(sa); @@ -2126,7 +2126,7 @@ sfc_eth_dev_init(struct rte_eth_dev *dev) * Linux kernel. Copy from NIC config to Ethernet device data. */ from = (const struct rte_ether_addr *)(encp->enc_mac_addr); - ether_addr_copy(from, &dev->data->mac_addrs[0]); + rte_ether_addr_copy(from, &dev->data->mac_addrs[0]); sfc_adapter_unlock(sa); diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c index 944296d..e1d981b 100644 --- a/drivers/net/sfc/sfc_flow.c +++ b/drivers/net/sfc/sfc_flow.c @@ -277,7 +277,7 @@ sfc_flow_parse_eth(const struct rte_flow_item *item, if (spec == NULL) return 0; - if (is_same_ether_addr(&mask->dst, &supp_mask.dst)) { + if (rte_is_same_ether_addr(&mask->dst, &supp_mask.dst)) { efx_spec->efs_match_flags |= is_ifrm ? EFX_FILTER_MATCH_IFRM_LOC_MAC : EFX_FILTER_MATCH_LOC_MAC; @@ -285,7 +285,7 @@ sfc_flow_parse_eth(const struct rte_flow_item *item, EFX_MAC_ADDR_LEN); } else if (memcmp(mask->dst.addr_bytes, ig_mask, EFX_MAC_ADDR_LEN) == 0) { - if (is_unicast_ether_addr(&spec->dst)) + if (rte_is_unicast_ether_addr(&spec->dst)) efx_spec->efs_match_flags |= is_ifrm ? EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST : EFX_FILTER_MATCH_UNKNOWN_UCAST_DST; @@ -293,7 +293,7 @@ sfc_flow_parse_eth(const struct rte_flow_item *item, efx_spec->efs_match_flags |= is_ifrm ? EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST : EFX_FILTER_MATCH_UNKNOWN_MCAST_DST; - } else if (!is_zero_ether_addr(&mask->dst)) { + } else if (!rte_is_zero_ether_addr(&mask->dst)) { goto fail_bad_mask; } @@ -302,11 +302,11 @@ sfc_flow_parse_eth(const struct rte_flow_item *item, * ethertype masks are equal to zero in inner frame, * so these fields are filled in only for the outer frame */ - if (is_same_ether_addr(&mask->src, &supp_mask.src)) { + if (rte_is_same_ether_addr(&mask->src, &supp_mask.src)) { efx_spec->efs_match_flags |= EFX_FILTER_MATCH_REM_MAC; rte_memcpy(efx_spec->efs_rem_mac, spec->src.addr_bytes, EFX_MAC_ADDR_LEN); - } else if (!is_zero_ether_addr(&mask->src)) { + } else if (!rte_is_zero_ether_addr(&mask->src)) { goto fail_bad_mask; } diff --git a/drivers/net/sfc/sfc_port.c b/drivers/net/sfc/sfc_port.c index 8de5f0c..23313e1 100644 --- a/drivers/net/sfc/sfc_port.c +++ b/drivers/net/sfc/sfc_port.c @@ -402,7 +402,7 @@ sfc_port_attach(struct sfc_adapter *sa) RTE_BUILD_BUG_ON(sizeof(encp->enc_mac_addr) != sizeof(*from)); from = (const struct rte_ether_addr *)(encp->enc_mac_addr); - ether_addr_copy(from, &port->default_mac_addr); + rte_ether_addr_copy(from, &port->default_mac_addr); port->max_mcast_addrs = EFX_MAC_MULTICAST_LIST_MAX; port->nb_mcast_addrs = 0; diff --git a/drivers/net/softnic/rte_eth_softnic_flow.c b/drivers/net/softnic/rte_eth_softnic_flow.c index ccd58c0..f05ff09 100644 --- a/drivers/net/softnic/rte_eth_softnic_flow.c +++ b/drivers/net/softnic/rte_eth_softnic_flow.c @@ -1681,9 +1681,9 @@ flow_rule_action_get(struct pmd_internals *softnic, item, "VXLAN ENCAP: first encap item should be ether"); } - ether_addr_copy(&spec.eth.dst, + rte_ether_addr_copy(&spec.eth.dst, &rule_action->encap.vxlan.ether.da); - ether_addr_copy(&spec.eth.src, + rte_ether_addr_copy(&spec.eth.src, &rule_action->encap.vxlan.ether.sa); item++; diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c index 43a6643..99de9f4 100644 --- a/drivers/net/szedata2/rte_eth_szedata2.c +++ b/drivers/net/szedata2/rte_eth_szedata2.c @@ -1522,7 +1522,7 @@ rte_szedata2_eth_dev_init(struct rte_eth_dev *dev, struct port_info *pi) return -ENOMEM; } - ether_addr_copy(ð_addr, data->mac_addrs); + rte_ether_addr_copy(ð_addr, data->mac_addrs); PMD_INIT_LOG(INFO, "%s device %s successfully initialized", RTE_STR(RTE_SZEDATA2_DRIVER_NAME), data->name); diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 71be763..949b72d 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -1163,7 +1163,7 @@ tap_mac_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) return -ENOTSUP; } - if (is_zero_ether_addr(mac_addr)) { + if (rte_is_zero_ether_addr(mac_addr)) { TAP_LOG(ERR, "%s: can't set an empty MAC address", dev->device->name); return -EINVAL; @@ -1172,14 +1172,15 @@ tap_mac_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) ret = tap_ioctl(pmd, SIOCGIFHWADDR, &ifr, 0, LOCAL_ONLY); if (ret < 0) return ret; - if (is_same_ether_addr((struct rte_ether_addr *)&ifr.ifr_hwaddr.sa_data, - mac_addr)) + if (rte_is_same_ether_addr( + (struct rte_ether_addr *)&ifr.ifr_hwaddr.sa_data, + mac_addr)) return 0; /* Check the current MAC address on the remote */ ret = tap_ioctl(pmd, SIOCGIFHWADDR, &ifr, 0, REMOTE_ONLY); if (ret < 0) return ret; - if (!is_same_ether_addr( + if (!rte_is_same_ether_addr( (struct rte_ether_addr *)&ifr.ifr_hwaddr.sa_data, mac_addr)) mode = LOCAL_AND_REMOTE; @@ -1754,8 +1755,8 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name, } if (pmd->type == ETH_TUNTAP_TYPE_TAP) { - if (is_zero_ether_addr(mac_addr)) - eth_random_addr((uint8_t *)&pmd->eth_addr); + if (rte_is_zero_ether_addr(mac_addr)) + rte_eth_random_addr((uint8_t *)&pmd->eth_addr); else rte_memcpy(&pmd->eth_addr, mac_addr, sizeof(*mac_addr)); } diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c index d155618..2096309 100644 --- a/drivers/net/tap/tap_flow.c +++ b/drivers/net/tap/tap_flow.c @@ -537,14 +537,14 @@ tap_flow_create_eth(const struct rte_flow_item *item, void *data) if (!flow) return 0; msg = &flow->msg; - if (!is_zero_ether_addr(&mask->dst)) { + if (!rte_is_zero_ether_addr(&mask->dst)) { tap_nlattr_add(&msg->nh, TCA_FLOWER_KEY_ETH_DST, ETHER_ADDR_LEN, &spec->dst.addr_bytes); tap_nlattr_add(&msg->nh, TCA_FLOWER_KEY_ETH_DST_MASK, ETHER_ADDR_LEN, &mask->dst.addr_bytes); } - if (!is_zero_ether_addr(&mask->src)) { + if (!rte_is_zero_ether_addr(&mask->src)) { tap_nlattr_add(&msg->nh, TCA_FLOWER_KEY_ETH_SRC, ETHER_ADDR_LEN, &spec->src.addr_bytes); tap_nlattr_add(&msg->nh, diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index ec20879..482968b 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -2179,10 +2179,10 @@ nicvf_eth_dev_init(struct rte_eth_dev *eth_dev) ret = -ENOMEM; goto alarm_fail; } - if (is_zero_ether_addr((struct rte_ether_addr *)nic->mac_addr)) - eth_random_addr(&nic->mac_addr[0]); + if (rte_is_zero_ether_addr((struct rte_ether_addr *)nic->mac_addr)) + rte_eth_random_addr(&nic->mac_addr[0]); - ether_addr_copy((struct rte_ether_addr *)nic->mac_addr, + rte_ether_addr_copy((struct rte_ether_addr *)nic->mac_addr, ð_dev->data->mac_addrs[0]); ret = nicvf_mbox_set_mac_addr(nic, nic->mac_addr); diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c index ef02fdc..ad13eac 100644 --- a/drivers/net/vdev_netvsc/vdev_netvsc.c +++ b/drivers/net/vdev_netvsc/vdev_netvsc.c @@ -387,7 +387,7 @@ vdev_netvsc_device_probe(const struct if_nameindex *iface, strlcpy(ctx->if_name, iface->if_name, sizeof(ctx->if_name)); return 0; } - if (!is_same_ether_addr(eth_addr, &ctx->if_addr)) + if (!rte_is_same_ether_addr(eth_addr, &ctx->if_addr)) return 0; /* Look for associated PCI device. */ ret = vdev_netvsc_sysfs_readlink(buf, sizeof(buf), iface->if_name, @@ -544,7 +544,7 @@ vdev_netvsc_netvsc_probe(const struct if_nameindex *iface, pair->value); return -EINVAL; } - if (is_same_ether_addr(eth_addr, &tmp)) + if (rte_is_same_ether_addr(eth_addr, &tmp)) break; } } diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index 6705e90..774774b 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -329,8 +329,8 @@ vhost_count_multicast_broadcast(struct vhost_queue *vq, struct vhost_stats *pstats = &vq->stats; ea = rte_pktmbuf_mtod(mbuf, struct rte_ether_addr *); - if (is_multicast_ether_addr(ea)) { - if (is_broadcast_ether_addr(ea)) + if (rte_is_multicast_ether_addr(ea)) { + if (rte_is_broadcast_ether_addr(ea)) pstats->xstats[VHOST_BROADCAST_PKT]++; else pstats->xstats[VHOST_MULTICAST_PKT]++; diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 9b99bf3..2762dcf 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1108,7 +1108,7 @@ virtio_get_hwaddr(struct virtio_hw *hw) offsetof(struct virtio_net_config, mac), &hw->mac_addr, ETHER_ADDR_LEN); } else { - eth_random_addr(&hw->mac_addr[0]); + rte_eth_random_addr(&hw->mac_addr[0]); virtio_set_hwaddr(hw); } } @@ -1164,7 +1164,7 @@ virtio_mac_addr_add(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr, const struct rte_ether_addr *addr = (i == index) ? mac_addr : addrs + i; struct virtio_net_ctrl_mac *tbl - = is_multicast_ether_addr(addr) ? mc : uc; + = rte_is_multicast_ether_addr(addr) ? mc : uc; memcpy(&tbl->macs[tbl->entries++], addr, ETHER_ADDR_LEN); } @@ -1193,10 +1193,10 @@ virtio_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index) for (i = 0; i < VIRTIO_MAX_MAC_ADDRS; i++) { struct virtio_net_ctrl_mac *tbl; - if (i == index || is_zero_ether_addr(addrs + i)) + if (i == index || rte_is_zero_ether_addr(addrs + i)) continue; - tbl = is_multicast_ether_addr(addrs + i) ? mc : uc; + tbl = rte_is_multicast_ether_addr(addrs + i) ? mc : uc; memcpy(&tbl->macs[tbl->entries++], addrs + i, ETHER_ADDR_LEN); } @@ -1662,7 +1662,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features) /* Copy the permanent MAC address to: virtio_hw */ virtio_get_hwaddr(hw); - ether_addr_copy((struct rte_ether_addr *)hw->mac_addr, + rte_ether_addr_copy((struct rte_ether_addr *)hw->mac_addr, ð_dev->data->mac_addrs[0]); PMD_INIT_LOG(DEBUG, "PORT MAC: %02X:%02X:%02X:%02X:%02X:%02X", diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c index fa9c855..3de4677 100644 --- a/drivers/net/virtio/virtio_rxtx.c +++ b/drivers/net/virtio/virtio_rxtx.c @@ -1114,8 +1114,8 @@ virtio_update_packet_stats(struct virtnet_stats *stats, struct rte_mbuf *mbuf) } ea = rte_pktmbuf_mtod(mbuf, struct rte_ether_addr *); - if (is_multicast_ether_addr(ea)) { - if (is_broadcast_ether_addr(ea)) + if (rte_is_multicast_ether_addr(ea)) { + if (rte_is_broadcast_ether_addr(ea)) stats->broadcast++; else stats->multicast++; diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index 3ad1e9e..f718b8b 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -316,7 +316,7 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev) return -ENOMEM; } /* Copy the permanent MAC address */ - ether_addr_copy((struct rte_ether_addr *)hw->perm_addr, + rte_ether_addr_copy((struct rte_ether_addr *)hw->perm_addr, ð_dev->data->mac_addrs[0]); PMD_INIT_LOG(DEBUG, "MAC Address : %02x:%02x:%02x:%02x:%02x:%02x", @@ -1209,7 +1209,7 @@ vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct rte_ether_addr *mac_addr) { struct vmxnet3_hw *hw = dev->data->dev_private; - ether_addr_copy(mac_addr, (struct rte_ether_addr *)(hw->perm_addr)); + rte_ether_addr_copy(mac_addr, (struct rte_ether_addr *)(hw->perm_addr)); vmxnet3_write_mac(hw, mac_addr->addr_bytes); return 0; } |