diff options
author | Edward Cree <ecree@solarflare.com> | 2014-03-07 13:27:41 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-03-10 13:53:37 -0400 |
commit | cd84ff4da1f46cbdc2d73366eabe9a8f818447cd (patch) | |
tree | 760779885f2e4d9b9fa319fa35e3d6209908968c /drivers/net/ethernet/sfc/siena_sriov.c | |
parent | 19433646fec836f6804fd5409f8a89a5869d1c7d (diff) |
sfc: Use ether_addr_copy and eth_broadcast_addr
Faster than memcpy/memset on some architectures.
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/siena_sriov.c')
-rw-r--r-- | drivers/net/ethernet/sfc/siena_sriov.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/net/ethernet/sfc/siena_sriov.c b/drivers/net/ethernet/sfc/siena_sriov.c index 0c38f926871e..9a9205e77896 100644 --- a/drivers/net/ethernet/sfc/siena_sriov.c +++ b/drivers/net/ethernet/sfc/siena_sriov.c | |||
@@ -1095,7 +1095,7 @@ static void efx_sriov_peer_work(struct work_struct *data) | |||
1095 | 1095 | ||
1096 | /* Fill the remaining addresses */ | 1096 | /* Fill the remaining addresses */ |
1097 | list_for_each_entry(local_addr, &efx->local_addr_list, link) { | 1097 | list_for_each_entry(local_addr, &efx->local_addr_list, link) { |
1098 | memcpy(peer->mac_addr, local_addr->addr, ETH_ALEN); | 1098 | ether_addr_copy(peer->mac_addr, local_addr->addr); |
1099 | peer->tci = 0; | 1099 | peer->tci = 0; |
1100 | ++peer; | 1100 | ++peer; |
1101 | ++peer_count; | 1101 | ++peer_count; |
@@ -1303,8 +1303,7 @@ int efx_sriov_init(struct efx_nic *efx) | |||
1303 | goto fail_vfs; | 1303 | goto fail_vfs; |
1304 | 1304 | ||
1305 | rtnl_lock(); | 1305 | rtnl_lock(); |
1306 | memcpy(vfdi_status->peers[0].mac_addr, | 1306 | ether_addr_copy(vfdi_status->peers[0].mac_addr, net_dev->dev_addr); |
1307 | net_dev->dev_addr, ETH_ALEN); | ||
1308 | efx->vf_init_count = efx->vf_count; | 1307 | efx->vf_init_count = efx->vf_count; |
1309 | rtnl_unlock(); | 1308 | rtnl_unlock(); |
1310 | 1309 | ||
@@ -1452,8 +1451,8 @@ void efx_sriov_mac_address_changed(struct efx_nic *efx) | |||
1452 | 1451 | ||
1453 | if (!efx->vf_init_count) | 1452 | if (!efx->vf_init_count) |
1454 | return; | 1453 | return; |
1455 | memcpy(vfdi_status->peers[0].mac_addr, | 1454 | ether_addr_copy(vfdi_status->peers[0].mac_addr, |
1456 | efx->net_dev->dev_addr, ETH_ALEN); | 1455 | efx->net_dev->dev_addr); |
1457 | queue_work(vfdi_workqueue, &efx->peer_work); | 1456 | queue_work(vfdi_workqueue, &efx->peer_work); |
1458 | } | 1457 | } |
1459 | 1458 | ||
@@ -1570,7 +1569,7 @@ int efx_sriov_set_vf_mac(struct net_device *net_dev, int vf_i, u8 *mac) | |||
1570 | vf = efx->vf + vf_i; | 1569 | vf = efx->vf + vf_i; |
1571 | 1570 | ||
1572 | mutex_lock(&vf->status_lock); | 1571 | mutex_lock(&vf->status_lock); |
1573 | memcpy(vf->addr.mac_addr, mac, ETH_ALEN); | 1572 | ether_addr_copy(vf->addr.mac_addr, mac); |
1574 | __efx_sriov_update_vf_addr(vf); | 1573 | __efx_sriov_update_vf_addr(vf); |
1575 | mutex_unlock(&vf->status_lock); | 1574 | mutex_unlock(&vf->status_lock); |
1576 | 1575 | ||
@@ -1633,7 +1632,7 @@ int efx_sriov_get_vf_config(struct net_device *net_dev, int vf_i, | |||
1633 | vf = efx->vf + vf_i; | 1632 | vf = efx->vf + vf_i; |
1634 | 1633 | ||
1635 | ivi->vf = vf_i; | 1634 | ivi->vf = vf_i; |
1636 | memcpy(ivi->mac, vf->addr.mac_addr, ETH_ALEN); | 1635 | ether_addr_copy(ivi->mac, vf->addr.mac_addr); |
1637 | ivi->tx_rate = 0; | 1636 | ivi->tx_rate = 0; |
1638 | tci = ntohs(vf->addr.tci); | 1637 | tci = ntohs(vf->addr.tci); |
1639 | ivi->vlan = tci & VLAN_VID_MASK; | 1638 | ivi->vlan = tci & VLAN_VID_MASK; |