Skip to contentSkip to conversation

i40e: Fix for VF MAC address 0

PATCH In review Jan Sokolowski 3 participants 5 messages Oct 31, 2022 – Nov 29, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i40e: Fix for VF MAC address 0

From: Sylwester Dziedziuch <[email protected]>

After spawning max VFs on a PF, some VFs were not
getting resources and their MAC addresses were 0.
This was caused by PF sleeping before flushing hw
registers which caused VIRTCHNL_VFR_VFACTIVE
to not be set in time for VF.

Fix by adding a sleep after hw flush.

Fixes e4b433f4a741 ("i40e: reset all VFs in parallel when rebuilding PF")
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +2 -0
index 72ddcefc45b1..635f93d60318 100644
@@ -1578,6 +1578,7 @@ bool i40e_reset_vf(struct i40e_vf *vf, bool flr)
 	i40e_cleanup_reset_vf(vf);
 
 	i40e_flush(hw);
+	usleep_range(20000, 40000);
 	clear_bit(I40E_VF_STATE_RESETTING, &vf->vf_states);
 
 	return true;
@@ -1701,6 +1702,7 @@ bool i40e_reset_all_vfs(struct i40e_pf *pf, bool flr)
 	}
 
 	i40e_flush(hw);
+	usleep_range(20000, 40000);
 	clear_bit(__I40E_VF_DISABLE, pf->state);
 
 	return true;
Signature · 6 lines
2.31.1

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Tested-by on v1 1/1
#1 lore raw

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c

Quoted 31 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Jan Sokolowski
Sent: Monday, October 31, 2022 1:00 PM
To: [email protected]
Cc: Dziedziuch, SylwesterX <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v1] i40e: Fix for VF MAC address 0

From: Sylwester Dziedziuch <[email protected]>

After spawning max VFs on a PF, some VFs were not getting resources and their MAC addresses were 0.
This was caused by PF sleeping before flushing hw registers which caused VIRTCHNL_VFR_VFACTIVE to not be set in time for VF.

Fix by adding a sleep after hw flush.

Fixes e4b433f4a741 ("i40e: reset all VFs in parallel when rebuilding PF")
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +0 -0
index 72ddcefc45b1..635f93d60318 100644

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#2 lore raw
In reply to Jan Sokolowski

Dear Jan,

Am 31.10.22 um 13:00 schrieb Jan Sokolowski:

Quoted 7 lines

From: Sylwester Dziedziuch <[email protected]>

After spawning max VFs on a PF, some VFs were not
getting resources and their MAC addresses were 0.
This was caused by PF sleeping before flushing hw
registers which caused VIRTCHNL_VFR_VFACTIVE
to not be set in time for VF.

Please reflow for 75 characters per line to make use of all the available textwidth.

Quoted 22 lines

Fix by adding a sleep after hw flush.

Fixes e4b433f4a741 ("i40e: reset all VFs in parallel when rebuilding PF")
---
  drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +1 -0
index 72ddcefc45b1..635f93d60318 100644
@@ -1578,6 +1578,7 @@ bool i40e_reset_vf(struct i40e_vf *vf, bool flr)
  	i40e_cleanup_reset_vf(vf);
 
  	i40e_flush(hw);
+	usleep_range(20000, 40000);
  	clear_bit(I40E_VF_STATE_RESETTING, &vf->vf_states);
 
  	return true;

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c bool i40e_reset_all_vfs(struct i40e_pf *pf, bool flr) · line 1708

Quoted 7 lines
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +1 -0
@@ -1701,6 +1702,7 @@ bool i40e_reset_all_vfs(struct i40e_pf *pf, bool flr)
  	}
 
  	i40e_flush(hw);
+	usleep_range(20000, 40000);
  	clear_bit(__I40E_VF_DISABLE, pf->state);
 
  	return true;

Did you test, what kind of performance impact this has, when resetting the VF? Is the reset happening often, so 20 ms to 40 ms are going to be noticed?

Kind regards,

Paul
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

#3 lore raw

Hello!
With regards to the perf question: No, such thing should not be noticed at all.

However, I've noticed this patch has been pulled to dev-queue branch of net-queue and next-queue. Should I reflow the commit msg and send a next version, or just leave it be?

-----Original Message-----
From: Paul Menzel <[email protected]>
Sent: Thursday, November 3, 2022 1:37 PM
To: Sokolowski, Jan <[email protected]>
Cc: [email protected]; Dziedziuch, SylwesterX <[email protected]>
Subject: Re: [Intel-wired-lan] [PATCH net v1] i40e: Fix for VF MAC address 0

Dear Jan

Am 31.10.22 um 13:00 schrieb Jan Sokolowski:

Quoted 7 lines

From: Sylwester Dziedziuch <[email protected]>

After spawning max VFs on a PF, some VFs were not
getting resources and their MAC addresses were 0.
This was caused by PF sleeping before flushing hw
registers which caused VIRTCHNL_VFR_VFACTIVE
to not be set in time for VF.

Please reflow for 75 characters per line to make use of all the available textwidth.

Quoted 22 lines

Fix by adding a sleep after hw flush.

Fixes e4b433f4a741 ("i40e: reset all VFs in parallel when rebuilding PF")
---
  drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +1 -0
index 72ddcefc45b1..635f93d60318 100644
@@ -1578,6 +1578,7 @@ bool i40e_reset_vf(struct i40e_vf *vf, bool flr)
  	i40e_cleanup_reset_vf(vf);
 
  	i40e_flush(hw);
+	usleep_range(20000, 40000);
  	clear_bit(I40E_VF_STATE_RESETTING, &vf->vf_states);
 
  	return true;

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c bool i40e_reset_all_vfs(struct i40e_pf *pf, bool flr) · line 1708

Quoted 7 lines
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +1 -0
@@ -1701,6 +1702,7 @@ bool i40e_reset_all_vfs(struct i40e_pf *pf, bool flr)
  	}
 
  	i40e_flush(hw);
+	usleep_range(20000, 40000);
  	clear_bit(__I40E_VF_DISABLE, pf->state);
 
  	return true;

Did you test, what kind of performance impact this has, when resetting the VF? Is the reset happening often, so 20 ms to 40 ms are going to be noticed?

Kind regards,

Paul
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

Tested-by on v1 1/1
#4 lore raw
In reply to Jan Sokolowski

drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c bool i40e_reset_vf(struct i40e_vf *vf, bool flr)

Quoted 32 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Jan Sokolowski
Sent: Monday, October 31, 2022 1:00 PM
To: [email protected]
Cc: Dziedziuch, SylwesterX <[email protected]>
Subject: [Intel-wired-lan] [PATCH net v1] i40e: Fix for VF MAC address 0

From: Sylwester Dziedziuch <[email protected]>

After spawning max VFs on a PF, some VFs were not getting resources and their MAC addresses were 0.
This was caused by PF sleeping before flushing hw registers which caused VIRTCHNL_VFR_VFACTIVE to not be set in time for VF.

Fix by adding a sleep after hw flush.

Fixes e4b433f4a741 ("i40e: reset all VFs in parallel when rebuilding PF")
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +0 -0
index 72ddcefc45b1..635f93d60318 100644
@@ -1578,6 +1578,7 @@ bool i40e_reset_vf(struct i40e_vf *vf, bool flr)

_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan