All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vmxnet3: mac address set fixes
@ 2017-08-25 18:54 David Harton
  2017-09-10 17:40 ` Shrikrishna Khare
  0 siblings, 1 reply; 3+ messages in thread
From: David Harton @ 2017-08-25 18:54 UTC (permalink / raw)
  To: skhare; +Cc: dev, David Harton

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.

Signed-off-by: David Harton <dharton@cisco.com>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 06735dd..6525bb2 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -537,10 +537,10 @@ static int eth_vmxnet3_pci_remove(struct rte_pci_device *pci_dev)
 		     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);
 }
 
@@ -1146,6 +1146,8 @@ static int eth_vmxnet3_pci_remove(struct rte_pci_device *pci_dev)
 {
 	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);
 }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] vmxnet3: mac address set fixes
  2017-08-25 18:54 [PATCH] vmxnet3: mac address set fixes David Harton
@ 2017-09-10 17:40 ` Shrikrishna Khare
  2017-09-11 13:29   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Shrikrishna Khare @ 2017-09-10 17:40 UTC (permalink / raw)
  To: David Harton; +Cc: skhare, dev



On Fri, 25 Aug 2017, David Harton wrote:

> 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.
> 
> Signed-off-by: David Harton <dharton@cisco.com>

Acked-by: Shrikrishna Khare <skhare@vmware.com>

> ---
>  drivers/net/vmxnet3/vmxnet3_ethdev.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> index 06735dd..6525bb2 100644
> --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
> +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
> @@ -537,10 +537,10 @@ static int eth_vmxnet3_pci_remove(struct rte_pci_device *pci_dev)
>  		     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);
>  }
>  
> @@ -1146,6 +1146,8 @@ static int eth_vmxnet3_pci_remove(struct rte_pci_device *pci_dev)
>  {
>  	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);
>  }
>  
> -- 
> 1.8.3.1
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] vmxnet3: mac address set fixes
  2017-09-10 17:40 ` Shrikrishna Khare
@ 2017-09-11 13:29   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-09-11 13:29 UTC (permalink / raw)
  To: Shrikrishna Khare, David Harton; +Cc: skhare, dev

On 9/10/2017 6:40 PM, Shrikrishna Khare wrote:
> 
> 
> On Fri, 25 Aug 2017, David Harton wrote:
> 
>> 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.
>>
>> Signed-off-by: David Harton <dharton@cisco.com>
> 
> Acked-by: Shrikrishna Khare <skhare@vmware.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-09-11 13:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-25 18:54 [PATCH] vmxnet3: mac address set fixes David Harton
2017-09-10 17:40 ` Shrikrishna Khare
2017-09-11 13:29   ` Ferruh Yigit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.