DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bernard Iremonger <bernard.iremonger@intel.com>
To: dev@dpdk.org
Cc: wenzhou.lu@intel.com
Subject: [dpdk-dev] [PATCH v3 3/3] ixgbe: fix dev_close to remove VF MAC address.
Date: Mon,  7 Mar 2016 17:38:26 +0000	[thread overview]
Message-ID: <1457372306-1746-4-git-send-email-bernard.iremonger@intel.com> (raw)
In-Reply-To: <1457372306-1746-1-git-send-email-bernard.iremonger@intel.com>

Call the ixgbevf_remove_mac_addr() function in the ixgbevf_dev_close()
function to ensure that the VF traffic goes to the PF after stop,
close and detach of the VF.

Fixes: af75078fece3 ("first public release")
Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 8 ++++++--
 drivers/net/ixgbe/ixgbe_pf.c     | 7 ++++---
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 759177a..96b42f8 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -3911,8 +3911,12 @@ ixgbevf_dev_close(struct rte_eth_dev *dev)
 
 	ixgbe_dev_free_queues(dev);
 
-	/* reprogram the RAR[0] in case user changed it. */
-	ixgbe_set_rar(hw, 0, hw->mac.addr, 0, IXGBE_RAH_AV);
+	/**
+	 * Remove the VF MAC address ro ensure
+	 * that the VF traffic goes to the PF
+	 * after stop, close and detach of the VF
+	 **/
+	ixgbevf_remove_mac_addr(dev, 0);
 }
 
 static void ixgbevf_set_vfta_all(struct rte_eth_dev *dev, bool on)
diff --git a/drivers/net/ixgbe/ixgbe_pf.c b/drivers/net/ixgbe/ixgbe_pf.c
index 2ffbd1f..e5cfd05 100644
--- a/drivers/net/ixgbe/ixgbe_pf.c
+++ b/drivers/net/ixgbe/ixgbe_pf.c
@@ -1,7 +1,7 @@
 /*-
  *   BSD LICENSE
  *
- *   Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2016 Intel Corporation. All rights reserved.
  *   All rights reserved.
  *
  *   Redistribution and use in source and binary forms, with or without
@@ -445,8 +445,9 @@ ixgbe_vf_set_mac_addr(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
 	int rar_entry = hw->mac.num_rar_entries - (vf + 1);
 	uint8_t *new_mac = (uint8_t *)(&msgbuf[1]);
 
-	if (is_valid_assigned_ether_addr((struct ether_addr*)new_mac)) {
-		rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
+	if (is_unicast_ether_addr((struct ether_addr *)new_mac)) {
+		if (!is_zero_ether_addr((struct ether_addr *)new_mac))
+			rte_memcpy(vfinfo[vf].vf_mac_addresses, new_mac, 6);
 		return hw->mac.ops.set_rar(hw, rar_entry, new_mac, vf, IXGBE_RAH_AV);
 	}
 	return -1;
-- 
2.6.3

  parent reply	other threads:[~2016-03-07 17:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 16:19 [dpdk-dev] [PATCH 0/3] ixgbe fixes Bernard Iremonger
2016-02-24 16:19 ` [dpdk-dev] [PATCH 1/3] ixgbe: cleanup eth_ixgbevf_dev_uninit Bernard Iremonger
2016-02-24 16:19 ` [dpdk-dev] [PATCH 2/3] ixgbe: add more information to the error message Bernard Iremonger
2016-02-24 16:19 ` [dpdk-dev] [PATCH 3/3] ixgbe: allow use of zero MAC address with VF Bernard Iremonger
2016-02-26 14:49 ` [dpdk-dev] [PATCH 0/3 v2] ixgbe fixes Bernard Iremonger
2016-02-26 14:49   ` [dpdk-dev] [PATCH 1/3 v2] ixgbe: cleanup eth_ixgbevf_dev_uninit Bernard Iremonger
2016-02-26 14:49   ` [dpdk-dev] [PATCH 2/3 v2] ixgbe: add more information to the error message Bernard Iremonger
2016-02-26 14:49   ` [dpdk-dev] [PATCH 3/3 v2] ixgbe: fix setting of VF MAC address Bernard Iremonger
2016-02-29 17:03   ` [dpdk-dev] [PATCH 0/3 v2] ixgbe fixes Ananyev, Konstantin
2016-03-07 17:38   ` [dpdk-dev] [PATCH v3 0/3] " Bernard Iremonger
2016-03-07 17:38     ` [dpdk-dev] [PATCH v3 1/3] ixgbe: cleanup eth_ixgbevf_dev_uninit Bernard Iremonger
2016-03-07 17:38     ` [dpdk-dev] [PATCH v3 2/3] ixgbe: add more information to the error message Bernard Iremonger
2016-03-07 17:38     ` Bernard Iremonger [this message]
2016-03-08 17:10     ` [dpdk-dev] [PATCH v4 0/3] ixgbe fixes Bernard Iremonger
2016-03-08 17:10       ` [dpdk-dev] [PATCH v4 1/3] ixgbe: cleanup eth_ixgbevf_dev_uninit Bernard Iremonger
2016-03-08 17:10       ` [dpdk-dev] [PATCH v4 2/3] ixgbe: add more information to the error message Bernard Iremonger
2016-03-08 17:10       ` [dpdk-dev] [PATCH v4 3/3] ixgbe: fix dev_close to remove VF MAC address Bernard Iremonger
2016-03-09 13:17         ` Ananyev, Konstantin
2016-03-11 17:19       ` [dpdk-dev] [PATCH v4 0/3] ixgbe fixes Bruce Richardson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457372306-1746-4-git-send-email-bernard.iremonger@intel.com \
    --to=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=wenzhou.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).