netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iwl-net] ice: Flush FDB entries before reset
@ 2024-08-05 13:43 Wojciech Drewek
  2024-08-24 13:58 ` Simon Horman
  2024-08-30  7:57 ` [Intel-wired-lan] " Buvaneswaran, Sujai
  0 siblings, 2 replies; 3+ messages in thread
From: Wojciech Drewek @ 2024-08-05 13:43 UTC (permalink / raw)
  To: netdev; +Cc: intel-wired-lan, anthony.l.nguyen, przemyslaw.kitszel

Triggering the reset while in switchdev mode causes
errors[1]. Rules are already removed by this time
because switch content is flushed in case of the reset.
We can avoid these errors by clearing the rules
early in the reset flow. Remove unnecessary
ice_clear_sw_switch_recipes.

[1]
ice 0000:01:00.0: Failed to delete FDB forward rule, err: -2
ice 0000:01:00.0: Failed to delete FDB guard rule, err: -2

Fixes: 7c945a1a8e5f ("ice: Switchdev FDB events support")
Reviewed-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
---
 .../net/ethernet/intel/ice/ice_eswitch_br.c   |  2 +-
 .../net/ethernet/intel/ice/ice_eswitch_br.h   |  1 +
 drivers/net/ethernet/intel/ice/ice_main.c     | 24 +++----------------
 3 files changed, 5 insertions(+), 22 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch_br.c b/drivers/net/ethernet/intel/ice/ice_eswitch_br.c
index f5aceb32bf4d..814df3419d63 100644
--- a/drivers/net/ethernet/intel/ice/ice_eswitch_br.c
+++ b/drivers/net/ethernet/intel/ice/ice_eswitch_br.c
@@ -582,7 +582,7 @@ ice_eswitch_br_switchdev_event(struct notifier_block *nb,
 	return NOTIFY_DONE;
 }
 
-static void ice_eswitch_br_fdb_flush(struct ice_esw_br *bridge)
+void ice_eswitch_br_fdb_flush(struct ice_esw_br *bridge)
 {
 	struct ice_esw_br_fdb_entry *entry, *tmp;
 
diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch_br.h b/drivers/net/ethernet/intel/ice/ice_eswitch_br.h
index c15c7344d7f8..66a2c804338f 100644
--- a/drivers/net/ethernet/intel/ice/ice_eswitch_br.h
+++ b/drivers/net/ethernet/intel/ice/ice_eswitch_br.h
@@ -117,5 +117,6 @@ void
 ice_eswitch_br_offloads_deinit(struct ice_pf *pf);
 int
 ice_eswitch_br_offloads_init(struct ice_pf *pf);
+void ice_eswitch_br_fdb_flush(struct ice_esw_br *bridge);
 
 #endif /* _ICE_ESWITCH_BR_H_ */
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 8f02b33adad1..fd27c7995d60 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -520,25 +520,6 @@ static void ice_pf_dis_all_vsi(struct ice_pf *pf, bool locked)
 		pf->vf_agg_node[node].num_vsis = 0;
 }
 
-/**
- * ice_clear_sw_switch_recipes - clear switch recipes
- * @pf: board private structure
- *
- * Mark switch recipes as not created in sw structures. There are cases where
- * rules (especially advanced rules) need to be restored, either re-read from
- * hardware or added again. For example after the reset. 'recp_created' flag
- * prevents from doing that and need to be cleared upfront.
- */
-static void ice_clear_sw_switch_recipes(struct ice_pf *pf)
-{
-	struct ice_sw_recipe *recp;
-	u8 i;
-
-	recp = pf->hw.switch_info->recp_list;
-	for (i = 0; i < ICE_MAX_NUM_RECIPES; i++)
-		recp[i].recp_created = false;
-}
-
 /**
  * ice_prepare_for_reset - prep for reset
  * @pf: board private structure
@@ -575,8 +556,9 @@ ice_prepare_for_reset(struct ice_pf *pf, enum ice_reset_req reset_type)
 	mutex_unlock(&pf->vfs.table_lock);
 
 	if (ice_is_eswitch_mode_switchdev(pf)) {
-		if (reset_type != ICE_RESET_PFR)
-			ice_clear_sw_switch_recipes(pf);
+		rtnl_lock();
+		ice_eswitch_br_fdb_flush(pf->eswitch.br_offloads->bridge);
+		rtnl_unlock();
 	}
 
 	/* release ADQ specific HW and SW resources */
-- 
2.40.1


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

* Re: [PATCH iwl-net] ice: Flush FDB entries before reset
  2024-08-05 13:43 [PATCH iwl-net] ice: Flush FDB entries before reset Wojciech Drewek
@ 2024-08-24 13:58 ` Simon Horman
  2024-08-30  7:57 ` [Intel-wired-lan] " Buvaneswaran, Sujai
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2024-08-24 13:58 UTC (permalink / raw)
  To: Wojciech Drewek
  Cc: netdev, intel-wired-lan, anthony.l.nguyen, przemyslaw.kitszel

On Mon, Aug 05, 2024 at 03:43:50PM +0200, Wojciech Drewek wrote:
> Triggering the reset while in switchdev mode causes
> errors[1]. Rules are already removed by this time
> because switch content is flushed in case of the reset.
> We can avoid these errors by clearing the rules
> early in the reset flow. Remove unnecessary
> ice_clear_sw_switch_recipes.

Hi Wojciech,

I think it would be helpful (at least to me) if the patch
description included some more detail on
1) How the current flow results in these warnings; and
2) The new flow ensures resources are released.

> 
> [1]
> ice 0000:01:00.0: Failed to delete FDB forward rule, err: -2
> ice 0000:01:00.0: Failed to delete FDB guard rule, err: -2
> 
> Fixes: 7c945a1a8e5f ("ice: Switchdev FDB events support")
> Reviewed-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
> Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>

...

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

* RE: [Intel-wired-lan] [PATCH iwl-net] ice: Flush FDB entries before reset
  2024-08-05 13:43 [PATCH iwl-net] ice: Flush FDB entries before reset Wojciech Drewek
  2024-08-24 13:58 ` Simon Horman
@ 2024-08-30  7:57 ` Buvaneswaran, Sujai
  1 sibling, 0 replies; 3+ messages in thread
From: Buvaneswaran, Sujai @ 2024-08-30  7:57 UTC (permalink / raw)
  To: Drewek, Wojciech, netdev@vger.kernel.org
  Cc: Nguyen, Anthony L, intel-wired-lan@lists.osuosl.org,
	Kitszel, Przemyslaw

> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Wojciech Drewek
> Sent: Monday, August 5, 2024 7:14 PM
> To: netdev@vger.kernel.org
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; intel-wired-
> lan@lists.osuosl.org; Kitszel, Przemyslaw <przemyslaw.kitszel@intel.com>
> Subject: [Intel-wired-lan] [PATCH iwl-net] ice: Flush FDB entries before reset
> 
> Triggering the reset while in switchdev mode causes errors[1]. Rules are
> already removed by this time because switch content is flushed in case of the
> reset.
> We can avoid these errors by clearing the rules early in the reset flow.
> Remove unnecessary ice_clear_sw_switch_recipes.
> 
> [1]
> ice 0000:01:00.0: Failed to delete FDB forward rule, err: -2 ice 0000:01:00.0:
> Failed to delete FDB guard rule, err: -2
> 
> Fixes: 7c945a1a8e5f ("ice: Switchdev FDB events support")
> Reviewed-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
> Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
> ---
>  .../net/ethernet/intel/ice/ice_eswitch_br.c   |  2 +-
>  .../net/ethernet/intel/ice/ice_eswitch_br.h   |  1 +
>  drivers/net/ethernet/intel/ice/ice_main.c     | 24 +++----------------
>  3 files changed, 5 insertions(+), 22 deletions(-)
> 
We are observing system hang and reboot while doing GLOBR reset on the interface when traffic is running.
This hang issue is blocking the patch verification.

Thanks,
Sujai Buvaneswaran

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

end of thread, other threads:[~2024-08-30  7:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-05 13:43 [PATCH iwl-net] ice: Flush FDB entries before reset Wojciech Drewek
2024-08-24 13:58 ` Simon Horman
2024-08-30  7:57 ` [Intel-wired-lan] " Buvaneswaran, Sujai

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