net/ixgbe: fix vf mac remains

Message ID 20210831141713.9225-1-chenqiming_huawei@163.com (mailing list archive)
State Superseded, archived
Delegated to: Qi Zhang
Headers
Series net/ixgbe: fix vf mac remains |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Qiming Chen Aug. 31, 2021, 2:17 p.m. UTC
  In the following two scenarios, the mac address residual problem
will occur:
1) In the VF hard pass-through environment, after adding the mac
address, the process restarts, and the previously added mac is
still valid;
2) In the vf hard pass-through environment, after the mac address
is issued, the port will start/stop, and the previously added mac
is still valid;

The patch clears the mac address at the start and stop of the vf
port. After the start is cleared, the rte framework will restore
the mac addition to solve the problem of residual mac addresses.

Fixes: abf7275bbaa2 ("ixgbe: move to drivers/net/")
Cc: stable@dpdk.org

Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Wang, Haiyue Sept. 6, 2021, 1:49 a.m. UTC | #1
> -----Original Message-----
> From: Qiming Chen <chenqiming_huawei@163.com>
> Sent: Tuesday, August 31, 2021 22:17
> To: dev@dpdk.org
> Cc: Wang, Haiyue <haiyue.wang@intel.com>; Qiming Chen <chenqiming_huawei@163.com>; stable@dpdk.org
> Subject: [PATCH] net/ixgbe: fix vf mac remains
> 
> In the following two scenarios, the mac address residual problem
> will occur:
> 1) In the VF hard pass-through environment, after adding the mac
> address, the process restarts, and the previously added mac is
> still valid;
> 2) In the vf hard pass-through environment, after the mac address
> is issued, the port will start/stop, and the previously added mac
> is still valid;
> 
> The patch clears the mac address at the start and stop of the vf
> port. After the start is cleared, the rte framework will restore
> the mac addition to solve the problem of residual mac addresses.
> 
> Fixes: abf7275bbaa2 ("ixgbe: move to drivers/net/")

Should be:

Fixes: af75078fece3 ("first public release")

> Cc: stable@dpdk.org
> 
> Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index 6a91f104e1..e40350d86e 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -5410,6 +5410,9 @@ ixgbevf_dev_start(struct rte_eth_dev *dev)
>  	 */
>  	ixgbevf_dev_link_update(dev, 0);
> 
> +	/* Clear the mac address, the rte frame will be restored */
> +	ixgbevf_set_uc_addr_vf(hw, 0, NULL);
> +
>  	hw->adapter_stopped = false;
> 
>  	return 0;
> @@ -5454,6 +5457,9 @@ ixgbevf_dev_stop(struct rte_eth_dev *dev)
>  		intr_handle->intr_vec = NULL;
>  	}
> 
> +	/* Clear the mac address */
> +	ixgbevf_set_uc_addr_vf(hw, 0, NULL);
> +
>  	adapter->rss_reta_updated = 0;
> 
>  	return 0;
> --
> 2.30.1.windows.1
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 6a91f104e1..e40350d86e 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -5410,6 +5410,9 @@  ixgbevf_dev_start(struct rte_eth_dev *dev)
 	 */
 	ixgbevf_dev_link_update(dev, 0);
 
+	/* Clear the mac address, the rte frame will be restored */
+	ixgbevf_set_uc_addr_vf(hw, 0, NULL);
+
 	hw->adapter_stopped = false;
 
 	return 0;
@@ -5454,6 +5457,9 @@  ixgbevf_dev_stop(struct rte_eth_dev *dev)
 		intr_handle->intr_vec = NULL;
 	}
 
+	/* Clear the mac address */
+	ixgbevf_set_uc_addr_vf(hw, 0, NULL);
+
 	adapter->rss_reta_updated = 0;
 
 	return 0;