net/vmxnet3: fix MAC address set
Updated vmxnet3_mac_addr_set() to store the newly set MAC address.
Modified vmxnet3_write_mac() so the h/w is updated in an endian
neutral manner.
Fixes: 139f39a978
("vmxnet3: support setting MAC address")
Cc: stable@dpdk.org
Signed-off-by: David Harton <dharton@cisco.com>
Acked-by: Shrikrishna Khare <skhare@vmware.com>
This commit is contained in:
parent
c740ba20c8
commit
66db172f26
@ -537,10 +537,10 @@ vmxnet3_write_mac(struct vmxnet3_hw *hw, const uint8_t *addr)
|
||||
addr[0], addr[1], addr[2],
|
||||
addr[3], addr[4], addr[5]);
|
||||
|
||||
val = *(const uint32_t *)addr;
|
||||
memcpy(&val, addr, 4);
|
||||
VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_MACL, val);
|
||||
|
||||
val = (addr[5] << 8) | addr[4];
|
||||
memcpy(&val, addr + 4, 2);
|
||||
VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_MACH, val);
|
||||
}
|
||||
|
||||
@ -1144,6 +1144,8 @@ vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
|
||||
{
|
||||
struct vmxnet3_hw *hw = dev->data->dev_private;
|
||||
|
||||
ether_addr_copy(mac_addr, (struct ether_addr *)(hw->perm_addr));
|
||||
ether_addr_copy(mac_addr, &dev->data->mac_addrs[0]);
|
||||
vmxnet3_write_mac(hw, mac_addr->addr_bytes);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user