DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ixgbe: fix vf mac remains
@ 2021-08-31 14:17 Qiming Chen
  2021-09-06  1:49 ` Wang, Haiyue
  2021-09-06  2:35 ` [dpdk-dev] [PATCH v2] " Qiming Chen
  0 siblings, 2 replies; 8+ messages in thread
From: Qiming Chen @ 2021-08-31 14:17 UTC (permalink / raw)
  To: dev; +Cc: haiyue.wang, Qiming Chen, stable

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(+)

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


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

* Re: [dpdk-dev] [PATCH] net/ixgbe: fix vf mac remains
  2021-08-31 14:17 [dpdk-dev] [PATCH] net/ixgbe: fix vf mac remains Qiming Chen
@ 2021-09-06  1:49 ` Wang, Haiyue
  2021-09-06  2:35 ` [dpdk-dev] [PATCH v2] " Qiming Chen
  1 sibling, 0 replies; 8+ messages in thread
From: Wang, Haiyue @ 2021-09-06  1:49 UTC (permalink / raw)
  To: Qiming Chen, dev; +Cc: stable

> -----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


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

* [dpdk-dev] [PATCH v2] net/ixgbe: fix vf mac remains
  2021-08-31 14:17 [dpdk-dev] [PATCH] net/ixgbe: fix vf mac remains Qiming Chen
  2021-09-06  1:49 ` Wang, Haiyue
@ 2021-09-06  2:35 ` Qiming Chen
  2021-09-08  8:35   ` Wang, Haiyue
  1 sibling, 1 reply; 8+ messages in thread
From: Qiming Chen @ 2021-09-06  2:35 UTC (permalink / raw)
  To: dev; +Cc: haiyue.wang, Qiming Chen, stable

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: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
---
v2:
  Modify fixes commit
---
 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


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

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix vf mac remains
  2021-09-06  2:35 ` [dpdk-dev] [PATCH v2] " Qiming Chen
@ 2021-09-08  8:35   ` Wang, Haiyue
  2021-09-09  1:41     ` Qiming Chen
  0 siblings, 1 reply; 8+ messages in thread
From: Wang, Haiyue @ 2021-09-08  8:35 UTC (permalink / raw)
  To: Qiming Chen, dev; +Cc: stable

> -----Original Message-----
> From: Qiming Chen <chenqiming_huawei@163.com>
> Sent: Monday, September 6, 2021 10:35
> To: dev@dpdk.org
> Cc: Wang, Haiyue <haiyue.wang@intel.com>; Qiming Chen <chenqiming_huawei@163.com>; stable@dpdk.org
> Subject: [PATCH v2] 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;

How did you test it ?

From the ixgbe PF, it will clean the MACs:

ixgbe_del_mac_filter(adapter, adapter->vfinfo[vf].vf_mac_addresses, vf);
ixgbe_set_vf_macvlan(adapter, vf, 0, NULL);

> 
> 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: af75078fece3 ("first public release")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
> ---
> v2:
>   Modify fixes commit
> ---
>  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


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

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix vf mac remains
  2021-09-08  8:35   ` Wang, Haiyue
@ 2021-09-09  1:41     ` Qiming Chen
  2021-09-09  2:42       ` Wang, Haiyue
  0 siblings, 1 reply; 8+ messages in thread
From: Qiming Chen @ 2021-09-09  1:41 UTC (permalink / raw)
  To: haiyue.wang; +Cc: dev, stable

thanks your reply.


kernal PF + dpdk VF mode, I developed a demo based on dpdk. I used igb_uio to take over the vf port, and then added a unicast MAC address to the port. As a result, the MAC packet was flowed to test ok, and then the demo was restarted, and the traffic still passed.
From this result, it can be seen that the mac remains, and there is no clear. This is vf driver quesion, not dpdk pf.


Also, the two interfaces you posted, I didn't find them in the dpdk code.
On 9/8/2021 16:35,Wang, Haiyue<haiyue.wang@intel.com> wrote:
-----Original Message-----
From: Qiming Chen <chenqiming_huawei@163.com>
Sent: Monday, September 6, 2021 10:35
To: dev@dpdk.org
Cc: Wang, Haiyue <haiyue.wang@intel.com>; Qiming Chen <chenqiming_huawei@163.com>; stable@dpdk.org
Subject: [PATCH v2] 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;

How did you test it ?

From the ixgbe PF, it will clean the MACs:

ixgbe_del_mac_filter(adapter, adapter->vfinfo[vf].vf_mac_addresses, vf);
ixgbe_set_vf_macvlan(adapter, vf, 0, NULL);


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: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
---
v2:
Modify fixes commit
---
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

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

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix vf mac remains
  2021-09-09  1:41     ` Qiming Chen
@ 2021-09-09  2:42       ` Wang, Haiyue
  2021-09-09  3:59         ` Qiming Chen
  0 siblings, 1 reply; 8+ messages in thread
From: Wang, Haiyue @ 2021-09-09  2:42 UTC (permalink / raw)
  To: Qiming Chen; +Cc: dev, stable

Please use the testpmd firstly to verify the PMD's issue!!!!!

And I tested in testpmd.

1. mac_addr set 0 00:11:22:33:44:88
2. quit testpmd.
3. Add debug message in PF: 

https://www.intel.com/content/www/us/en/download/14302/14687/intel-network-adapter-driver-for-pcie-intel-10-gigabit-ethernet-network-connections-under-linux.html

--- a/src/ixgbe_sriov.c
+++ b/src/ixgbe_sriov.c
@@ -776,6 +776,9 @@ static inline void ixgbe_vf_reset_event(struct ixgbe_adapter *adapter, u32 vf)
        /* Flush and reset the mta with the new values */
        ixgbe_set_rx_mode(adapter->netdev);

+       dev_info(&adapter->pdev->dev, "Deleting VF%u mac %pM \n", vf,
+                adapter->vfinfo[vf].vf_mac_addresses);
+
        ixgbe_del_mac_filter(adapter, adapter->vfinfo[vf].vf_mac_addresses, vf);
        ixgbe_set_vf_macvlan(adapter, vf, 0, NULL);

You can see PF will delete the MAC when VF exit.
  ixgbe 0000:86:00.0: Deleting VF0 mac 00:11:22:33:44:88


BR,
Haiyue

From: Qiming Chen <chenqiming_huawei@163.com> 
Sent: Thursday, September 9, 2021 09:41
To: Wang, Haiyue <haiyue.wang@intel.com>
Cc: dev@dpdk.org; stable@dpdk.org
Subject: Re: [PATCH v2] net/ixgbe: fix vf mac remains

thanks your reply.

kernal PF + dpdk VF mode, I developed a demo based on dpdk. I used igb_uio to take over the vf port, and then added a unicast MAC address to the port. As a result, the MAC packet was flowed to test ok, and then the demo was restarted, and the traffic still passed.
From this result, it can be seen that the mac remains, and there is no clear. This is vf driver quesion, not dpdk pf.

Also, the two interfaces you posted, I didn't find them in the dpdk code.
On 9/8/2021 16:35,mailto:haiyue.wang@intel.com wrote: 
-----Original Message-----
From: Qiming Chen <mailto:chenqiming_huawei@163.com>
Sent: Monday, September 6, 2021 10:35
To: mailto:dev@dpdk.org
Cc: Wang, Haiyue <mailto:haiyue.wang@intel.com>; Qiming Chen <mailto:chenqiming_huawei@163.com>; mailto:stable@dpdk.org
Subject: [PATCH v2] 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;

How did you test it ?

From the ixgbe PF, it will clean the MACs:

ixgbe_del_mac_filter(adapter, adapter->vfinfo[vf].vf_mac_addresses, vf);
ixgbe_set_vf_macvlan(adapter, vf, 0, NULL);

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: af75078fece3 ("first public release")
Cc: mailto:stable@dpdk.org

Signed-off-by: Qiming Chen <mailto:chenqiming_huawei@163.com>
---
v2:
Modify fixes commit
---
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

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

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix vf mac remains
  2021-09-09  2:42       ` Wang, Haiyue
@ 2021-09-09  3:59         ` Qiming Chen
  2021-09-09  8:41           ` Qiming Chen
  0 siblings, 1 reply; 8+ messages in thread
From: Qiming Chen @ 2021-09-09  3:59 UTC (permalink / raw)
  To: haiyue.wang; +Cc: dev, stable

OK,Thanks your test and reply. 
It may be that the pf kernel version I tested before is older, and the code snippets you posted have not yet been implemented.


I will test it again based on the latest version.




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

* Re: [dpdk-dev] [PATCH v2] net/ixgbe: fix vf mac remains
  2021-09-09  3:59         ` Qiming Chen
@ 2021-09-09  8:41           ` Qiming Chen
  0 siblings, 0 replies; 8+ messages in thread
From: Qiming Chen @ 2021-09-09  8:41 UTC (permalink / raw)
  To: haiyue.wang; +Cc: dev, stable

I have re-tested with kernel driver version 5.6.3 and found that this problem has been solved, thank you again for your reply.

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

end of thread, other threads:[~2021-09-09  8:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31 14:17 [dpdk-dev] [PATCH] net/ixgbe: fix vf mac remains Qiming Chen
2021-09-06  1:49 ` Wang, Haiyue
2021-09-06  2:35 ` [dpdk-dev] [PATCH v2] " Qiming Chen
2021-09-08  8:35   ` Wang, Haiyue
2021-09-09  1:41     ` Qiming Chen
2021-09-09  2:42       ` Wang, Haiyue
2021-09-09  3:59         ` Qiming Chen
2021-09-09  8:41           ` Qiming Chen

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).