[dpdk-dev,v2] net/i40e: fix setting of MAC address on i40evf

Message ID 20180103133418.494-1-olivier.matz@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Helin Zhang
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Olivier Matz Jan. 3, 2018, 1:34 p.m. UTC
  When setting the MAC address, the ethdev layer copies the new mac
address in dev->data->mac_addrs[0] before calling the dev_ops.

Therefore, "is_same_ether_addr(mac_addr, dev->data->mac_addrs)" was
always true, and the MAC was never set. Remove this test to fix the
issue.

Fixes: 943c2d899a0c ("net/i40e: set VF MAC from VF")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 3 ---
 1 file changed, 3 deletions(-)
  

Comments

Xing, Beilei Jan. 4, 2018, 7:39 a.m. UTC | #1
> -----Original Message-----
> From: Olivier Matz [mailto:olivier.matz@6wind.com]
> Sent: Wednesday, January 3, 2018 9:34 PM
> To: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> <beilei.xing@intel.com>
> Cc: stable@dpdk.org
> Subject: [PATCH v2] net/i40e: fix setting of MAC address on i40evf
> 
> When setting the MAC address, the ethdev layer copies the new mac
> address in dev->data->mac_addrs[0] before calling the dev_ops.
> 
> Therefore, "is_same_ether_addr(mac_addr, dev->data->mac_addrs)" was
> always true, and the MAC was never set. Remove this test to fix the issue.
> 
> Fixes: 943c2d899a0c ("net/i40e: set VF MAC from VF")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>

Acked-by: Beilei Xing <beilei.xing@intel.com>, thanks for the fix.
  
Zhang, Helin Jan. 8, 2018, 6:43 a.m. UTC | #2
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xing, Beilei
> Sent: Thursday, January 4, 2018 3:40 PM
> To: Olivier Matz; dev@dpdk.org; Wu, Jingjing
> Cc: stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix setting of MAC address on
> i40evf
> 
> 
> > -----Original Message-----
> > From: Olivier Matz [mailto:olivier.matz@6wind.com]
> > Sent: Wednesday, January 3, 2018 9:34 PM
> > To: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; Xing, Beilei
> > <beilei.xing@intel.com>
> > Cc: stable@dpdk.org
> > Subject: [PATCH v2] net/i40e: fix setting of MAC address on i40evf
> >
> > When setting the MAC address, the ethdev layer copies the new mac
> > address in dev->data->mac_addrs[0] before calling the dev_ops.
> >
> > Therefore, "is_same_ether_addr(mac_addr, dev->data->mac_addrs)" was
> > always true, and the MAC was never set. Remove this test to fix the issue.
> >
> > Fixes: 943c2d899a0c ("net/i40e: set VF MAC from VF")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
> 
> Acked-by: Beilei Xing <beilei.xing@intel.com>, thanks for the fix.
Applied to dpdk-next-net-intel, thanks!

/Helin
  

Patch

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 91b5bb033..17446ec23 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -2681,9 +2681,6 @@  i40evf_set_default_mac_addr(struct rte_eth_dev *dev,
 		return;
 	}
 
-	if (is_same_ether_addr(mac_addr, dev->data->mac_addrs))
-		return;
-
 	if (vf->flags & I40E_FLAG_VF_MAC_BY_PF)
 		return;