From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EX13-EDG-OU-002.vmware.com (ex13-edg-ou-002.vmware.com [208.91.0.190]) by dpdk.org (Postfix) with ESMTP id E5B3C6841 for ; Sun, 10 Sep 2017 19:40:00 +0200 (CEST) Received: from sc9-mailhost1.vmware.com (10.113.161.71) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Sun, 10 Sep 2017 10:39:55 -0700 Received: from shri-linux.eng.vmware.com (shri-linux.eng.vmware.com [10.33.72.16]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id 37B9B18080; Sun, 10 Sep 2017 10:40:00 -0700 (PDT) Date: Sun, 10 Sep 2017 10:40:00 -0700 From: Shrikrishna Khare To: David Harton CC: , In-Reply-To: <20170825185457.38261-1-dharton@cisco.com> Message-ID: References: <20170825185457.38261-1-dharton@cisco.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Received-SPF: None (EX13-EDG-OU-002.vmware.com: skhare@shri-linux.eng.vmware.com does not designate permitted sender hosts) Subject: Re: [dpdk-dev] [PATCH] vmxnet3: mac address set fixes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Sep 2017 17:40:02 -0000 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 Acked-by: Shrikrishna Khare > --- > 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 > >