DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: fix setting MAC address on i40evf
@ 2018-01-09 10:37 Beilei Xing
  2018-01-11  5:17 ` Zhang, Qi Z
  0 siblings, 1 reply; 3+ messages in thread
From: Beilei Xing @ 2018-01-09 10:37 UTC (permalink / raw)
  To: qi.z.zhang; +Cc: dev, jingjing.wu, stable

New mac address is copied to dev->data->mac_addrs[0]
before calling setting MAC address ops. So it will fail
when deleting dev->data->mac_addrs[0].
Deleting hw->mac.addr will fix the issue.

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

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/i40e/i40e_ethdev_vf.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 31a8c77..5bbe2b2 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -2658,6 +2658,7 @@ i40evf_set_default_mac_addr(struct rte_eth_dev *dev,
 			    struct ether_addr *mac_addr)
 {
 	struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
+	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
 
 	if (!is_valid_assigned_ether_addr(mac_addr)) {
 		PMD_DRV_LOG(ERR, "Tried to set invalid MAC address.");
@@ -2667,7 +2668,9 @@ i40evf_set_default_mac_addr(struct rte_eth_dev *dev,
 	if (vf->flags & I40E_FLAG_VF_MAC_BY_PF)
 		return;
 
-	i40evf_del_mac_addr_by_addr(dev, dev->data->mac_addrs);
+	i40evf_del_mac_addr_by_addr(dev, (struct ether_addr *)hw->mac.addr);
 
 	i40evf_add_mac_addr(dev, mac_addr, 0, 0);
+
+	ether_addr_copy(mac_addr, (struct ether_addr *)hw->mac.addr);
 }
-- 
2.5.5

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

* Re: [dpdk-dev] [PATCH] net/i40e: fix setting MAC address on i40evf
  2018-01-09 10:37 [dpdk-dev] [PATCH] net/i40e: fix setting MAC address on i40evf Beilei Xing
@ 2018-01-11  5:17 ` Zhang, Qi Z
  2018-01-13  5:46   ` Zhang, Helin
  0 siblings, 1 reply; 3+ messages in thread
From: Zhang, Qi Z @ 2018-01-11  5:17 UTC (permalink / raw)
  To: Xing, Beilei; +Cc: dev, Wu, Jingjing, stable



> -----Original Message-----
> From: Xing, Beilei
> Sent: Tuesday, January 9, 2018 6:38 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>; stable@dpdk.org
> Subject: [PATCH] net/i40e: fix setting MAC address on i40evf
> 
> New mac address is copied to dev->data->mac_addrs[0] before calling
> setting MAC address ops. So it will fail when deleting
> dev->data->mac_addrs[0].
> Deleting hw->mac.addr will fix the issue.
> 
> Fixes: 943c2d899a0c ("net/i40e: set VF MAC from VF")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

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

* Re: [dpdk-dev] [PATCH] net/i40e: fix setting MAC address on i40evf
  2018-01-11  5:17 ` Zhang, Qi Z
@ 2018-01-13  5:46   ` Zhang, Helin
  0 siblings, 0 replies; 3+ messages in thread
From: Zhang, Helin @ 2018-01-13  5:46 UTC (permalink / raw)
  To: Zhang, Qi Z, Xing, Beilei; +Cc: dev, Wu, Jingjing, stable



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Zhang, Qi Z
> Sent: Thursday, January 11, 2018 1:18 PM
> To: Xing, Beilei
> Cc: dev@dpdk.org; Wu, Jingjing; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix setting MAC address on i40evf
> 
> 
> 
> > -----Original Message-----
> > From: Xing, Beilei
> > Sent: Tuesday, January 9, 2018 6:38 PM
> > To: Zhang, Qi Z <qi.z.zhang@intel.com>
> > Cc: dev@dpdk.org; Wu, Jingjing <jingjing.wu@intel.com>;
> > stable@dpdk.org
> > Subject: [PATCH] net/i40e: fix setting MAC address on i40evf
> >
> > New mac address is copied to dev->data->mac_addrs[0] before calling
> > setting MAC address ops. So it will fail when deleting
> > dev->data->mac_addrs[0].
> > Deleting hw->mac.addr will fix the issue.
> >
> > Fixes: 943c2d899a0c ("net/i40e: set VF MAC from VF")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> 
> Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel, thanks!

/Helin

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

end of thread, other threads:[~2018-01-13  5:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-09 10:37 [dpdk-dev] [PATCH] net/i40e: fix setting MAC address on i40evf Beilei Xing
2018-01-11  5:17 ` Zhang, Qi Z
2018-01-13  5:46   ` Zhang, Helin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).